Sync from SUSE:SLFO:Main werken-xpath revision 4fbbad2707f0e4f296091f5afbb74171

This commit is contained in:
Adrian Schröter 2024-05-04 01:52:48 +02:00
commit d82e85cd29
14 changed files with 422 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

6
werken-xpath-0.9.4.pom Normal file
View File

@ -0,0 +1,6 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>werken-xpath</groupId>
<artifactId>werken-xpath</artifactId>
<version>0.9.4</version>
</project>

55
werken-xpath-Driver.patch Normal file
View File

@ -0,0 +1,55 @@
--- test/src/com/werken/xpath/test/Driver.java.sav 2000-11-09 18:43:30.000000000 +0100
+++ test/src/com/werken/xpath/test/Driver.java 2006-05-05 20:40:06.000000000 +0200
@@ -12,6 +12,7 @@
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
import org.jdom.output.XMLOutputter;
+import org.jdom.output.Format;
import java.io.File;
import java.io.IOException;
@@ -98,6 +99,10 @@
{
e.printStackTrace();
}
+ catch (IOException ioe)
+ {
+ ioe.printStackTrace();
+ }
System.out.println("================================================================================");
System.out.println("TEST SUMMARY");
@@ -150,6 +155,10 @@
{
e.printStackTrace();
}
+ catch (IOException ioe)
+ {
+ ioe.printStackTrace();
+ }
if ( doc != null )
{
@@ -221,8 +230,11 @@
}
else
{
- XMLOutputter outputter = new XMLOutputter(" ", true);
-
+ XMLOutputter outputter = new XMLOutputter();
+ Format fmt = outputter.getFormat();
+ fmt.setIndent(" ");
+ fmt.setLineSeparator("\n");
+
try
{
@@ -412,7 +424,7 @@
elemID = "";
}
- resultNode.addAttribute("id", elemID);
+ resultNode.setAttribute("id", elemID);
node.addContent( resultNode );
results.addContent( node );
}

View File

@ -0,0 +1,17 @@
--- src/com/werken/xpath/ElementNamespaceContext.java.sav 2006-05-05 19:54:34.000000000 +0200
+++ src/com/werken/xpath/ElementNamespaceContext.java 2006-05-05 19:55:02.000000000 +0200
@@ -62,12 +62,12 @@
lineage.push(_element);
- Element elem = _element.getParent();
+ Element elem = (Element)_element.getParent();
while (elem != null)
{
lineage.push(elem);
- elem = elem.getParent();
+ elem = (Element)elem.getParent();
}
List nsList = null;

View File

@ -0,0 +1,22 @@
--- src/com/werken/xpath/impl/NodeTypeStep.java.sav 2006-05-05 20:09:00.000000000 +0200
+++ src/com/werken/xpath/impl/NodeTypeStep.java 2006-05-05 20:09:25.000000000 +0200
@@ -84,16 +84,16 @@
{
if ( isAbsolute() )
{
- results.addAll( applyToNodes( ((Element)node).getDocument().getMixedContent() ) );
+ results.addAll( applyToNodes( ((Element)node).getDocument().getContent() ) );
}
else
{
- results.addAll( applyToNodes( ((Element)node).getMixedContent() ) );
+ results.addAll( applyToNodes( ((Element)node).getContent() ) );
}
}
else if ( node instanceof Document )
{
- results.addAll( applyToNodes( ((Document)node).getMixedContent() ) );
+ results.addAll( applyToNodes( ((Document)node).getContent() ) );
}
return results;

View File

