Author: mukulg Date: Wed Feb 14 11:43:19 2018 New Revision: 1824226 URL: http://svn.apache.org/viewvc?rev=1824226&view=rev Log: as per jira issue XERCESJ-1688, committing implementation of XSD 1.1 validation when doing SAX parsing
Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/SAXParserImpl.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/SAXParserImpl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/SAXParserImpl.java?rev=1824226&r1=1824225&r2=1824226&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/SAXParserImpl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/SAXParserImpl.java Wed Feb 14 11:43:19 2018 @@ -87,6 +87,10 @@ public class SAXParserImpl extends javax /** Property identifier: security manager. */ private static final String SECURITY_MANAGER = Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY; + + /** Property identifier: XML Schema version. */ + private static final String XML_SCHEMA_VERSION = + Constants.XERCES_PROPERTY_PREFIX + Constants.XML_SCHEMA_VERSION_PROPERTY; private final JAXPSAXParser xmlReader; private String schemaLanguage = null; // null means DTD @@ -166,7 +170,11 @@ public class SAXParserImpl extends javax XMLComponent validatorComponent = null; /** For Xerces grammars, use built-in schema validator. **/ if (grammar instanceof XSGrammarPoolContainer) { + String xmlSchemaVersion = ((XSGrammarPoolContainer) grammar).getXMLSchemaVersion(); validatorComponent = new XMLSchemaValidator(); + if ((Constants.W3C_XML_SCHEMA11_NS_URI).equals(xmlSchemaVersion)) { + validatorComponent.setProperty(XML_SCHEMA_VERSION, Constants.W3C_XML_SCHEMA11_NS_URI); + } fSchemaValidationManager = new ValidationManager(); fUnparsedEntityHandler = new UnparsedEntityHandler(fSchemaValidationManager); config.setDTDHandler(fUnparsedEntityHandler); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org