Sync from SUSE:SLFO:Main dom4j revision 8a19b5a5e756bb5dca272fb8a854ce9e

This commit is contained in:
Adrian Schröter 2024-05-03 12:10:25 +02:00
commit ac4a4934b7
9 changed files with 1301 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

713
0001-no-jaxen-dom4.patch Normal file
View File

@ -0,0 +1,713 @@
From b494798add23c21d68b1dd54e8929095396516bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.strba@bluewin.ch>
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 );
}
- /**
- * <p>
- * <code>createPattern</code> parses the given XPath expression to create
- * an XSLT style {@link Pattern}instance which can then be used in an XSLT
- * processing model.
- * </p>
- *
- * @param xpathPattern
- * is the XPath pattern expression to create
- *
- * @return a new <code>Pattern</code> 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);
}
- /**
- * <p>
- * <code>createPattern</code> parses the given XPath expression to create
- * an XSLT style {@link Pattern}instance which can then be used in an XSLT
- * processing model.
- * </p>
- *
- * @param xpathPattern
- * is the XPath pattern expression to create
- *
- * @return a new <code>Pattern</code> instance
- */
- public static Pattern createPattern(String xpathPattern) {
- return getDocumentFactory().createPattern(xpathPattern);
- }
-
/**
* <p>
* <code>selectNodes</code> 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;
-
-/**
- * <p>
- * Default implementation of {@link org.dom4j.XPath}which uses the <a
- * href="http://jaxen.org">Jaxen </a> project.
- * </p>
- *
- * @author bob mcwhirter
- * @author <a href="mailto:jstrachan@apache.org">James Strachan </a>
- */
-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<String, String> 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<Object> 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<Node> selectNodes(Object context) {
- try {
- setNSContext(context);
-
- return (List<Node>) xpath.selectNodes(context);
- } catch (JaxenException e) {
- handleJaxenException(e);
-
- return Collections.emptyList();
- }
- }
-
- public List<Node> selectNodes(Object context, org.dom4j.XPath sortXPath) {
- List<Node> answer = selectNodes(context);
- sortXPath.sort(answer);
-
- return answer;
- }
-
- public List<Node> selectNodes(Object context, org.dom4j.XPath sortXPath,
- boolean distinct) {
- List<Node> 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;
- }
- }
-
- /**
- * <p>
- * <code>sort</code> sorts the given List of Nodes using this XPath
- * expression as a {@link Comparator}.
- * </p>
- *
- * @param list
- * is the list of Nodes to sort
- */
- public void sort(List<Node> list) {
- sort(list, false);
- }
-
- /**
- * <p>
- * <code>sort</code> sorts the given List of Nodes using this XPath
- * expression as a {@link Comparator}and optionally removing duplicates.
- * </p>
- *
- * @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<Node> list, boolean distinct) {
- if ((list != null) && !list.isEmpty()) {
- int size = list.size();
- HashMap<Node, Object> sortValues = new HashMap<Node, Object>(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<Object> 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<Node> list, final Map<Node, Object> sortValues) {
- Collections.sort(list, new Comparator<Node>() {
- 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<Object> c1 = (Comparable<Object>) 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<Node> list, Map<Node, Object> sortValues) {
- // remove distinct
- HashSet<Object> distinctValues = new HashSet<Object>();
-
- for (Iterator<Node> 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;
-
-/**
- * <p>
- * <code>XPathPattern</code> is an implementation of Pattern which uses an
- * XPath xpath.
- * </p>
- *
- * @author <a href="mailto:jstrachan@apache.org">James Strachan </a>
- * @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

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<flavor>bootstrap</flavor>
</multibuild>

15
_service Normal file
View File

@ -0,0 +1,15 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="scm">git</param>
<param name="url">https://github.com/dom4j/dom4j.git</param>
<param name="revision">version-2.1.4</param>
<param name="match-tag">version-*</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="versionrewrite-pattern">version-(.*)</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="disabled"/>
</services>

77
dom4j-2.1.4.pom Normal file
View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- This module was also published with a richer model, Gradle metadata, -->
<!-- which should be used instead. Do not delete the following line which -->
<!-- is to indicate to Gradle or any Gradle module metadata file consumer -->
<!-- that they should prefer consuming it instead. -->
<!-- do_not_remove: published-with-gradle-metadata -->
<modelVersion>4.0.0</modelVersion>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.4</version>
<name>dom4j</name>
<description>flexible XML framework for Java</description>
<url>http://dom4j.github.io/</url>
<licenses>
<license>
<name>Plexus</name>
<url>https://github.com/dom4j/dom4j/blob/master/LICENSE</url>
</license>
</licenses>
<developers>
<developer>
<name>Filip Jirsák</name>
<email>filip@jirsak.org</email>
<url>https://github.com/FilipJirsak</url>
</developer>
</developers>
<scm>
<connection>scm:git:git@github.com:dom4j/dom4j.git</connection>
<developerConnection>scm:git:git@github.com:dom4j/dom4j.git</developerConnection>
<url>git@github.com:dom4j/dom4j.git</url>
</scm>
<dependencies>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1.6</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
<version>1.0-2</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>net.java.dev.msv</groupId>
<artifactId>xsdlib</artifactId>
<version>2013.6.1</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.12</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>pull-parser</groupId>
<artifactId>pull-parser</artifactId>
<version>2.1.10</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>xpp3</groupId>
<artifactId>xpp3</artifactId>
<version>1.1.4c</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
</dependencies>
</project>

BIN
dom4j-2.1.4.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

117
dom4j-build.xml Normal file
View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="dom4j" default="package" basedir=".">
<!-- ====================================================================== -->
<!-- Build environment properties -->
<!-- ====================================================================== -->
<property name="project.groupId" value="org.dom4j"/>
<property name="project.artifactId" value="dom4j"/>
<property name="project.version" value="2.1.4"/>
<property name="compiler.source" value="1.8"/>
<property name="compiler.target" value="${compiler.source}"/>
<property name="build.finalName" value="${project.artifactId}-${project.version}"/>
<property name="build.dir" value="target"/>
<property name="build.outputDir" value="${build.dir}/classes"/>
<property name="build.srcDir" value="src/main/java"/>
<property name="build.resourceDir" value="src/main/resources"/>
<property name="reporting.outputDirectory" value="${build.dir}/site"/>
<!-- ====================================================================== -->
<!-- Defining classpaths -->
<!-- ====================================================================== -->
<path id="build.classpath">
<fileset dir="lib">
<include name="**/*"/>
</fileset>
</path>
<!-- ====================================================================== -->
<!-- Cleaning up target -->
<!-- ====================================================================== -->
<target name="clean" description="Clean the output directory">
<delete dir="${build.dir}"/>
</target>
<!-- ====================================================================== -->
<!-- Compilation target -->
<!-- ====================================================================== -->
<target name="compile" description="Compile the code">
<mkdir dir="${build.outputDir}"/>
<javac destdir="${build.outputDir}"
nowarn="false"
debug="true"
encoding="utf-8"
optimize="false"
deprecation="true"
target="${compiler.target}"
verbose="false"
fork="false"
source="${compiler.source}">
<src>
<pathelement location="${build.srcDir}"/>
</src>
<classpath refid="build.classpath"/>
</javac>
</target>
<!-- ====================================================================== -->
<!-- Javadoc target -->
<!-- ====================================================================== -->
<target name="javadoc" description="Generates the Javadoc of the application">
<javadoc sourcepath="${build.srcDir}"
packagenames="*"
destdir="${reporting.outputDirectory}/apidocs"
access="protected"
encoding="utf-8"
source="${compiler.source}"
verbose="false"
version="true"
use="true"
author="true"
splitindex="false"
nodeprecated="false"
nodeprecatedlist="false"
notree="false"
noindex="false"
nohelp="false"
nonavbar="false"
serialwarn="false"
charset="ISO-8859-1"
linksource="false"
breakiterator="false">
<classpath refid="build.classpath"/>
</javadoc>
</target>
<!-- ====================================================================== -->
<!-- Package target -->
<!-- ====================================================================== -->
<target name="package" depends="compile" description="Package the application">
<jar jarfile="${build.dir}/${build.finalName}.jar"
compress="true"
index="false"
basedir="${build.outputDir}"
excludes="**/package.html">
<manifest>
<attribute name="Automatic-Module-Name" value="${project.groupId}"/>
</manifest>
</jar>
</target>
<!-- ====================================================================== -->
<!-- A dummy target for the package named after the type it creates -->
<!-- ====================================================================== -->
<target name="jar" depends="package" description="Builds the jar for the application"/>
</project>

