> No, there is no guarantee that the string will be non-empty (that goes
> down to the underlying XML library).  Again, make sure that you set
> value = "" at the start event, and then process value at the
> corresponding end event.
> David

OK, I think I've figured out what the mitigating circumstance is. I can avoid 
strings composed purely of blank spaces and newlines, but this seems to create 
a problem
with table constructs:

  <function NAME="aero/coefficient/Cnb">
      <description>Yaw moment due to beta</description>
                  -0.349  -0.0227
                   0.0     0.0
                   0.349   0.0227

I need each line of tableData to be read in and stored as a separate string. 
What fixes
the first problem I reported seems to cause a second, whereby the tableData 
stored ends up
looking like this:

  -0.349  -0.0227      0.0     0.0
   0.349   0.0227

That is, some of the lines are read in together. This is why it is so 
imperative for me to
understand the mechanics of how the data() function works and what can be 
passed in.

Here's what I have now for relevant parts of the functions:


  if (!working_string.empty()) current_element->AddData(working_string);

  data_string = string(s, length);
  working_string += data_string;

Any suggestions?


Flightgear-devel mailing list

Reply via email to