XSD-Validation speed not linear
I'm validating an xml file using an xsd schema with JAXP. My xml contains a huge amount of "position"-nodes. Validating works well for small xml files.
Lets say we have 500 positions, this needs about 1 minute. But when I validate an xml file that contains 1000 positions, the validation needs about 8 minutes....8 times longer for only the double amount of positions.
I'm using JAXP_14_Nightly.jar from September 27, 2007 at 11:15:39 PM. With JAXP SP2 it's even slower.
I also tried to remove keyrefs from my schema, but this didn't help...
Validation code (extract):
String xsdFile = "files://.....";
//Load XSD Schema
SchemaFactory jaxp = SchemaFactory.newInstance(SCHEMALANG);
myXSD= jaxp.newSchema(new StreamSource(xsdFile));
SAXSource source = new SAXSource(new InputSource(_xmlInputStream));
//Validate xml file against XSD file
Validator validator = myXSD.newValidator();
//Register error handler
//Register SAX data handler
SAXResult sax = new SAXResult(saxErrorHandler);