item>
<title>AED/INR</title>
<link>http://xxx.com/INR/AED.aspx</link>
<guid>f770299c-1d99-4c84-981e-3eb95d7bf4fd</guid>
<pubDate>Thu, 27 May 2010 21:26:45 GMT</pubDate>
<description>1 Indian Rupee = 0.07883 United Arab Emirates Dirham</description>
<category>Middle East</category>
</item>
<item>
<title>ARS/INR</title>
<link>http://xxx.com/INR/ARS.aspx</link>
<guid>05d0b0aa-c5c2-49a1-828f-820a03734f70</guid>
<pubDate>Thu, 27 May 2010 21:26:45 GMT</pubDate>
<description>1 Indian Rupee = 0.08379 Argentine Peso</description>
<category>South America</category>
</item>
.... so on
IF ISCLEAR(xmlHTTP) THEN CREATE(xmlHTTP); IF ISCLEAR(XMLDoc) THEN CREATE(XMLDoc); xmlHTTP.open('GET','http://themoneyconverter.com/INR/rss.xml',FALSE); xmlHTTP.send; XMLDoc := xmlHTTP.responseXML; XMLNode :=XMLDoc.selectSingleNode('//rss/channel/item/description'); IF NOT ISCLEAR(XMLNode) THEN MESSAGE(XMLNode.text); XMLDoc.save('C:\NavRSS2.xml'); CLEAR(XMLNode); CLEAR(XMLDoc); CLEAR(xmlHTTP);
Comments
First you can use a NodeList and go through its child-elements:
using WHILE ... or if you prefer FOR
Or the "direct" way:
Best regards
Falk
what can I do to prove if one node exists or not?
For example: the node description by USD doesn't exists.
XMLNode := XMLDoc.selectSingleNode('//rss/channel/item[title="USD"]/description');
Hi FAFL,
what can I do to prove if one node exists or not?
For example: the node description by USD doesn't exists.
After your xpath-query, you check if the node is null (ISCLEAR(XmlNode)) to find it out .