You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Salim Erradey <se...@innovance.com> on 2001/12/20 21:25:20 UTC
Root tag name missing in DOCTYPE declaration when serializing usi
ng SAX
Hi,
I am serializing an XML document using SAX interfaces:
OutputFormat fmt = new OutputFormat ("xml", "UTF-8", true);
fmt.setDoctype(publicId, dtdUrl);
XMLSerializer xmlSerializer = new XMLSerializer(writer, fmt);
xmlSerializer.startDocument();
...
empty = new String();
//root is the root element
xmlSerializer.startElement(empty, empty, root, attrs);
...
The output I am getting is missing the root tag in the DOCTYPE declaration:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE PUBLIC "publicID" "myDTD.dtd">
<root>
...
</root>
How do I make sure that my DOCTYPE declaration states the root element name
?
Thanks,
Salim Erradey
e-mail: serradey@innovance.com