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

Author:
G
06/18/2008 08:00 AM

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.


Search net-talk

October 22, 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