Forum Moderators: open
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:
Quote:
-<shrs>
-<rq url="http://api.example.com/a/j-api/xml-v2/7">
<t>Doctor </t>
<dt>2009-09-14T22:24:19Z</dt>
<si>0</si>
<rpd>10</rpd>
<tr>200691</tr>
<tv>1000</tv>
<em url=""/>
-<h>
<kw pos="1"/>
</h>
</rq>
-<rs>
-<r>
<jt>Title</jt>
<cn url="">URL</cn>
<src url="http://api.example.com/a/j-api/xml-v2/7Dk0JmNfaWQ9NDgzNSZwX2lkPTEzNTcwJnBvcz0xJnpvbmU9NiZjcGM9MC4xNiZpcD0maGFzaD03NWNhMjlhMjQ0MTQzMzYwNzVk YTFiODI1ZjAwZDE5YiZjb3VudD0yJnN</src>
<ty>sponsored</ty>
<loc cty="" st="MS" postal="" county="" region="" country="US">STATES</loc>
<ls>2009-08-31T12:54:43Z</ls>
<dp>2009-08-31T12:54:43Z</dp>
-<e>
----------------------
</e>
</r>
.
.
.
.
.
.
Any ideas?
Thanks
[edited by: httpwebwitch at 1:01 pm (utc) on Sep. 17, 2009]
[edit reason] examplified [/edit]
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]