The XML 1.0 specification defines the XML document type declaration to be

'<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'

which corresponds to your first example

<?xml version="1.0" encoding="UTF-8" standalone="no"?>


While the EncodingDecl and SDDecl parts are optional, the order of items is
NOT.

-----Original Message-----
From: Hollenbeck, Scott [mailto:[EMAIL PROTECTED]
Sent: Monday, April 30, 2001 8:50 AM
To: '[EMAIL PROTECTED]'
Subject: Encoding Attribute Placement


Might anyone offer any insights into why Xerces-J 1.3.1 is sensitive to
placement of the "encoding" and "standalone" attributes in an XML
declaration?  For example, these declarations works fine:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<?xml version="1.0" encoding="UTF-8"?>

but this one:

<?xml version="1.0" standalone="no" encoding="UTF-8"?>

produces an error:

>java sax.SAXCount -v foo.xml
[Fatal Error] foo.xml:1:37: The XML declaration must end with "?>".
org.xml.sax.SAXException: Stopping after fatal error: The XML declaration
must end with "?>".
...

<Scott/>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





======================= Confidentiality Statement ======================= 
The information contained in this message and any attachments is 
intended only for the use of the individual or entity to which it is 
addressed, and may contain information that is PRIVILEGED, CONFIDENTIAL 
and exempt from disclosure under applicable law.  If you have received 
this message in error, you are prohibited from copying, distributing, or 
using the information.  Please contact the sender immediately by return 
e-mail and delete the original message from your system. 
===================== End Confidentiality Statement =====================  



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to