I am trying to learn how to work with XML better... please help me figure out how to do this example. There are certain elements that have child elements - I don't want to display them or the child elements, because I will loop through them later. Please help!
while(xmlReader.Read)
{
if(xmlReader.NodeType == XmlNodeType.Element)
{
if(xmlReader.LocalName == "USER")
{
// Don't read ANY of this element, or child elements!
}
}
}
XML Example:
<Root>
<company>
<owner>John Doe</owner>
<user>
<name>mgreen</name>
<birthdate>09/19/1980</bir
thdate>
</user>
<user>
<name>aasdf</name>
<birthdate>09/19/2004</bir
thdate>
</user>
<manager>MyName</Manager>
</company>
</Root>
this isn't a real xml file, but I am trying to find out how to develop this so when I do have a real file, i know what to do. I appreciate any help you can give me.
Br
Start Free Trial