majkinetor
Programmer
Hi there.
Is there any quick way to read everything that is contained in XML node, similar to what InnerText represents to HTML. I want to get everything contained in that node.
<elem>
<child1>text<child1>
<child2>text<child2>
</elem>
I want to get this string if I am currently on <elem> :
string s = <child1>text<child2>\n<child2>text</child2>
Is there any simple way to do this ? Currently I use XML namespace and XPathNodeIterator to walk all fields and generate XML "again":
And I want to do something like this (pseudocode)
s = iter1.Current.InnerText();
to achieve the same.
thank you.
}
Is there any quick way to read everything that is contained in XML node, similar to what InnerText represents to HTML. I want to get everything contained in that node.
<elem>
<child1>text<child1>
<child2>text<child2>
</elem>
I want to get this string if I am currently on <elem> :
string s = <child1>text<child2>\n<child2>text</child2>
Is there any simple way to do this ? Currently I use XML namespace and XPathNodeIterator to walk all fields and generate XML "again":
Code:
XPathNodeIterator iter = iter1.Current.SelectDescendants(XPathNodeType.Element, false);
s = "";
while ( iter.MoveNext() )
s += "<"+iter.Current.Name+">"+ iter.Current.Value +"</>iter.Current.Name + ">"
And I want to do something like this (pseudocode)
s = iter1.Current.InnerText();
to achieve the same.
thank you.
}