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

Re: Re: Problem with encoding using document function

Subject: Re: Re: Problem with encoding using document function
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 2 Mar 2005 12:58:16 GMT
createprocessinginstruction utf 8
  aDocXml.createProcessingInstruction("xml", " version='1.0'

the <?xml syntax is not a processing instruction, it's an xml
declaration. It tells a parser some things (mainly the encoding) that it
needs to interpret the bytes in the file as unicode characters. once the
thing is parsed into a tree it's not really in an encoding at all in
that sense it is a data structure that contains characters, not a string
of bytes that encode uniocde according to some encoding. (Of course
really it's all just 1's and 0's in memory so everything is an encoding
really but that is working at a different level.

So if your xsml document has already been processed enough to generate
an aDocXml object the system must already have figured out what encoding
the original file was in, so the above, even if it worked, would not
have any effect.

> I've attached the string containing the instruction to the beginig of the XML.
> response.Write "<?xml version=""1.0"" encoding=""ISO-8859-1"" ?>" & aDocXml.xml

that looks dangerous. The rest of the file will be linearised according
to the object's .xml method in whatever encoding that uses (mst likely
utf8 or utf16 I'd have thought) but you are unconditionally appending a
declaration that the file is in latin1. Note that if the file is in utf8
but you say it's latin1 you won't get an error, you just get spurious
characters which is why people often complain about getting accented A
appearing before no breaking space; it's what you get if you interpret
a utf8 byte stream as latin 1.


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:

Current Thread


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.
First Name
Last Name
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.