Hi,

what about something like that:

import java.io.*;
import java.net.*;
import org.xml.sax.*;

public class URLEntityResolver implements EntityResolver
{
    public URLEntityResolver()
    {
    }

    public InputSource resolveEntity (String name, String uri) throws
        IOException, SAXException
    {
        URL url = new URL(uri);
        InputStream inputStream = url.openStream();
        InputSource inputSource =  new InputSource(inputStream);
        inputSource.setSystemId (uri);
        inputSource.setPublicId (name);
        return inputSource;
    }
}

Regards,
Tomasz

-----Ursprungliche Nachricht-----
Von: Ceki Gulcu [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 18. Februar 2003 01:38
An: [EMAIL PROTECTED]
Betreff: good EntityResolver code



Hi all,

Does anyone know how to implement an org.xml.sax.EntityResolver that is 
able to resolve a DTD from a URL? I am sure this has been done a million 
times before, I just don't want to reinvent the wheel...

--
Ceki 


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





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

Reply via email to