I am working on a simple XML merger which reads lots of XML files and merges them into one. At the end I have to write the XML into a memory buffer which looks like this:
Code: Select all
size = ExportXMLSize(*mData)
*buffer = AllocateMemory(size)
If ExportXML(*mData, *buffer, size)
Debug PeekS(*buffer, -1, #PB_UTF8)
AddPackMemory(*mZip, *buffer, size, "Data.xml")
EndIf
FreeMemory(*buffer)
Code: Select all
</Recipe></Recipes></hixz>
Code: Select all
</Recipe></Recipes
I also tried to always make the buffer 1000 bytes bigger, but it did not change anything:
Code: Select all
size = ExportXMLSize(*mData) + 1000
Maybe some interesting things I do:
- I use CopyXMLNode() to copy nodes from other XML trees to the *mData tree
- I change attributes on some nodes in the source tree before I copy them to *mData
- *mData is a completely fresh tree, created with CreateXML(#PB_Any, #PB_UTF8)
- The other trees were created using CatchXML() and defaul encoding