ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject XML parser in junit not validating schemas
Date Thu, 12 Aug 2004 12:28:56 GMT

I have a fun little problem

1. unit tests for code that validates XSD documents -and which therefore 
request validation


         XMLReader xerces = 
XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
 
xerces.setFeature("http://apache.org/xml/features/validation/schema",true);

2. intelliJ idea, which runs the tests happily from the in-IDE test runner

3. ant command line , which fails with

Feature 'http://apache.org/xml/features/validation/schema' is not 
recognized.

org.xml.sax.SAXNotRecognizedException: Feature 
'http://apache.org/xml/features/validation/schema' is not recognized. at 
org.apache.xerces.parsers.AbstractSAXParser.setFeature(Unknown Source)

the command line is running forking ant with XML Reporting.


Observations
(a) we have xerces, cos it is what I asked for and got in the stack trace
(b) there is an up to date version of xerces in ant/lib (the one that 
comes with Xom1.0alpha5)
(c)  but it isnt recognising the schema stuff

I am wondering if this is an endorsed directory thing. It also looks 
like something relatively easy to write a unit test for, given that is 
what I already (accidentally) have.

Anyone else hit this?


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message