[ https://issues.apache.org/jira/browse/XERCESJ-1703?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Terry Lacy updated XERCESJ-1703: -------------------------------- Affects Version/s: 2.12.0 > Can't get validation examples to work with XSD 1.1 > -------------------------------------------------- > > Key: XERCESJ-1703 > URL: https://issues.apache.org/jira/browse/XERCESJ-1703 > Project: Xerces2-J > Issue Type: Bug > Affects Versions: 2.12.0 > Environment: Windows 10 Enterprise > JDK 1.8.0_121 64-bit > Maven 3.3.9 on Spring Tool Suite 3.9.4.RELEASE > Reporter: Terry Lacy > Priority: Major > > I'm using Maven. I have this dependency: > {code:java} > <dependency> > <groupId>xerces</groupId> > <artifactId>xercesImpl</artifactId> > <version>2.12.0</version> > </dependency>{code} > I've attempted exactly the code shown in XERCES-1688 and in the documentation > example here: [https://xerces.apache.org/xerces2-j/faq-xs.html.] > They do not work. When I get to this line: > {code:java} > SchemaFactory.newInstance("http://www.w3.org/XML/XMLSchema/v1.1");{code} > I get the exception: > {code:java} > java.lang.IllegalArgumentException: No SchemaFactory that implements the > schema language specified by: http://www.w3.org/XML/XMLSchema/v1.1 could be > loaded > at > javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:215){code} > Is there something missing from the sample code? Does the maven artifact in > maven central not have 1.1 support? > Here's the code I'm currently using: > > {code:java} > private static final String W3C_XML_SCHEMA_11_NS_URI = > "http://www.w3.org/XML/XMLSchema/v1.1"; > // ... > saxParserFactory = SAXParserFactory.newInstance(); > saxParserFactory.setNamespaceAware(true); > // Throws exception here: > schemaFactory = SchemaFactory.newInstance(W3C_XML_SCHEMA_11_NS_URI); > saxParserFactory.setSchema(schemaFactory.newSchema(new File(schemaFile))); > saxParser = saxParserFactory.newSAXParser(); > {code} > > -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: j-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: j-dev-h...@xerces.apache.org