Re: [xml] [Bug 126351] Changed - Entity resolution failed

On Thu, Nov 06, 2003 at 06:21:06PM +0100, Karl Eichwalder wrote:
+Actually it's for a slightly different reason:
+  booktitle.xml is an external parsed entity.
+The <?xml at the beginning us not parsed using the xmlDecl rule of
+XML-1.0 but by textDecl
+the encoding is mandatory for external parsed entities.
+The document must be fixed. It was a bug in libxml2 that apparently
+got introduced at some point (I used to check that I'm sure) and
+got fixed in 2.6.2
+The gimp files will have to be fixed !
+Or they should use XInclude to aggregate the files instead of
+using external parsed entities.

I guess this section is what you have in mind:

    Although an XML processor is required to read only entities in the
    UTF-8 and UTF-16 encodings, it is recognized that other encodings

  No, it has nothing to do with the encoding of the entity.

What I pointed to is IMHO very clear:
  4.3.1 The Text Declaration

  External parsed entities should each begin with a text declaration.
  Text Declaration
  [77]    TextDecl    ::=    '<?xml' VersionInfo? EncodingDecl S? '?>'

The following entity:
<?xml version='1.0'>

  is fine as a document.
But if used as an external parsed entity it generate a fatal error
because it misses the EncodingDecl encoding part of the text declaration
which is not optional.
Compare to  the XML Declaration
[23]    XMLDecl    ::=    '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'

My conclusion is right, you must add the encoding declaration in the
included entities (or drop the TextDecl altogether if using UTF-8,
or use XInclude instead of parsed entities).


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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