Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Load XML elements on HTML page

from a different server

12:09 am on Sep 15, 2009 (gmt 0)

New User

10+ Year Member

joined:Nov 14, 2006
votes: 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]

1:09 pm on Sept 17, 2009 (gmt 0)

Senior Member from CA 

WebmasterWorld Senior Member httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 29, 2003
votes: 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]


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members