[dom4j] 01/74: Initial import

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Wed Oct 25 10:33:58 UTC 2017


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository dom4j.

commit b27ad760736da0b6f8b0eab7e8280bc2a4d0fff8
Author: Wolfgang Bär <wbaer at gmx.de>
Date:   Sun Feb 12 19:08:29 2006 +0000

    Initial import
---
 debian/README.Debian                               |  10 +
 debian/README.Debian-source                        |   5 +
 debian/changelog                                   |   7 +
 debian/compat                                      |   1 +
 debian/control                                     |  33 ++
 debian/copyright                                   | 111 +++++
 .../org/jaxen/dom4j/DocumentNavigator.java         | 509 +++++++++++++++++++++
 debian/jaxen_src/org/jaxen/dom4j/Dom4jXPath.java   | 103 +++++
 debian/jaxen_src/org/jaxen/dom4j/package.html      |  13 +
 debian/libdom4j-java-doc.doc-base                  |  10 +
 debian/libdom4j-java-doc.docs                      |   4 +
 debian/libdom4j-java.dirs                          |   1 +
 .../patches/00_BuildXml_DisableStaxDatatype.patch  |  68 +++
 debian/patches/01_BuildXml_JaxenIncludes.patch     |  11 +
 debian/rules                                       |  24 +
 15 files changed, 910 insertions(+)

diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..40ef310
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,10 @@
+libdom4j-java for Debian
+---------------------
+
+dom4j for debian is currently build without support for xsd because
+of license issues.
+
+Cause of circular dependencies with libjaxen-java for the XPath support
+dom4j jar will include the needed jaxen classes in its library.
+
+-- Wolfgang Baer <WBaer at gmx.de>  Sat, 15 Oct 2005 13:34:45 +0200
diff --git a/debian/README.Debian-source b/debian/README.Debian-source
new file mode 100644
index 0000000..cb26411
--- /dev/null
+++ b/debian/README.Debian-source
@@ -0,0 +1,5 @@
+From the original upstream distribution the prebuilt
+jar files were removed:
+
+rm -rf lib
+rm *.jar
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..9f21957
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,7 @@
+libdom4j-java (1.6.1-1) unstable; urgency=low
+
+  * Initial Release (closes: #305227)
+  * Disabled support for STAX and datatypes (xsdlib)
+  * Enabled junit tests - Stax/Datatype testcases failures are expected
+
+ -- Wolfgang Baer <WBaer at gmx.de>  Sat, 15 Oct 2005 13:34:45 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..b8626c4
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+4
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..393f50f
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,33 @@
+Source: libdom4j-java
+Section: libs
+Priority: optional
+Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
+Uploaders: Wolfgang Baer <WBaer at gmx.de>
+Build-Depends-Indep: debhelper (>= 4.2.30), cdbs (>= 0.4.28), ant, ant-optional, kaffe, libxpp2-java, libxpp3-java, libjaxme-java, libjaxen-java (>= 1.1.beta8-1), libjaxp1.2-java, libjunitperf-java, junit, libxalan2-java, libxerces2-java
+Standards-Version: 3.6.2
+
+Package: libdom4j-java
+Architecture: all
+Section: libs
+Depends: kaffe | java1-runtime | java2-runtime, libxpp2-java, libxpp3-java, libjaxme-java, libjaxen-java (>= 1.1.beta8-1)
+Suggests: java-virtual-machine, libdom4j-java-doc
+Description: flexible XML framework for Java
+ dom4j is an open source framework for processing XML which is integrated with
+ XPath and fully supports DOM, SAX, JAXP. It allows you to read, write, 
+ navigate, create and modify XML documents
+ .
+ Features:
+  * full support for JAXP, SAX, DOM and XSLT (TrAX not in debian package)
+  * fully integrated XPath support for easy navigation of XML documents
+  * event based proccessing mode to support for massive documents or 
+    XML streams (based on XmlPull parser API)
+ .
+ Homepage: http://www.dom4j.org/
+
+Package: libdom4j-java-doc
+Architecture: all
+Section: doc
+Suggests: libdom4j-java
+Description: documentation and API for libdom4j-java
+ This package contains the html documentation for dom4j
+ as well as the full javadoc API documentation.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..cb464f6
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,111 @@
+This package was debianized by Wolfgang Baer <WBaer at gmx.de> on
+Sat, 23 Apr 2005 15:23:09 +0200.
+
+It was downloaded from <http://www.dom4j.org/>
+
+Copyright:
+
+Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
+
+Upstream Authors: Curt Arnold, David Lucas, David White, Jakob Jenkov
+                  James Strachan, Laramie Crocker, Maarten Coene,
+                  Michael Skells, Nick Sanderson, Steen Lehmann,
+                  Tobias Rademacher, Bob McWhirter, Todd Wolff,
+                  OuYang Chen, Yuxin Ruan, Aleksander Andrzej Slominski
+
+License:
+
+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 at 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.
+
+The debian package also contains two classes from the jaxen project to
+workaround circular dependencies. These classes are licensed as follows:
+
+The source was downloaded from <http://jaxen.org/>
+
+Upstream Authors: Bob McWhirter <bob at werken.com> and 
+                  James Strachan <jstrachan at apache.org>
+
+Copyright:
+
+/*
+ $Id: LICENSE.txt,v 1.3 2003/06/29 18:22:02 ssanders Exp $
+
+ Copyright 2003 (C) The Werken Company. All Rights Reserved.
+ 
+ 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 "jaxen" must not be used to endorse or promote
+    products derived from this Software without prior written
+    permission of The Werken Company.  For written permission,
+    please contact bob at werken.com.
+ 
+ 4. Products derived from this Software may not be called "jaxen"
+    nor may "jaxen" appear in their names without prior written
+    permission of The Werken Company. "jaxen" is a registered
+    trademark of The Werken Company.
+ 
+ 5. Due credit should be given to The Werken Company.
+    (http://jaxen.werken.com/).
+ 
+ THIS SOFTWARE IS PROVIDED BY THE WERKEN COMPANY 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
+ THE WERKEN COMPANY 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.
+
+ */
diff --git a/debian/jaxen_src/org/jaxen/dom4j/DocumentNavigator.java b/debian/jaxen_src/org/jaxen/dom4j/DocumentNavigator.java
new file mode 100644
index 0000000..4114c6e
--- /dev/null
+++ b/debian/jaxen_src/org/jaxen/dom4j/DocumentNavigator.java
@@ -0,0 +1,509 @@
+package org.jaxen.dom4j;
+
+/*
+ * $Header: /home/projects/jaxen/scm/jaxen/src/java/main/org/jaxen/dom4j/DocumentNavigator.java,v 1.30 2005/06/28 13:44:45 elharo Exp $
+ * $Revision: 1.30 $
+ * $Date: 2005/06/28 13:44:45 $
+ *
+ * ====================================================================
+ *
+ * Copyright (C) 2000-2005 bob mcwhirter & James Strachan.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions, and the disclaimer that follows
+ *    these conditions in the documentation and/or other materials
+ *    provided with the distribution.
+ *
+ * 3. The name "Jaxen" must not be used to endorse or promote products
+ *    derived from this software without prior written permission.  For
+ *    written permission, please contact license at jaxen.org.
+ *
+ * 4. Products derived from this software may not be called "Jaxen", nor
+ *    may "Jaxen" appear in their name, without prior written permission
+ *    from the Jaxen Project Management (pm at jaxen.org).
+ *
+ * In addition, we request (but do not require) that you include in the
+ * end-user documentation provided with the redistribution and/or in the
+ * software itself an acknowledgement equivalent to the following:
+ *     "This product includes software developed by the
+ *      Jaxen Project <http://www.jaxen.org/>."
+ * Alternatively, the acknowledgment may be graphical using the logos
+ * available at http://www.jaxen.org/
+ *
+ * THIS SOFTWARE IS PROVIDED ``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 THE Jaxen AUTHORS OR THE PROJECT
+ * 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.
+ *
+ * ====================================================================
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Jaxen Project and was originally
+ * created by bob mcwhirter <bob at werken.com> and
+ * James Strachan <jstrachan at apache.org>.  For more information on the
+ * Jaxen Project, please see <http://www.jaxen.org/>.
+ *
+ * $Id: DocumentNavigator.java,v 1.30 2005/06/28 13:44:45 elharo Exp $
+*/
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+
+import org.dom4j.Attribute;
+import org.dom4j.Branch;
+import org.dom4j.CDATA;
+import org.dom4j.Comment;
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+import org.dom4j.Namespace;
+import org.dom4j.Node;
+import org.dom4j.ProcessingInstruction;
+import org.dom4j.QName;
+import org.dom4j.Text;
+import org.dom4j.io.SAXReader;
+import org.jaxen.DefaultNavigator;
+import org.jaxen.FunctionCallException;
+import org.jaxen.NamedAccessNavigator;
+import org.jaxen.Navigator;
+import org.jaxen.XPath;
+import org.jaxen.JaxenConstants;
+import org.jaxen.saxpath.SAXPathException;
+import org.jaxen.util.SingleObjectIterator;
+
+/** 
+ * Interface for navigating around the DOM4J object model.
+ *
+ * <p>
+ * This class is not intended for direct usage, but is
+ * used by the Jaxen engine during evaluation.
+ * </p>
+ *
+ * @see XPath
+ *
+ * @author <a href="mailto:bob at werken.com">bob mcwhirter</a>
+ * @author Stephen Colebourne
+ */
+public class DocumentNavigator extends DefaultNavigator implements NamedAccessNavigator
+{
+    
+    private transient SAXReader reader;
+
+    /** Singleton implementation.
+     */
+    private static class Singleton
+    {
+        /** Singleton instance.
+         */
+        private static DocumentNavigator instance = new DocumentNavigator();
+    }
+
+    /** Retrieve the singleton instance of this <code>DocumentNavigator</code>.
+     */
+    public static Navigator getInstance()
+    {
+        return Singleton.instance;
+    }
+
+    public boolean isElement(Object obj)
+    {
+        return obj instanceof Element;
+    }
+
+    public boolean isComment(Object obj)
+    {
+        return obj instanceof Comment;
+    }
+
+    public boolean isText(Object obj)
+    {
+        return ( obj instanceof Text 
+                 ||
+                 obj instanceof CDATA );
+    }
+
+    public boolean isAttribute(Object obj)
+    {
+        return obj instanceof Attribute;
+    }
+
+    public boolean isProcessingInstruction(Object obj)
+    {
+        return obj instanceof ProcessingInstruction;
+    }
+
+    public boolean isDocument(Object obj)
+    {
+        return obj instanceof Document;
+    }
+
+    public boolean isNamespace(Object obj)
+    {
+        return obj instanceof Namespace;
+    }
+
+    public String getElementName(Object obj)
+    {
+        Element elem = (Element) obj;
+
+        return elem.getName();
+    }
+
+    public String getElementNamespaceUri(Object obj)
+    {
+        Element elem = (Element) obj;
+        
+        String uri = elem.getNamespaceURI();
+        if ( uri == null)
+            return "";
+        else
+            return uri;
+    }
+
+    public String getElementQName(Object obj)
+    {
+        Element elem = (Element) obj;
+
+        return elem.getQualifiedName();
+    }
+
+    public String getAttributeName(Object obj)
+    {
+        Attribute attr = (Attribute) obj;
+
+        return attr.getName();
+    }
+
+    public String getAttributeNamespaceUri(Object obj)
+    {
+        Attribute attr = (Attribute) obj;
+
+        String uri = attr.getNamespaceURI();
+        if ( uri == null)
+            return "";
+        else
+            return uri;
+    }
+
+    public String getAttributeQName(Object obj)
+    {
+        Attribute attr = (Attribute) obj;
+
+        return attr.getQualifiedName();
+    }
+
+    public Iterator getChildAxisIterator(Object contextNode)
+    {
+        Iterator result = null;
+        if ( contextNode instanceof Branch )
+        {
+            Branch node = (Branch) contextNode;
+            result = node.nodeIterator();
+        }
+        if (result != null) {
+            return result;
+        }
+        return JaxenConstants.EMPTY_ITERATOR;
+    }
+
+    /**
+     * Retrieves an <code>Iterator</code> over the child elements that
+     * match the supplied name.
+     *
+     * @param contextNode  the origin context node
+     * @param localName  the local name of the children to return, always present
+     * @param namespacePrefix  the prefix of the namespace of the children to return
+     * @param namespaceURI  the uri of the namespace of the children to return
+     * @return an Iterator that traverses the named children, or null if none
+     */
+    public Iterator getChildAxisIterator(
+            Object contextNode, String localName, String namespacePrefix, String namespaceURI) {
+
+        if ( contextNode instanceof Element ) {
+            Element node = (Element) contextNode;
+            return node.elementIterator(QName.get(localName, namespacePrefix, namespaceURI));
+        }
+        if ( contextNode instanceof Document ) {
+            Document node = (Document) contextNode;
+            Element el = node.getRootElement();
+            if (el.getName().equals(localName) == false) {
+                return JaxenConstants.EMPTY_ITERATOR;
+            }
+            if (namespaceURI != null) {
+                if (namespaceURI.equals(el.getNamespaceURI()) == false) {
+                    return JaxenConstants.EMPTY_ITERATOR;
+                }
+            }
+            return new SingleObjectIterator(el);
+        }
+
+        return JaxenConstants.EMPTY_ITERATOR;
+    }
+
+    public Iterator getParentAxisIterator(Object contextNode)
+    {
+        if ( contextNode instanceof Document )
+        {
+            return JaxenConstants.EMPTY_ITERATOR;
+        }
+
+        Node node = (Node) contextNode;
+
+        Object parent = node.getParent();
+
+        if ( parent == null )
+        {
+            parent = node.getDocument();
+        }
+        
+        return new SingleObjectIterator( parent );
+    }
+
+    public Iterator getAttributeAxisIterator(Object contextNode)
+    {
+        if ( ! ( contextNode instanceof Element ) )
+        {
+            return JaxenConstants.EMPTY_ITERATOR;
+        }
+
+        Element elem = (Element) contextNode;
+
+        return elem.attributeIterator();
+    }
+
+    /**
+     * Retrieves an <code>Iterator</code> over the attribute elements that
+     * match the supplied name.
+     *
+     * @param contextNode  the origin context node
+     * @param localName  the local name of the attributes to return, always present
+     * @param namespacePrefix  the prefix of the namespace of the attributes to return
+     * @param namespaceURI  the URI of the namespace of the attributes to return
+     * @return an Iterator that traverses the named attributes, not null
+     */
+    public Iterator getAttributeAxisIterator(
+            Object contextNode, String localName, String namespacePrefix, String namespaceURI) {
+
+        if ( contextNode instanceof Element ) {
+            Element node = (Element) contextNode;
+            Attribute attr = node.attribute(QName.get(localName, namespacePrefix, namespaceURI));
+            if (attr == null) {
+                return JaxenConstants.EMPTY_ITERATOR;
+            }
+            return new SingleObjectIterator(attr);
+        }
+        return JaxenConstants.EMPTY_ITERATOR;
+    }
+        
+    public Iterator getNamespaceAxisIterator(Object contextNode)
+    {
+        if ( ! ( contextNode instanceof Element ) )
+        {
+            return JaxenConstants.EMPTY_ITERATOR;
+        }
+
+        Element element = (Element) contextNode;
+        List nsList = new ArrayList();
+        HashSet prefixes = new HashSet();
+        for ( Element context = element; context != null; context = context.getParent() ) {
+            List declaredNS = new ArrayList(context.declaredNamespaces());
+            declaredNS.add(context.getNamespace());
+
+            for ( Iterator iter = context.attributes().iterator(); iter.hasNext(); )
+            {
+                Attribute attr = (Attribute) iter.next();
+                declaredNS.add(attr.getNamespace());
+            }
+
+            for ( Iterator iter = declaredNS.iterator(); iter.hasNext(); )
+            {
+                Namespace namespace = (Namespace) iter.next();
+                if (namespace != Namespace.NO_NAMESPACE)
+                {
+                    String prefix = namespace.getPrefix();
+                    if ( ! prefixes.contains( prefix ) ) {
+                        prefixes.add( prefix );
+                        nsList.add( namespace.asXPathResult( element ) );
+                    }
+                }
+            }
+        }
+        nsList.add( Namespace.XML_NAMESPACE.asXPathResult( element ) );
+        return nsList.iterator();
+    }
+
+    public Object getDocumentNode(Object contextNode)
+    {
+        if ( contextNode instanceof Document ) 
+        {
+            return contextNode;
+        }
+        else if ( contextNode instanceof Node ) 
+        {
+            Node node = (Node) contextNode;
+            return node.getDocument();
+        }
+        return null;
+    }
+
+    /** Returns a parsed form of the given xpath string, which will be suitable
+     *  for queries on DOM4J documents.
+     */
+    public XPath parseXPath (String xpath) throws SAXPathException
+    {
+        return new Dom4jXPath(xpath);
+    }
+
+    public Object getParentNode(Object contextNode)
+    {
+        if ( contextNode instanceof Node ) 
+        {
+            Node node = (Node) contextNode;
+            Object answer = node.getParent();
+            if ( answer == null ) 
+            {
+                answer = node.getDocument();
+                if (answer == contextNode) {
+                    return null;
+                }
+            }
+            return answer;            
+        }
+        return null;
+    }
+
+    public String getTextStringValue(Object obj)
+    {
+        return getNodeStringValue( (Node) obj );
+    }
+
+    public String getElementStringValue(Object obj)
+    {
+        return getNodeStringValue( (Node) obj );
+    }
+
+    public String getAttributeStringValue(Object obj)
+    {
+        return getNodeStringValue( (Node) obj );
+    }
+
+    private String getNodeStringValue(Node node)
+    {
+        return node.getStringValue();
+    }
+
+    public String getNamespaceStringValue(Object obj)
+    {
+        Namespace ns = (Namespace) obj;
+
+        return ns.getURI();
+    }
+
+    public String getNamespacePrefix(Object obj)
+    {
+        Namespace ns = (Namespace) obj;
+
+        return ns.getPrefix();
+    }
+
+    public String getCommentStringValue(Object obj)
+    {
+        Comment cmt = (Comment) obj;
+
+        return cmt.getText();
+    }
+    
+    public String translateNamespacePrefixToUri(String prefix, Object context)
+    {
+        Element element = null;
+        if ( context instanceof Element ) 
+        {
+            element = (Element) context;
+        }
+        else if ( context instanceof Node )
+        {
+            Node node = (Node) context;
+            element = node.getParent();
+        }
+        if ( element != null )
+        {
+            Namespace namespace = element.getNamespaceForPrefix( prefix );
+
+            if ( namespace != null ) 
+            {
+                return namespace.getURI();
+            }
+        }
+        return null;
+    }
+    
+    public short getNodeType(Object node) 
+    {
+        if ( node instanceof Node )
+        {
+            return ((Node) node).getNodeType();
+        }
+        return 0;
+    }
+    
+    public Object getDocument(String uri) throws FunctionCallException
+    {
+        try
+        {
+            return getSAXReader().read( uri );
+        }
+        catch (DocumentException e)
+        {
+            throw new FunctionCallException("Failed to parse document for URI: " + uri, e);
+        }
+    }
+
+    public String getProcessingInstructionTarget(Object obj)
+    {
+        ProcessingInstruction pi = (ProcessingInstruction) obj;
+
+        return pi.getTarget();
+    }
+
+    public String getProcessingInstructionData(Object obj)
+    {
+        ProcessingInstruction pi = (ProcessingInstruction) obj;
+
+        return pi.getText();
+    }
+    
+    // Properties
+    //-------------------------------------------------------------------------    
+    public SAXReader getSAXReader()
+    {
+        if ( reader == null ) 
+        {
+            reader = new SAXReader();
+            reader.setMergeAdjacentText( true );
+        }
+        return reader;
+    }
+    
+    public void setSAXReader(SAXReader reader)
+    {
+        this.reader = reader;
+    }
+    
+}
diff --git a/debian/jaxen_src/org/jaxen/dom4j/Dom4jXPath.java b/debian/jaxen_src/org/jaxen/dom4j/Dom4jXPath.java
new file mode 100644
index 0000000..a02d6e2
--- /dev/null
+++ b/debian/jaxen_src/org/jaxen/dom4j/Dom4jXPath.java
@@ -0,0 +1,103 @@
+/*
+ * $Header: /home/projects/jaxen/scm/jaxen/src/java/main/org/jaxen/dom4j/Dom4jXPath.java,v 1.6 2005/06/28 13:44:45 elharo Exp $
+ * $Revision: 1.6 $
+ * $Date: 2005/06/28 13:44:45 $
+ *
+ * ====================================================================
+ *
+ * Copyright (C) 2000-2002 bob mcwhirter & James Strachan.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions, and the disclaimer that follows 
+ *    these conditions in the documentation and/or other materials 
+ *    provided with the distribution.
+ *
+ * 3. The name "Jaxen" must not be used to endorse or promote products
+ *    derived from this software without prior written permission.  For
+ *    written permission, please contact license at jaxen.org.
+ * 
+ * 4. Products derived from this software may not be called "Jaxen", nor
+ *    may "Jaxen" appear in their name, without prior written permission
+ *    from the Jaxen Project Management (pm at jaxen.org).
+ * 
+ * In addition, we request (but do not require) that you include in the 
+ * end-user documentation provided with the redistribution and/or in the 
+ * software itself an acknowledgement equivalent to the following:
+ *     "This product includes software developed by the
+ *      Jaxen Project <http://www.jaxen.org/>."
+ * Alternatively, the acknowledgment may be graphical using the logos 
+ * available at http://www.jaxen.org/
+ *
+ * THIS SOFTWARE IS PROVIDED ``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 THE Jaxen AUTHORS OR THE PROJECT
+ * 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.
+ *
+ * ====================================================================
+ * This software consists of voluntary contributions made by many 
+ * individuals on behalf of the Jaxen Project and was originally 
+ * created by bob mcwhirter <bob at werken.com> and 
+ * James Strachan <jstrachan at apache.org>.  For more information on the 
+ * Jaxen Project, please see <http://www.jaxen.org/>.
+ * 
+ * $Id: Dom4jXPath.java,v 1.6 2005/06/28 13:44:45 elharo Exp $
+ */
+
+
+
+package org.jaxen.dom4j;
+
+import org.jaxen.BaseXPath;
+import org.jaxen.JaxenException;
+
+/** An XPath implementation for the dom4j model
+ *
+ * <p>This is the main entry point for matching an XPath against a DOM
+ * tree.  You create a compiled XPath object, then match it against
+ * one or more context nodes using the {@link #selectNodes(Object)}
+ * method, as in the following example:</p>
+ *
+ * <pre>
+ * Node node = ...;
+ * XPath path = new Dom4jXPath("a/b/c");
+ * List results = path.selectNodes(node);
+ * </pre>
+ *
+ * @see BaseXPath
+ * @see <a href="http://dom4j.org/">The dom4j website</a>
+ *
+ * @author <a href="mailto:bob at werken.com">bob mcwhirter</a>
+ * @author <a href="mailto:jstachan at apache.org">James Strachan</a>
+ *
+ * @version $Revision: 1.6 $
+ */
+public class Dom4jXPath extends BaseXPath
+{
+    /** Construct given an XPath expression string.
+     *
+     *  @param xpathExpr the XPath expression
+     *
+     *  @throws JaxenException if there is a syntax error while
+     *          parsing the expression
+     */
+    public Dom4jXPath(String xpathExpr) throws JaxenException
+    {
+        super( xpathExpr, DocumentNavigator.getInstance() );
+    }
+} 
diff --git a/debian/jaxen_src/org/jaxen/dom4j/package.html b/debian/jaxen_src/org/jaxen/dom4j/package.html
new file mode 100644
index 0000000..123ff56
--- /dev/null
+++ b/debian/jaxen_src/org/jaxen/dom4j/package.html
@@ -0,0 +1,13 @@
+<html>
+	<head>
+		<title>
+			org.jaxen.dom4j.*
+		</title>
+	</head>
+
+	<body>
+		<p>
+			Navigation for <a href="http://dom4j.org">dom4j</a> trees.
+		</p>
+	</body>
+</html>
diff --git a/debian/libdom4j-java-doc.doc-base b/debian/libdom4j-java-doc.doc-base
new file mode 100644
index 0000000..3368635
--- /dev/null
+++ b/debian/libdom4j-java-doc.doc-base
@@ -0,0 +1,10 @@
+Document: libdom4j-java-doc
+Title: Programmer API for libdom4j-java
+Author: Dom4J developers
+Abstract: Programmer API of the dom4j, a flexible XML framework for processing
+ XML which is integrated with XPath and fully supports DOM, SAX, JAXP.
+Section: Programming
+
+Format: HTML
+Index: /usr/share/doc/libdom4j-java-doc/apidocs/index.html
+Files: /usr/share/doc/libdom4j-java-doc/apidocs/*
diff --git a/debian/libdom4j-java-doc.docs b/debian/libdom4j-java-doc.docs
new file mode 100644
index 0000000..852cfe0
--- /dev/null
+++ b/debian/libdom4j-java-doc.docs
@@ -0,0 +1,4 @@
+docs/*.html
+docs/images
+docs/style
+docs/apidocs
diff --git a/debian/libdom4j-java.dirs b/debian/libdom4j-java.dirs
new file mode 100644
index 0000000..13c9f03
--- /dev/null
+++ b/debian/libdom4j-java.dirs
@@ -0,0 +1 @@
+usr/share/java
diff --git a/debian/patches/00_BuildXml_DisableStaxDatatype.patch b/debian/patches/00_BuildXml_DisableStaxDatatype.patch
new file mode 100644
index 0000000..90880e7
--- /dev/null
+++ b/debian/patches/00_BuildXml_DisableStaxDatatype.patch
@@ -0,0 +1,68 @@
+--- build.xml.orig	2006-02-12 18:52:29.000000000 +0100
++++ build.xml	2006-02-12 18:51:57.000000000 +0100
+@@ -16,13 +16,11 @@
+     </path>
+ 
+     <path id="test.classpath">
+-        <path refid="compile.classpath" />
+-        <fileset dir="./lib/test">
+-            <include name="**/*.jar" />
+-        </fileset>
+-        <fileset dir="./lib/tools">
+-            <include name="xalan*.jar" />
+-            <include name="xerces*.jar" />
++        <fileset dir="/usr/share/java">
++            <include name="xalan2.jar" />
++            <include name="xerces*.jar" />
++            <include name="jaxen.jar" />
++            <include name="xpp3.jar" />
+         </fileset>
+     </path>
+ 
+@@ -144,8 +142,13 @@
+            optimize="${optimize}"
+            target="1.3"
+            source="1.3"
+-           deprecation="${deprecation}"
+-           classpathref="compile.classpath">
++           deprecation="${deprecation}"
++           nowarn="yes"
++           includeJavaRuntime="yes"
++           bootclasspath="/usr/share/java/jaxp-1.2.jar">
++	<exclude name="org/dom4j/datatype/**"/>
++        <exclude name="org/dom4j/io/STAXEventReader.java"/>
++        <exclude name="org/dom4j/io/STAXEventWriter.java"/>
+     </javac>
+   </target>
+ 
+@@ -158,7 +161,9 @@
+            debug="${debug}"
+            optimize="${optimize}"
+            deprecation="${deprecation}"
+-           classpathref="test.classpath">
++           nowarn="yes">
++        <exclude name="org/dom4j/datatype/**"/>
++        <exclude name="org/dom4j/io/StaxTest.java"/>
+     </javac>
+   </target>
+ 
+@@ -270,7 +275,7 @@
+   <!-- =================================================================== -->
+   <target name="test" depends="compile-test">
+     <mkdir dir="${build.dir}/test-results/xml"/>
+-    <junit printsummary="yes" haltonfailure="yes">
++    <junit printsummary="yes" haltonfailure="no">
+       <formatter type="xml"/>
+ 
+       <classpath>
+@@ -280,8 +285,8 @@
+ 
+       <batchtest fork="yes" todir="${build.dir}/test-results/xml">
+         <fileset dir="${test.dir}">
+-          <include name="**/*Test.java" />
+-          <exclude name="**/AllTests.java,**/Abstract*.java,**/TestCase.java" />
++          <include name="**/*Test.java" />
++          <exclude name="**/AllTests.java,**/Abstract*.java,**/TestCase.java,**/StaxTest.java,**/datatype/*Test.java" />
+         </fileset>
+       </batchtest>
+     </junit>
diff --git a/debian/patches/01_BuildXml_JaxenIncludes.patch b/debian/patches/01_BuildXml_JaxenIncludes.patch
new file mode 100644
index 0000000..f4d5494
--- /dev/null
+++ b/debian/patches/01_BuildXml_JaxenIncludes.patch
@@ -0,0 +1,11 @@
+--- build.xml.orig	2006-02-12 18:51:57.000000000 +0100
++++ build.xml	2006-02-12 18:54:41.000000000 +0100
+@@ -185,7 +185,7 @@
+   <target name="package" depends="compile">
+     <jar jarfile="${build.dir}/${name}.jar"
+          basedir="${build.dest}"
+-         includes="org/dom4j/**"/>
++         includes="org/dom4j/** org/jaxen/**"/>
+   </target>
+ 
+   <!-- =================================================================== -->
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..f76d953
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,24 @@
+#!/usr/bin/make -f
+# debian/rules file for dom4j (uses cdbs)
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/ant.mk
+include /usr/share/cdbs/1/rules/simple-patchsys.mk
+
+export UPSTREAM_VERSION = $(shell head -1 debian/changelog | cut -f2 -d\( | cut -f1 -d\) | cut -f1 -d\-)
+
+JAVA_HOME := /usr/lib/kaffe
+ANT_HOME := /usr/share/ant
+DEB_JARS := $(ANT_HOME)/lib/ant-launcher.jar xpp2 xpp3 jaxen jaxme-api junitperf xalan2 xercesImpl $(ANT_HOME)/lib/ant-junit.jar junit
+DEB_ANT_BUILD_TARGET := package test
+
+clean::
+	rm -rf src/java/org/jaxen
+
+common-configure-indep::
+	# move jaxen/dom4j stuff to the source directory
+	cp -r debian/jaxen_src/* src/java/	
+
+install/libdom4j-java::
+	install -m 644 build/dom4j.jar debian/libdom4j-java/usr/share/java/dom4j-$(UPSTREAM_VERSION).jar
+	ln -s dom4j-$(UPSTREAM_VERSION).jar debian/libdom4j-java/usr/share/java/dom4j.jar	

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/dom4j.git



More information about the pkg-java-commits mailing list