ODE-1032: Update xerces to the latest 2.11.0 version. Thanks to Igor Vorobiov for the patch.
Project: http://git-wip-us.apache.org/repos/asf/ode/repo Commit: http://git-wip-us.apache.org/repos/asf/ode/commit/2c01017f Tree: http://git-wip-us.apache.org/repos/asf/ode/tree/2c01017f Diff: http://git-wip-us.apache.org/repos/asf/ode/diff/2c01017f Branch: refs/heads/master Commit: 2c01017fd7c3025761432c6ef015c0f971df0dcb Parents: 0c9e3a7 Author: Tammo van Lessen <[email protected]> Authored: Wed Jun 10 16:01:29 2015 +0200 Committer: Tammo van Lessen <[email protected]> Committed: Wed Jun 10 16:08:17 2015 +0200 ---------------------------------------------------------------------- dependencies.rb | 2 +- .../apache/ode/utils/xsd/SchemaModelImpl.java | 44 ++++++++++---------- 2 files changed, 22 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ode/blob/2c01017f/dependencies.rb ---------------------------------------------------------------------- diff --git a/dependencies.rb b/dependencies.rb index 9a69f1a..a790e28 100644 --- a/dependencies.rb +++ b/dependencies.rb @@ -143,7 +143,7 @@ TRANQL = [ "tranql:tranql-connector:jar:1.1", COMMONS.primitives ] WOODSTOX = "woodstox:wstx-asl:jar:3.2.4" WSDL4J = "wsdl4j:wsdl4j:jar:1.6.3" XALAN = "xalan:xalan:jar:2.7.1" -XERCES = "xerces:xercesImpl:jar:2.9.1" +XERCES = "xerces:xercesImpl:jar:2.11.0" WS_COMMONS = struct( :axiom =>AXIOM, :neethi =>"org.apache.neethi:neethi:jar:3.0.2", http://git-wip-us.apache.org/repos/asf/ode/blob/2c01017f/utils/src/main/java/org/apache/ode/utils/xsd/SchemaModelImpl.java ---------------------------------------------------------------------- diff --git a/utils/src/main/java/org/apache/ode/utils/xsd/SchemaModelImpl.java b/utils/src/main/java/org/apache/ode/utils/xsd/SchemaModelImpl.java index 78e63ea..072a990 100644 --- a/utils/src/main/java/org/apache/ode/utils/xsd/SchemaModelImpl.java +++ b/utils/src/main/java/org/apache/ode/utils/xsd/SchemaModelImpl.java @@ -18,9 +18,21 @@ */ package org.apache.ode.utils.xsd; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.net.URI; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import javax.xml.namespace.QName; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.xerces.dom.DOMInputImpl; import org.apache.xerces.impl.Constants; import org.apache.xerces.impl.xs.XMLSchemaLoader; +import org.apache.xerces.impl.xs.util.LSInputListImpl; import org.apache.xerces.xni.XMLResourceIdentifier; import org.apache.xerces.xni.XNIException; import org.apache.xerces.xni.parser.XMLEntityResolver; @@ -28,20 +40,10 @@ import org.apache.xerces.xni.parser.XMLInputSource; import org.apache.xerces.xs.LSInputList; import org.apache.xerces.xs.XSModel; import org.apache.xerces.xs.XSTypeDefinition; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.w3c.dom.DOMErrorHandler; import org.w3c.dom.DOMError; +import org.w3c.dom.DOMErrorHandler; import org.w3c.dom.ls.LSInput; -import javax.xml.namespace.QName; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.net.URI; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - /** * Xerces based schema model. */ @@ -79,18 +81,14 @@ public class SchemaModelImpl implements SchemaModel { ++idx; } - LSInputList list = new LSInputList() { - public LSInput item(int index) { - DOMInputImpl input = new DOMInputImpl(); - input.setSystemId(uris[index]); - input.setByteStream(new ByteArrayInputStream(content[index])); - return input; - } - - public int getLength() { - return uris.length; - } - }; + LSInput[] inputs = new LSInput[uris.length]; + for (int index = 0; index < uris.length; index++) { + DOMInputImpl input = new DOMInputImpl(); + input.setSystemId(uris[index]); + input.setByteStream(new ByteArrayInputStream(content[index])); + inputs[index] = input; + } + LSInputList list = new LSInputListImpl(inputs, inputs.length); XSModel xsm = schemaLoader.loadInputList(list); return new SchemaModelImpl(xsm);
