Title: RE: Prevent Validation agains DTD of input file ??
You can turn off the validation in different ways.  However, the DTD file has to exist if it is specified in the DOCTYPE of the source XML file.  Even though xalan does not validate, it will raise exception and quit if it can not find the DTD file.
 
To turn off the validation:
 
If you use SAX parser, you may use
    SAXParserFactory.setValidating( false );
or
    org.apache.xerces.parsers.SAXParser.setFeature( "http://xml.org/sax/features/validation", false );
 
If you use DOMSource, you may use
    DocumentBuilderFactory.setValidating( false );
or
    org.apache.xerces.parsers.DOMParser.setFeature( "http://xml.org/sax/features/validation", false );
 
Whatever you use, the DTD file has to exist even if it is empty.
 
cheers,
 
Yueming Xu
Sr. Consutling Architect
Vitria Technology, Inc.
----- Original Message -----
Sent: Thursday, October 04, 2001 6:31 AM
Subject: RE: Prevent Validation agains DTD of input file ??

Sorry, not sure how to do this from the command line.

 

You can easily do it in code though: http://xml.apache.org/xerces-j/features.html

 

Also see: http://www.megginson.com/SAX/Java/features.html

 

Regards,

 

-Chris.

 

Chris Raber, Systems Engineer, AvantGo Inc.

http://www.avantgo.com/

 

-----Original Message-----
From: Nicholas Waltham [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 04, 2001 8:27 AM
To: Christopher Raber; [EMAIL PROTECTED]
Subject: Re: Prevent Validation agains DTD of input file ??

 

Hello Chris,

 Thanks very much for your message. Could you tell me how I do that from the command line? I cannot

find it in the manual.. Sorry to bother you again.


Thanks,

Nicholas Waltham

 

----- Original Message -----

To: 'Nicholas Waltham' ; '[EMAIL PROTECTED]'

Sent: Thursday, October 04, 2001 2:23 PM

Subject: RE: Prevent Validation agains DTD of input file ??

 

Set the feature http://xml.org/sax/features/validation to false.

Chris Raber, Systems Engineer, AvantGo Inc.
http://www.avantgo.com/

-----Original Message-----
From: Nicholas Waltham [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 04, 2001 4:59 AM
To: [EMAIL PROTECTED]
Subject: Prevent Validation agains DTD of input file ??

Hello all,
 I am currently calling Xalan like this?

java org.apache.xalan.xslt.Process -in in.xml -xsl style.xsl -out out.xml

Obviously its vital the input XML file is well formed, but I would like to
have the option to not validate agains a DTD, even when the DTD to use is
specified in the XML file. How can I turn off this validation. If I don't
have the DTD file, it just stops and refuses to go any further.

Thanks in advance,
Nicholas Waltham

Reply via email to