Welcome to WebmasterWorld Guest from

Forum Moderators: httpwebwitch

Message Too Old, No Replies

Can I access GET data with XML?

need to access GET data



10:00 pm on Sep 4, 2009 (gmt 0)

5+ Year Member

Hi Forum,

Newbie XML programmer here. Can I access a variable passed along on the URL with XML? I have been scowering the web and this forum but, cannot find an answer to this so, I am guessing it is not possible?

IE: I want to get the value of the CategoryID variable below


How can I grab that CategoryID and dereference it?

Thanks very much for the help.

[edited by: httpwebwitch at 11:03 pm (utc) on Sep. 4, 2009]
[edit reason] examplified the example [/edit]


10:23 pm on Sep 4, 2009 (gmt 0)

WebmasterWorld Administrator mack is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

I think this would be more a case of what you are using to output your XML file. For example, to most of us an XML file is simply a text file with a markup, but it can be dynamic. A fairly common way of doing this is to have your XML file generated using php or another scripting language. Then you can set up the server using htaccess to handle .xml in the same way it would handle .php

With a php page you can simply GET the contents from the url, and use it within your page. What you would then do is echo the contents of the file in an xml format. Then when a user or XML reader accesed the page all they would see would be the XML. Even although the XML is generated using php code, and is a dynamic php page.



10:54 pm on Sep 4, 2009 (gmt 0)

5+ Year Member

Hi Mack,

Actually, this is straight XML that is being generated through a CMS that my company uses. We are using XSL to pretty it up for the web and transform it into HTML but the underlying code is XML.

I am working on some dynamic portions and know PHP very well. I am just starting to learn XML and wanted to know if I could grab the GET variables like I can in PHP.


5:28 pm on Sep 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

You can use javascript to get at the URL of the current document. So use your XSL to render a bit of javascript into the HTML.

Featured Threads

Hot Threads This Week

Hot Threads This Month