[ 
https://issues.apache.org/jira/browse/XERCESJ-150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18003478#comment-18003478
 ] 

Elliotte Rusty Harold commented on XERCESJ-150:
-----------------------------------------------

verified this is still an issue

> Processing instruction cannot precede doctype
> ---------------------------------------------
>
>                 Key: XERCESJ-150
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-150
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: Serialization
>    Affects Versions: 2.0.0
>         Environment: Operating System: Other
> Platform: Other
>            Reporter: Paul Prescod
>
> Given: 
> {noformat}
>     public static void main(String []args) throws SAXException{
>         XMLSerializer serializer = new XMLSerializer();
>         serializer.setOutputByteStream(System.out);
>         serializer.startDocument();
>         serializer.processingInstruction("foo", "bar");
>         serializer.startDTD("foo", "bar", "baz");
>         serializer.startElement("foo", "bar", "bar", null);
>         serializer.endElement("foo", "bar", "bar");
>         serializer.endDocument();
>     }
> {noformat}
> Xerces goes to a great deal of effort to make the processing instruction 
> appear 
> AFTER the doctype (serializePreRoot etc.). But why is this so? It is 
> perfectly 
> legal in XML for a processing instruction to proceed the doctype!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to