Menu

Saving all tags to string from specific Node

2006-12-06
2013-05-20
  • Rommel Palomo

    Rommel Palomo - 2006-12-06

    Hi,

    I'm a newbie here.

    I was wondering if someone can help me on how to do this:

    I have a xml file, in which I need to get a all tags from a specific node, in less code.

    Example:

    <Root>
    <Hello1>
    <Hello2>
    <World>1</World>
    <World>2</World>
    <World>3</World>
    <World>4
    <Help1>1</Help1>
    <Help1>2</Help1>
    <Help1>3</Help1>
    <Help1>4</Help1>
    </World>
    </Hello2>
    </Hello1>
    <Nihao1>
    </Nihao1>
    </Root>

    Get all tags from Node "Hello2"
    <Hello2>
    <World>1</World>
    <World>2</World>
    <World>3</World>
    <World>4
    <Help1>1</Help1>
    <Help1>2</Help1>
    <Help1>3</Help1>
    <Help1>4</Help1>
    </World>
    </Hello2>

    Thanks for the help.
    Mhelinx

     
    • Rommel Palomo

      Rommel Palomo - 2006-12-06

      Hi,

      I got the answer from the previous questions.

      Maybe this will help others.

      https://sourceforge.net/forum/message.php?msg_id=2761156

      TiXmlString s;
      TiXmlOutStream os_stream;

      os_stream << * node;
      s = os_stream;
      return s;
      }

      Regards,
      Rommel

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.