Hi all,
I was toying with the idea of replacing the XML parser in one of our products with xerces-c 2.5.0 when I came across the following problem while running our regression tests:
A document /tmp/x1.xml uses an external DTD x1.dtd that resides in a subdirectory /tmp/x1d. The document references an external entity e1. The content of /tmp/x1.xml is:
<!DOCTYPE x1 SYSTEM "x1d/x1.dtd"> <x1>&e1;</x1>
The entity e1 is declared in the DTD (in /tmp/x1d/x1.dtd) with a relative pathname like this:
<!ELEMENT x1 ANY> <!ENTITY e1 SYSTEM "e1.txt">
The replacement text of the entity is contained in the file e1.txt in the same subdirectory as the DTD (i.e. /tmp/x1d/e1.txt).
When trying to parse the document /tmp/x1.xml (using a SAX2 parser), xerces throws a runtime exception, telling me that it cannot open the external entity /tmp/e1.txt.
Obviously, the pathname for the external entity is constructed by merging the location of the xml document instance with the relative pathname from the definition of the external entity.
According to section 4.2.2 of the XML spec, the relative pathname of the external entity should be relative to the location of the external entity in which the entity declaration occurs, so the correct path would be /tmp/x1d/e1.txt.
I'm a bit reluctant to post a bug report about this issue because it seems to be such an obvious case. Am I missing something?
I would appreciate any comments or suggestions. Thank you.
Heinz-Detlev
-- Heinz-Detlev Koch, E-Mail: [EMAIL PROTECTED] EPC, Breslauer Str. 33, 68775 Ketsch, Germany Tel.: +49 6202 690685, Fax: +49 6202 690686
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]