House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  .NET Technical Talk (Net-Talk)

Help with XML Parsing

  << Previous Post |  RSS |  Tree View |  Sort Oldest First |  Subscribe to this Group Next >> 

Help with XML Parsing

I'm no expert on this, but aren't the nodes just children of the particular G 06/18/2008 08:00 AM
Hi, I'm trying to iterate over an xml doc and then access some values. I've got Andre Turrettini 06/17/2008 10:59 AM

06/18/2008 08:00 AM
Author: G Short Link: http://www.houseoffusion.com/groups/net-talk/thread.cfm/threadid:1699#5351 I'm no expert on this, but aren't the nodes just children of the particular node you are on? So in your loop, can't you use . notation to get at the children, something like: node.cake node.cake.filling etc...? Hi, I'm trying to iterate over an xml doc and then access some values. I've got the iterate part down but accessing the values slightly deeper seems to be beyond me. So, with this xml in mind, <?xml version="1.0" encoding="UTF-8"?> <items> <item> <cake> <filling> <fruit>strawberry</fruit> </filling> <icing> <fruit>apple</fruit> </icing> </cake> </item> <item> ..... </item> <item> ..... </item> </items> I loop over the items like so : XmlNodeList fileNodeList = xmldoc.SelectNodes("//item"); foreach (XmlNode node in fileNodeList) { But then how do I reach in and grab the values for the fruit? } I've tried selectChildren and all sorts of similar but I cant quite figure it out. Any help greatly appreciated.
06/17/2008 10:59 AM
Author: Andre Turrettini Short Link: http://www.houseoffusion.com/groups/net-talk/thread.cfm/threadid:1699#5350 Hi, I'm trying to iterate over an xml doc and then access some values. I've got the iterate part down but accessing the values slightly deeper seems to be beyond me. So, with this xml in mind, <?xml version="1.0" encoding="UTF-8"?> <items> <item> <cake> <filling> <fruit>strawberry</fruit> </filling> <icing> <fruit>apple</fruit> </icing> </cake> </item> <item> .... </item> <item> .... </item> </items> I loop over the items like so : XmlNodeList fileNodeList = xmldoc.SelectNodes("//item"); foreach (XmlNode node in fileNodeList) { But then how do I reach in and grab the values for the fruit? } I've tried selectChildren and all sorts of similar but I cant quite figure it out. Any help greatly appreciated.
<< Previous Thread Today's Threads Next Thread >>

Search net-talk

December 19, 2014

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31       

Designer, Developer and mobile workflow conference