diff --git a/0001-no-jaxen-dom4.patch b/0001-no-jaxen-dom4.patch new file mode 100644 index 0000000..553a7f7 --- /dev/null +++ b/0001-no-jaxen-dom4.patch @@ -0,0 +1,713 @@ +From b494798add23c21d68b1dd54e8929095396516bb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fridrich=20=C5=A0trba?= +Date: Wed, 23 Aug 2023 20:33:23 +0200 +Subject: [PATCH] no-jaxen-dom4 + +--- + src/main/java/org/dom4j/DocumentFactory.java | 22 +- + src/main/java/org/dom4j/DocumentHelper.java | 16 - + .../java/org/dom4j/tree/AbstractNode.java | 4 - + .../org/dom4j/util/ProxyDocumentFactory.java | 4 - + .../java/org/dom4j/xpath/DefaultXPath.java | 409 ------------------ + .../java/org/dom4j/xpath/XPathPattern.java | 164 ------- + 6 files changed, 2 insertions(+), 617 deletions(-) + delete mode 100644 src/main/java/org/dom4j/xpath/DefaultXPath.java + delete mode 100644 src/main/java/org/dom4j/xpath/XPathPattern.java + +diff --git a/src/main/java/org/dom4j/DocumentFactory.java b/src/main/java/org/dom4j/DocumentFactory.java +index 9aaaa11..fa2bbb8 100644 +--- a/src/main/java/org/dom4j/DocumentFactory.java ++++ b/src/main/java/org/dom4j/DocumentFactory.java +@@ -27,8 +27,6 @@ import org.dom4j.tree.DefaultText; + import org.dom4j.tree.QNameCache; + import org.dom4j.util.SimpleSingleton; + import org.dom4j.util.SingletonStrategy; +-import org.dom4j.xpath.DefaultXPath; +-import org.dom4j.xpath.XPathPattern; + import org.jaxen.VariableContext; + + /** +@@ -219,7 +217,7 @@ public class DocumentFactory implements Serializable { + */ + public XPath createXPath(String xpathExpression) + throws InvalidXPathException { +- DefaultXPath xpath = new DefaultXPath(xpathExpression); ++ XPath xpath = createXPath(xpathExpression); + + if (xpathNamespaceURIs != null) { + xpath.setNamespaceURIs(xpathNamespaceURIs); +@@ -291,22 +289,6 @@ public class DocumentFactory implements Serializable { + // return new DefaultXPath( xpathFilterExpression ); + } + +- /** +- *

+- * createPattern parses the given XPath expression to create +- * an XSLT style {@link Pattern}instance which can then be used in an XSLT +- * processing model. +- *

+- * +- * @param xpathPattern +- * is the XPath pattern expression to create +- * +- * @return a new Pattern instance +- */ +- public Pattern createPattern(String xpathPattern) { +- return new XPathPattern(xpathPattern); +- } +- + // Properties + // ------------------------------------------------------------------------- + +@@ -445,4 +427,4 @@ public class DocumentFactory implements Serializable { + * POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved. +- */ +\ No newline at end of file ++ */ +diff --git a/src/main/java/org/dom4j/DocumentHelper.java b/src/main/java/org/dom4j/DocumentHelper.java +index 865a51a..040770c 100644 +--- a/src/main/java/org/dom4j/DocumentHelper.java ++++ b/src/main/java/org/dom4j/DocumentHelper.java +@@ -160,22 +160,6 @@ public final class DocumentHelper { + return getDocumentFactory().createXPathFilter(xpathFilterExpression); + } + +- /** +- *

+- * createPattern parses the given XPath expression to create +- * an XSLT style {@link Pattern}instance which can then be used in an XSLT +- * processing model. +- *

+- * +- * @param xpathPattern +- * is the XPath pattern expression to create +- * +- * @return a new Pattern instance +- */ +- public static Pattern createPattern(String xpathPattern) { +- return getDocumentFactory().createPattern(xpathPattern); +- } +- + /** + *

+ * selectNodes performs the given XPath expression on the +diff --git a/src/main/java/org/dom4j/tree/AbstractNode.java b/src/main/java/org/dom4j/tree/AbstractNode.java +index 3957c29..e8b14c7 100644 +--- a/src/main/java/org/dom4j/tree/AbstractNode.java ++++ b/src/main/java/org/dom4j/tree/AbstractNode.java +@@ -206,10 +206,6 @@ public abstract class AbstractNode implements Node, Cloneable, Serializable { + return getDocumentFactory().createXPathFilter(patternText); + } + +- public Pattern createPattern(String patternText) { +- return getDocumentFactory().createPattern(patternText); +- } +- + public Node asXPathResult(Element parent) { + if (supportsParent()) { + return this; +diff --git a/src/main/java/org/dom4j/util/ProxyDocumentFactory.java b/src/main/java/org/dom4j/util/ProxyDocumentFactory.java +index 65624be..8bf7e57 100644 +--- a/src/main/java/org/dom4j/util/ProxyDocumentFactory.java ++++ b/src/main/java/org/dom4j/util/ProxyDocumentFactory.java +@@ -146,10 +146,6 @@ public abstract class ProxyDocumentFactory { + return proxy.createXPathFilter(xpathFilterExpression); + } + +- public Pattern createPattern(String xpathPattern) { +- return proxy.createPattern(xpathPattern); +- } +- + // Implementation methods + // ------------------------------------------------------------------------- + protected DocumentFactory getProxy() { +diff --git a/src/main/java/org/dom4j/xpath/DefaultXPath.java b/src/main/java/org/dom4j/xpath/DefaultXPath.java +deleted file mode 100644 +index f81eec5..0000000 +--- a/src/main/java/org/dom4j/xpath/DefaultXPath.java ++++ /dev/null +@@ -1,409 +0,0 @@ +-/* +- * Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved. +- * +- * This software is open source. +- * See the bottom of this file for the licence. +- */ +- +-package org.dom4j.xpath; +- +-import java.io.Serializable; +-import java.util.Collections; +-import java.util.Comparator; +-import java.util.HashMap; +-import java.util.HashSet; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +- +-import org.dom4j.InvalidXPathException; +-import org.dom4j.Node; +-import org.dom4j.NodeFilter; +-import org.dom4j.XPathException; +- +-import org.jaxen.FunctionContext; +-import org.jaxen.JaxenException; +-import org.jaxen.NamespaceContext; +-import org.jaxen.SimpleNamespaceContext; +-import org.jaxen.VariableContext; +-import org.jaxen.XPath; +-import org.jaxen.dom4j.Dom4jXPath; +- +-/** +- *

+- * Default implementation of {@link org.dom4j.XPath}which uses the Jaxen project. +- *

+- * +- * @author bob mcwhirter +- * @author James Strachan +- */ +-public class DefaultXPath implements org.dom4j.XPath, NodeFilter, Serializable { +- private String text; +- +- private XPath xpath; +- +- private NamespaceContext namespaceContext; +- +- /** +- * Construct an XPath +- * +- * @param text +- * DOCUMENT ME! +- * +- * @throws InvalidXPathException +- * DOCUMENT ME! +- */ +- public DefaultXPath(String text) throws InvalidXPathException { +- this.text = text; +- this.xpath = parse(text); +- } +- +- public String toString() { +- return "[XPath: " + xpath + "]"; +- } +- +- // XPath interface +- +- /** +- * Retrieve the textual XPath string used to initialize this Object +- * +- * @return The XPath string +- */ +- public String getText() { +- return text; +- } +- +- public FunctionContext getFunctionContext() { +- return xpath.getFunctionContext(); +- } +- +- public void setFunctionContext(FunctionContext functionContext) { +- xpath.setFunctionContext(functionContext); +- } +- +- public NamespaceContext getNamespaceContext() { +- return namespaceContext; +- } +- +- public void setNamespaceURIs(Map map) { +- setNamespaceContext(new SimpleNamespaceContext(map)); +- } +- +- public void setNamespaceContext(NamespaceContext namespaceContext) { +- this.namespaceContext = namespaceContext; +- xpath.setNamespaceContext(namespaceContext); +- } +- +- public VariableContext getVariableContext() { +- return xpath.getVariableContext(); +- } +- +- public void setVariableContext(VariableContext variableContext) { +- xpath.setVariableContext(variableContext); +- } +- +- public Object evaluate(Object context) { +- try { +- setNSContext(context); +- +- List answer = xpath.selectNodes(context); +- +- if ((answer != null) && (answer.size() == 1)) { +- return answer.get(0); +- } +- +- return answer; +- } catch (JaxenException e) { +- handleJaxenException(e); +- +- return null; +- } +- } +- +- public Object selectObject(Object context) { +- return evaluate(context); +- } +- +- public List selectNodes(Object context) { +- try { +- setNSContext(context); +- +- return (List) xpath.selectNodes(context); +- } catch (JaxenException e) { +- handleJaxenException(e); +- +- return Collections.emptyList(); +- } +- } +- +- public List selectNodes(Object context, org.dom4j.XPath sortXPath) { +- List answer = selectNodes(context); +- sortXPath.sort(answer); +- +- return answer; +- } +- +- public List selectNodes(Object context, org.dom4j.XPath sortXPath, +- boolean distinct) { +- List answer = selectNodes(context); +- sortXPath.sort(answer, distinct); +- +- return answer; +- } +- +- public Node selectSingleNode(Object context) { +- try { +- setNSContext(context); +- +- Object answer = xpath.selectSingleNode(context); +- +- if (answer instanceof Node) { +- return (Node) answer; +- } +- +- if (answer == null) { +- return null; +- } +- +- throw new XPathException("The result of the XPath expression is " +- + "not a Node. It was: " + answer + " of type: " +- + answer.getClass().getName()); +- } catch (JaxenException e) { +- handleJaxenException(e); +- +- return null; +- } +- } +- +- public String valueOf(Object context) { +- try { +- setNSContext(context); +- +- return xpath.stringValueOf(context); +- } catch (JaxenException e) { +- handleJaxenException(e); +- +- return ""; +- } +- } +- +- public Number numberValueOf(Object context) { +- try { +- setNSContext(context); +- +- return xpath.numberValueOf(context); +- } catch (JaxenException e) { +- handleJaxenException(e); +- +- return null; +- } +- } +- +- public boolean booleanValueOf(Object context) { +- try { +- setNSContext(context); +- +- return xpath.booleanValueOf(context); +- } catch (JaxenException e) { +- handleJaxenException(e); +- +- return false; +- } +- } +- +- /** +- *

+- * sort sorts the given List of Nodes using this XPath +- * expression as a {@link Comparator}. +- *

+- * +- * @param list +- * is the list of Nodes to sort +- */ +- public void sort(List list) { +- sort(list, false); +- } +- +- /** +- *

+- * sort sorts the given List of Nodes using this XPath +- * expression as a {@link Comparator}and optionally removing duplicates. +- *

+- * +- * @param list +- * is the list of Nodes to sort +- * @param distinct +- * if true then duplicate values (using the sortXPath for +- * comparisions) will be removed from the List +- */ +- public void sort(List list, boolean distinct) { +- if ((list != null) && !list.isEmpty()) { +- int size = list.size(); +- HashMap sortValues = new HashMap(size); +- +- for (Node node : list) { +- Object expression = getCompareValue(node); +- sortValues.put(node, expression); +- } +- +- sort(list, sortValues); +- +- if (distinct) { +- removeDuplicates(list, sortValues); +- } +- } +- } +- +- public boolean matches(Node node) { +- try { +- setNSContext(node); +- +- List answer = xpath.selectNodes(node); +- +- if ((answer != null) && (answer.size() > 0)) { +- Object item = answer.get(0); +- +- if (item instanceof Boolean) { +- return (Boolean) item; +- } +- +- return answer.contains(node); +- } +- +- return false; +- } catch (JaxenException e) { +- handleJaxenException(e); +- +- return false; +- } +- } +- +- /** +- * Sorts the list based on the sortValues for each node +- * +- * @param list +- * DOCUMENT ME! +- * @param sortValues +- * DOCUMENT ME! +- */ +- protected void sort(List list, final Map sortValues) { +- Collections.sort(list, new Comparator() { +- public int compare(Node n1, Node n2) { +- Object o1 = sortValues.get(n1); +- Object o2 = sortValues.get(n2); +- +- if (o1 == o2) { +- return 0; +- } else if (o1 instanceof Comparable) { +- Comparable c1 = (Comparable) o1; +- +- return c1.compareTo(o2); +- } else if (o1 == null) { +- return 1; +- } else if (o2 == null) { +- return -1; +- } else { +- return o1.equals(o2) ? 0 : (-1); +- } +- } +- }); +- } +- +- // Implementation methods +- +- /** +- * Removes items from the list which have duplicate values +- * +- * @param list +- * DOCUMENT ME! +- * @param sortValues +- * DOCUMENT ME! +- */ +- protected void removeDuplicates(List list, Map sortValues) { +- // remove distinct +- HashSet distinctValues = new HashSet(); +- +- for (Iterator iter = list.iterator(); iter.hasNext();) { +- Node node = iter.next(); +- Object value = sortValues.get(node); +- +- if (distinctValues.contains(value)) { +- iter.remove(); +- } else { +- distinctValues.add(value); +- } +- } +- } +- +- /** +- * DOCUMENT ME! +- * +- * @param node +- * DOCUMENT ME! +- * +- * @return the node expression used for sorting comparisons +- */ +- protected Object getCompareValue(Node node) { +- return valueOf(node); +- } +- +- protected static XPath parse(String text) { +- try { +- return new Dom4jXPath(text); +- } catch (JaxenException e) { +- throw new InvalidXPathException(text, e.getMessage()); +- } catch (RuntimeException e) { +- } +- +- throw new InvalidXPathException(text); +- } +- +- protected void setNSContext(Object context) { +- if (namespaceContext == null) { +- xpath.setNamespaceContext(DefaultNamespaceContext.create(context)); +- } +- } +- +- protected void handleJaxenException(JaxenException exception) +- throws XPathException { +- throw new XPathException(text, exception); +- } +-} +- +-/* +- * Redistribution and use of this software and associated documentation +- * ("Software"), with or without modification, are permitted provided that the +- * following conditions are met: +- * +- * 1. Redistributions of source code must retain copyright statements and +- * notices. Redistributions must also contain a copy of this document. +- * +- * 2. Redistributions in binary form must reproduce the above copyright notice, +- * this list of conditions and the following disclaimer in the documentation +- * and/or other materials provided with the distribution. +- * +- * 3. The name "DOM4J" must not be used to endorse or promote products derived +- * from this Software without prior written permission of MetaStuff, Ltd. For +- * written permission, please contact dom4j-info@metastuff.com. +- * +- * 4. Products derived from this Software may not be called "DOM4J" nor may +- * "DOM4J" appear in their names without prior written permission of MetaStuff, +- * Ltd. DOM4J is a registered trademark of MetaStuff, Ltd. +- * +- * 5. Due credit should be given to the DOM4J Project - http://www.dom4j.org +- * +- * THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND +- * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +- * ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE +- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +- * POSSIBILITY OF SUCH DAMAGE. +- * +- * Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved. +- */ +diff --git a/src/main/java/org/dom4j/xpath/XPathPattern.java b/src/main/java/org/dom4j/xpath/XPathPattern.java +deleted file mode 100644 +index 65d656b..0000000 +--- a/src/main/java/org/dom4j/xpath/XPathPattern.java ++++ /dev/null +@@ -1,164 +0,0 @@ +-/* +- * Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved. +- * +- * This software is open source. +- * See the bottom of this file for the licence. +- */ +- +-package org.dom4j.xpath; +- +-import java.util.ArrayList; +-import java.util.Collections; +- +-import org.dom4j.InvalidXPathException; +-import org.dom4j.Node; +-import org.dom4j.XPathException; +- +-import org.jaxen.Context; +-import org.jaxen.ContextSupport; +-import org.jaxen.JaxenException; +-import org.jaxen.SimpleNamespaceContext; +-import org.jaxen.SimpleVariableContext; +-import org.jaxen.VariableContext; +-import org.jaxen.XPathFunctionContext; +-import org.jaxen.dom4j.DocumentNavigator; +-import org.jaxen.pattern.Pattern; +-import org.jaxen.pattern.PatternParser; +-import org.jaxen.saxpath.SAXPathException; +- +-/** +- *

+- * XPathPattern is an implementation of Pattern which uses an +- * XPath xpath. +- *

+- * +- * @author James Strachan +- * @version $Revision: 1.18 $ +- */ +-public class XPathPattern implements org.dom4j.rule.Pattern { +- private String text; +- +- private Pattern pattern; +- +- private Context context; +- +- public XPathPattern(Pattern pattern) { +- this.pattern = pattern; +- this.text = pattern.getText(); +- this.context = new Context(getContextSupport()); +- } +- +- public XPathPattern(String text) { +- this.text = text; +- this.context = new Context(getContextSupport()); +- +- try { +- this.pattern = PatternParser.parse(text); +- } catch (SAXPathException e) { +- throw new InvalidXPathException(text, e.getMessage()); +- } catch (RuntimeException e) { +- throw new InvalidXPathException(text); +- } +- } +- +- public boolean matches(Node node) { +- try { +- context.setNodeSet(Collections.singletonList(node)); +- +- return pattern.matches(node, context); +- } catch (JaxenException e) { +- handleJaxenException(e); +- +- return false; +- } +- } +- +- public String getText() { +- return text; +- } +- +- public double getPriority() { +- return pattern.getPriority(); +- } +- +- public org.dom4j.rule.Pattern[] getUnionPatterns() { +- Pattern[] patterns = pattern.getUnionPatterns(); +- +- if (patterns != null) { +- int size = patterns.length; +- XPathPattern[] answer = new XPathPattern[size]; +- +- for (int i = 0; i < size; i++) { +- answer[i] = new XPathPattern(patterns[i]); +- } +- +- return answer; +- } +- +- return null; +- } +- +- public short getMatchType() { +- return pattern.getMatchType(); +- } +- +- public String getMatchesNodeName() { +- return pattern.getMatchesNodeName(); +- } +- +- public void setVariableContext(VariableContext variableContext) { +- context.getContextSupport().setVariableContext(variableContext); +- } +- +- public String toString() { +- return "[XPathPattern: text: " + text + " Pattern: " + pattern + "]"; +- } +- +- protected ContextSupport getContextSupport() { +- return new ContextSupport(new SimpleNamespaceContext(), +- XPathFunctionContext.getInstance(), +- new SimpleVariableContext(), DocumentNavigator.getInstance()); +- } +- +- protected void handleJaxenException(JaxenException exception) +- throws XPathException { +- throw new XPathException(text, exception); +- } +-} +- +-/* +- * Redistribution and use of this software and associated documentation +- * ("Software"), with or without modification, are permitted provided that the +- * following conditions are met: +- * +- * 1. Redistributions of source code must retain copyright statements and +- * notices. Redistributions must also contain a copy of this document. +- * +- * 2. Redistributions in binary form must reproduce the above copyright notice, +- * this list of conditions and the following disclaimer in the documentation +- * and/or other materials provided with the distribution. +- * +- * 3. The name "DOM4J" must not be used to endorse or promote products derived +- * from this Software without prior written permission of MetaStuff, Ltd. For +- * written permission, please contact dom4j-info@metastuff.com. +- * +- * 4. Products derived from this Software may not be called "DOM4J" nor may +- * "DOM4J" appear in their names without prior written permission of MetaStuff, +- * Ltd. DOM4J is a registered trademark of MetaStuff, Ltd. +- * +- * 5. Due credit should be given to the DOM4J Project - http://www.dom4j.org +- * +- * THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND +- * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +- * ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE +- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +- * POSSIBILITY OF SUCH DAMAGE. +- * +- * Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved. +- */ +-- +2.41.0 + diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..655ec81 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + bootstrap + diff --git a/_service b/_service new file mode 100644 index 0000000..9072f87 --- /dev/null +++ b/_service @@ -0,0 +1,15 @@ + + + git + https://github.com/dom4j/dom4j.git + version-2.1.4 + version-* + @PARENT_TAG@ + version-(.*) + + + *.tar + xz + + + diff --git a/dom4j-1.6.1-bug1618750.patch b/dom4j-1.6.1-bug1618750.patch deleted file mode 100644 index f954337..0000000 --- a/dom4j-1.6.1-bug1618750.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- dom4j/src/java/org/dom4j/util/SimpleSingleton.java -+++ dom4j/src/java/org/dom4j/util/SimpleSingleton.java -@@ -35,8 +35,7 @@ - if (singletonClassName != null) { - Class clazz = null; - try { -- clazz = Thread.currentThread().getContextClassLoader().loadClass( -- singletonClassName); -+ clazz = Class.forName(singletonClassName); - singletonInstance = clazz.newInstance(); - } catch (Exception ignore) { - try { diff --git a/dom4j-1.6.1-debian.tar.bz2 b/dom4j-1.6.1-debian.tar.bz2 deleted file mode 100644 index 935f0ae..0000000 --- a/dom4j-1.6.1-debian.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d72427a11a23df97f8957331269df7fde4fcc982ac3b9d399a49e4df8598b94a -size 1962425 diff --git a/dom4j-1.6.1.pom b/dom4j-1.6.1.pom deleted file mode 100644 index c3b107a..0000000 --- a/dom4j-1.6.1.pom +++ /dev/null @@ -1,221 +0,0 @@ - - 4.0.0 - dom4j - dom4j - dom4j - 1.6.1 - dom4j: the flexible XML framework for Java - http://dom4j.org - - http://sourceforge.net/tracker/?group_id=16035 - - - - -
dom4j-dev@lists.sourceforge.net
-
-
-
- 2001 - - - dom4j user list - http://lists.sourceforge.net/lists/listinfo/dom4j-user - http://lists.sourceforge.net/lists/listinfo/dom4j-user - http://www.mail-archive.com/dom4j-user%40lists.sourceforge.net/ - - - dom4j developer list - http://lists.sourceforge.net/lists/listinfo/dom4j-dev - http://lists.sourceforge.net/lists/listinfo/dom4j-dev - http://www.mail-archive.com/dom4j-dev%40lists.sourceforge.net/ - - - dom4j commits list - http://lists.sourceforge.net/lists/listinfo/dom4j-commits - http://lists.sourceforge.net/lists/listinfo/dom4j-commits - - - - - carnold - Curt Arnold - carnold@users.sourceforge.net - - - ddlucas - David Lucas - ddlucas@users.sourceforge.net - - - drwhite - David White - drwhite@users.sourceforge.net - - - jjenkov - Jakob Jenkov - jjenkov@users.sourceforge.net - - - jstrachan - James Strachan - jstrachan@apache.org - SpiritSoft, Inc. - - - laramiec - Laramie Crocker - laramiec@users.sourceforge.net - - - maartenc - Maarten Coene - maartenc@users.sourceforge.net - Cronos - - - mskells - Michael Skells - mskells@users.sourceforge.net - - - nicksanderson - Nick Sanderson - nicksanderson@users.sourceforge.net - - - slehmann - Steen Lehmann - slehmann@users.sourceforge.net - - - tradem - Tobias Rademacher - tradem@users.sourceforge.net - - - werken - Bob McWhirter - werken@users.sourceforge.net - - - wolfftw - Todd Wolff - wolfftw@users.sourceforge.net - - - yeekee - OuYang Chen - yeekee@users.sourceforge.net - - - yruan2 - Yuxin Ruan - yruan2@users.sourceforge.net - - - - scm:cvs:pserver:anonymous@cvs.sourceforge.net:/cvsroot/dom4j:dom4j - scm:cvs:ext:${maven.username}@cvs.sourceforge.net:/cvsroot/dom4j:dom4j - http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dom4j/dom4j/ - - - MetaStuff Ltd. - http://sourceforge.net/projects/dom4j - - - src/java - src/test - - - maven-surefire-plugin - - - **/*Test.java - - - - - - - - jaxme - jaxme-api - 0.3 - true - - - jaxen - jaxen - 1.1-beta-6 - true - - - msv - xsdlib - 20030807 - true - - - msv - relaxngDatatype - 20030807 - true - - - pull-parser - pull-parser - 2 - true - - - xpp3 - xpp3 - 1.1.3.3 - true - - - stax - stax-api - 1.0 - true - - - xml-apis - xml-apis - 1.0.b2 - - - junitperf - junitperf - 1.8 - test - - - stax - stax-ri - 1.0 - test - - - xerces - xercesImpl - 2.6.2 - test - - - xalan - xalan - 2.5.1 - test - - - - - default - Default Site - scp://dom4j.org//home/groups/d/do/dom4j/htdocs - - -
\ No newline at end of file diff --git a/dom4j-2.1.4.pom b/dom4j-2.1.4.pom new file mode 100644 index 0000000..ab34e95 --- /dev/null +++ b/dom4j-2.1.4.pom @@ -0,0 +1,77 @@ + + + + + + + + 4.0.0 + org.dom4j + dom4j + 2.1.4 + dom4j + flexible XML framework for Java + http://dom4j.github.io/ + + + Plexus + https://github.com/dom4j/dom4j/blob/master/LICENSE + + + + + Filip Jirsák + filip@jirsak.org + https://github.com/FilipJirsak + + + + scm:git:git@github.com:dom4j/dom4j.git + scm:git:git@github.com:dom4j/dom4j.git + git@github.com:dom4j/dom4j.git + + + + jaxen + jaxen + 1.1.6 + runtime + true + + + javax.xml.stream + stax-api + 1.0-2 + runtime + true + + + net.java.dev.msv + xsdlib + 2013.6.1 + runtime + true + + + javax.xml.bind + jaxb-api + 2.2.12 + runtime + true + + + pull-parser + pull-parser + 2.1.10 + runtime + true + + + xpp3 + xpp3 + 1.1.4c + runtime + true + + + diff --git a/dom4j-2.1.4.tar.xz b/dom4j-2.1.4.tar.xz new file mode 100644 index 0000000..b1f866e --- /dev/null +++ b/dom4j-2.1.4.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:442ba06cc110721084312dec9ed41d00d2741362b37f1e6d89a595a79ff9a262 +size 397532 diff --git a/dom4j-CVE-2018-1000632.patch b/dom4j-CVE-2018-1000632.patch deleted file mode 100644 index 788b519..0000000 --- a/dom4j-CVE-2018-1000632.patch +++ /dev/null @@ -1,259 +0,0 @@ -Index: dom4j/src/java/org/dom4j/Namespace.java -=================================================================== ---- dom4j.orig/src/java/org/dom4j/Namespace.java -+++ dom4j/src/java/org/dom4j/Namespace.java -@@ -51,6 +51,10 @@ public class Namespace extends AbstractN - public Namespace(String prefix, String uri) { - this.prefix = (prefix != null) ? prefix : ""; - this.uri = (uri != null) ? uri : ""; -+ -+ if (!this.prefix.isEmpty()) { -+ QName.validateNCName(this.prefix); -+ } - } - - /** -Index: dom4j/src/java/org/dom4j/QName.java -=================================================================== ---- dom4j.orig/src/java/org/dom4j/QName.java -+++ dom4j/src/java/org/dom4j/QName.java -@@ -11,6 +11,7 @@ import java.io.IOException; - import java.io.ObjectInputStream; - import java.io.ObjectOutputStream; - import java.io.Serializable; -+import java.util.regex.Pattern; - - import org.dom4j.tree.QNameCache; - import org.dom4j.util.SingletonStrategy; -@@ -20,6 +21,7 @@ import org.dom4j.util.SingletonStrategy; - * QName represents a qualified name value of an XML element or - * attribute. It consists of a local name and a {@link Namespace}instance. This - * object is immutable. -+ * @author Filip Jirsak - *

- * - * @author James Strachan -@@ -28,6 +30,81 @@ public class QName implements Serializab - /** The Singleton instance */ - private static SingletonStrategy singleton = null; - -+ /** -+ * {@code NameStartChar} without colon. -+ * -+ *
NameStartChar      ::=     ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
-+ * -+ * @see XML 1.0 - 2.3 Common Syntactic Constructs -+ * @see XML 1.1 - 2.3 Common Syntactic Constructs -+ */ -+ private static final String NAME_START_CHAR = "_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD"; -+ -+ /** -+ * {@code NameChar} without colon. -+ * -+ *
NameChar   ::=     NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
-+ * -+ * @see XML 1.0 - 2.3 Common Syntactic Constructs -+ * @see XML 1.1 - 2.3 Common Syntactic Constructs -+ */ -+ private static final String NAME_CHAR = NAME_START_CHAR + "-.0-9\u00B7\u0300-\u036F\u203F-\u2040"; -+ -+ /** -+ * {@code NCName} -+ * {@code NCName} -+ * -+ *
-+     * NCName          ::=     NCNameStartChar NCNameChar*     (An XML Name, minus the ":")
-+     * NCNameChar      ::=     NameChar -':'
-+     * NCNameStartChar ::=     NameStartChar -':'
-+     * 
-+ * -+ * @see Namespaces in XML 1.0 - 4 Qualified Names -+ * @see Namespaces in XML 1.1 - 4 Qualified Names -+ */ -+ private static final String NCNAME = "["+NAME_START_CHAR+"]["+NAME_CHAR+"]*"; -+ -+ /** -+ * Regular expression for {@code Name} (with colon). -+ * -+ *
Name       ::=     NameStartChar (NameChar)*
-+ * -+ * @see XML 1.0 - 2.3 Common Syntactic Constructs -+ * @see XML 1.1 - 2.3 Common Syntactic Constructs -+ */ -+ private static final Pattern RE_NAME = Pattern.compile("[:"+NAME_START_CHAR+"][:"+NAME_CHAR+"]*"); -+ -+ /** -+ * Regular expression for {@code NCName}. -+ * -+ *
-+     * NCName          ::=     NCNameStartChar NCNameChar*     (An XML Name, minus the ":")
-+     * NCNameChar      ::=     NameChar -':'
-+     * NCNameStartChar ::=     NameStartChar -':'
-+     * 
-+ * -+ * @see Namespaces in XML 1.0 - 4 Qualified Names -+ * @see Namespaces in XML 1.1 - 4 Qualified Names -+ */ -+ private static final Pattern RE_NCNAME = Pattern.compile(NCNAME); -+ -+ /** -+ * Regular expression for {@code QName}. -+ * -+ *
-+     * QName           ::=     PrefixedName | UnprefixedName
-+     * PrefixedName    ::=     Prefix ':' LocalPart
-+     * UnprefixedName  ::=     LocalPart
-+     * Prefix          ::=     NCName
-+     * LocalPart       ::=     NCName
-+     * 
-+ * -+ * @see Namespaces in XML 1.0 - 4 Qualified Names -+ * @see Namespaces in XML 1.1 - 4 Qualified Names -+ */ -+ private static final Pattern RE_QNAME = Pattern.compile("(?:"+NCNAME+":)?"+NCNAME); -+ - static { - try { - String defaultSingletonClass = "org.dom4j.util.SimpleSingleton"; -@@ -73,6 +150,11 @@ public class QName implements Serializab - this.name = (name == null) ? "" : name; - this.namespace = (namespace == null) ? Namespace.NO_NAMESPACE - : namespace; -+ if (this.namespace.equals(Namespace.NO_NAMESPACE)) { -+ validateName(this.name); -+ } else { -+ validateNCName(this.name); -+ } - } - - public QName(String name, Namespace namespace, String qualifiedName) { -@@ -80,6 +162,8 @@ public class QName implements Serializab - this.qualifiedName = qualifiedName; - this.namespace = (namespace == null) ? Namespace.NO_NAMESPACE - : namespace; -+ validateNCName(this.name); -+ validateQName(this.qualifiedName); - } - - public static QName get(String name) { -@@ -253,6 +337,24 @@ public class QName implements Serializab - QNameCache cache = (QNameCache) singleton.instance(); - return cache; - } -+ -+ private static void validateName(String name) { -+ if (!RE_NAME.matcher(name).matches()) { -+ throw new IllegalArgumentException(String.format("Illegal character in name: '%s'.", name)); -+ } -+ } -+ -+ protected static void validateNCName(String ncname) { -+ if (!RE_NCNAME.matcher(ncname).matches()) { -+ throw new IllegalArgumentException(String.format("Illegal character in local name: '%s'.", ncname)); -+ } -+ } -+ -+ private static void validateQName(String qname) { -+ if (!RE_QNAME.matcher(qname).matches()) { -+ throw new IllegalArgumentException(String.format("Illegal character in qualified name: '%s'.", qname)); -+ } -+ } - } - - -Index: dom4j/src/java/org/dom4j/tree/QNameCache.java -=================================================================== ---- dom4j.orig/src/java/org/dom4j/tree/QNameCache.java -+++ dom4j/src/java/org/dom4j/tree/QNameCache.java -@@ -164,6 +164,8 @@ public class QNameCache { - - if (index < 0) { - return get(qualifiedName, Namespace.get(uri)); -+ } else if (index == 0){ -+ throw new IllegalArgumentException("Qualified name cannot start with ':'."); - } else { - String name = qualifiedName.substring(index + 1); - String prefix = qualifiedName.substring(0, index); -Index: dom4j/src/test/org/dom4j/AllowedCharsTest.java -=================================================================== ---- /dev/null -+++ dom4j/src/test/org/dom4j/AllowedCharsTest.java -@@ -0,0 +1,78 @@ -+package org.dom4j;^M -+^M -+import org.testng.annotations.Test;^M -+^M -+/**^M -+ * @author Filip Jirsak^M -+ */^M -+public class AllowedCharsTest {^M -+ @Test^M -+ public void localName() {^M -+ QName.get("element");^M -+ QName.get(":element");^M -+ QName.get("elem:ent");^M -+ }^M -+^M -+ @Test(expectedExceptions = IllegalArgumentException.class)^M -+ public void localNameFail() {^M -+ QName.get("!element");^M -+ }^M -+^M -+ @Test^M -+ public void qname() {^M -+ QName.get("element", "http://example.com/namespace");^M -+ QName.get("ns:element", "http://example.com/namespace");^M -+ }^M -+^M -+ @Test(expectedExceptions = IllegalArgumentException.class)^M -+ public void qnameFail1() {^M -+ QName.get("ns:elem:ent", "http://example.com/namespace");^M -+ }^M -+^M -+ @Test(expectedExceptions = IllegalArgumentException.class)^M -+ public void qnameFail2() {^M -+ QName.get(":nselement", "http://example.com/namespace");^M -+ }^M -+^M -+ @Test(expectedExceptions = IllegalArgumentException.class)^M -+ public void createElementLT() {^M -+ DocumentHelper.createElement("elementname");^M -+ }^M -+^M -+ @Test(expectedExceptions = IllegalArgumentException.class)^M -+ public void createElementAmpersand() {^M -+ DocumentHelper.createElement("element&name");^M -+ }^M -+^M -+ @Test(expectedExceptions = IllegalArgumentException.class)^M -+ public void addElement() {^M -+ Element root = DocumentHelper.createElement("root");^M -+ root.addElement("element>name");^M -+ }^M -+^M -+ @Test(expectedExceptions = IllegalArgumentException.class)^M -+ public void addElementQualified() {^M -+ Element root = DocumentHelper.createElement("root");^M -+ root.addElement("element>name", "http://example.com/namespace");^M -+ }^M -+^M -+ @Test(expectedExceptions = IllegalArgumentException.class)^M -+ public void addElementQualifiedPrefix() {^M -+ Element root = DocumentHelper.createElement("root");^M -+ root.addElement("ns:element>name", "http://example.com/namespace");^M -+ }^M -+^M -+ @Test(expectedExceptions = IllegalArgumentException.class)^M -+ public void addElementPrefix() {^M -+ Element root = DocumentHelper.createElement("root");^M -+ root.addElement("ns>:element", "http://example.com/namespace");^M -+ }^M -+^M -+ //TODO It is illegal to create element or attribute with namespace prefix and empty namespace IRI.^M -+ //See https://www.w3.org/TR/2006/REC-xml-names11-20060816/#scoping^M -+}^M diff --git a/dom4j-CVE-2020-10683.patch b/dom4j-CVE-2020-10683.patch deleted file mode 100644 index 2c5724b..0000000 --- a/dom4j-CVE-2020-10683.patch +++ /dev/null @@ -1,484 +0,0 @@ -From a8228522a99a02146106672a34c104adbda5c658 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Filip=20Jirs=C3=A1k?= -Date: Sat, 11 Apr 2020 19:06:44 +0200 -Subject: [PATCH] SAXReader uses system default XMLReader with its defaults. - New factory method SAXReader.createDefault() sets more secure defaults. - ---- - src/java/org/dom4j/DocumentHelper.java | 65 +- - src/java/org/dom4j/io/SAXHelper.java | 37 +- - src/java/org/dom4j/io/SAXReader.java | 1824 ++++++++++--------- - 3 files changed, 973 insertions(+), 953 deletions(-) - -Index: dom4j/src/java/org/dom4j/io/SAXHelper.java -=================================================================== ---- dom4j.orig/src/java/org/dom4j/io/SAXHelper.java -+++ dom4j/src/java/org/dom4j/io/SAXHelper.java -@@ -13,6 +13,8 @@ import org.xml.sax.SAXNotSupportedExcept - import org.xml.sax.XMLReader; - import org.xml.sax.helpers.XMLReaderFactory; - -+import javax.xml.parsers.SAXParserFactory; -+ - /** - *

- * SAXHelper contains some helper methods for working with SAX -@@ -59,9 +61,18 @@ class SAXHelper { - } - - /** -- * Creats a default XMLReader via the org.xml.sax.driver system property or -+ * Creates a default XMLReader via the org.xml.sax.driver system property or - * JAXP if the system property is not set. - * -+ * This method internally calls {@link SAXParserFactory}{@code .newInstance().newSAXParser().getXMLReader()} or {@link XMLReaderFactory#createXMLReader()}. -+ * Be sure to configure returned reader if the default configuration does not suit you. Consider setting the following properties: -+ * -+ *

-+     * reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
-+     * reader.setFeature("http://xml.org/sax/features/external-general-entities", false);
-+     * reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
-+     * 
-+ * - * @param validating - * DOCUMENT ME! - * -Index: dom4j/src/java/org/dom4j/io/SAXReader.java -=================================================================== ---- dom4j.orig/src/java/org/dom4j/io/SAXReader.java -+++ dom4j/src/java/org/dom4j/io/SAXReader.java -@@ -30,6 +30,8 @@ import org.xml.sax.XMLReader; - import org.xml.sax.helpers.DefaultHandler; - import org.xml.sax.helpers.XMLReaderFactory; - -+import javax.xml.parsers.SAXParserFactory; -+ - /** - *

- * SAXReader creates a DOM4J tree from SAX parsing events. -@@ -135,17 +137,76 @@ public class SAXReader { - /** The SAX filter used to filter SAX events */ - private XMLFilter xmlFilter; - -+ public static SAXReader createDefault() { -+ SAXReader reader = new SAXReader(); -+ try { -+ reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); -+ reader.setFeature("http://xml.org/sax/features/external-general-entities", false); -+ reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false); -+ } catch (SAXException e) { -+ // nothing to do, incompatible reader -+ } -+ return reader; -+ } -+ -+ /** -+ * This method internally calls {@link SAXParserFactory}{@code .newInstance().newSAXParser().getXMLReader()} or {@link XMLReaderFactory#createXMLReader()}. -+ * Be sure to configure returned reader if the default configuration does not suit you. Consider setting the following properties: -+ * -+ *

-+     * reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
-+     * reader.setFeature("http://xml.org/sax/features/external-general-entities", false);
-+     * reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
-+     * 
-+ */ - public SAXReader() { - } - -+ /** -+ * This method internally calls {@link SAXParserFactory}{@code .newInstance().newSAXParser().getXMLReader()} or {@link XMLReaderFactory#createXMLReader()}. -+ * Be sure to configure returned reader if the default configuration does not suit you. Consider setting the following properties: -+ * -+ *
-+     * reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
-+     * reader.setFeature("http://xml.org/sax/features/external-general-entities", false);
-+     * reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
-+     * 
-+ * -+ * @param validating -+ */ - public SAXReader(boolean validating) { - this.validating = validating; - } - -+ /** -+ * This method internally calls {@link SAXParserFactory}{@code .newInstance().newSAXParser().getXMLReader()} or {@link XMLReaderFactory#createXMLReader()}. -+ * Be sure to configure returned reader if the default configuration does not suit you. Consider setting the following properties: -+ * -+ *
-+     * reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
-+     * reader.setFeature("http://xml.org/sax/features/external-general-entities", false);
-+     * reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
-+     * 
-+ * -+ * @param factory -+ */ - public SAXReader(DocumentFactory factory) { - this.factory = factory; - } - -+ /** -+ * This method internally calls {@link SAXParserFactory}{@code .newInstance().newSAXParser().getXMLReader()} or {@link XMLReaderFactory#createXMLReader()}. -+ * Be sure to configure returned reader if the default configuration does not suit you. Consider setting the following properties: -+ * -+ *
-+     * reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
-+     * reader.setFeature("http://xml.org/sax/features/external-general-entities", false);
-+     * reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
-+     * 
-+ * -+ * @param factory -+ * @param validating -+ */ - public SAXReader(DocumentFactory factory, boolean validating) { - this.factory = factory; - this.validating = validating; -@@ -185,14 +246,10 @@ public class SAXReader { - * this method is to correctly configure an XMLReader object instance and - * call the {@link #setXMLReader(XMLReader)}method - * -- * @param name -- * is the SAX property name -- * @param value -- * is the value of the SAX property -- * -- * @throws SAXException -- * if the XMLReader could not be created or the property could -- * not be changed. -+ * @param name is the SAX property name -+ * @param value is the value of the SAX property -+ * @throws SAXException if the XMLReader could not be created or the property could -+ * not be changed. - */ - public void setProperty(String name, Object value) throws SAXException { - getXMLReader().setProperty(name, value); -@@ -205,14 +262,10 @@ public class SAXReader { - * calling this method is to correctly configure an XMLReader object - * instance and call the {@link #setXMLReader(XMLReader)}method - * -- * @param name -- * is the SAX feature name -- * @param value -- * is the value of the SAX feature -- * -- * @throws SAXException -- * if the XMLReader could not be created or the feature could -- * not be changed. -+ * @param name is the SAX feature name -+ * @param value is the value of the SAX feature -+ * @throws SAXException if the XMLReader could not be created or the feature could -+ * not be changed. - */ - public void setFeature(String name, boolean value) throws SAXException { - getXMLReader().setFeature(name, value); -@@ -223,13 +276,9 @@ public class SAXReader { - * Reads a Document from the given File - *

- * -- * @param file -- * is the File to read from. -- * -+ * @param file is the File to read from. - * @return the newly created Document instance -- * -- * @throws DocumentException -- * if an error occurs during parsing. -+ * @throws DocumentException if an error occurs during parsing. - */ - public Document read(File file) throws DocumentException { - try { -@@ -272,13 +321,9 @@ public class SAXReader { - * Reads a Document from the given URL using SAX - *

- * -- * @param url -- * URL to read from. -- * -+ * @param url URL to read from. - * @return the newly created Document instance -- * -- * @throws DocumentException -- * if an error occurs during parsing. -+ * @throws DocumentException if an error occurs during parsing. - */ - public Document read(URL url) throws DocumentException { - String systemID = url.toExternalForm(); -@@ -304,13 +349,9 @@ public class SAXReader { - * String} to denote the source of the document. - *

- * -- * @param systemId -- * is a URL for a document or a file name. -- * -+ * @param systemId is a URL for a document or a file name. - * @return the newly created Document instance -- * -- * @throws DocumentException -- * if an error occurs during parsing. -+ * @throws DocumentException if an error occurs during parsing. - */ - public Document read(String systemId) throws DocumentException { - InputSource source = new InputSource(systemId); -@@ -326,13 +367,9 @@ public class SAXReader { - * Reads a Document from the given stream using SAX - *

- * -- * @param in -- * InputStream to read from. -- * -+ * @param in InputStream to read from. - * @return the newly created Document instance -- * -- * @throws DocumentException -- * if an error occurs during parsing. -+ * @throws DocumentException if an error occurs during parsing. - */ - public Document read(InputStream in) throws DocumentException { - InputSource source = new InputSource(in); -@@ -348,13 +385,9 @@ public class SAXReader { - * Reads a Document from the given Reader using SAX - *

- * -- * @param reader -- * is the reader for the input -- * -+ * @param reader is the reader for the input - * @return the newly created Document instance -- * -- * @throws DocumentException -- * if an error occurs during parsing. -+ * @throws DocumentException if an error occurs during parsing. - */ - public Document read(Reader reader) throws DocumentException { - InputSource source = new InputSource(reader); -@@ -370,15 +403,10 @@ public class SAXReader { - * Reads a Document from the given stream using SAX - *

- * -- * @param in -- * InputStream to read from. -- * @param systemId -- * is the URI for the input -- * -+ * @param in InputStream to read from. -+ * @param systemId is the URI for the input - * @return the newly created Document instance -- * -- * @throws DocumentException -- * if an error occurs during parsing. -+ * @throws DocumentException if an error occurs during parsing. - */ - public Document read(InputStream in, String systemId) - throws DocumentException { -@@ -396,13 +424,9 @@ public class SAXReader { - * Reads a Document from the given Reader using SAX - *

- * -- * @param reader -- * is the reader for the input -- * @param systemId -- * is the URI for the input -- * -+ * @param reader is the reader for the input -+ * @param systemId is the URI for the input - * @return the newly created Document instance -- * - * @throws DocumentException - * if an error occurs during parsing. - */ -@@ -422,13 +446,9 @@ public class SAXReader { - * Reads a Document from the given InputSource using SAX - *

- * -- * @param in -- * InputSource to read from. -- * -+ * @param in InputSource to read from. - * @return the newly created Document instance -- * -- * @throws DocumentException -- * if an error occurs during parsing. -+ * @throws DocumentException if an error occurs during parsing. - */ - public Document read(InputSource in) throws DocumentException { - try { -@@ -695,8 +715,7 @@ public class SAXReader { - /** - * Sets the entity resolver used to resolve entities. - * -- * @param entityResolver -- * DOCUMENT ME! -+ * @param entityResolver DOCUMENT ME! - */ - public void setEntityResolver(EntityResolver entityResolver) { - this.entityResolver = entityResolver; -@@ -706,9 +725,7 @@ public class SAXReader { - * DOCUMENT ME! - * - * @return the XMLReader used to parse SAX events -- * -- * @throws SAXException -- * DOCUMENT ME! -+ * @throws SAXException DOCUMENT ME! - */ - public XMLReader getXMLReader() throws SAXException { - if (xmlReader == null) { -@@ -721,8 +738,7 @@ public class SAXReader { - /** - * Sets the XMLReader used to parse SAX events - * -- * @param reader -- * is the XMLReader to parse SAX events -+ * @param reader is the XMLReader to parse SAX events - */ - public void setXMLReader(XMLReader reader) { - this.xmlReader = reader; -@@ -742,8 +758,7 @@ public class SAXReader { - /** - * Sets encoding used for InputSource (null means system default encoding) - * -- * @param encoding -- * is encoding used for InputSource -+ * @param encoding is encoding used for InputSource - */ - public void setEncoding(String encoding) { - this.encoding = encoding; -@@ -753,12 +768,9 @@ public class SAXReader { - * Sets the class name of the XMLReader to be used to parse - * SAX events. - * -- * @param xmlReaderClassName -- * is the class name of the XMLReader to parse SAX -- * events -- * -- * @throws SAXException -- * DOCUMENT ME! -+ * @param xmlReaderClassName is the class name of the XMLReader -+ * to parse SAX events -+ * @throws SAXException DOCUMENT ME! - */ - public void setXMLReaderClassName(String xmlReaderClassName) - throws SAXException { -@@ -769,11 +781,9 @@ public class SAXReader { - * Adds the ElementHandler to be called when the specified - * path is encounted. - * -- * @param path -- * is the path to be handled -- * @param handler -- * is the ElementHandler to be called by the event -- * based processor. -+ * @param path is the path to be handled -+ * @param handler is the ElementHandler to be called by the event -+ * based processor. - */ - public void addHandler(String path, ElementHandler handler) { - getDispatchHandler().addHandler(path, handler); -@@ -783,8 +793,7 @@ public class SAXReader { - * Removes the ElementHandler from the event based processor, - * for the specified path. - * -- * @param path -- * is the path to remove the ElementHandler for. -+ * @param path is the path to remove the ElementHandler for. - */ - public void removeHandler(String path) { - getDispatchHandler().removeHandler(path); -@@ -795,9 +804,8 @@ public class SAXReader { - * registered, this will set a default ElementHandler to be - * called for any path which does NOT have a handler registered. - * -- * @param handler -- * is the ElementHandler to be called by the event -- * based processor. -+ * @param handler is the ElementHandler to be called by the event -+ * based processor. - */ - public void setDefaultHandler(ElementHandler handler) { - getDispatchHandler().setDefaultHandler(handler); -@@ -824,8 +832,7 @@ public class SAXReader { - /** - * Sets the SAX filter to be used when filtering SAX events - * -- * @param filter -- * is the SAX filter to use or null to disable filtering -+ * @param filter is the SAX filter to use or null to disable filtering - */ - public void setXMLFilter(XMLFilter filter) { - this.xmlFilter = filter; -@@ -838,9 +845,7 @@ public class SAXReader { - * Installs any XMLFilter objects required to allow the SAX event stream to - * be filtered and preprocessed before it gets to dom4j. - * -- * @param reader -- * DOCUMENT ME! -- * -+ * @param reader DOCUMENT ME! - * @return the new XMLFilter if applicable or the original XMLReader if no - * filter is being used. - */ -@@ -886,9 +891,7 @@ public class SAXReader { - * XMLReader objects - * - * @return DOCUMENT ME! -- * -- * @throws SAXException -- * DOCUMENT ME! -+ * @throws SAXException DOCUMENT ME! - */ - protected XMLReader createXMLReader() throws SAXException { - return SAXHelper.createXMLReader(isValidating()); -@@ -897,13 +900,9 @@ public class SAXReader { - /** - * Configures the XMLReader before use - * -- * @param reader -- * DOCUMENT ME! -- * @param handler -- * DOCUMENT ME! -- * -- * @throws DocumentException -- * DOCUMENT ME! -+ * @param reader DOCUMENT ME! -+ * @param handler DOCUMENT ME! -+ * @throws DocumentException DOCUMENT ME! - */ - protected void configureReader(XMLReader reader, DefaultHandler handler) - throws DocumentException { -@@ -918,10 +917,11 @@ public class SAXReader { - SAXHelper.setParserProperty(reader, SAX_DECL_HANDLER, handler); - } - -- // configure namespace support -- SAXHelper.setParserFeature(reader, SAX_NAMESPACES, true); -+ // // configure namespace support -+ // SAXHelper.setParserFeature(reader, SAX_NAMESPACES, true); - -- SAXHelper.setParserFeature(reader, SAX_NAMESPACE_PREFIXES, false); -+ // string interning -+ // SAXHelper.setParserFeature(reader, SAX_NAMESPACE_PREFIXES, false); - - // string interning - SAXHelper.setParserFeature(reader, SAX_STRING_INTERNING, -@@ -936,8 +936,8 @@ public class SAXReader { - * includeExternalParameterEntities ); - */ - // use Locator2 if possible -- SAXHelper.setParserFeature(reader, -- "http://xml.org/sax/features/use-locator2", true); -+ // SAXHelper.setParserFeature(reader, -+ // "http://xml.org/sax/features/use-locator2", true); - - try { - // configure validation support -@@ -960,9 +960,7 @@ public class SAXReader { - /** - * Factory Method to allow user derived SAXContentHandler objects to be used - * -- * @param reader -- * DOCUMENT ME! -- * -+ * @param reader DOCUMENT ME! - * @return DOCUMENT ME! - */ - protected SAXContentHandler createContentHandler(XMLReader reader) { diff --git a/dom4j-build.xml b/dom4j-build.xml new file mode 100644 index 0000000..3d40761 --- /dev/null +++ b/dom4j-build.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dom4j-enable-stax-datatypes.patch b/dom4j-enable-stax-datatypes.patch deleted file mode 100644 index 5b4f8a5..0000000 --- a/dom4j-enable-stax-datatypes.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: dom4j/build.xml -=================================================================== ---- dom4j.orig/build.xml -+++ dom4j/build.xml -@@ -146,9 +146,6 @@ - source="8" - deprecation="${deprecation}" - classpathref="compile.classpath"> -- -- -- - - - diff --git a/dom4j-javadoc.patch b/dom4j-javadoc.patch deleted file mode 100644 index 895211b..0000000 --- a/dom4j-javadoc.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- dom4j/build.xml 2009-05-12 15:04:18.000000000 +0200 -+++ dom4j/build.xml 2018-07-10 10:51:51.814095475 +0200 -@@ -224,7 +224,6 @@ - doctitle="${Name}" - bottom="Copyright © ${year} MetaStuff Ltd. All Rights Reserved. Hosted by <p> <img src='http://sourceforge.net/sflogo.php?group_id=16035' width='88' height='31' border='0' alt='SourceForge Logo' />" - stylesheetfile="${doc.dir}/style/javadoc.css"> -- - - - -@@ -240,8 +239,6 @@ - doctitle="${Name}" - bottom="Copyright © ${year} MetaStuff Ltd. All Rights Reserved. Hosted by <p> <img src='http://sourceforge.net/sflogo.php?group_id=16035' width='88' height='31' border='0' alt='SourceForge Logo' />" - stylesheetfile="${doc.dir}/style/javadoc.css"> -- -- - - - diff --git a/dom4j-sourcetarget.patch b/dom4j-sourcetarget.patch deleted file mode 100644 index 1644b75..0000000 --- a/dom4j-sourcetarget.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- dom4j/build.xml 2009-05-12 15:04:18.000000000 +0200 -+++ dom4j/build.xml 2017-09-11 13:36:05.252661089 +0200 -@@ -142,8 +142,8 @@ - destdir="${build.dest}" - debug="${debug}" - optimize="${optimize}" -- target="1.3" -- source="1.3" -+ target="8" -+ source="8" - deprecation="${deprecation}" - classpathref="compile.classpath"> - -@@ -195,6 +195,7 @@ - - - - + +- Make a separate flavour for a minimal dom4j-bootstrap package + used to build jaxen and full dom4j +- Added patch: + * 0001-no-jaxen-dom4.patch + * for the bootstrap package, patch out the code that requires + jaxen with dom4j support to build + +------------------------------------------------------------------- +Thu Aug 24 04:59:20 UTC 2023 - Fridrich Strba + +- Upgrade to upstream version 2.1.4 + * Improvements and potentially breaking changes + + Added new factory method + org.dom4j.io.SAXReader.createDefault(). It has more secure + defaults than new SAXReader(), which uses system + XMLReaderFactory.createXMLReader() or + SAXParserFactory.newInstance().newSAXParser(). + + If you use some optional dependency of dom4j (for example + Jaxen, xsdlib etc.), you need to specify an explicit + dependency on it in your project. They are no longer marked as + a mandatory transitive dependency by dom4j. + + Following SAX parser features are disabled by default in + DocumentHelper.parse() for security reasons (they were enabled + in previous versions): + ° http://xml.org/sax/properties/external-general-entities + ° http://xml.org/sax/properties/external-parameter-entities + * Other changes: + + updated pull-parser version + + Reuse the writeAttribute method in writeAttributes + + support build on OS with non-UTF8 as default charset + + Gradle: add an automatic module name + + Use Correct License Name "Plexus" + + Possible vulnerability of DocumentHelper.parseText() to XML + injection + + CVS directories left in the source tree + + XMLWriter does not escape supplementary unicode characters + correctly + + writer.writeOpen(x) doesn't write namespaces + + concurrency problem with QNameCache + + all dependencies are optional + + SAXReader: hardcoded namespace features + + validate QNames + + StringIndexOutOfBoundsException in + XMLWriter.writeElementContent() + + TreeNode has grown some generics + + QName serialization fix + + DocumentException initialize with nested exception + + Accidentally occurring error in a multi-threaded test + + compatibility with W3C DOM Level 3 + + use Java generics +- Removed patches: + * dom4j-1.6.1-bug1618750.patch + * dom4j-CVE-2018-1000632.patch + * dom4j-CVE-2020-10683.patch + * dom4j-enable-stax-datatypes.patch + * dom4j-javadoc.patch + * dom4j-sourcetarget.patch + + not needed with this version + ------------------------------------------------------------------- Mon Jul 24 19:38:26 UTC 2023 - Fridrich Strba @@ -32,7 +94,7 @@ Fri Jan 25 11:10:16 UTC 2019 - Cédric Bosdonnat - Build STAXEventReader, STAXEventWriter and the data types. [bsc#1123158] - * Added patch dom4j-enable-stax-datatypes.patch + * Added patch dom4j-enable-stax-datatypes.patch ------------------------------------------------------------------- Tue Sep 18 10:31:28 UTC 2018 - pmonrealgonzalez@suse.com diff --git a/dom4j.spec b/dom4j.spec index 36c075c..4f0c72d 100644 --- a/dom4j.spec +++ b/dom4j.spec @@ -1,7 +1,8 @@ # -# spec file for package dom4j +# spec file # # Copyright (c) 2023 SUSE LLC +# Copyright (c) 2000-2007, JPackage Project # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,208 +17,133 @@ # -Name: dom4j -Version: 1.6.1 +%global base_name dom4j +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "bootstrap" +%bcond_without bootstrap +%else +%bcond_with bootstrap +%endif +Version: 2.1.4 Release: 0 -Summary: JarJar of dom4j for JBoss -License: Apache-1.1 -Group: Development/Libraries/Java -URL: https://www.dom4j.org/ -#Source0: dom4j-1.6.1.tar.gz -# Debian sources don't need a proprietary msv for build, so that's why I used them -# svn co svn://svn.debian.org/svn/pkg-java/trunk/dom4j -# rm dom4j/docs/xref/org/dom4j/tree/ConcurrentReaderHashMap.html -# rm dom4j/docs/clover/org/dom4j/tree/ConcurrentReaderHashMap.html -# #bnc501764 -# rm dom4j/lib/tools/clover.license -# tar --exclude-vcs -cjf dom4j-1.6.1-debian.tar.bz2 dom4j/ -Source0: dom4j-1.6.1-debian.tar.bz2 -Source1: dom4j_rundemo.sh -Source2: https://repo1.maven.org/maven2/dom4j/dom4j/1.6.1/dom4j-1.6.1.pom -Patch0: dom4j-1.6.1-bug1618750.patch -Patch1: dom4j-sourcetarget.patch -Patch2: dom4j-javadoc.patch -# PATCH-FIX-UPSTREAM bsc#1105443 CVE-2018-1000632 -Patch3: dom4j-CVE-2018-1000632.patch -# PATCH-FIX-OPENSUSE bsc#1123158 Don't disable STAX and datatypes -Patch4: dom4j-enable-stax-datatypes.patch -# PATCH-FIX-UPSTREAM bsc#1169760 CVE-2020-10683 XML Externl Entity vulnerability in default SAX parser -Patch5: dom4j-CVE-2020-10683.patch -BuildRequires: ant >= 1.6.5 -BuildRequires: ant-apache-resolver -BuildRequires: ant-junit -BuildRequires: bea-stax +Summary: Open Source XML framework for Java +License: BSD-3-Clause +URL: https://dom4j.github.io/ +Source0: %{base_name}-%{version}.tar.xz +Source1: https://repo1.maven.org/maven2/org/%{base_name}/%{base_name}/%{version}/%{base_name}-%{version}.pom +Source2: %{base_name}-build.xml +Patch0: 0001-no-jaxen-dom4.patch +BuildRequires: ant BuildRequires: fdupes BuildRequires: glassfish-jaxb-api -BuildRequires: isorelax -BuildRequires: java-devel >= 1.6 -# Needed for maven conversions -BuildRequires: javapackages-local -BuildRequires: javapackages-tools -BuildRequires: jaxen-bootstrap >= 1.1 -BuildRequires: junit -BuildRequires: junitperf -BuildRequires: relaxngDatatype -BuildRequires: stax_1_0_api -BuildRequires: ws-jaxme -BuildRequires: xalan-j2 >= 2.7 -BuildRequires: xerces-j2 -BuildRequires: xpp2 -BuildRequires: xpp3 -Requires: bea-stax -Requires: glassfish-jaxb-api -Requires: isorelax -Requires: java >= 1.6.0 -Requires: jaxen >= 1.1 -Requires: relaxngDatatype -Requires: stax_1_0_api -Requires: ws-jaxme -Requires: xalan-j2 -Requires: xerces-j2 -Requires: xpp2 -Requires: xpp3 -#Requires: jaxp = 1.2 -Requires(post): javapackages-tools -Requires(postun):javapackages-tools +BuildRequires: javapackages-local >= 6 +Obsoletes: %{base_name}-manual < %{version} BuildArch: noarch +%if %{with bootstrap} +Name: %{base_name}-bootstrap +%else +Name: %{base_name} +%endif +%if %{without bootstrap} +BuildRequires: fdupes +BuildRequires: jaxen +Conflicts: %{base_name}-bootstrap +Obsoletes: %{base_name}-bootstrap +%else +BuildRequires: jaxen-bootstrap +Conflicts: %{base_name} +%endif %description -dom4j is an easy to use Open Source XML, XPath and XSLT framework for -Java using the Java Collections Framework. dom4j allows you to read, +dom4j is an Open Source XML framework for Java. dom4j allows you to read, write, navigate, create and modify XML documents. dom4j integrates with -DOM, SAX and JAXP and is seamlessly integrated with full XPath support. +DOM and SAX and is seamlessly integrated with full XPath support. +%if %{without bootstrap} %package demo -Summary: XML, XPath and XSLT library for Java +Summary: Open Source XML framework for Java - demo Group: Development/Libraries/Java -Requires: %{name} = %{version} +Requires: %{base_name} = %{version} %description demo -dom4j is an easy to use Open Source XML, XPath and XSLT framework for -Java using the Java Collections Framework. dom4j allows you to read, +dom4j is an Open Source XML framework for Java. dom4j allows you to read, write, navigate, create and modify XML documents. dom4j integrates with -DOM, SAX and JAXP and is seamlessly integrated with full XPath support. - -%package manual -Summary: JarJar of dom4j for JBoss -Group: Development/Libraries/Java - -%description manual -dom4j is an easy to use Open Source XML, XPath and XSLT framework for -Java using the Java Collections Framework. dom4j allows you to read, -write, navigate, create and modify XML documents. dom4j integrates with -DOM, SAX and JAXP and is seamlessly integrated with full XPath support. +DOM and SAX and is seamlessly integrated with full XPath support. %package javadoc -Summary: XML, XPath and XSLT library for Java -Group: Development/Libraries/Java +Summary: Javadoc for %{base_name} %description javadoc -dom4j is an easy to use Open Source XML, XPath and XSLT framework for -Java using the Java Collections Framework. dom4j allows you to read, -write, navigate, create and modify XML documents. dom4j integrates with -DOM, SAX and JAXP and is seamlessly integrated with full XPath support. +Javadoc for %{base_name}. +%endif %prep -%setup -q -n %{name} -# replace run.sh -cp %{SOURCE1} run.sh -cp %{SOURCE2} pom.xml -%pom_add_dep javax.xml.bind:jaxb-api pom.xml "true" +%setup -q -n %{base_name}-%{version} +%if %{with bootstrap} +%patch0 -p1 +%endif -rm -f src/test/org/dom4j/xpath/MatrixConcatTest.java -# won't succeed in headless environment -rm src/test/org/dom4j/bean/BeansTest.java -# FIXME Bug in Xalan 2.6 -- reactivate with Xalan 2.7 -#rm src/test/org/dom4j/XPathExamplesTest.java -# fix for deleted jars -sed -i -e '/unjar/d' -e 's|,cookbook/\*\*,|,|' build.xml -# FIXME: (yyang): failed in JDK6 -rm -f src/test/org/dom4j/ThreadingTest.java -# FIXME: (yyang): failed in JDK6, maybe failed to load russArticle.xml because it's russian encoding -rm -f src/test/org/dom4j/io/StaxTest.java -%patch0 -p1 -b .bug1618750 -%patch1 -p1 -b .sourcetarget -%patch2 -p1 -b .javadoc -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -perl -pi -e 's/\r//g' LICENSE.txt docs/clover/*.css docs/style/*.css docs/xref/*.css docs/xref-test/*.css src/doc/style/*.css docs/benchmarks/xpath/*.java +cp %{SOURCE1} pom.xml +cp %{SOURCE2} build.xml -pushd lib -ln -sf $(build-classpath xpp2) -ln -sf $(build-classpath relaxngDatatype) -ln -sf $(build-classpath jaxme/jaxmeapi) -#ln -sf $(build-classpath msv-xsdlib) -#ln -sf $(build-classpath msv-msv) -ln -sf $(build-classpath jaxen) -ln -sf $(build-classpath bea-stax-api) -pushd test -ln -sf $(build-classpath bea-stax-ri) -ln -sf $(build-classpath junitperf) -ln -sf $(build-classpath junit) -popd -ln -sf $(build-classpath xpp3) -pushd tools -ln -sf $(build-classpath jaxme/jaxmexs) -ln -sf $(build-classpath xalan-j2) -ln -sf $(build-classpath xalan-j2-serializer) -ln -sf $(build-classpath jaxme/jaxmejs) -ln -sf $(build-classpath isorelax) -ln -sf $(build-classpath jaxme/jaxme2) -ln -sf $(build-classpath xerces-j2) -popd -popd +# Remove xpp2 support +rm -r src/main/java/org/dom4j/xpp +rm src/main/java/org/dom4j/io/XPPReader.java + +# Remove datatype code which depends on msv +rm -r src/main/java/org/dom4j/datatype +%pom_remove_dep net.java.dev.msv:xsdlib + +# Remove xpp3 support +rm src/main/java/org/dom4j/io/XPP3Reader.java +%pom_remove_dep xpp3:xpp3 +%pom_remove_dep pull-parser:pull-parser +%pom_remove_dep javax.xml.stream:stax-api %build -export CLASSPATH=$(build-classpath \ - glassfish-jaxb-api \ - jaxen relaxngDatatype xpp3 xpp2) -export OPT_JAR_LIST="junit ant/ant-junit" -rm -rf src/java/org/dom4j/datatype -ant package release-javadoc +mkdir -p lib +build-jar-repository -s lib jaxen glassfish-jaxb-api +%{ant} jar javadoc %install -# jars -install -d -m 755 %{buildroot}%{_javadir} -install -d -m 755 %{buildroot}%{_datadir}/maven2/poms -cp -p build/%{name}.jar %{buildroot}%{_javadir}/%{name}.jar -mkdir -p %{buildroot}/%{_mavenpomdir} -install -m 644 pom.xml %{buildroot}/%{_mavenpomdir}/JPP-%{name}.pom -%add_maven_depmap JPP-%{name}.pom %{name}.jar -a "org.dom4j:dom4j" +# jar +install -dm 0755 %{buildroot}%{_javadir} +install -pm 0644 target/%{base_name}-%{version}.jar %{buildroot}%{_javadir}/%{base_name}.jar + +%if %{without bootstrap} +# pom +install -dm 0755 %{buildroot}%{_mavenpomdir} +%{mvn_install_pom} pom.xml %{buildroot}%{_mavenpomdir}/%{base_name}.pom +%add_maven_depmap %{base_name}.pom %{base_name}.jar -a %{base_name}:%{base_name} # javadoc -mkdir -p %{buildroot}%{_javadocdir}/%{name} -cp -pr build/doc/javadoc/* %{buildroot}%{_javadocdir}/%{name} -# manual -mkdir -p %{buildroot}%{_docdir}/%{name}-%{version} -rm -rf docs/apidocs -cp -pr docs/* %{buildroot}%{_docdir}/%{name}-%{version} +install -dm 0755 %{buildroot}%{_javadocdir}/%{base_name} +cp -r target/site/apidocs %{buildroot}%{_javadocdir}/%{base_name} +%fdupes -s %{buildroot}%{_javadocdir} + # demo -mkdir -p %{buildroot}%{_datadir}/%{name}/classes/org/dom4j -cp -pr xml %{buildroot}%{_datadir}/%{name} -mkdir -p %{buildroot}%{_datadir}/%{name}/src -cp -pr src/samples %{buildroot}%{_datadir}/%{name}/src -#cp -pr build/classes/org/dom4j/samples $RPM_BUILD_ROOT%%{_datadir}/%%{name}/classes/org/dom4j -install -m 0755 run.sh %{buildroot}%{_datadir}/%{name} -%fdupes -s %{buildroot}%{_javadocdir}/%{name} -%fdupes -s %{buildroot}%{_docdir}/%{name}-%{version} -%fdupes -s %{buildroot}%{_datadir}/%{name} +install -dm 0755 %{buildroot}%{_datadir}/%{base_name}/src +cp -pr xml %{buildroot}%{_datadir}/%{base_name} +cp -pr src/example %{buildroot}%{_datadir}/%{base_name}/src +%fdupes -s %{buildroot}%{_datadir}/%{base_name} %files -f .mfiles -%license LICENSE.txt - -%files javadoc -%defattr(0644,root,root,0755) -%{_javadocdir}/%{name} - -%files manual -%defattr(0644,root,root,0755) -%{_docdir}/%{name}-%{version} +%license LICENSE +%doc README.md %files demo -%defattr(-,root,root,0755) -%{_datadir}/%{name} +%{_datadir}/%{base_name} + +%files javadoc +%license LICENSE +%{_javadocdir}/%{base_name} + +%else + +%files +%{_javadir}/%{base_name}.jar + +%endif %changelog diff --git a/dom4j_rundemo.sh b/dom4j_rundemo.sh deleted file mode 100644 index d2bb912..0000000 --- a/dom4j_rundemo.sh +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh - -XMLFMTOPS="-indentSize 2 -trimText -newlines" - -if [ $# -eq 0 ]; then -echo PullParserDemo -echo ./run.sh samples.PullParserDemo $XMLFMTOPS xml/web.xml -echo ./run.sh samples.PullParserDemo $XMLFMTOPS xml/fibo.xml -echo -echo SAXDemo -echo ./run.sh samples.SAXDemo $XMLFMTOPS xml/web.xml -echo ./run.sh samples.SAXDemo $XMLFMTOPS xml/test/test_schema.xml -echo ./run.sh samples.SAXDemo $XMLFMTOPS xml/xhtml/xhtml-basic.xml -echo ./run.sh samples.SAXDemo $XMLFMTOPS xml/contents.xml -echo ./run.sh samples.SAXDemo $XMLFMTOPS xml/cdata.xml -echo ./run.sh -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser samples.SAXDemo $XMLFMTOPS xml/cdata.xml -echo ./run.sh -Dorg.xml.sax.driver=xml.aelfred2.SAXDriver samples.SAXDemo $XMLFMTOPS xml/cdata.xml -echo ./run.sh samples.SAXDemo $XMLFMTOPS xml/testPI.xml -echo ./run.sh samples.SAXDemo $XMLFMTOPS xml/namespaces.xml -echo ./run.sh samples.SAXDemo $XMLFMTOPS xml/testNamespaces.xml -echo ./run.sh samples.SAXDemo $XMLFMTOPS xml/inline.xml -echo -echo DOMDemo -echo ./run.sh samples.dom.DOMDemo xml/contents.xml -echo -echo SAXDOMDemo -echo ./run.sh samples.dom.SAXDOMDemo xml/contents.xml -echo -echo VisitorDemo -echo ./run.sh samples.VisitorDemo xml/cdata.xml -echo -echo CountDemo -echo ./run.sh samples.CountDemo xml/fibo.xml -echo -echo CreateXMLDemo -echo ./run.sh samples.CreateXMLDemo -echo -echo HTMLWriterDemo -echo ./run.sh samples.HTMLWriterDemo xml/xhtml.xml -echo -echo PerformanceTest -echo ./run.sh -Xprof samples.performance.PerformanceSupport xml/periodic_table.xml org.dom4j.DocumentFactory 10 -echo ./run.sh -Xprof -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser samples.performance.PerformanceSupport xml/periodic_table.xml org.dom4j.DocumentFactory 10 -echo ./run.sh -Xprof -Dorg.xml.sax.driver=xml.aelfred2.SAXDriver samples.performance.PerformanceSupport xml/periodic_table.xml org.dom4j.DocumentFactory 10 -echo ./run.sh -Xprof samples.performance.PerformanceSupport xml/much_ado.xml org.dom4j.DocumentFactory 10 -echo ./run.sh -Xprof -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser samples.performance.PerformanceSupport xml/much_ado.xml org.dom4j.DocumentFactory 10 -echo ./run.sh -Xprof -Dorg.xml.sax.driver=xml.aelfred2.SAXDriver samples.performance.PerformanceSupport xml/much_ado.xml org.dom4j.DocumentFactory 10 -echo -echo XPathDemo -echo ./run.sh samples.XPathDemo xml/web.xml //servlet/servlet-class -echo ./run.sh samples.XPathDemo xml/much_ado.xml //ACT/TITLE -echo -echo XSLTDemo -echo ./run.sh samples.XSLTDemo xml/nitf/sample.xml xml/nitf/ashtml.xsl -echo -echo XSLTNativeDOMDemo -echo ./run.sh samples.dom.XSLTNativeDOMDemo xml/nitf/sample.xml xml/nitf/ashtml.xsl -echo -echo LargeDocumentDemo -echo ./run.sh samples.LargeDocumentDemo xml/much_ado.xml /PLAY/ACT -echo -echo LargeDocumentDemo2 -echo ./run.sh samples.LargeDocumentDemo2 xml/much_ado.xml -echo -echo LinkCheckerDemo -echo ./run.sh samples.LinkChecker xml/xhtml/xhtml-basic.xml -echo -echo BeanDemo -echo ./run.sh samples.bean.BeanDemo xml/bean/gui.xml -echo -echo SAXValidatorDemo -echo ./run.sh samples.validate.SAXValidatorDemo xml/nitf/invalid.xml -echo -echo VisitorDemo -echo ./run.sh -Dorg.dom4j.factory=org.dom4j.datatype.DatatypeDocumentFactory samples.VisitorDemo xml/schema/personal-schema.xml -echo -echo JTableDemo -echo ./run.sh samples.swing.JTableDemo xml/web.xml -echo -echo JTableTool -echo ./run.sh samples.swing.JTableTool xml/swing/tableForAtoms.xml xml/periodic_table.xml -echo -echo JTreeDemo -echo ./run.sh samples.swing.JTreeDemo xml/web.xml -exit 0 -fi - -if [ -z "$JAVA_HOME" ] ; then - JAVA=`which java` - if [ -z "$JAVA" ] ; then - echo "Cannot find JAVA. Please set your PATH." - exit 1 - fi - JAVA_BIN=`dirname $JAVA` - JAVA_HOME=$JAVA_BIN/.. -fi - -JAVA=$JAVA_HOME/bin/java - -CLASSPATH=`build-classpath \ -dom4j \ -xpp2 \ -fop \ -xerces-j2 \ -msv-relaxngDatatype \ -msv-xsdlib \ -msv-isorelax \ -msv \ -jaxen \ -junit \ -junitperf \ -saxpath \ -xalan-j2 \ -xml-commons-apis \ -avalon-framework \ -avalon-logkit \ -`:$CLASSPATH - -BOOTCLASSPATH=`build-classpath \ -xml-commons-apis \ -xerces-j2 \ -xalan-j2 \ -` - -CLASSPATH=classes:$CLASSPATH:$JAVA_HOME/lib/tools.jar - - -$JAVA -Xbootclasspath/p:$BOOTCLASSPATH -classpath $CLASSPATH "$@"