Can Print but not Access Values

Jeremy A
  • Jeremy A
    Jeremy A

    I have a very weird problem with tinyxml in my program. The Value() function returns nothing.

    I can use the Print() function and the document is printed correctly. I can also navigate the tree. However, the tutorial function dump_to_stdout produces empty value fields for all the data - although it does dump out the types and structure.  My own application also gets empty fields.

    I am using the latest version of code and have compiled it using GCC 4.1.2 on Centos 5.2

    I have tested this with and without STL enabled. I have also tested with documents read from disk - the Hello World example- as well as documents created from memory data.

    Here is what I get from a typical test:

    string sdoc("<?xml version=\&quot;1.0\&quot; ?><shapes><circle name=\&quot;int-based\&quot; x=\&quot;20\&quot; y=\&quot;30\&quot; r=\&quot;50\&quot; /><point name=\&quot;float-based\&quot; x=\&quot;3.5\&quot; y=\&quot;52.1\&quot; /></shapes>");

    doc = new TiXmlDocument ( );
    doc->Parse( sdoc.c_str());
    dump_to_stdout( doc );

    <?xml version="1.0" ?>
        <circle name="int-based" x="20" y="30" r="50" />
        <point name="float-based" x="3.5" y="52.1" />
    + Declaration
    + Element []
    (No attributes)
      + Element []
        + : value=[        ]
        + : value=[] int=20 d=20.0
        + : value=[] int=30 d=30.0
        + : value=[] int=50 d=50.0
        4 attributes
      + Element []
        + : value=[
        + : value=[] int=3 d=3.5
        + : value=[] int=52 d=52.1
        3 attributes