Archived Forum Post

Index of archived forum posts


Possible bug in ChilkatXML

Dec 08 '14 at 08:55

In the ActiveX ChilkatXML class, when I do this:

Set MyXmlChild=MyXml.NewChildBefore(1,"MyTag","MyContent")

it behaves the same as if I had put this instead:

Set MyXmlChild=MyXml.NewChildBefore(0,"MyTag","MyContent")

The code line that specifies index 1 should shove the current content of everything from index 1 and above, onto the next higher index, and then put in index 1 the current content. But it does not. Instead what is happening is it is saying, "ok 0 is before 1, so I will put this at index 0, and shove everything that is at index 0 and above, onto the the next higher index". This is wrong. I'm trying to insert a child node AT the current location. And I thought that that's what the NewChildBefore would accomplish. It would make the new child node at the current index, and shove everything after that up by one index, thus after the insertion, the new node WOULD exist before the current node that previously existed there. I'm not sure if this is a bug, or if it's behaving exactly as it's supposed to (and I'm just using this class incorrectly). If it's a bug, please fix it. If I'm using it incorrectly, please let me know how to insert a new child node at the current position, such that everything at and above the current position is shoved up by one index.


Thanks Ben,

I found and fixed the problem. Unfortunately, version was just released, so this fix will be in the next official release. You can download the fix here:

32-bit Download:

64-bit Download: