Click here to Skip to main content
15,885,099 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
XML
<tabular>
   <noteGroup xml:id="c1-ntgp-0001">
     <note xml:id="c1-note-0001"><?LABEL a?>It would appear that Europe</note>
    <note xml:id="c1-note-0002"><?LABEL b?>It is also clear</note>
                </noteGroup>
</tabular>


Hai this is xml code, in this xml how to check the ancesior element name


for sample
this if statement check node first child processing instruction or not,
now how to check node ancestor value <tabular> or not in same statement

Using LINQ

current node is <note>

C#
if (node.FirstChild == child && child.NodeType == XmlNodeType.ProcessingInstruction )
{
        return false;
}
Posted
Updated 28-Mar-15 8:14am
v4
Comments
Maciej Los 28-Mar-15 14:24pm    
Could you be more specific and provide more details?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900