[jdom-interest] DTD location
Syloke Soong
ssoong at protedyne.com
Tue Nov 14 14:07:47 PST 2006
I have a folder in a netbeans webapp.
/NB-Projects/whatever/app/WEB-INF/fistx/ .
In that folder I have two files.
windsor.xml and its dtd fist.dtd .
windsor.xml starts with these two lines:
<?xml version="1.0" ?>
<!DOCTYPE fist SYSTEM "fist.dtd" >
However, SAX builder keeps insisting on wanting to read the fist.dtd
from
/..../netbeans/tomcat5.5.7/bin .
Is there a way to tell SAX builder to look for the DTD at the directory
where the xml file is being parsed?
Or at any location I wish to specify,
[pseudo-code]
String fistdtd =
session.getServletContext()
.getRealPath("/WEB-INF/fistx/fist.dtd");
SAXBuilder saxb = new SAXBuilder();
saxb.setValidation(fistdtd);
[/pseudo-code]
Additionally,
[pseudo-code]
saxb.setValidation(
"http|ftp ://MyFavouriteServer/myFavouriteDTDs/fist.dtd");
[/pseudo-code]
I could specify
<!DOCTYPE fist SYSTEM /NB-Projects/whatever/app/WEB-INF/fistx/fist.dtd"
>
But that would not be very portable, would it?
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender immediately. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Even though this company takes every precaution to ensure this email is virus-free, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
Protedyne Corporation, 1000 Day Hill Rd, Windsor, CT 06095, USA,
www.protedyne.com
More information about the jdom-interest
mailing list