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

Re: Re: XML/XHTML fragment to text

Subject: Re: Re: XML/XHTML fragment to text
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Thu, 16 Aug 2007 16:42:52 +0200
Re:  Re: XML/XHTML fragment to text
Abel Braaksma wrote:

One attribute on xsl:output causes problems always, as far as I could tell, which is the following:


* byte-order-mark

When you use it together with UTF-8 it will offset the amount by one. This is because the byte order mark (xFEFF), when interpreted as a string, will be translated into the equivalent string representation in UTF-8, which is the byte sequence xEFBBBF, now representing the codepoint 65279 (U+FEFF) (Zero Width No Break Space, deprecated but allowed). This interpretation is in lieu of the Unicode recommendation. It is useless to put a BOM at the beginning of a UTF-8 stream, so it is best to avoid it.


Oh, I must be sleeping. The analysis above is correct, but the amount "offset by one" is also correct. A UTF-8 bytestream will never start with the bytes xFFEF or xFEFF. When the BOM is present in UTF-8, it is (and must be) encoded as xEFBBBF, meaning: the UTF-8 representation of U+FEFF. Ergo: the total amount (plus three for the BOM) is correct. Ergo: there are no mistakes in calculation when using the mentioned approach.

Sorry for cluttering this thread...

Cheers,
-- Abel Braaksma

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.