0

I am using C with mini-XML 2.7, and reading a XML doc. All is fine, except that my XML has a section that looks like this:

<layer name="pattern1" width="100" height="40">
<data encoding="csv">
970,970,970,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,
1089,0,4,765,21,
0,1089,0,0,0,0,0,0,0,0,0,0,0,0,0
  </data>
 </layer>

My code parses all the XML down here flawlessly. Then I attempt to read the CSV values, by using this:

s = mxmlGetText(node, &has_space);

But right after that, a printf() statement like this

printf("s='%s'", s);

Shows only the first line.

970,970,970,0,0,0,0,0,0,0,

I would like to read the lines below the first line, but tried to use mxmlGetText() again with no luck. And all the lines are shown by using mxmlSaveFile().

How can I get all the lines? thanks in advance.

ted
  • 13,596
  • 9
  • 65
  • 107
Tucho
  • 1

1 Answers1

0

I found a solution for this issue.

1.-Loaded the XML file using MXML_OPAQUE_CALLBACK instead MXML_TEXT_CALLBACK in the call to mxmlLoadFile().

2.-Used mxmlGetOpaque() instead mxmlGetText().

Now my code works flawlessly.

Tucho
  • 1