[ 
http://issues.apache.org/jira/browse/XALANC-597?page=comments#action_12365144 ] 

David Bertoni commented on XALANC-597:
--------------------------------------

You are missing the very first sentence of the XML output method section:

http://www.w3.org/TR/xslt#section-XML-Output-Method

"The xml output method outputs the result tree as a well-formed XML external 
general parsed entity."

A general parsed entity that is not encoded in UTF-8 or UTF-16 must have an 
XML/text declaration with an encoding "attribute" to be well-formed:

http://www.w3.org/TR/REC-xml/#charencoding

"Although an XML processor is required to read only entities in the UTF-8 and 
UTF-16 encodings, it is recognized that other encodings are used around the 
world, and it may be desired for XML processors to read entities that use them. 
In the absence of external character encoding information (such as MIME 
headers), parsed entities which are stored in an encoding other than UTF-8 or 
UTF-16 MUST begin with a text declaration (see 4.3.1 The Text Declaration) 
containing an encoding declaration:"

Saxon and Xalan-C++ used to get this right.  Now, only Saxon does the right 
thing.

XSLT processors create well-formed external general parsed entities, not 
something that only becomes well-formed with information from some external 
transport protocol.

> Serializers for encodings other than UTF-8 and UTF-16 should not omit the XML 
> declaration
> -----------------------------------------------------------------------------------------
>
>          Key: XALANC-597
>          URL: http://issues.apache.org/jira/browse/XALANC-597
>      Project: XalanC
>         Type: Bug
>     Versions: CurrentCVS
>     Reporter: David Bertoni
>     Assignee: David Bertoni
>  Attachments: patch.diff
>
> Our new serializer for encodings other than UTF-8 and UTF-16 will omit the 
> XML declaration if the xsl:output element attribute omit-xml-declaration is 
> equal to "yes."  This is contrary to what the XSLT recommendation states, as 
> it can create XML that is not well-formed.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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

Reply via email to