From 87348cc6cd024fab97445f3a62d16c2ba6ae038a Mon Sep 17 00:00:00 2001 From: Menzo Windhouwer Date: Fri, 29 Jan 2021 16:56:36 +0100 Subject: [PATCH 1/2] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b5fec4d..0e6eb22 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ xerces xercesImpl - 2.11.0-xml-schema-1.1-beta + 2.12.1-xml-schema-1.1 runtime From 9c144cbba3e02ddddd11060a7e83968b1da63891 Mon Sep 17 00:00:00 2001 From: Menzo Windhouwer Date: Wed, 18 Aug 2021 22:21:22 +0200 Subject: [PATCH 2/2] Upgrade Xerces --- .gitignore | 1 + pom.xml | 24 +++++++++++++++---- .../java/nl/mpi/tla/schemanon/SchemAnon.java | 5 +++- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index bf27e38..8f7a316 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ .project /.settings/ +.vscode/settings.json diff --git a/pom.xml b/pom.xml index 0e6eb22..304e460 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 nl.mpi.tla SchemAnon - 1.1.0 + 1.1.1 jar @@ -14,7 +14,7 @@ commons-io commons-io - 2.4 + 2.11.0 jar @@ -24,9 +24,25 @@ jar - xerces + org.exist-db.thirdparty.xerces xercesImpl - 2.12.1-xml-schema-1.1 + 2.12.0 + xml-schema-1.1 + runtime + + + + + org.exist-db.thirdparty.org.eclipse.wst.xml + xpath2 + 1.2.0 + runtime + + + edu.princeton.cup + java-cup + 10k runtime diff --git a/src/main/java/nl/mpi/tla/schemanon/SchemAnon.java b/src/main/java/nl/mpi/tla/schemanon/SchemAnon.java index e616010..d9554ca 100644 --- a/src/main/java/nl/mpi/tla/schemanon/SchemAnon.java +++ b/src/main/java/nl/mpi/tla/schemanon/SchemAnon.java @@ -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; @@ -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) {