At 12:07 PM 09/27/2000 -0400, Garg, Sanjeev wrote:
> The way, I have included DTD in the XML is:
> <!DOCTYPE TestXML SYSTEM "test.dtd">
> But somehow, when I run my application and it tries to parse the XML
>document, I get the following SAXParserException:
> Relative URI "test.dtd"; can not be resolved without a document URI.
> I was getting the same kind of error in Windows as well. It was because
>of the way I referred to my DTD.
> <!DOCTYPE TestXML SYSTEM "c:\\test.dtd"> was generating the same error.
> But when I referred it as:
> <!DOCTYPE TestXML SYSTEM "file:///c:/test.dtd"> ; it started working.
> Now how to do the same thing on a UNIX system???
I don't know for sure (must've left my Solaris system in my other jeans :).
But you might try a relative path which points up to the parent directory,
then comes back down to the DTD, like:
<!DOCTYPE TestXML SYSTEM "../test.dtd">
The error you were experiencing with Windows might seem strange. (OTOH, I
often test XSLT stylesheets in the same folder as the source XML, and never
have had to use drive letters or paths.) But it's quite possible that the
parser is expecting a URI of a valid form, and:
is not a valid URI, while:
*is* a valid URI.
My understanding of the file:/// "protocol" in URIs is that what follows it
is OS-dependent. So presumably you'd use something like:
Sorry -- that probably wasn't very helpful!
John E. Simpson | "If you were going to
http://www.flixml.org | shoot a mime, would you use
XML Q&A: http://www.xml.com | a silencer?" (Steven Wright)