[xml] Re: passing the FPI to the DTD validator



Daniel Veillard <veillard redhat com> writes:

location of the local copy. I did put such guidelines at 
   http://xmlsoft.org/guidelines.html#Canonical

But there is also http://xmlsoft.org/catalog.html containing some
statements wich are not that clear.  It talks about mapping public
identifiers to local resources.

I have

<public
publicId="-//W3C//DTD XHTML 1.0 Strict//EN"
uri="/etc/xml/w3c/xhtml/1_0/dtd/xhtml1-strict.dtd"/>

According to catalog.html and to the XML Catalogs Working Draft by
Norman Walsh such an entry should be sufficient to map the FPI to the
local file - but libxml2 (xmllint) does not work this way.  It insists
either on a system entry with an systemId/uri mapping or on a
rewriteSystem entry.

xmlcatalog see this resource:

xmlcatalog  /etc/xml/catalog "-//W3C//DTD XHTML 1.0 Strict//EN"
file:///usr/share/sgml/xhtml/xhtml-1.0/DTD/xhtml1-strict.dtd

but xmllint does not make use of the public identifier at all:

xmllint --nonet --valid --noout test.xml
I/O error : Attempt to load network entity http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
test.xml:3: validity error : Validation failed: no DTD found !
<html>
     ^
cat test.xml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html>
  <head>
   <title>ke test</title>
  </head>
  <body>
  </body>
</html>

If you don't want to support public and publicId in a straight forward
manner I'd recommend to add such info to
http://xmlsoft.org/catalog.html .



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