Quick Note: XmlAttributes
I have to use xml fairly often. Mostly for connecting to different web services. I haven't dealt with to many web services that return attributes within the XML like this:
<hi>73</hi>
<low>52</low>
<sunr>6:17 AM</sunr>
<suns>8:08 PM</suns>
<part p="d">
<icon>30</icon>
<t>Partly Cloudy</t>
<wind>
<s>17</s>
<gust>N/A</gust>
<d>291</d>
<t>WNW</t>
</wind>
<bt>P Cloudy</bt>
<ppcp>10</ppcp>
<hmid>39</hmid>
</part>
<part p="n">
<icon>31</icon>
<t>Clear</t>
<wind>
<s>16</s>
<gust>N/A</gust>
<d>337</d>
<t>NNW</t>
</wind>
<bt>Clear</bt>
<ppcp>10</ppcp>
<hmid>61</hmid>
</part>
</day>
I seem to always forget how to access the attributes. The attributes in above example are d="0" t="Monday" dt = "May 12" as well as p="d" and p = "n".
I have decided to blog about it so I remember next time.
To access the above attributes use XmlAttributes. If the variable containing the above XML was called XMLVar then you would use the following code to access the attributes:
Date: #XMLVar.d.XmlAttributes.dt#
Nothing to it really.
http://www.cfedge.com/trackback.cfm?8326CC4E-60DB-BB56-3E70F5E337B5D3F9



There are no comments for this entry.
[Add Comment]