Mukul Gandhi commented on XERCESJ-1688:

I've just committed a piece of code, which makes it possible to do XSD 1.1 
validation while doing DOM parsing.

Here's what we need to write in the client side code, to be able to do this,

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
 SchemaFactory sf = 
 Schema schema = sf.newSchema(new File(xsd));
 DocumentBuilder builder = factory.newDocumentBuilder();
 builder.setErrorHandler(new ErrorHandler1());
 Document document = builder.parse(xml);

class ErrorHandler1 implements ErrorHandler {

public void error(SAXParseException arg0) throws SAXException {

public void fatalError(SAXParseException arg0) throws SAXException {

public void warning(SAXParseException arg0) throws SAXException {



> Support for XML Schema 1.1 validation with the DOM and SAX parsers
> ------------------------------------------------------------------
>                 Key: XERCESJ-1688
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1688
>             Project: Xerces2-J
>          Issue Type: Wish
>         Environment: JDK 1.4 and above, OS independent
>            Reporter: Mukul Gandhi
>            Priority: Minor
> XML Schema 1.0 validation has been available in XercesJ since long time. 
> There we have following three methods for doing XML Schema 1.0 validation:
> Using DOM parser,
> Using SAX parser,
> Using JAXP API
> But XercesJ's XML Schema 1.1 processor, supports XML Schema 1.1 validation 
> using only JAXP API. I wish we support XML Schema 1.1 validation, using DOM 
> and SAX parsing as well. I feel, this will make our XML Schema 1.1 validation 
> API complete.
> I'm creating this issue, so that anyone (including me) can try implementing 
> the functionality I've mentioned in this issue.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: j-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-dev-h...@xerces.apache.org

Reply via email to