Re: [xml] About libxml2 and XML 1.1



Diego Santa Cruz schrieb am 21.07.2010 um 15:33 (+0200):

While libxml2 appears to parse the file correctly it complains that it
does no support that version of XML (parser warning : Unsupported
version '1.1').

I am not familiar with the differences between XML 1.1 and 1.0, so if
someone can enlighten me with respect to libxml2 that would be greatly
appreciated.

All you need to know about XML 1.1 in six paragraphs:

http://www.w3.org/TR/xml11/#sec-xml11

* allow usage of the most weird characters on Earth in element and
  attribute names (upgrade to latest Unicode standard version)
* more liberal, open name definition
* IBM mainframe line endings
* control character policy change
* "full normalization" to allow binary comparison of two documents

Bottom line: don't bother, XML 1.1 is probably irrelevant to you. One
XML expert taught me in his class that XML 1.1 should not be used, and
people shouldn't worry about it. Use XML 1.0 instead.

As LibXML2 doesn't claim to support XML 1.1, you shouldn't expect it to
do.

When encountering a 1.1 document, try changing the version number to
1.0. If it still parses okay using a 1.0-only parser, I'd say it's safe
to assume that the document doesn't use any 1.1 features and hence
should not carry the 1.1 version, but the 1.0 version.

-- 
Michael Ludwig



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]