The quickest answer to your problem is the last item in the FAQ

http://dom4j.org/faq.html

here

http://dom4j.org/faq.html#Cannot%20find%20DTD;%20how%20can%20I%20tell%20dom4
j%20where%20to%20find%20the%20DTD%20from%20a%20DOCTYPE?

its to use an EntityResolver

James
-------
http://radio.weblogs.com/0112098/
----- Original Message -----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 9:46 AM
Subject: Can you please help?



Hi,
I was using dom4j to read and validate an xml file.  At present I am
specifying the location of my xsd file as given below.
<sdd:rules xmlns:sdd="http://www.mycomp.com";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://www.mycomp.com test.xsd">

When test.xsd is in the working directory it validates against the schema.
I would like to include the xml file and the test.xsd in a jar file.  I can
use myclass.class.getResourceAsStream() to read the xml file.  My question
is how to specify the path to the test.xsd within the xml header or is there
another way to do this?

Ideally is there a way to modify this method  which I have in my code to
specify the relative path of the test.xsd ?
public void parseWithSAX(InputStream inStream, boolean validate) throws
DocumentException
        {
                        SAXReader xmlReader = new SAXReader(validate);
                        this.doc = xmlReader.read(inStream);
        }


Thank  you.

Amila.

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


-------------------------------------------------------
This SF.NET email is sponsored by: FREE  SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your  SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to