@ -0,0 +1,11 @@
--- src/com/werken/xpath/impl/ParentStep.java.sav 2006-05-05 20:01:17.000000000 +0200
+++ src/com/werken/xpath/impl/ParentStep.java 2006-05-05 20:02:17.000000000 +0200
@@ -50,7 +50,7 @@
if ( each instanceof Element )
{
- parent = ((Element)each).getParent();
+ parent = (Element)((Element)each).getParent();
if (parent != null)
{

View File

@ -0,0 +1,38 @@
--- src/com/werken/xpath/util/Partition.java.sav 2006-05-05 19:58:58.000000000 +0200
+++ src/com/werken/xpath/util/Partition.java 2006-05-05 19:59:29.000000000 +0200
@@ -67,7 +67,7 @@
public static List followingSiblings(Element node)
{
- Element parent = node.getParent();
+ Element parent = (Element)node.getParent();
if (parent == null)
{
@@ -95,7 +95,7 @@
public static List preceedingSiblings(Element node)
{
- Element parent = node.getParent();
+ Element parent = (Element)node.getParent();
if (parent == null)
{
@@ -137,7 +137,7 @@
results.addAll( Partition.descendants( each ) );
}
- Element parent = node.getParent();
+ Element parent = (Element)node.getParent();
if (parent != null)
{
@@ -170,7 +170,7 @@
results.addAll( Partition.descendants( each ) );
}
- Element parent = node.getParent();
+ Element parent = (Element)node.getParent();
if (parent != null)
{

View File

@ -0,0 +1,11 @@
--- src/com/werken/xpath/function/StringFunction.java.sav 2006-05-05 20:15:22.000000000 +0200
+++ src/com/werken/xpath/function/StringFunction.java 2006-05-05 20:15:34.000000000 +0200
@@ -71,7 +71,7 @@
public static String evaluate(Element elem)
{
- List content = elem.getMixedContent();
+ List content = elem.getContent();
Iterator contentIter = content.iterator();
Object each = null;

13
werken-xpath-Test.patch Normal file
View File

@ -0,0 +1,13 @@
--- src/com/werken/xpath/Test.java.sav 2006-05-05 20:17:22.000000000 +0200
+++ src/com/werken/xpath/Test.java 2006-05-05 20:18:22.000000000 +0200
@@ -61,6 +61,10 @@
{
jde.printStackTrace(System.err);
}
+ catch (IOException ioe)
+ {
+ ioe.printStackTrace(System.err);
+ }
}

View File

@ -0,0 +1,47 @@
--- src/com/werken/xpath/impl/UnAbbrStep.java.sav 2000-10-31 21:20:56.000000000 +0100
+++ src/com/werken/xpath/impl/UnAbbrStep.java 2006-05-05 20:20:11.000000000 +0200
@@ -175,7 +175,7 @@
}
}
- return aggregateResults;;
+ return aggregateResults;
}
private List applyPredicates(List nodeSet,
@@ -227,7 +227,7 @@
if ( node instanceof Element )
{
- List children = ((Element)node).getMixedContent();
+ List children = ((Element)node).getContent();
results.addAll( applyTo( children,
support,
@@ -235,7 +235,7 @@
}
else if ( node instanceof Document )
{
- List children = ((Document)node).getMixedContent();
+ List children = ((Document)node).getContent();
results.addAll( applyTo( children,
support,
@@ -256,7 +256,7 @@
if ( node instanceof Element )
{
- List children = ((Element)node).getMixedContent();
+ List children = ((Element)node).getContent();
results.addAll( applyTo( children,
support,
@@ -264,7 +264,7 @@
}
else if ( node instanceof Document )
{
- List children = ((Document)node).getMixedContent();
+ List children = ((Document)node).getContent();
results.addAll( applyTo( children,
support,

View File

@ -0,0 +1,8 @@
--- runtests.sh.sav 2006-05-05 20:46:37.000000000 +0200
+++ runtests.sh 2006-05-05 20:46:54.000000000 +0200
@@ -11,4 +11,4 @@
CP=$ANTLR_CP:$JDOM_CP:$XPATH_CP:$TEST_CP:$XERCES_CP
-java -classpath $CP $TEST_DRIVER $TESTS_XML
+java -classpath $CLASSPATH $TEST_DRIVER $TESTS_XML

48
werken-xpath.changes Normal file
View File

@ -0,0 +1,48 @@
-------------------------------------------------------------------
Wed Mar 23 11:43:03 UTC 2022 - Fridrich Strba <fstrba@suse.com>
- Specify java source and target level 1.8
-------------------------------------------------------------------
Wed Sep 20 09:39:48 UTC 2017 - fstrba@suse.com
- Fix build with jdk9: specify java source and target level 1.6
- Clean spec file and fix rpmlint errors and warnings
-------------------------------------------------------------------
Fri May 19 11:55:54 UTC 2017 - dziolkowski@suse.com
- New build dependency: javapackages-local
- cleaned spec using spec-cleaner
-------------------------------------------------------------------
Wed Mar 18 09:46:24 UTC 2015 - tchvatal@suse.com
- Fix build with new javapackages-tools
-------------------------------------------------------------------
Fri Jun 27 14:04:48 UTC 2014 - tchvatal@suse.com
- Cleanup java-javadoc dep to build on SLE11
-------------------------------------------------------------------
Wed Sep 11 08:55:10 UTC 2013 - mvyskocil@suse.com
- use add_maven_depmap from javapackages-tools
-------------------------------------------------------------------
Mon Sep 9 11:06:26 UTC 2013 - tchvatal@suse.com
- Move from jpackage-utils to javapackage-tools
-------------------------------------------------------------------
Mon Oct 22 08:01:14 UTC 2012 - cfarrell@suse.com
- license update: Apache-1.1
As acknowledgement is not binding this license is more akin to Apache-1.1
-------------------------------------------------------------------
Wed Jun 3 16:51:20 CEST 2009 - mvyskocil@suse.cz
- Initial SUSE packaging from jpackage.org 5.0

120
werken-xpath.spec Normal file
View File

@ -0,0 +1,120 @@
#
# spec file for package werken-xpath
#
# Copyright (c) 2022 SUSE LLC
#
# 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/
#
%define dotname werken.xpath
Name: werken-xpath
Version: 0.9.4
Release: 0
Summary: XPath implementation using JDOM
License: Apache-1.1
Group: Development/Libraries/Java
URL: https://sourceforge.net/projects/werken-xpath/
Source0: %{dotname}-%{version}-beta-src.tar.bz2
Source1: %{name}-%{version}.pom
Patch0: %{name}-ElementNamespaceContext.patch
Patch1: %{name}-Partition.patch
Patch2: %{name}-ParentStep.patch
Patch3: %{name}-NodeTypeStep.patch
Patch4: %{name}-UnAbbrStep.patch
Patch5: %{name}-StringFunction.patch
Patch6: %{name}-Test.patch
Patch7: %{name}-Driver.patch
Patch8: %{name}-runtests_sh.patch
BuildRequires: ant >= 1.6
BuildRequires: antlr
BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local
BuildRequires: jdom
BuildRequires: xerces-j2
BuildRequires: xml-commons-apis
Requires: jdom
Provides: werken.xpath = %{version}-%{release}
Obsoletes: werken.xpath < 0.9.4
BuildArch: noarch
%description
werken.xpath is an implementation of the W3C XPath Recommendation, on
top of the JDOM library. It takes as input a XPath expression, and a
JDOM tree, and returns a NodeSet (java.util.List) of selected
elements. Is is being used in the development of the
as-yet-unreleased werken.xslt (eXtensible Stylesheet Language) and the
werken.canonical (XML canonicalization) packages.
%package javadoc
Summary: Javadoc for %{name}
Group: Documentation/HTML
Provides: werken.xpath-javadoc = %{version}-%{release}
Obsoletes: werken.xpath-javadoc < 0.9.4
%description javadoc
werken.xpath is an implementation of the W3C XPath Recommendation, on
top of the JDOM library. It takes as input a XPath expression, and a
JDOM tree, and returns a NodeSet (java.util.List) of selected
elements. Is is being used in the development of the
as-yet-unreleased werken.xslt (eXtensible Stylesheet Language) and the
werken.canonical (XML canonicalization) packages.
%prep
%setup -q -n %{dotname}
%patch0 -b .sav
%patch1 -b .sav
%patch2 -b .sav
%patch3 -b .sav
%patch4 -b .sav
%patch5 -b .sav
%patch6 -b .sav
%patch7 -b .sav
%patch8 -b .sav
# remove all binary libs
for j in $(find . -name "*.jar"); do
mv $j $j.no
done
%build
export CLASSPATH=$(build-classpath jdom antlr xerces-j2 xml-commons-apis)
ant -Dant.build.javac.source=1.8 -Dant.build.javac.target=1.8 package javadoc compile-test
# Note that you'll have to java in PATH for this to work, it is by default
# when using a JPackage JVM.
CLASSPATH=$CLASSPATH:build/werken.xpath.jar:build/test/classes
sh runtests.sh
%install
# jars
mkdir -p %{buildroot}%{_javadir}
cp -p build/%{dotname}.jar %{buildroot}%{_javadir}/%{dotname}.jar
ln -sf %{dotname}.jar %{buildroot}%{_javadir}/%{name}.jar
# pom
mkdir -p %{buildroot}%{_mavenpomdir}
cp %{SOURCE1} %{buildroot}%{_mavenpomdir}/JPP-werken-xpath.pom
%add_maven_depmap
# javadoc
mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -pr build/apidocs/* %{buildroot}%{_javadocdir}/%{name}
%fdupes -s %{buildroot}%{_javadocdir}/%{name}
%files -f .mfiles
%{_javadir}/%{dotname}.jar
%license LICENSE
%doc LIMITATIONS README TODO
%files javadoc
%{_javadocdir}/%{name}
%changelog

BIN
werken.xpath-0.9.4-beta-src.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.