homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

Load XML elements on HTML page
from a different server

5+ Year Member

Msg#: 3989435 posted 12:09 am on Sep 15, 2009 (gmt 0)

Hi Everybody

I am trying to load selected elements of a xml dtd formatted page onto a html page.
The xml and html pages are on different servers.
Here is part of the xml page:
-<rq url="http://api.example.com/a/j-api/xml-v2/7">
<t>Doctor </t>
<em url=""/>
<kw pos="1"/>
<cn url="">URL</cn>
<src url="http://api.example.com/a/j-api/xml-v2/7Dk0JmNfaWQ9NDgzNSZwX2lkPTEzNTcwJnBvcz0xJnpvbmU9NiZjcGM9MC4xNiZpcD0maGFzaD03NWNhMjlhMjQ0MTQzMzYwNzVk YTFiODI1ZjAwZDE5YiZjb3VudD0yJnN</src>
<loc cty="" st="MS" postal="" county="" region="" country="US">STATES</loc>

Any ideas?


[edited by: httpwebwitch at 1:01 pm (utc) on Sep. 17, 2009]
[edit reason] examplified [/edit]



WebmasterWorld Administrator httpwebwitch us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 3989435 posted 1:09 pm on Sep 17, 2009 (gmt 0)

I always use a server-side language to do this kind of thing. In PHP there is a simple XML parser [ca3.php.net] that you would find useful; similar facilities exist in C#.NET, Java, Perl, Python, Ruby, VBScript, etc.

First, you request the XML from the 3rd party server. Then you parse it and turn it into an XML object. Then use XPATH to grab the nodes you want, or perhaps iterate through nodes looking for pattern matches. Once found, the result can be output to your HTML page.

You can find practical examples here [ca3.php.net]

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