XML Text access
-
I need to access the value of a node that also contains childnodes such as <node> text <child>value</child> </node> Inner text doesn't work because I get the child text also. I think that the way Innertext is done is pretty bad. Any Ideas? Thanks. Steve Steve Not all who wander are lost...
-
I need to access the value of a node that also contains childnodes such as <node> text <child>value</child> </node> Inner text doesn't work because I get the child text also. I think that the way Innertext is done is pretty bad. Any Ideas? Thanks. Steve Steve Not all who wander are lost...
You can just iterate through the children (IXMLDOMNodeList) checking the type (IXMLDOMNode::nodeType), if it is a text node (NODE_TEXT) append the value to your string otherwise keep iterating...
-
You can just iterate through the children (IXMLDOMNodeList) checking the type (IXMLDOMNode::nodeType), if it is a text node (NODE_TEXT) append the value to your string otherwise keep iterating...
Thanks. Will this also work on .NET? Steve Not all who wander are lost...
-
Thanks. Will this also work on .NET? Steve Not all who wander are lost...
Sure, it'll work with any DOM/Language, just the interface/method/constants names may vary slightly...
-
Thanks. Will this also work on .NET? Steve Not all who wander are lost...
If you're using the .NET XML classes, then use XmlNode::ReadElementString. Cheers, Tom Archer Inside C#,
Extending MFC Applications with the .NET Framework It's better to listen to others than to speak, because I already know what I'm going to say anyway. - friend of Jörgen Sigvardsson