bah.libxml bug?

BlitzMax Forums/Brucey's Modules/bah.libxml bug?

TaskMaster(Posted 2013) [#1]
When you run the example1.bmx for the first time, the doc.saveFile("aaa.xml") line corrupts the xml file. It writes the "<?xml version="1.0"?>" line a second time and then the file is no longer correct and the example will not read it again.

The line:

root.addPreviousSibling(n)

causes the corruption.

I am no expert, as I just started using this, but I am assuming that it is just a bug in the example and not a bug in the libxml.mod...


Brucey(Posted 2013) [#2]
Yes, it's just a very bad example.

It is probably the line with addProcessingInstruction() blindly adding to the file which already has it. Usually you wouldn't do that.

There are lots more useful examples in the doc folder (perhaps most easily accessible via the Documentation Help).