DotNetGnat
Programmer
Guys,
My xml document looks like this
I want to get the result as
18.5 Design Example
18.5.1 Structure Example
that is i am only wanting to get the values of the <p> tag if the style attribute inside it is "yes"
Here is the function i have so far...
as you see i am able to get the name but when i try xmlReader.Value, i get empty values...
can someone please assist me with this.
thanks
-DNG
My xml document looks like this
Code:
<worksheet>
[blue]<metadata>
<generator>blah</generator>
<userData>
<title/>
<description/>
<author>John</author>
</userData>
<identityInfo>
<revision>34</revision>
<documentID>sdfds</documentID>
</identityInfo>
</metadata>[/blue]
[green]<regions>
<region>
<text>
<p style="Yes">18.5<tab/>Design Example</p>
</text>
</region>
<region>
<text>
<p style="No">some text</p>
</text>
</region>
<region>
<text>
<p style="Yes">18.5.1<tab/>Structure Example</p>
</text>
</region>
</regions>[/green]
</worksheet>
18.5 Design Example
18.5.1 Structure Example
that is i am only wanting to get the values of the <p> tag if the style attribute inside it is "yes"
Here is the function i have so far...
Code:
private string ProcessXml(XmlTextReader xmlReader)
{
StringBuilder temp = new StringBuilder();
while ( xmlReader.Read() )
{
if (xmlReader.NodeType == XmlNodeType.Element)
{
if (xmlReader.Name=="p")
{
temp.Append(xmlReader.Name + "<br>");
}
}
return temp.ToString();
}
as you see i am able to get the name but when i try xmlReader.Value, i get empty values...
can someone please assist me with this.
thanks
-DNG