201
dom4j.changes Normal file
View File

@ -0,0 +1,201 @@
-------------------------------------------------------------------
Thu Feb 15 06:06:58 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- The license is actually Plexus
-------------------------------------------------------------------
Thu Nov 2 11:40:16 UTC 2023 - Anton Shvetz <shvetz.anton@gmail.com>
- JPMS: Add the Automatic-Module-Name attribute to the manifest.
-------------------------------------------------------------------
Thu Aug 24 10:08:25 UTC 2023 - Fridrich Strba <fstrba@suse.com>
- 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 <fstrba@suse.com>
- 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 <fstrba@suse.com>
- Do not depend on jtidy, since it is not used during build
-------------------------------------------------------------------
Wed Mar 30 09:56:14 UTC 2022 - Fridrich Strba <fstrba@suse.com>
- Build against the standalone JavaEE modules unconditionally
-------------------------------------------------------------------
Mon Mar 28 13:50:07 UTC 2022 - Fridrich Strba <fstrba@suse.com>
- Add alias to the new artifact coordinates org.dom4j:dom4j
- Simplify the spec file a bit
-------------------------------------------------------------------
Thu Mar 17 15:40:13 UTC 2022 - Fridrich Strba <fstrba@suse.com>
- Add jaxb-api dependency for relevant distribution versions so that
we can build with JDKs that do not include the JavaEE modules
-------------------------------------------------------------------
Fri Apr 17 12:04:59 UTC 2020 - Pedro Monreal Gonzalez <pmonrealgonzalez@suse.com>
- Security fix: [bsc#1169760, CVE-2020-10683]
* External Entity vulnerability in default SAX parser
* Add dom4j-CVE-2020-10683.patch
-------------------------------------------------------------------
Fri Jan 25 11:10:16 UTC 2019 - Cédric Bosdonnat <cbosdonnat@suse.com>
- Build STAXEventReader, STAXEventWriter and the data types.
[bsc#1123158]
* Added patch dom4j-enable-stax-datatypes.patch
-------------------------------------------------------------------
Tue Sep 18 10:31:28 UTC 2018 - pmonrealgonzalez@suse.com
- Security fix: [bsc#1105443, CVE-2018-1000632]
* Version prior to version 2.1.1 contains a CWE-91: XML
Injectionvulnerability in Class: Element. Methods: addElement,
addAttribute that canresult in an attacker tampering with XML
documents through.
* Added dom4j-CVE-2018-1000632.patch
-------------------------------------------------------------------
Tue Jul 10 12:41:17 UTC 2018 - fstrba@suse.com
- Added patch:
* dom4j-javadoc.patch
+ Don't load urls while building javadoc in environment without
connectivity
-------------------------------------------------------------------
Wed May 16 11:56:27 UTC 2018 - fstrba@suse.com
- Modified patch:
* dom4j-sourcetarget.patch
+ Build with source and target 8 to prepare for a possible
removal of 1.6 compatibility
-------------------------------------------------------------------
Fri Sep 8 05:47:14 UTC 2017 - fstrba@suse.com
- Added patch:
* dom4j-sourcetarget.patch
+ Use java source and target level 1.6 in order to allow
building with jdk9
-------------------------------------------------------------------
Fri May 19 09:03:12 UTC 2017 - mpluskal@suse.com
- Update dependencies
-------------------------------------------------------------------
Wed Mar 18 09:46:06 UTC 2015 - tchvatal@suse.com
- Fix build with new javapackages-tools
-------------------------------------------------------------------
Tue Jul 8 10:43:35 UTC 2014 - tchvatal@suse.com
- Do not depend on ant-trax and run spec-cleaner.
-------------------------------------------------------------------
Mon Sep 9 11:05:39 UTC 2013 - tchvatal@suse.com
- Move from jpackage-utils to javapackage-tools
-------------------------------------------------------------------
Wed Aug 28 13:57:11 UTC 2013 - mvyskocil@suse.com
- use add_maven_depmap from javapackages-tools
- drop repolib part (never built)
- drop pointless jarjar
- unversioned javadoc
-------------------------------------------------------------------
Fri Mar 23 08:50:16 UTC 2012 - cfarrell@suse.com
- license update: Apache-1.1
SPDX
-------------------------------------------------------------------
Sun Sep 18 17:17:12 UTC 2011 - jengelh@medozas.de
- Remove redundant tags/sections from specfile
(cf. packaging guidelines)
-------------------------------------------------------------------
Wed May 20 11:39:13 CEST 2009 - mvyskocil@suse.cz
- 'fixed bnc#501764: removed clover.license from source tarball'
-------------------------------------------------------------------
Mon May 18 15:04:56 CEST 2009 - mvyskocil@suse.cz
- Removed documentation of ConcurrentReaderHashMap (bnc#504663)
* dom4j-1.6.1/docs/clover/org/dom4j/tree/ConcurrentReaderHashMap.html
* dom4j-1.6.1/docs/xref/org/dom4j/tree/ConcurrentReaderHashMap.html
-------------------------------------------------------------------
Thu May 14 11:06:10 CEST 2009 - mvyskocil@suse.cz
- Initial SUSE packaging:
* spec script and jarjar build support was taken from jpackage.org 5.0
* Source of dom4j and build.xml comes from Debian unstable, as there don't need
proprietary msv from sun (bnc#430592)

149
dom4j.spec Normal file
View File

@ -0,0 +1,149 @@
#
# spec file for package dom4j
#
# Copyright (c) 2024 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
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%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: Open Source XML framework for Java
License: Plexus
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: 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 Open Source XML framework for Java. dom4j allows you to read,
write, navigate, create and modify XML documents. dom4j integrates with
DOM and SAX and is seamlessly integrated with full XPath support.
%if %{without bootstrap}
%package demo
Summary: Open Source XML framework for Java - demo
Group: Development/Libraries/Java
Requires: %{base_name} = %{version}
%description demo
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 and SAX and is seamlessly integrated with full XPath support.
%package javadoc
Summary: Javadoc for %{base_name}
%description javadoc
Javadoc for %{base_name}.
%endif
%prep
%setup -q -n %{base_name}-%{version}
%if %{with bootstrap}
%patch0 -p1
%endif
cp %{SOURCE1} pom.xml
cp %{SOURCE2} build.xml
# 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
mkdir -p lib
build-jar-repository -s lib jaxen glassfish-jaxb-api
%{ant} jar javadoc
%install
# 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
install -dm 0755 %{buildroot}%{_javadocdir}/%{base_name}
cp -r target/site/apidocs %{buildroot}%{_javadocdir}/%{base_name}
%fdupes -s %{buildroot}%{_javadocdir}
# demo
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
%doc README.md
%files demo
%{_datadir}/%{base_name}
%files javadoc
%license LICENSE
%{_javadocdir}/%{base_name}
%else
%files
%{_javadir}/%{base_name}.jar
%endif
%changelog