[[ begin unhelpful rant ]] DTD's - the bane of XML. Parsers are required to
hunt them down in order to support a few unnecessary features of XML even
when you don't care about validation. The easiest workaround is to create an
empty DTD file, but you can also write code to cauterize DTDs in a more
powerful way by inserting a resolver that effectively does the same thing.
I'm sorry but I don't know how to do that w/Xproc. [[ end unhelpful rant ]]
_____
From: xproc-dev-request@w3.org [mailto:xproc-dev-request@w3.org] On Behalf
Of Jostein Austvik Jacobsen
Sent: Thursday, October 21, 2010 10:58 AM
To: xproc-dev@w3.org
Subject: p:load can't find missing DTD when not validating against it...
I'm trying to load an XML-file that declares a DTD in its doctype, but the
DTD isn't available. I don't need to validate against it anyway, but the
declaration is there. This doesn't work:
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:c="http://www.w3.org/ns/xproc-step"
version="1.0">
<p:input port="source">
<p:inline>
<test/>
</p:inline>
</p:input>
<p:output port="result"/>
<p:store href="test.xml" doctype-public="-//TEST//DTD TEST Test//EN"
doctype-system="test.dtd"/>
<p:load href="test.xml" dtd-validate="false"/>
</p:declare-step>
Shortened down, this is the error I get:
com.xmlcalabash.core.XProcException: XProc error err:XD0011
at com.xmlcalabash.core.XProcException.dynamicError(XProcException.java:176)
Caused by: net.sf.saxon.s9api.SaxonApiException:
java.io.FileNotFoundException: /home/jostein/Skrivebord/test.dtd (No such
file or directory)
at net.sf.saxon.s9api.DocumentBuilder.build(DocumentBuilder.java:338)
Caused by: net.sf.saxon.trans.XPathException: java.io.FileNotFoundException:
/home/jostein/Skrivebord/test.dtd (No such file or directory)
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:423)
Caused by: java.io.FileNotFoundException: /home/jostein/Skrivebord/test.dtd
(No such file or directory)
So it looks for the DTD, even though I specifically ask it not to validate
against it. Is this correct behavior?
As you can see from the output, I'm using Calabash (CLI reports version
0.9.22 although I think I've installed 0.9.23).
Best regards
Jostein Austvik Jacobsen