[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] [Summary #2] Why is Encoding Metadata (e.g. encoding="UTF-8") put Inside the XML Document?
- From: "Eric Bréchemier" <eric.brechemier@gmail.com>
- To: "Costello, Roger L." <costello@mitre.org>
- Date: Fri, 21 Sep 2007 18:30:48 +0200
"Whitespace may preceed an XML declaration, so an XML parser will
parse through the whitespace bytes until it arrives at the start of
the XML declaration."
This (whitespace before XML declaration) is not allowed by the EBNF
productions defining a well-formed XML Document:
http://www.w3.org/TR/REC-xml/#sec-well-formed
--
"By this point an XML parser will know the endianness and byte-size
being used by the document's encoding. So it can parse the XML
declaration!"
It think there is a fast shortcut here, as shown in examples by
Philippe Poulard and Richard Tobin.
As a side note, you do not mention how the parser figures out whether
there is an XML declaration or not.
--
"Since XML support only a finite set of character encodings the
problem is tractable."
XML _processors_ may support only a finite set of character encodings.
The XML recommendation does not restrict the possible encodings, but
mentions [1] that:
"It is RECOMMENDED that character encodings registered (as charsets)
with the Internet Assigned Numbers Authority [IANA-CHARSETS], other
than those just listed, be referred to using their registered names;
other encodings SHOULD use names starting with an "x-" prefix."
and
"processors are, of course, not required to support all
IANA-registered encodings."
[1] http://www.w3.org/TR/REC-xml/#charencoding
[2] [IANA-CHARSETS] http://www.iana.org/assignments/character-sets
--
some typos
"may preceed an XML declaration"
"may be found in the XML 1.0 Recomendation"
Regards,
Eric Bréchemier
On 9/21/07, Costello, Roger L. <costello@mitre.org> wrote:
> Hi Folks,
>
> Excellent discussion! Thank you!
>
> Here is the updated document, based on my understanding of all your
> comments:
>
> http://www.xfront.com/specifying-encoding/
>
> As always, please let me know of any errors or unclear parts.
>
> /Roger
>
> _______________________________________________________________________
>
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
>
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>
>
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]