Resolving Entities 2003-11-18 - By Eric Sirianni
I am trying to parse the following XML document using Xerces-J:
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ <!ENTITY chap1 SYSTEM "chap1.xml"> <!ENTITY chap2 SYSTEM "chap2.xml"> ]> <book> &chap1; &chap2; </book>
The parser seems to be having an issue resolving the locations of chap1.xml and chap2.xml. It appears to be looking for them in the directory from which I ran java, instead of relative to the original XML doc. Here is the error I receive:
java.io.FileNotFoundException: C:\wherever-i-run-java\chap1.xml (The system cannot find the file specified)
Clearly, I don't want to add full path names to these entity declarations. The XML document above and chap1.xml and chap2.xml are all in the same directory, so I would expect the parser to attempt to search there first... no?
This must be a common issue, but I can't find any information on how to resolve this...
Thanks, Eric
--------------------------------------------------------------------- To unsubscribe, e-mail: xerces-j-user-unsubscribe@(protected) For additional commands, e-mail: xerces-j-user-help@(protected)
|
|