-
1. Re: JBoss4.0.3SP1 | Issues with Parsing XML Schema importin
sg283 Feb 20, 2009 2:24 AM (in response to sg283)Instead of parsing the schema with DOM/SAX, just loading it with URL worked with JBoss.
But I don’t know how and why?
here is the sample code:
URL schemaURL = Thread.currentThread().getContextClassLoader().getResource(WSConstants.BOOKING_SCHEMA_FILE);
SchemaFactory provBookingSchemaFactory = schemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); provBookingSchemaFactory.setErrorHandler(new InvalidXMLErrorHandler());
Schema provBookingSchema = provBookingSchemaFactory.newSchema(schemaURL);
Validator provBookingValidator = provBookingSchema.newValidator();
provBookingValidator.validate(new DOMSource(requestDoc));
Earlier I was creating the schema instance using the DOM source:-
Schema provBookingSchema = provBookingSchemaFactory.newSchema(new DOMSource(schemaDoc));