Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XmlNode Level problem

Status
Not open for further replies.

sheila11

Programmer
Dec 27, 2000
251
US
Hi all,

I am getting an error while parsing my XML with C#. I need to find the level of each <unordered-list> node in this document. But when I try to read the xmlNode.ParentNode.Name for the Level 2 (or more) node, I receive "Undefined" for the ParentNode.

Could someone please help me?

TIA,
Sheila


My XML is:
<?xml version="1.0" encoding="utf-8"?>
<x-Root>
<x-Root-description>
<unordered-list bullet-type="circle-filled">
<unordered-list-item><para>For topical dosage form (ointment):
<unordered-list bullet-type="circle-unfilled">
<unordered-list-item><para>For bacterial infections:
<unordered-list bullet-type="asterisk">
<unordered-list-item><para>Adults: Apply one or two times a

day.</para></unordered-list-item>
<unordered-list-item><para>Children: Use is not

recommended.</para></unordered-list-item>
</unordered-list>
</para></unordered-list-item>
<unordered-list-item><para>For viral infections:

<unordered-list bullet-type="asterisk">
<unordered-list-item><para>Adults: Use is not

recommended.</para></unordered-list-item>
<unordered-list-item><para>Children: Use is not

recommended.</para></unordered-list-item>
</unordered-list>
</para></unordered-list-item>
</unordered-list>
</para></unordered-list-item>
</unordered-list>
</x-Root-description>
</x-Root>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top