i am reading XML using XMLTextReader but can't get whole line
my XML is as follows
[CODE]
when i read
XmlReaderObject.Value then i get only [B]This is text[/B]
but i want whole line as
[B]This is test XML yes [/B]
how can i code it ???
any hint ??
thankx in advance
koolprasad2003:)
Niradhip ChakrabortyPosted Jun 26, 2009, 3:11 AM
instead of < please use < and > use >
Your xml code: This is test XML yes
Revised xml code: This is test <b>XML</b> yes
Niradhip ChakrabortyPosted Jun 26, 2009, 2:31 AM
as a different element and it is not giving you the text inside you will get the text inside in next iteration. So you can hold the previous value in string and concatinate with the new value to get the entire string.
Try the following method
Check my xml file:
while (reader.Read())
{
if (reader.NodeType == XmlNodeType.Element)
{
strNodeName = reader.Name;
}
if (reader.NodeType == XmlNodeType.Text)
{
if (strNodeName == "MayPara")
{
strvalue = reader.Value.ToString();
}
if(strNodeName == "b")
{
if((strNodeName !="")
{
strNodeName = strNodeName + reader.Value.ToString();
}
}
}
}