[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: BOM and encodings questions
Original Message From: "Shlomo Yona" > .1. > > If an XML document starts with the FF FE BOM (UTF-16, little endian) but > the encoding is set to "UTF-8" in the prolog, what is the expected > behavior of the Parser? > > I think that the parser should respect the BOM, read the prolog assuming > it is encoded in UTF-16 little endian and then process the remaining of > the XML document in UTF-8 as the prolog says. > > Is this correct? I don't think so. I don't think there is any notion in XML that a single document (including the Prolog) can be in different character encodings. There's also no text that clearly states where any change of character encoding of that nature would take place. e.g. would it be straight after the encodingDecl attribute, at the end of the XMLDecl, at the start of the element after the XMLDecl? Without such a statement it's impossible to make the switch. I can't see text that says if you have assessed the encoding to be one thing, and the EncodingDecl says it's another thing, then it's an error. The nearest thing I can see is: "It is a fatal error if an XML entity is determined (via default, encoding declaration, or higher-level protocol) to be in a certain encoding but contains byte sequences that are not legal in that encoding." > .2. > > Is an XML parser expected to process a document in alternating > encodings? I mean, is there a way to signal the parser that from a > certain point on the encoding changes to some other encoding? If so, > how? > > > > .3. > > Is there a way to express the expected encoding of the XML document in > the XML Schema? If so, how? No. They are operating at very different domains. HTH, Pete. -- ============================================= Pete Cordell Tech-Know-Ware Ltd for XML to C++ data binding visit http://www.tech-know-ware.com/lmx/ http://www.codalogic.com/lmx/ =============================================
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|