Re: [xml] xmlDocDump() fails to dump the DTD

On Sat, Jan 19, 2002 at 09:03:45AM -0800, William King wrote:
Well, I think this is a bug, but it could just be may total failure to
understand how libXml is supposed to be used :-).

xmlDocDump() fails to dump the DTD. A suggested patch is to add the
following in xmlDocContentDumpOutput() in tree.c.

If the current behaviour is the desired behaviour, I'd appreciate
understanding why.

 the current behaviour is the normal one. 

-     if (cur->intSubset != NULL) {
-           xmlNodeDumpOutput(buf, cur, (xmlNodePtr) cur->intSubset, 0,
format, encoding);
-           xmlOutputBufferWriteString(buf, "\n");
-     }

Because the DTD is normally linked as a child of doc too and this would lead
to serialize it twice.

-     if (cur->extSubset != NULL) {
-           xmlNodeDumpOutput(buf, cur, (xmlNodePtr) cur->extSubset, 0,
format, encoding);
-           xmlOutputBufferWriteString(buf, "\n");
-     }

I'm sorry that part is really not appropriate, it's trying to serialize the
external subset as part of the document entity while it's precisely not part
of that entity (it's external !).


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml Gnome XML XSLT toolkit | Rpmfind RPM search engine

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