Cirip Tomas wrote:
> Why? Where is it getting "d:\tc\" from? I parse XML Document using following
> code

Without a base systemId to work with, the parser tries to locate
the DTD by using the current working directory of the application
to expand the relative systemId. To avoid this and use your own
base systemId, remember to set the systemId of your input source.

>       InputSource inputSource = new InputSource(new
> java.io.StringReader(getText()));
>         parser.setEntityResolver(new MyEntityResolver());
>       parser.parse(inputSource);

Add a line of code after you create the input source to set a
systemId that it should use to expand relative systemIds. For
example:

  InputSource inputSource = new InputSource(new StringReader(TEXT));
  inputSource.setSystemId("http://www.example.com/path/document.xml";);

Then, when the parser sees the relative systemId "test.dtd" 
in your document, the expanded systemId passed to your entity 
resolver will be "http://www.example.com/path/test.dtd";.

-- 
Andy Clark * [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to