Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

What's the point of XmlNode.InnerText

Avatar of dbnewbie
dbnewbie asked on
XML
6 Comments1 Solution556 ViewsLast Modified:
I'm curious about the purpose of Microsoft's extension to the DOM: InnerText. Take a look at the following code:

        Dim a As Xml.XmlDocument = New Xml.XmlDocument
        a.LoadXml("<person><name type='first'>John</name><name type='last'>Doe</name></person>")
        MessageBox.Show(a.InnerText)

The message box will display:

JohnDoe

Does anyone know how this might be useful? If it included a space between "John" and "Doe", there might be some use for it (e.g. tokenizing for search). But when it's concatenated this way, I'm not sure what use it is.

Also, according to http://msdn2.microsoft.com/en-us/library/system.xml.xmlnode.innertext(VS.80).aspx, this method "gets or sets the concatenated values of the node and all its child nodes." As the example shows, it only got the values of the elements and skipped the attributes. Both are "nodes." Is there a reason why the attribute nodes were excluded from the result?
ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)Flag of Belgium imageInformation Architect
Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answers