[xml] xmlCopyDtd() does not copy the children of the DTD node...



If we call xmlCopyDoc() on a document that contains declarations etc 
within its DTD, they will not be copied. This can be demonstrated by
running the attached program on, for instance, test/defattr.xml, and
diffing original.xml and final.xml.

This is because xmlCopyDtd() does not copy the children of the DTD node -
is this the correct behaviour? If not, I'll happily write a patch to try
and fix it, but I'm not entirely sure about the correct way to do it:

1) Should xmlCopyDtd() recursively copy the children of the DTD node, or do
   we want to keep the current behaviour, and have a different function to
   copy a DTD node and its children?
2) This would require the facility to copy the element/attribute/entity
   declaration nodes (any others?), should this just be added to
   xmlStaticCopyNode()?

Thanks,

Anthony

Attachment: test.c
Description: Text document



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]