Menu

Getting whole Text

Developer
1234
2007-08-24
2013-05-20
  • 1234

    1234 - 2007-08-24

    Does anybody knows how to get the text of all the nodes below given node? for. e.g. if I want to get text of root element, it should give text of entire dom tree like msxml.

     
    • Ellers

      Ellers - 2007-08-25

      From your question I'm not sure if you mean a way to convert the TinyXml DOM into a string representation of the DOM or to extract all the content of the text nodes into a single node?

      i.e., this:

      (a) dom -> "<?xml ?><container><string>Hello</string><string>There</string></container>"

      or

      (b) dom -> "HelloThere"

      ?

       
    • 1234

      1234 - 2007-08-27

      I mean (b) dom -> "HelloThere"

       
      • Ellers

        Ellers - 2007-08-27

        No prebuilt way exists for that function. My suggestion is to iterate through the DOM looking for text nodes, appending all the text to a string as you go.

        HTH

         

Log in to post a comment.