homepage Welcome to WebmasterWorld Guest from 54.237.54.83
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
Can I access GET data with XML?
need to access GET data
ktxml




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

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

http://www.example.com/category.xml?CategoryID=24

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]

 

mack




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

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.

Mack.

ktxml




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

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.

john_k




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

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved