[ http://issues.apache.org/jira/browse/XALANC-597?page=comments#action_12365632 ]
David Bertoni commented on XALANC-597: -------------------------------------- I would really like to see the XSLT working group clarify this, because I don't see how you can satisfy this condition in the XSLT recommendation if you omit the XML declaration: "The xml output method outputs the result tree as a well-formed XML external general parsed entity. If the root node of the result tree has a single element node child and no text node children, then the entity should also be a well-formed XML document entity. When the entity is referenced within a trivial XML document wrapper like this <!DOCTYPE doc [ <!ENTITY e SYSTEM "entity-URI"> ]> <doc>&e;</doc> where entity-URI is a URI for the entity, then the wrapper document as a whole should be a well-formed XML document conforming to the XML Namespaces Recommendation [XML Names]. In addition, the output should be such that if a new tree was constructed by parsing the wrapper as an XML document as specified in [3 Data Model], and then removing the document element, making its children instead be children of the root node, then the new tree would be the same as the result tree, with the following possible exceptions:" In particular, you cannot guarantee that you can parse this XML document to recover the source tree, because the parser will report a fatal error if the external entity needs a text declaration with the proper encoding attribute, and it's not there. This could also create difficulties for users, because they can create XML that may be well-formed, but they will not be able to parse it. It would also be helpful to know if the omit-xml-declaration attribute trumps the standalone attribute, because it's not clear to me from reading the reading the recommendation which wins. > 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]
