I think I understand now. InnerText returns the words, the actual content of the tag. InnerXml gives everything from tag start to tag end. Thanks for your help tsuji.
I went to the try-me at the W3: http://www.w3schools.com/js/tryit.asp?filename=try_dom_tut_getelementsbytagname and nested a tag to see what would happen. I modified:
<p id="main1">The DOM is very useful</p>
to:
<p id="main1"><><g>stuff</g>The DOM is very useful</p>
It displayed:
Second...
[0] Yeah, xlf is really the abc in my example. sorry
[1] When I view originalSourceText in the C# debugger I see either the proper "Yesterday" when the XML does not contain a nested tag or /r/n/r/n Tomorrow when there is a nested tag. You said "It won't contain the abc:good tag! why should it?"...
I am using GetElementByTagname. Here is the code:
XmlNodeList elemList = doc.GetElementsByTagName("xlf:start");
for (int i = 0; i < elemList.Count; i++)
{
String originalSourceText = elemList[i].InnerText;
if (originalSourceText.Contains("<xlf:"))
{
label4.Text =...
I have an xml file where the nodes I'm interested in are usually formatted this way:
<abc:start>Yesterday</abc:start>
Sometimes, there are nested tags like this:
<abc:start>
<abc:good ctype="link" id="1">
</abc:good>Tomorrow</abc:start>
I'm stuck with a brain block, sorry to say. I just want...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.