Bug 444802
Summary: | parser error : parsing XML declaration: '?>' expected when DTD specified | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Dave Malcolm <dmalcolm> |
Component: | libxml2 | Assignee: | Daniel Veillard <veillard> |
Status: | CLOSED NOTABUG | QA Contact: | |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 5.0 | ||
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2008-05-12 07:55:22 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Dave Malcolm
2008-04-30 17:36:39 UTC
It's actually not a bug ! But understanding why is a bit nasty ... It all boils down to the SYSTEM identifier you used in the DTD declaration: "" , i.e. an empty string. http://www.w3.org/TR/REC-xml/#NT-doctypedecl and http://www.w3.org/TR/REC-xml/#NT-ExternalID are the production gouverning the DOCTYPE. ------------------------ Definition: The SystemLiteral is called the entity's system identifier. It is meant to be converted to a URI reference (as defined in [IETF RFC 3986]), ------------------------ Now if you go back to RFC 3986] and al. you will find that "" is a correct URI-Reference meaning "the current document containing the reference", so basically you're asking the XML parser to use your XML as the DTD, this leads to a fatal error, the first one being that for an external parsed entity the XML declaration doesn't allow a 'standalone' part. Of course if you don't specify validation, the DTD is not fetched/parsed and the document appears well-formed. The real solution is to follow the indications from XHTML1 and *never* put an empty system identifier, but follow the practice indicated on the spec itself for conformance to the specification: http://www.w3.org/TR/xhtml1/#strict and if you don't want network fetch the solution is to ask xmllint to forbid them with --nonet Definitely not a bug, the XML is actually not well-formed but that can be detected only in validating mode ! Daniel |