Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It looks like you want to use the iteration functions described here (<a href="http://www.minixml.org/mxml.html#3_7" rel="nofollow">http://www.minixml.org/mxml.html#3_7</a>) to get the child nodes.</p> <p>EDIT: I wrote this to iterate down through the first child node and it works fine, used <code>mxmlGetFirstChild</code> and <code>mxmlGetNextSibling</code>:</p> <pre><code>&lt;!-- language: c --&gt; mxml_node_t* node = mxmlLoadFile(NULL,f,MXML_TEXT_CALLBACK); while ( node != NULL ) { switch ( mxmlGetType(node) ) { case MXML_ELEMENT: { fprintf(stdout,"Element = %s\n",mxmlGetElement(node)); } break; case MXML_TEXT: { fprintf(stdout," Value = %s\n",mxmlGetText(node,0)); } break; default: { } break; } mxml_node_t* next = mxmlGetFirstChild(node); if ( next != NULL ) { node = next; } else { next = mxmlGetNextSibling(node); if ( next != NULL ) { node = next; } else { node = next; fprintf(stdout,"Done\n"); } } } </code></pre> <p>Produces output:</p> <pre><code>Element = root Value = Root Value = Element = pai Value = Pai_1 Value = Element = filho Value = Pai1,Filho1 </code></pre> <p>I presume you can use one of the getParent functions to iterate back up, or save off the last node before diving down into a child, using a stack of node pointers, if you want to iterate through the whole file. Note that I only handle / print data for two node types - you'll want to experiment to see what the other node types contain, if you need that info as well.</p> <p>** MORE EDIT after your edit **</p> <p>I suggested just the other day that someone else try <code>libxml2</code> (<a href="http://xmlsoft.org/examples/index.html#xmlReader" rel="nofollow">http://xmlsoft.org/examples/index.html#xmlReader</a>) - check that link out. The xmlReader example shows usage. It's incredibly easy to create a reader and iterate through the nodes - when you hit each node just check it's type to be sure it's one you care about (usually <code>ELEMENT</code>, <code>ATTRIBUTE</code>, <code>TEXT</code>, and <code>END_ELEMENT</code>), and then pull out either the name or the value. I like it much better than mxml. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload