[jboss-user] [Beginners Corner] - Re: JBoss4.0.3SP1 | Issues with Parsing XML Schema importin

sg283 do-not-reply at jboss.com
Fri Feb 20 02:24:14 EST 2009


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));

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4211697#4211697

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4211697




More information about the jboss-user mailing list