John McNally wrote:
> 
> I would like to get it figured out directly with xerces.  Torque's
> XmlToAppData class contains the line I have commented out below.  I
> added the the second feature.  My understanding is as follows: the first
> feature sets validation to be optional depending on whether xerces was
> able to find the dtd.  The second feature tells xerces to validate.  So
> with the first line commented out xerces would throw an exception if it
> could not find the dtd.  The first line without the second would not
> tell xerces to validate.  But obviously my interpretation is not
> completely correct, as I am not getting validation under any
> combination.
> 
>             //parser.setFeature(
>             //    "http://apache.org/xml/features/validation/dynamic",
> true);
>             parser.setFeature("http://xml.org/sax/features/validation",
> true);
> 

Ok, if you are seeing no validation, are you using an errorhandler?  ie:

parser.setErrorHandler(new ErrorHandlerImplementation());

ErrorHandlerImplementation would implement org.xml.sax.ErrorHandler.  So
the pseudo-ish code to report validation error is:

class ErrorHandlerImplementation implements ErrorHandler
{
...
public void error(SAXParseException spe)
{
  System.out.println("Line: " + spe.getLineNumber() +
  " Row: " + spe.getColumnNumber() +
  " Msg: " + spe.getMessage());
}
...
}

Regards,
~Eric

-- 
Eric J Altman
[EMAIL PROTECTED]


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to