Hi Stephan

----- Original Message -----
From: <[EMAIL PROTECTED]>
> Hi all
>
> I have a problem using my app with Java 1.4.
>
> My XML has the following DOCTYPE line:
> <!DOCTYPE MYDEF PUBLIC "-//company//DTD MYDEF//EN"  "mydef.xml">
>
> I'm using my own entity resolver because the DTD is inside the application
jar.
>
> public class MyResolver implements EntityResolver
>  {
>     public InputSource resolveEntity (String publicId, String systemId)
>     {
>                 if (publicId != null && "-//company//DTD
> MYDEF//EN".equals(publicId))
>                 {
>             // read and return the dtd as an input source
>                         .........
>                 }
>
>         // use the default behaviour
>                 return null;
>     }
> }
>
> This approach works fine with Java 1.3.x but running the app with Java 1.4
I'll
> get the following error message:
>
> "Relative URI "mydef.xml"; can not be resolved without a base URI."
>
> Can anybody give me a hint how to solve this problem. I don't have (need)
a base
> URI.

This sounds a bit wierd. You could always try change your URI to
"/mydef.xml" and see if that fixes it. Or you could add an
xml:base="http://acme.com/something"; attribute to your document as described
in XML Base.

e.g.

<?xml version="1.0"?>
<doc xml:base="http://example.org/today/";>
  <head>
    ...

Though its wierd, I thought it wouldn't really matter if you were using your
own EntityResolver. It might be worth creating a simple test case using your
document and EntityResolver and just trying to use SAX to parse the
document - to see if its a problem with the underlying SAX parser that comes
with JDK1.4 or if its something introduced by dom4j.


> BTW: Many thanks for the incredible great DOM4J XML API.

Glad you like it!

James


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to