Print

Print


How do I use something like xmllint to validate a TEI document  
against a remote DTD?

I have sets of TEI P4 documents that all validate against my locally  
stored version of the DTD. Each document has the following declaration:

   <!DOCTYPE TEI.2 PUBLIC "-//TEI P4//DTD Main Document Type//EN"
   "http://infomotions.com/alex/dtd/tei2.dtd" [
   <!ENTITY % TEI.XML     'INCLUDE' >
   <!ENTITY % TEI.prose   'INCLUDE' >
   <!ENTITY % TEI.linking 'INCLUDE' >
   <!ENTITY % TEI.figures 'INCLUDE' >
   <!ATTLIST xptr   url CDATA #IMPLIED >
   <!ATTLIST xref   url CDATA #IMPLIED >
   <!ATTLIST figure url CDATA #IMPLIED >
   ]>

Using the following command I can validate my documents against the DTD:

   xmllint --valid --noout twain-new-642.xml

I have moved my documents to a location remote from the DTD, and I  
can validate them just like before, but the validation process takes  
a long time because xmllint needs to get my DTD from a remote host.  
(Bummer.) Then I got the bright idea of copying the DTD from the  
remote host to the new host and then using something like the  
following commands to validate my documents against the copied DTD:

   xmllint --loaddtd ./dtd/tei2.dtd --noout poe-cask-641.xml
   xmllint --dtdvalid ./dtd/tei2.dtd --noout poe-cask-641.xml


Alas, these commands do not work. The former fetches the remote DTD  
anyway and returns a parser error. The second just returns a parser  
error. Moreover, the parser errors are different from command to  
command. Go figure.

What am I doing wrong?

-- 
Eric Lease Morgan
Head, Digital Access and Information Architecture Department
University Libraries of Notre Dame