Title: Root tag name missing in DOCTYPE declaration when serializing using 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: [EMAIL PROTECTED]

Reply via email to