You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Kelvin Lawrence <kl...@us.ibm.com> on 2000/12/11 21:33:21 UTC

resolveEntity and systemId question

Sorry if this has been asked before but I would appreciate an answer.

Even though I do make sure I set the system ID before calling the parser,
when I parse XML files that refer to a Schema, and my resolveEntity method
is called, the value of systemId is just the file name (not a full URL with
a path). However, if the XML file uses a DTD file, then when resolveEntity
gets called I get passed the full URL of the form
file:///mypath/mydir/myfile.dtd . Is this a Xerces bug or am I probably
doing something wrong in my code. Seems that regardless of whether I am
dealing with DTDs or Schemas that my code should be passed the fully
qualified URL to the "schema" as the parser has that information available.
Without this I have to try and figure out in my own code where the schema
is even though the parser knows where it is.

Thanks
Kelvin



Re: resolveEntity and systemId question

Posted by Elena Litani <hl...@jtcsv.com>.
Hi, Kelvin, 

> when I parse XML files that refer to a Schema, and my resolveEntity method
> is called, the value of systemId is just the file name (not a full URL with
> a path). However, if the XML file uses a DTD file, then when resolveEntity
> gets called I get passed the full URL of the form
> file:///mypath/mydir/myfile.dtd . Is this a Xerces bug or am I probably
> doing something wrong in my code.

I think that this is a bug in XMLValidator. We should expand path for
schema file before calling user's EntityResolver. The proposed patch is
attached. 

Eric, can you, please, confirm that this is a right thing to do?

Thank you,
Elena


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org