Hi.
I dont expect a solution as such but maybe just to be pointed to an area which contains enough information for me to get going. Most of the information I have read tends to be about writing XML and/or basic reading of XML files.
Here is a sample of the XML data:
Basically I have an ASP page with a search properties box. A user can simply select various items from drop downs and click 'Search'. It then submits and XML request to an API server which then returns something like the above.
Once returned I would like to be able to format the result in a readable manner.
The only information I need is within each <property> tag (ie. <abstract>,<image>,<flag> etc) aswell as all the sub-information within the tag itself (ie. ref, status, rent etc).
I know getting the tag information is possible but im not totally sure on the sub-information.
Here is what I quickly have for my response code:
Any help would be appreciated.
- FateFirst
I dont expect a solution as such but maybe just to be pointed to an area which contains enough information for me to get going. Most of the information I have read tends to be about writing XML and/or basic reading of XML files.
Here is a sample of the XML data:
Code:
<result>
<header>
<head name="Item1" value="Blah blah"/>
<head name="Item2" value="Blah blah"/>
<head name="Item3" value="Blah blah"/>
<head name="Item4" value="Blah blah"/>
<head name="Item5" value="Blah blah"/>
</header>
<status>
<condition>ok</condition>
<code>-1</code>
<message>request completed successfully</message>
<timestamp>1154346698</timestamp>
</status>
<properties result-num="4" total-rec="4">
<property ref="1" status="Available" rent="0" sale="1" saletype="Off Plan" exclusive="1" bedrooms="4" propertytype="Detached Villa">
<abstract>Descriptive text goes here.</abstract>
<image>[URL unfurl="true"]http://www.website.com/image1.jpg</image>[/URL]
<flag>[URL unfurl="true"]http://www.website.com/flag1.jpg</flag>[/URL]
</property>
<property ref="2" status="Available" rent="0" sale="1" saletype="Off Plan" exclusive="1" bedrooms="4" propertytype="Detached Villa">
<abstract>Descriptive text goes here.</abstract>
<image>[URL unfurl="true"]http://www.website.com/image2.jpg</image>[/URL]
<flag>[URL unfurl="true"]http://www.website.com/flag2.jpg</flag>[/URL]
</property>
<property ref="3" status="Available" rent="0" sale="1" saletype="Off Plan" exclusive="1" bedrooms="4" propertytype="Detached Villa">
<abstract>Descriptive text goes here.</abstract>
<image>[URL unfurl="true"]http://www.website.com/image3.jpg</image>[/URL]
<flag>[URL unfurl="true"]http://www.website.com/flag3.jpg</flag>[/URL]
</property>
</properties>
</result>
Basically I have an ASP page with a search properties box. A user can simply select various items from drop downs and click 'Search'. It then submits and XML request to an API server which then returns something like the above.
Once returned I would like to be able to format the result in a readable manner.
The only information I need is within each <property> tag (ie. <abstract>,<image>,<flag> etc) aswell as all the sub-information within the tag itself (ie. ref, status, rent etc).
I know getting the tag information is possible but im not totally sure on the sub-information.
Here is what I quickly have for my response code:
Code:
Set objXML=Server.CreateObject("Microsoft.XMLDOM")
strXML = "" '# See sample XML data above
objXML.async = False
objXML.loadXML (strXML)
for each x in objXML.documentElement.selectNodes("/result/properties/property")
response.write("<b>" & x.nodename & "</b>")
response.write(": ")
response.write("<xmp>" & x.text & "</xmp><br>")
next
response.write("<hr>")
Response.Write("<xmp>" & objXML.xml & "</xmp>")
Any help would be appreciated.
- FateFirst