[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: encoding <-> omit-xml-declaration

Subject: RE: encoding <-> omit-xml-declaration
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Mon, 19 Jan 2004 02:27:44 -0000
omit xml declaration
> i have just noticed, that if i have
>     <xsl:output method="xml" omit-xml-declaration="yes"/>
> i get the output file with no xml declaration (as it should be).
> 
> but if i set the encoding attribute on anything different 
> than UTF-8 the omit-xml-declaration get ignored and i always 
> get the xml declaration at the beginning of the output file.
> 
> could anyone explain me this correlation?

The XSLT 1.0 spec doesn't say explicitly what the processor should do in
this situation, but it does say that the serializer must generate
well-formed XML. XML encoded in anything other than UTF-8 or UTF-16 must
have an XML declaration to be well-formed, so something has to give.
With Saxon, it's the omit-xml-declaration that gives, and that's what's
specified in XSLT 2.0.

Michael Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.