Skip to content

Commit

Permalink
Merge pull request #1 from clarin-eric/master
Browse files Browse the repository at this point in the history
Upgrade Xerces for 1.1.1 release
  • Loading branch information
menzowindhouwer authored Aug 18, 2021
2 parents 42c0d85 + 9c144cb commit 3cb5924
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.project

/.settings/
.vscode/settings.json
24 changes: 20 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>nl.mpi.tla</groupId>
<artifactId>SchemAnon</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
Expand All @@ -14,7 +14,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
<version>2.11.0</version>
<type>jar</type>
</dependency>
<dependency>
Expand All @@ -24,9 +24,25 @@
<type>jar</type>
</dependency>
<dependency>
<groupId>xerces</groupId>
<groupId>org.exist-db.thirdparty.xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0-xml-schema-1.1-beta</version>
<version>2.12.0</version>
<classifier>xml-schema-1.1</classifier>
<scope>runtime</scope>
</dependency>

<!-- xpath2 and java-cup are needed at runtime
for xercesImpl Schema 1.1 support -->
<dependency>
<groupId>org.exist-db.thirdparty.org.eclipse.wst.xml</groupId>
<artifactId>xpath2</artifactId>
<version>1.2.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>edu.princeton.cup</groupId>
<artifactId>java-cup</artifactId>
<version>10k</version>
<scope>runtime</scope>
</dependency>
<dependency>
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/nl/mpi/tla/schemanon/SchemAnon.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import java.io.IOException;
import java.net.URL;
import java.util.List;

import javax.xml.XMLConstants;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
Expand Down Expand Up @@ -219,7 +221,8 @@ private synchronized Schema getXSD() throws SchemAnonException, IOException {
System.setProperty("javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema/v1.1",
"org.apache.xerces.jaxp.validation.XMLSchema11Factory");
try {
SchemaFactory sf = SchemaFactory.newInstance("http://www.w3.org/XML/XMLSchema/v1.1");
SchemaFactory sf = SchemaFactory.newInstance("http://www.w3.org/XML/XMLSchema/v1.1");//.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
sf.setFeature("http://apache.org/xml/features/validation/cta-full-xpath-checking",true);
sf.setErrorHandler(new SimpleErrorHandler(msgList,true));
xsdSchema = sf.newSchema(srcSchema);
} catch(Exception ex) {
Expand Down

0 comments on commit 3cb5924

Please sign in to comment.