Re: [xml] Problem validating documents containing public entities with empty URIs

On Fri, Sep 10, 2010 at 02:52:17PM +0200, Nikolai Weibull wrote:

Given the following files, invoking xmllint failes to validate a.xml,
instead spewing out the same couple of error messages over and over

XML_CATALOG_FILES=catalog xmllint --valid a.xml


<!ELEMENT a (b)>


<!DOCTYPE a PUBLIC "" "a.dtd" [
<!ENTITY b PUBLIC "b" "">

I failed to determine a way of solving this, though I only glanced at
the source.

[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]), as part of the process of dereferencing it to obtain input for
the XML processor to construct the entity's replacement text.]

If you look at RFC3986 you will see that and empty string is a correct
URI interpreted as an URI-Reference pointing to the containing document.

Hence using "" means 'this document' and the behaviour you are seing.

All normal, you asked for something foolish, and you got it :-)
Instead of trying to turn around thefact taht an URI is being needed
by trying to avoid it, define and URI, it's needed, it's mandated by the
XML specification (contrary to e.g. SGML).


Daniel Veillard      | libxml Gnome XML XSLT toolkit
daniel veillard com  | Rpmfind RPM search engine | virtualization library

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