Hi,
I've been creating a new document by importing an
element node and its children from one document into another, and writing the
result out to a new file.
When I then re-parse the resulting document, I find
that the element directly below the one that was inserted is mis-interpreted as
a deferred-text node, rather than being read as an element node.
I've been using the same code to import an element
from one document into another in a few places in my project and not had any
problems. The difference is that this time, I am inserting the imported node
before an existing node, rather than appending to a list of element nodes.
The problem seems to be a missing carriage return
between the end tag of the imported element and the start tag of the next
element. If I go into the file on my hard drive and add that carriage return by
hand, then everything parses correctly. - Which seems odd to me, as my inserted
element is all inserted on one long line and it manages to read all the child
elements in there. There's a couple of references to carriage return issues in
the bug lists for xerces, and I wondered if this was a known issue, or is there
were any work arounds for this.
Thanks for any
help,
Claire
|