xpp3-1.1.4c/build.sh100755 0 0 2174 10525225064 13312 0ustaraslomewww 0 0 #!/bin/sh # $Id: build.sh,v 1.2 2002/04/08 17:49:38 aslom Exp $ # You can set JAVA_HOME to point ot JDK 1.3 # or shell will try to deterine java location using which # IMPPORTANT: and make sure that JAVA_HOME\lib contains tools.jar !!!! # # written by Aleksander Slominski [http://www.extreme.indiana.edu/~aslom] # # No need to modify anything after this line. # -------------------------------------------------------------------- if [ -z "$JAVA_HOME" ] ; then JAVA=`/usr/bin/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/.. else JAVA=$JAVA_HOME/bin/java fi echo "JAVA=$JAVA" #if [ ! "`$JAVA -version 2>&1 | grep "\ 1\.3"`" ]; then #if [ ! "`$JAVA -version 2>&1 | egrep "\ 1\.[3456789].*"`" ]; then # echo Required 1.3 or better version of JDK: can not use $JAVA # echo Current version is: # $JAVA -version # exit 1 #fi #echo setting LOCALCLASSPATH LOCALCLASSPATH=`/bin/sh $PWD/classpath.sh build` CMD="$JAVA $OPTS -classpath $LOCALCLASSPATH org.apache.tools.ant.Main $@ -buildfile build.xml" echo $CMD $CMD xpp3-1.1.4c/classpath.sh100755 0 0 3070 10525225064 14171 0ustaraslomewww 0 0 #!/bin/sh # # This script sets required LOCALCLASSPATH and by default CLASSPATH # if no arguments.Otherwise use "set" option to set CLASSPATH # and use "quiet" option to suppress prinitng of messages # It must be run by source its content to modify current environment # . classpath.sh [build|run] [set] [quiet] # # written by Aleksander Slominski [http://www.extreme.indiana.edu/~aslom] LOCALCLASSPATH=. if [ ! "`echo lib/junit/*.jar`" = "lib/junit/*.jar" ] ; then LOCALCLASSPATH=`echo lib/junit/*.jar | tr ' ' ':'`:$LOCALCLASSPATH fi if [ ! "`echo lib/xmlpull/*.jar`" = "lib/xmlpull/*.jar" ] ; then LOCALCLASSPATH=`echo lib/xmlpull/*.jar | tr ' ' ':'`:$LOCALCLASSPATH fi if [ "$1" = "build" ] ; then LOCALCLASSPATH=`echo lib/ant/*.jar | tr ' ' ':'`:$LOCALCLASSPATH LOCALCLASSPATH=$JAVA_HOME/lib/tools.jar:$LOCALCLASSPATH if [ "$2" = "set" ] ; then CLASSPATH=$LOCALCLASSPATH if [ ! "$3" = "quiet" ] ; then echo $LOCALCLASSPATH fi elif [ ! "$2" = "quiet" ] ; then echo $LOCALCLASSPATH fi else LOCALCLASSPATH=build/api:build/samples:build/classes:build/tests:$LOCALCLASSPATH if [ "$1" = "run" ] ; then if [ "$2" = "set" ] ; then CLASSPATH=$LOCALCLASSPATH if [ ! "$3" = "quiet" ] ; then echo $LOCALCLASSPATH fi elif [ ! "$2" = "quiet" ] ; then echo $LOCALCLASSPATH fi else CLASSPATH=$LOCALCLASSPATH if [ ! "$1" = "quiet" ] ; then echo $CLASSPATH fi fi fi export CLASSPATH xpp3-1.1.4c/run.sh100755 0 0 2501 10525225064 13011 0ustaraslomewww 0 0 #!/bin/sh # # You can set JAVA_HOME to point ot JDK 1.3 # or shell will try to deterine java location using which # # written by Aleksander Slominski [http://www.extreme.indiana.edu/~aslom] #JAVA_HOME=/l/jdk1.3 # # No need to modify anything after this line. # -------------------------------------------------------------------- if [ -z "$JAVA_HOME" ] ; then JAVA=`/usr/bin/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/.. else JAVA=$JAVA_HOME/bin/java fi #echo "JAVA= $JAVA" #if [ ! "`$JAVA -version 2>&1 | grep "\ 1\.3"`" ]; then #if [ ! "`$JAVA -version 2>&1 | egrep "\ 1\.[23456789].*"`" ]; then # echo Required 1.2 verion of JDK: can not use $JAVA # echo Current version is: # $JAVA -version # exit 1 #fi #JAVA_OPTS="$JAVA_OPTS -Djava.compiler=NONE" #echo set required LOCALCLASSPATH LOCALCLASSPATH=`/bin/sh $PWD/classpath.sh run` MY_JAVA="$JAVA $JAVA_OPTS $JAVA_DEBUG_OPTS -cp $LOCALCLASSPATH" if [ -z "$1" ] ; then echo Please specify test name. exit 1 fi NAME=$1 shift if [ "$NAME" = "junit" ] ; then CMD="$MY_JAVA org.xmlpull.v1.tests.PackageTests $*" elif [ "$NAME" = "eventtypes" ] ; then CMD="$MY_JAVA eventtypes.EventTypes $*" else CMD="$MY_JAVA $NAME $*" fi echo $CMD $CMD xpp3-1.1.4c/ 40755 0 0 0 10525225065 11554 5ustaraslomewww 0 0 xpp3-1.1.4c/doc/ 40755 0 0 0 10525225065 12321 5ustaraslomewww 0 0 xpp3-1.1.4c/doc/acknowledgement/ 40755 0 0 0 10525225064 15467 5ustaraslomewww 0 0 xpp3-1.1.4c/lib/ 40755 0 0 0 10525225065 12322 5ustaraslomewww 0 0 xpp3-1.1.4c/lib/ant/ 40755 0 0 0 10525225065 13104 5ustaraslomewww 0 0 xpp3-1.1.4c/lib/junit/ 40755 0 0 0 10525225065 13453 5ustaraslomewww 0 0 xpp3-1.1.4c/lib/xmlpull/ 40755 0 0 0 10525225065 14017 5ustaraslomewww 0 0 xpp3-1.1.4c/src/ 40755 0 0 0 10525225064 12342 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/ 40755 0 0 0 10525225064 13263 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/api/ 40755 0 0 0 10525225062 14032 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/api/org/ 40755 0 0 0 10525225062 14621 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/api/org/xmlpull/ 40755 0 0 0 10525225062 16316 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/api/org/xmlpull/v1/ 40755 0 0 0 10525225062 16644 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/builder/ 40755 0 0 0 10525225063 14710 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/builder/javax/ 40755 0 0 0 10525225063 16021 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/builder/javax/xml/ 40755 0 0 0 10525225063 16621 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/builder/javax/xml/namespace/ 40755 0 0 0 10525225063 20555 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/builder/org/ 40755 0 0 0 10525225063 15477 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/builder/org/xmlpull/ 40755 0 0 0 10525225063 17174 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/ 40755 0 0 0 10525225063 17522 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/ 40755 0 0 0 10525225063 21150 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/adapter/ 40755 0 0 0 10525225063 22570 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/impl/ 40755 0 0 0 10525225063 22111 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/dom2_builder/ 40755 0 0 0 10525225063 15631 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/dom2_builder/org/ 40755 0 0 0 10525225063 16420 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/dom2_builder/org/xmlpull/ 40755 0 0 0 10525225063 20115 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/dom2_builder/org/xmlpull/v1/ 40755 0 0 0 10525225063 20443 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/dom2_builder/org/xmlpull/v1/dom2_builder/ 40755 0 0 0 10525225063 23012 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/mxp1_min/ 40755 0 0 0 10525225062 15011 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/mxp1_min/META-INF/ 40755 0 0 0 10525225062 16151 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/mxp1_min/META-INF/services/ 40755 0 0 0 10525225062 17774 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/mxp1_min/org/ 40755 0 0 0 10525225062 15600 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/mxp1_min/org/xmlpull/ 40755 0 0 0 10525225062 17275 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/mxp1_min/org/xmlpull/mxp1/ 40755 0 0 0 10525225062 20162 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/mxp1_standard/ 40755 0 0 0 10525225062 16026 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/mxp1_standard/META-INF/ 40755 0 0 0 10525225062 17166 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/mxp1_standard/META-INF/services/ 40755 0 0 0 10525225062 21011 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/mxp1_standard/org/ 40755 0 0 0 10525225062 16615 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/mxp1_standard/org/xmlpull/ 40755 0 0 0 10525225062 20312 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/mxp1_standard/org/xmlpull/mxp1/ 40755 0 0 0 10525225062 21177 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/parser_pool/ 40755 0 0 0 10525225063 15607 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/parser_pool/org/ 40755 0 0 0 10525225063 16376 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/parser_pool/org/xmlpull/ 40755 0 0 0 10525225063 20073 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/parser_pool/org/xmlpull/v1/ 40755 0 0 0 10525225063 20421 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/parser_pool/org/xmlpull/v1/parser_pool/ 40755 0 0 0 10525225063 22746 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/samples/ 40755 0 0 0 10525225062 14725 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/samples/eventlist/ 40755 0 0 0 10525225062 16742 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/sax2_driver/ 40755 0 0 0 10525225062 15511 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/sax2_driver/org/ 40755 0 0 0 10525225062 16300 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/sax2_driver/org/xmlpull/ 40755 0 0 0 10525225062 17775 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/sax2_driver/org/xmlpull/v1/ 40755 0 0 0 10525225062 20323 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/sax2_driver/org/xmlpull/v1/sax2/ 40755 0 0 0 10525225063 21201 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/serializer_impl/ 40755 0 0 0 10525225062 16453 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/serializer_impl/org/ 40755 0 0 0 10525225062 17242 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/serializer_impl/org/xmlpull/ 40755 0 0 0 10525225062 20737 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/serializer_impl/org/xmlpull/mxp1_serializer/ 40755 0 0 0 10525225062 24055 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/tests/ 40755 0 0 0 10525225064 14425 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/tests/org/ 40755 0 0 0 10525225064 15214 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/tests/org/xmlpull/ 40755 0 0 0 10525225064 16711 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/ 40755 0 0 0 10525225064 17237 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/ 40755 0 0 0 10525225064 20401 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/util/ 40755 0 0 0 10525225063 14237 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/util/org/ 40755 0 0 0 10525225063 15026 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/util/org/xmlpull/ 40755 0 0 0 10525225063 16523 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/util/org/xmlpull/v1/ 40755 0 0 0 10525225063 17051 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/util/org/xmlpull/v1/util/ 40755 0 0 0 10525225063 20026 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/wrapper/ 40755 0 0 0 10525225063 14742 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/wrapper/org/ 40755 0 0 0 10525225063 15531 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/wrapper/org/xmlpull/ 40755 0 0 0 10525225063 17226 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/wrapper/org/xmlpull/v1/ 40755 0 0 0 10525225063 17554 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/wrapper/org/xmlpull/v1/wrapper/ 40755 0 0 0 10525225063 21234 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/wrapper/org/xmlpull/v1/wrapper/classic/ 40755 0 0 0 10525225063 22655 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/ 40755 0 0 0 10525225063 14406 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/ 40755 0 0 0 10525225063 15175 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/ 40755 0 0 0 10525225063 16672 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/ 40755 0 0 0 10525225063 17220 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/ 40755 0 0 0 10525225063 20646 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/ 40755 0 0 0 10525225063 21772 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/impl/ 40755 0 0 0 10525225063 22733 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/ 40755 0 0 0 10525225063 23077 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/ 40755 0 0 0 10525225063 24055 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/ 40755 0 0 0 10525225063 25020 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ 40755 0 0 0 10525225063 24724 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ext/ 40755 0 0 0 10525225063 25524 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/ 40755 0 0 0 10525225063 24554 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/ 40755 0 0 0 10525225063 24054 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/ 40755 0 0 0 10525225063 23442 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/com/ 40755 0 0 0 10525225063 24220 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/com/werken/ 40755 0 0 0 10525225063 25513 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/ 40755 0 0 0 10525225063 27163 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/conformance/ 40755 0 0 0 10525225063 25734 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/helpers/ 40755 0 0 0 10525225063 25104 5ustaraslomewww 0 0 xpp3-1.1.4c/src/java/xpath_samples/ 40755 0 0 0 10525225064 16133 5ustaraslomewww 0 0 xpp3-1.1.4c/src/xml/ 40755 0 0 0 10525225064 13142 5ustaraslomewww 0 0 xpp3-1.1.4c/src/xml/tests/ 40755 0 0 0 10525225064 14304 5ustaraslomewww 0 0 xpp3-1.1.4c/LICENSE.txt100644 0 0 4217 10525225064 13477 0ustaraslomewww 0 0 Indiana University Extreme! Lab Software License Version 1.1.1 Copyright (c) 2002 Extreme! Lab, Indiana University. 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 following disclaimer in the documentation and/or other materials provided with the distribution. 3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by the Indiana University Extreme! Lab (http://www.extreme.indiana.edu/)." Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. 4. The names "Indiana Univeristy" and "Indiana Univeristy Extreme! Lab" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact http://www.extreme.indiana.edu/. 5. Products derived from this software may not use "Indiana Univeristy" name nor may "Indiana Univeristy" appear in their name, without prior written permission of the Indiana University. 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 AUTHORS, COPYRIGHT HOLDERS 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. xpp3-1.1.4c/README.html100644 0 0 7171 10525225064 13501 0ustaraslomewww 0 0 XMLPULL V1 API Documentation

XML Pull Parser 3 (XPP3)

Quick introduction

XPP3 is implementation of XMLPULL V1 API.(visit its website at http://www.xmlpull.org).

XMLPULL V1 API defines a simple to use but still powerful common XML Pull Parsing API that will work from small devices (J2ME compatible API and small size) up to application servers (J2EE). XMLPULL parsers such as XPP3 can easily be added to J2ME, J2SE or J2EE environment and as they typically does not require lot of  resources (such as memory) and still can be very fast they are a good choice when there is need to handle multiple concurrent XML input streams (XPP3 attempt to be both high performance and small size implementation).

How to get started

To use this parser please read first quick introduction to XMLPULL API and then simply add to your CLASSPATH jar file with XPP3 jar (xpp3_version.jar)  from build/lib directory (the jar file contains both parser implementation and XMLPULL API).

The source code for XPP3 is also provided and you can follow build instructions to get your own implementation of XPP3 compiled. The latest source code for XPP3 is available from http://www.extreme.indiana.edu/xgws/xsoap/xpp/download/ or directly from CVS .

You should verify that XPP3 is passing conformance tests for XMLPULL API this can be easily done by running XMLPULL API V1 Conformance tests that are based on JUnit. To do this use provided run.bat script on Windows (run.sh on UNIX) and on Windows execute  run junit (on UNIX use ./run.sh junit).

More questions

If you have questions please check first XPP3 FAQ and if your question is unanswered please post it to mailing list.

XPP3 is distributed under Apache-style license - please read it and give us credit when you find XPP3 useful (we always appreciate to hear from happy users and that helps us to keep working and improving!)

Finally if you are interested in XPP3 latest developments please see list of changes.

Last but not least: Thanks to all that helped XPP3!

For the latest version and more information please see: XPP3 Home Page

Acknowledgment

XPath support for XB1 contains code derived from Jaxen and SAXPath. See acknowledgement directory for license information.

 


Aleksander Slominski

 

 

 

 

 

 

 

 

xpp3-1.1.4c/build.bat100644 0 0 2205 10525225065 13437 0ustaraslomewww 0 0 @echo off REM $Id: build.bat,v 1.2 2002/04/08 17:49:38 aslom Exp $ REM REM REQUIRED: Please make sure that JAVA_HOME points to JDK top level dire REM and make sure that JAVA_HOME\lib contains tools.jar !!!! REM REM written by Aleksander Slominski [http://www.extreme.indiana.edu/~aslom] REM JAVA_HOME can be set manualy .. REM set JAVA_HOME=c:\jdk13 if "%JAVA_HOME%" == "" goto javahomeerror REM REM No need to modify anything after this line. REM -------------------------------------------------------------------- rem echo JAVA_HOME=%JAVA_HOME% set OLDCLASSPATH=%CLASSPATH% call classpath.bat build quiet set CMD=%JAVA_HOME%\bin\java.exe -classpath %LOCALCLASSPATH% org.apache.tools.ant.Main -buildfile build.xml %1 %2 %3 %4 %5 %6 %7 %8 %9 rem clean up set CLASSPATH=%OLDCLASSPATH% set OLDCLASSPATH= rem execute it echo %CMD% %CMD% goto end REM -----------ERROR------------- :javahomeerror echo "ERROR: JAVA_HOME not found in your environment." echo "Please, set the JAVA_HOME variable in your environment to match the" echo "location of the Java Virtual Machine you want to use." :end xpp3-1.1.4c/build.xml100644 0 0 74041 10525225064 13517 0ustaraslomewww 0 0 xpp3-1.1.4c/classpath.bat100644 0 0 3205 10525225065 14323 0ustaraslomewww 0 0 @echo off rem rem This script set classpath rem Usage: classpath [run|build] [set] [queit] rem By default it sets CLASSPATH to execute direct java invocations (all included) rem option build prepares LOCALCLASSPATH to use in build.bat rem option build prepares LOCALCLASSPATH to use in run.bat rem by using set CLASSPATH also be set by run|build rem by using queit no echo of set CLASSOATH well be visible rem rem written by Aleksander Slominski [http://www.extreme.indiana.edu/~aslom] set LOCALCLASSPATH= for %%i in (lib\junit\*.jar) do call lib\ant\lcp.bat %%i for %%i in (lib\xmlpull\*.jar) do call lib\ant\lcp.bat %%i if "%1" == "build" goto build_classpath if "%1" == "run" goto run_classpath if "%1" == "clean" goto clean_classpath REM otherwise set user classpath set LOCALCLASSPATH=classes.cpr;build\classes;build\samples;build\tests;%LOCALCLASSPATH% set CLASSPATH=%LOCALCLASSPATH% if "%1" == "quiet" goto end echo %CLASSPATH% goto end :clean_classpath set CLASSPATH= set LOCALCLASSPATH= if "%2" == "quiet" goto end echo set CLASSPATH=%CLASSPATH% echo set LOCALCLASSPATH=%LOCALCLASSPATH% goto end :build_classpath for %%i in (lib\ant\*.jar) do call lib\ant\lcp.bat %%i if exist %JAVA_HOME%\lib\tools.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%JAVA_HOME%\lib\tools.jar goto extra_args :run_classpath set LOCALCLASSPATH=build\api;build\classes;build\samples;build\tests;%LOCALCLASSPATH% :extra_args if not "%2" == "set" goto check_echo set CLASSPATH=%LOCALCLASSPATH% :check_echo if "%2" == "quiet" goto end if "%3" == "quiet" goto end echo %LOCALCLASSPATH% goto end :end xpp3-1.1.4c/doc/ABOUT.txt100644 0 0 137 10525225064 14011 0ustaraslomewww 0 0 XML Pull Parser 3 (XPP3) for more information please see: http://www.extreme.indiana.edu/xpp/ xpp3-1.1.4c/doc/THANKS.txt100644 0 0 567 10525225064 14136 0ustaraslomewww 0 0 * Stefan Haustein for getting me motivated to do yet another major release of XPP ... * Toivo Lainevool for finding bug in namespace handling for empty elements * Mans af Klercker finding and reporting really nasty bu in nextImpl() and lacking use of bufAbsoluteOffset resulting in corruption of PC buffer when reading buf[] after more()/fillBuf() ... xpp3-1.1.4c/doc/TODO.html100644 0 0 572 10525225064 14034 0ustaraslomewww 0 0 MXP1/XPP3 TODO list

TODO list for MXP1/XPP3

xpp3-1.1.4c/doc/acknowledgement/LICENSE.jaxen.txt100644 0 0 4750 10525225064 20521 0ustaraslomewww 0 0 /*-- $Id: LICENSE.jaxen.txt,v 1.1 2004/06/16 15:45:08 aslom Exp $ 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@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@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 and James Strachan . For more information on the Jaxen Project, please see . */ xpp3-1.1.4c/doc/acknowledgement/LICENSE.saxpath.txt100644 0 0 5124 10525225064 21060 0ustaraslomewww 0 0 * * Copyright (C) 2000-2002 werken digital. * 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 "SAXPath" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact license@saxpath.org. * * 4. Products derived from this software may not be called "SAXPath", nor * may "SAXPath" appear in their name, without prior written permission * from the SAXPath Project Management (pm@saxpath.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 * SAXPath Project (http://www.saxpath.org/)." * Alternatively, the acknowledgment may be graphical using the logos * available at http://www.saxpath.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 SAXPath 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 SAXPath Project and was originally * created by bob mcwhirter and * James Strachan . For more information on the * SAXPath Project, please see . * xpp3-1.1.4c/doc/acknowledgement/LICENSE.txt100644 0 0 4217 10525225064 17413 0ustaraslomewww 0 0 Indiana University Extreme! Lab Software License Version 1.1.1 Copyright (c) 2002 Extreme! Lab, Indiana University. 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 following disclaimer in the documentation and/or other materials provided with the distribution. 3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by the Indiana University Extreme! Lab (http://www.extreme.indiana.edu/)." Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. 4. The names "Indiana Univeristy" and "Indiana Univeristy Extreme! Lab" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact http://www.extreme.indiana.edu/. 5. Products derived from this software may not use "Indiana Univeristy" name nor may "Indiana Univeristy" appear in their name, without prior written permission of the Indiana University. 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 AUTHORS, COPYRIGHT HOLDERS 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. xpp3-1.1.4c/doc/build.txt100644 0 0 3372 10525225064 14262 0ustaraslomewww 0 0 Building XPP3 ------------- If ANT 1.4+ and JUnit 3.7 is already available use provided build.xml otherwise you can use provided ANT if full distribution was downloaded and or taken from CVS, if source distribution was downloaded please look into lib/anr and lib/junit and put required jar files there. XPP3 can be built uning a simple scripted build system on top ANT that will work if ANT jar files are present in lib/ant direcotry (see this directory for instructions how to get ANT files). If ANT is already available on CLASSPATH it can be used directly. First make sure that JAVA_HOME environment variable points to your installation of JDK version 1.1 or above. If you want to use other ANT verion simply replace JAR files already existing in lib subdirectory (check README.txt files there for description). To build XPP3 from scratch use build script * on UNIX it is ./build.sh and * on WINDOWS build.bat refered here as "build": and then call build all (on UNIX usie./build.sh) For more documentation please browse to XMLPULL website at http://www.xmlpull.org Building and executing automatic tests -------------------------------------- NOTE: those tests are to verify implementation of XMLPULL API V1 and they are taken from http://www.xmlpull.org To execute tests you can use ANT target called "junit" (make sure that JUnit is on CLASSPATH!!!) build junit and you should see all tests passed successfully, similarly to: junit: [java] ............... [java] Time: 0.151 [java] [java] OK (15 tests) [java] now you can start using XMLPULL, see provided samples in src/java/samples and read documentation at http://www.xmlpull.org Please report bugs to http://www.extreme.indiana.edu/soap/xpp/ Thanks! Aleksander Slominski xpp3-1.1.4c/doc/changes.html100644 0 0 33234 10525225065 14741 0ustaraslomewww 0 0 MXP1/XPP3 Changes

Changes to XPP3

2006

2006-04-25 (XPP3_1_1_3__7)

  • Reversed changes made in bug 135: implement DETECT ENCODING feature as for some types of input streams (URLConnection ...) it is not possible to do more than once new InputStreamReader(inputStream) as it somehow detects it and closes underlying input stream (b.....d!)

    In future one will need better low level byte-by-byte reading of prolog and then doing InputStream ...

2006-04-22 (XPP3_1_1_3__6)

2004-04

  • TODO: as part of XB1 adaptation to JDK 1.5 it is now using Iterable/SimpleIteraor (local stubs) instead of Iterator

  • XB1: API generally can take now QName in places where (XmlNamespace, prefix) is used

  • 2005-08-11 (1.1.3.4.0, CVS TAG: XPP3_1_1_3_4_O): fixed Bug 228 overflow error in MXParser buffer sizing
  • 2004-10-22 (1.1.3.4.M): fixed  lookupNamespaceByName / lookupNamespaceByPrefix to work in XmlElementAdapter
  • 2004-09-30 (1.1.3.4.K): performance improvement to fix Bug 214: MXParser.parseEpilog throws/catches EOFException, making it very slow
  • 2004-09-30: misc. fixes to XPath support (default factory, exception handling)
  • 2004-09-30: XB1 API improvements: added XmlElementAdapter, attributes can implement XmlSerializable to provide custom XML serialization, XmlAttribute now implements Cloneable, fixed (hopefully) XmlElement.castOrWrap behavior for very complex chains, added XmlElement.replaceChildrenWithText(String textContent)
  • 2004-09-02 (CVS TAG: XPP3_1_1_3_4_I): fixed bug in addElement (did not set parent)
  • 2004-08-19: fixed Bug 202 ArrayStoreException when defining entity replacements reported by Benjamin Amodio using suggested patch (thanks!)
  • 2004-6-16 (1.1.3.4.G): added XPath support based on code Jaxen.org, a separate xpp3_xpath_VERSION.jar is built and if added to CLASSPATH then XPath support in XB1 is available
  • 2004-6-16 (1.1.3.4.G): changed XB1 parse method to handle more efficiently adding thousands of children (like big arrays) avoiding N^2 in the worst case (addElement was doing lookup of parent children to check if added element was added ...)
  • 2004-5-15 (1.1.3.4.D): added XmlInfosetBuilder.newInstance(factory) to allow creation of XB1 builder without using default System.getProperty() which is no possible in applets
  • 2004-5-12: fixed bug in XmlElementImpl.element(int position)
  • 2004-4-16: XB1 improved serialization especially handling of XmlCharacter
  • 2004-4-15: added interface XmlContained as an abstraction for XML Infoset items that are contained inside other items

  • 2004-4-15: backward incompatible change: XmlCharacters is now XmlContained and getParent() returns XmlContainer instead of XmlElement (JDK15 can use covariant return types but not JDK 1.4 ...)

2004-02 (XPP3_1_1_3_4)

  • TODO allow option to ask serializer to escape chars > 127
  • TODO: XB1 location info with mini XPath locator ...
  • 2004-3-4: improved support for XML element wrapping: use FooAdapter foo2 = (FooAdapter) XmlElementAdapter.castOrWrap(barAdapter, FooAdapter.class); instead of new FooAdapter(barAdapter) to avoid duplicate wrappings
  • 2004-2-22: backward incompatible change: to reflect better API intent XmlPullBuilder was renamed to XmlInfosetBuilder
  • 2004-2-13: added cloning support to standard XPP3 standard parser (not minimum JAR file!)
  • 2004-2-13: added cloning support to XmlDocument and XmlElement
  • 2004-2-7: removed use of SimpleIterator replaced with standard java.util.Iterator (this is consistent with JDK 1.5 change)
  • 2004-2-7: synced up with the latest XmlPull API and unit tests
  • 2004-01-22: XB1: added elements() and attribute() XPath like locators to XmlElement
  • 2004-01-21: allow to call XmlSerializer.flush() after serialization is finished and modified XmlPullBuilder to call it for serialize(*, ser)
  • 2004-01-21: XB1: fixed bug that too many XB1 elements extended XmlContainer
  • 2004-01-21: XB1:added getRoot() to XmlElement to find the topmost element container
  • 2004-01-21: XB1: rewritten serialization of XmlElement to not print namespace xmlns declaration when it is not needed ...
  • 2004-01-20: XB1: semantics change - addChild no longer checks if child is XmlElement and does not fix parent only addElement does calls setParent()!!!
  • 2004-01-20: XB1: addition of element(namespace, name, [create]) method to facilitate XPath like traversal and path creation (when create = true)!
  • 2004-01-20: serializer: fix CR, LF, TAB and chars <32 in attribute value escaping
  • 2004-01-20: added support for http://xmlpull.org/v1/doc/properties.html#location
  • 2004-01-20: serializer will escape chars < 32 expect for TAB (9) and NL (10) that are passed unchanged
  • added to build.xml target="1.1" for parser/serializer related targets to make sure that compiled code can work with JDK 1.1 (as described in ANT Javac Task documentation: (...) Generate class files for specific VM version (e.g., 1.1 or 1.2). Note that the default value depends on the JVM that is running Ant. In particular, if you use JDK 1.4 the generated classes will not be usable for a 1.1 Java VM unless you explicitly set this attribute to the value 1.1 (which is the default value for JDK 1.1 to 1.3).
  • XB1: fixed problem with no respecting element prefix when serializing - it works but there is some improvement possible when XmlSerializer is fixed see issue report (bug 169) for details
  • XB1: added to XmlElement methods requiredElementContent() and requiredTextContent() to simplify SOAP like processing
  • XB1: modified XmlSerializable to throw IOException
  • added getWriter() to MXSerializer so it can be accessed by casting XmlSerializer (if somebody really needs it)
  • RC5 fixed bug 160: text() should make sure to escape "]]>"
  • allow user to decide what kind of quotation is used in document prolog <?xml by checking value of FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE
  • RC3 fixed bug 148: two bugs in CDSECT handling: not marking it as PCDATA and incorrect normalization
  • RC2 fixed bug 147: bug with parsing entity reference if it is sole element content
  • RC1 fixed bug 146: bug in CDATA parsing (]] <)
  • extended XB1 builder to allow serializing Collections as containers for children
  • added DOM2 builder add-on from XmlPull add-ons
  • changed XmlElement lookupNamespace to check parent for namespace declarations
  • more strict checking that namespace name passed to XmlSerializer.getPrefix() is not null and not empty

2003-07-01 (XPP3_1_1_3_3)

  • improved error diagnostics in exception especially greatly improved in case when start tag is not closed (possibly lot of lines later ...) (described in Bug 128 except for XB1 XPath locations)
  • fixed [Bug 134] Comment handling: greater than eaten inside comments: parseComment() (and parsePI()) was incorrectly not copying normalized chars from input buffer to buffer with normalized content for >, this was happening only when EOL normalization was triggered by \r\n ... (reported by Jean-Paul Finne)

2003-03-09 (XPP3_1_1_2a)

  • fixed bug in MXParser that make it report comment/PI as element content from next() if comment or PI was directly after start tag (reported by Henry Minsky)
  • implemented optional formatting properties for XmlSerializer to allow pretty printing of XML output (indent, new lines, quotation character used for attribute values) for details see RFE (bug 50)
  • fixed bug in MXParser.processPI that prevented it from properly reporting processing instruction that had just target, example <?target?>
  • updated XmlPullWrapper to have methods to extract PI target and data and added Junit tests

2002-10-06 (XPP3_1_1_2)

  • fixed ROUNDTRIP bug reported by Pace Jim that made MXP1 to report instead of start tag (getText()) just attribute value when value contained entity reference (and PC was generated)
  • rewritten CDATA handling to do normalization when combined as TEXT by next()
  • fixed bug in nextImpl() that kept pointer to pos with using bufAbsoluteOffset resulting in corruption of output (reported by M?ns af Klercker)

2002-08-27 (XPP3_1_1_1)

  • implements XmlPull API 1.1.1 including XmlSerializer, updated samples and tests (including tests described in XML)
  • better diagnostic messages
  • fixed bug in CDSECT parsing that ignored CDATA content if CDEXT was directly after tag ...
  • fixed bug with character entities that were using hex digits.

2002-04-24 (XPP3_1_0_8a)

  • fixed bug with parsing attribute value if & is first character

2002-04-24 (XPP3_1_0_8)

  • mainly support for correct depth of END_TAG - the same as START_TAG
  • MXP1 is now fully integrated with XPP3 for better or worse ...

2002-04-23 (XPP3_MXP1_BETA3)

  • internal release only: tracking progress of XMLPULL API changes

2002-04-21 (XPP3_MXP1_BETA2)

  • fixed bug in namespace handling for empty elements (did not unwind namespace stack) reported by Toivo Lainevool

2002-04-16 (XPP3_MXP1_BETA1)

2002-04-07 (XPP3_1_0_7_1)

  • reorganized build structure to include XMLPULL API, samples, and tests source to make it easier for users to build and use XPP3; jar file will include now XMLPULL API as well
  • removed Xpp3Factory and now parser class i directly created by XmlPullParserFactory
  • updated to XMLPULL API version 1.0.7.1

2002-04-07 (XPP3_1_0_7)

2002-04-06 (XPP3_1_0_6)

  • updated to XMLPULL API version 1.0.6

2002-03-30 (XPP3_1_0_5)

  • first official release (passes all XMLPULL 1.0.5 API TESTS)

2002-03-25

  • internal release

Aleksander Slominski
xpp3-1.1.4c/doc/faq.html100644 0 0 2403 10525225064 14051 0ustaraslomewww 0 0 XPP3/MXP1 FAQ

XPP3/MXP1 FAQ

How to access the latest source code?

The latest packaged releases are available at http://www.extreme.indiana.edu/soap/xpp/ and the latest source (if you want to be on the cutting edge) can be obtained now from anonymous CVS at:

cvs -d :pserver:anonymous@cvs.extreme.indiana.edu:/l/extreme/cvspub login
CVS password: cvsanon

cvs -d :pserver:anonymous@cvs.extreme.indiana.edu:/l/extreme/cvspub co XPP3/java

More questions?

If they relate directly to the implementation, build or bugs them to XPP3 mailing list (XPP3 is part of  XGWS) or if question is implementation imdependent and is about XmlPull API questions to XmlPull discussion list.


Aleksander Slominski
xpp3-1.1.4c/doc/xb1_user_guide.html100644 0 0 4610 10525225065 16212 0ustaraslomewww 0 0 XB1: XML Infoset API User Guide

XB1: XML Infoset API User Guide

What is it?

In Web services and other applications when XML is used it is important to represent XML in an abstract way. XML Information Set (often called XML Infoset) is a W3C specification that precisely pays this role and defines number of such concepts like Element Information Item (so called eii) that precisely define what is XML element. If you do not know it go read it NOW!

XB1 is an Java API for XML Infoset that strives to provide a straightforward translation of XML Infoset information items and properties into Java interfaces and methods.

Name XB1 stands for XML Builder Version One as a second role XB1 API plays is to allow easy construction of XML documents in an incremental way. Typically when creating XML one needs to maintain also Java objects therefore XB1 allows that element children are Objects. Additionally XB1 provides XmlElementAdapter class to easily extend existing Element Information Items with custom methods.

XB1 is interface based so it is possible to swap-in different implementation for example on top of DOM (though that is not a trivial task to do ...)

Gotcha

Here is list of not so intuitive parts of API

  • addChild and addElement works differently! Method addElement will remove added element from other XML tree. However method addChild does not check that  added child is an element so it is possible to add element using addChild() that is still in other tree. Beware! This can lead to strange bugs when traversing tree.

More ...

 

For more info contact the author.


Valid XHTML 1.0!

xpp3-1.1.4c/lib/ant/LICENSE.txt100644 0 0 5222 10525225065 15025 0ustaraslomewww 0 0 /* * ============================================================================ * The Apache Software License, Version 1.1 * ============================================================================ * * Copyright (C) 1999 The Apache Software Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without modifica- * tion, 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 following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The end-user documentation included with the redistribution, if any, must * include the following acknowledgment: "This product includes software * developed by the Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, if * and wherever such third-party acknowledgments normally appear. * * 4. The names "Ant" and "Apache Software Foundation" must not be used to * endorse or promote products derived from this software without prior * written permission. For written permission, please contact * apache@apache.org. * * 5. Products derived from this software may not be called "Apache", nor may * "Apache" appear in their name, without prior written permission of the * Apache Software Foundation. * * 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 * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- * DING, 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 Apache Software Foundation. For more information on the * Apache Software Foundation, please see . * */ xpp3-1.1.4c/lib/ant/README.txt100644 0 0 164 10525225065 14660 0ustaraslomewww 0 0 Contains all that is required to build package with ANT For more details please see: http://jakarta.apache.org/ant/ xpp3-1.1.4c/lib/ant/lcp.bat100644 0 0 313 10525225065 14424 0ustaraslomewww 0 0 set _CLASSPATHCOMPONENT=%1 :argCheck if %2a==a goto gotAllArgs shift set _CLASSPATHCOMPONENT=%_CLASSPATHCOMPONENT% %1 goto argCheck :gotAllArgs set LOCALCLASSPATH=%_CLASSPATHCOMPONENT%;%LOCALCLASSPATH% xpp3-1.1.4c/lib/junit/LICENSE.txt100644 0 0 27054 10525225065 15423 0ustaraslomewww 0 0 from http://junit.org/ "JUnit is a regression testing framework written by Erich Gamma and Kent Beck. It is used by the developer who implements unit tests in Java. JUnit is Open Source Software, released under the IBM Public License and hosted on SourceForge." IBM Public License Version 1.0 is available at: http://oss.software.ibm.com/developerworks/opensource/license10.html IBM Public License Version 1.0 THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS IBM PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 1. DEFINITIONS "Contribution" means: a) in the case of International Business Machines Corporation ("IBM"), the Original Program, and b) in the case of each Contributor, i) changes to the Program, and ii) additions to the Program; where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. "Contributor" means IBM and any other entity that distributes the Program. "Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. "Original Program" means the original version of the software accompanying this Agreement as released by IBM, including source code, object code and documentation, if any. "Program" means the Original Program and Contributions. "Recipient" means anyone who receives the Program under this Agreement, including all Contributors. 2. GRANT OF RIGHTS a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. 3. REQUIREMENTS A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: a) it complies with the terms and conditions of this Agreement; and b) its license agreement: i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. When the Program is made available in source code form: a) it must be made available under this Agreement; and b) a copy of this Agreement must be included with each copy of the Program. Each Contributor must include the following in a conspicuous location in the Program: Copyright {date here}, International Business Machines Corporation and others. All Rights Reserved. In addition, each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. 4. COMMERCIAL DISTRIBUTION Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. 5. NO WARRANTY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. 6. DISCLAIMER OF LIABILITY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), 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 OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 7. GENERAL If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. IBM may publish new versions (including revisions) of this Agreement from time to time. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. No one other than IBM has the right to modify this Agreement. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. xpp3-1.1.4c/lib/junit/README.txt100644 0 0 67 10525225065 15211 0ustaraslomewww 0 0 Latest JUnit jar downloaded from http://www.junit.org/ xpp3-1.1.4c/lib/xmlpull/LICENSE.txt100644 0 0 562 10525225065 15722 0ustaraslomewww 0 0 XMLPULL API IS FREE ------------------- All of the XMLPULL API source code, compiled code, and documentation contained in this distribution *except* for tests (see separate LICENSE_TESTS.txt) are in the Public Domain. XMLPULL API comes with NO WARRANTY or guarantee of fitness for any purpose. Initial authors: Stefan Haustein Aleksander Slominski 2001-12-12 xpp3-1.1.4c/lib/xmlpull/LICENSE_TESTS.txt100644 0 0 61204 10525225065 16744 0ustaraslomewww 0 0 XMLPULL API TESTS LICENSE -------------------------------------- XMLPULL V1 API TESTS Copyright (C) 2002 Aleksander Slominski XMLPULL V1 API TESTS are free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. XMLPULL V1 API TESTS are distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (see below and at http://www.gnu.org/copyleft/lesser.html). NOTE: XMLPULL V1 API TESTS are released under the Lesser GPL (LGPL) license, granting you permission to use them in commercial and non-commercial applications for free. Unlike regular GPL, LGPL does not force you to license your own software under GPL. ------------------------------------------------------------------------------- GNU Lesser Public License Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS xpp3-1.1.4c/lib/xmlpull/README.txt100644 0 0 112 10525225065 15564 0ustaraslomewww 0 0 Latest XMLPULL V1 API jars can be downloaded from http://www.xmlpull.org/ xpp3-1.1.4c/run.bat100644 0 0 3220 10525225065 13142 0ustaraslomewww 0 0 @echo off REM $Id: run.bat,v 1.2 2002/04/08 17:49:38 aslom Exp $ REM REM REQUIRED: Please make sure that JAVA_HOME points to JDK top level dir REM and make sure that JAVA_HOME\lib contains tools.jar !!!! REM REM written by Aleksander Slominski [http://www.extreme.indiana.edu/~aslom] REM JAVA_HOME can be set manualy .. REM set JAVA_HOME=c:\jdk13 if "%JAVA_HOME%" == "" goto javahomeerror REM REM No need to modify anything after this line. REM -------------------------------------------------------------------- echo JAVA_HOME=%JAVA_HOME% set OLDCLASSPATH=%CLASSPATH% call classpath.bat run quiet REM set POLICY=-Djava.security.policy=D:\java\Janus\src\resman\janus\archive\java.policy REM set JAVA_OPTS=-DDebug REM set JAVA_OPTS=-Dlog.names= REM set JAVA_OPTS="%JAVA_OPTS%" set NAME=%1 shift set OLDJAVA=%JAVA% set JAVA=%JAVA_HOME%\bin\java %JAVA_OPTS% %JAVA_DEBUG_OPTS% -cp %LOCALCLASSPATH% if "%NAME%" == "junit" ( set CMD=%JAVA% org.xmlpull.v1.tests.PackageTests %JAVA_ARGS% %1 %2 %3 %4 %5 %6 %7 %8 %9 ) else if "%NAME%" == "eventypes" ( set CMD=%JAVA% eventtypes.EventTypes %JAVA_ARGS% %1 %2 %3 %4 %5 %6 %7 %8 %9 ) else ( set CMD=%JAVA% %NAME% %JAVA_ARGS% %1 %2 %3 %4 %5 %6 %7 %8 %9 ) rem clean up set CLASSPATH=%OLDCLASSPATH% set JAVA=%OLDJAVA% set OLDCLASSPATH= set OLDJAVA= rem exute it echo %CMD% %CMD% goto end REM -----------ERROR------------- :javahomeerror echo "ERROR: JAVA_HOME not found in your environment." echo "Please, set the JAVA_HOME variable in your environment to match the" echo "location of the Java Virtual Machine you want to use." :end xpp3-1.1.4c/src/java/api/LICENSE.txt100644 0 0 562 10525225062 15735 0ustaraslomewww 0 0 XMLPULL API IS FREE ------------------- All of the XMLPULL API source code, compiled code, and documentation contained in this distribution *except* for tests (see separate LICENSE_TESTS.txt) are in the Public Domain. XMLPULL API comes with NO WARRANTY or guarantee of fitness for any purpose. Initial authors: Stefan Haustein Aleksander Slominski 2001-12-12 xpp3-1.1.4c/src/java/api/README.txt100644 0 0 154 10525225062 15605 0ustaraslomewww 0 0 This is copy of src/java/api directory from xmlpull-api-v1 CVS for more details see: http://www.xmlpull.org xpp3-1.1.4c/src/java/api/org/xmlpull/v1/XmlPullParser.java100644 0 0 131360 10525225062 22422 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package org.xmlpull.v1; import java.io.InputStream; import java.io.IOException; import java.io.Reader; /** * XML Pull Parser is an interface that defines parsing functionlity provided * in XMLPULL V1 API (visit this website to * learn more about API and its implementations). * *

There are following different * kinds of parser depending on which features are set:

    *
  • non-validating parser as defined in XML 1.0 spec when * FEATURE_PROCESS_DOCDECL is set to true *
  • validating parser as defined in XML 1.0 spec when * FEATURE_VALIDATION is true (and that implies that FEATURE_PROCESS_DOCDECL is true) *
  • when FEATURE_PROCESS_DOCDECL is false (this is default and * if different value is required necessary must be changed before parsing is started) * then parser behaves like XML 1.0 compliant non-validating parser under condition that * no DOCDECL is present in XML documents * (internal entites can still be defined with defineEntityReplacementText()). * This mode of operation is intened for operation in constrained environments such as J2ME. *
* * *

There are two key methods: next() and nextToken(). While next() provides * access to high level parsing events, nextToken() allows access to lower * level tokens. * *

The current event state of the parser * can be determined by calling the * getEventType() method. * Initially, the parser is in the START_DOCUMENT * state. * *

The method next() advances the parser to the * next event. The int value returned from next determines the current parser * state and is identical to the value returned from following calls to * getEventType (). * *

Th following event types are seen by next()

*
START_TAG
An XML start tag was read. *
TEXT
Text content was read; * the text content can be retreived using the getText() method. * (when in validating mode next() will not report ignorable whitespaces, use nextToken() instead) *
END_TAG
An end tag was read *
END_DOCUMENT
No more events are available *
* *

after first next() or nextToken() (or any other next*() method) * is called user application can obtain * XML version, standalone and encoding from XML declaration * in following ways:

    *
  • version: * getProperty("http://xmlpull.org/v1/doc/properties.html#xmldecl-version") * returns String ("1.0") or null if XMLDecl was not read or if property is not supported *
  • standalone: * getProperty("http://xmlpull.org/v1/doc/features.html#xmldecl-standalone") * returns Boolean: null if there was no standalone declaration * or if property is not supported * otherwise returns Boolean(true) if standalon="yes" and Boolean(false) when standalone="no" *
  • encoding: obtained from getInputEncoding() * null if stream had unknown encoding (not set in setInputStream) * and it was not declared in XMLDecl *
* * A minimal example for using this API may look as follows: *
 * import java.io.IOException;
 * import java.io.StringReader;
 *
 * import org.xmlpull.v1.XmlPullParser;
 * import org.xmlpull.v1.XmlPullParserException.html;
 * import org.xmlpull.v1.XmlPullParserFactory;
 *
 * public class SimpleXmlPullApp
 * {
 *
 *     public static void main (String args[])
 *         throws XmlPullParserException, IOException
 *     {
 *         XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
 *         factory.setNamespaceAware(true);
 *         XmlPullParser xpp = factory.newPullParser();
 *
 *         xpp.setInput( new StringReader ( "<foo>Hello World!</foo>" ) );
 *         int eventType = xpp.getEventType();
 *         while (eventType != XmlPullParser.END_DOCUMENT) {
 *          if(eventType == XmlPullParser.START_DOCUMENT) {
 *              System.out.println("Start document");
 *          } else if(eventType == XmlPullParser.END_DOCUMENT) {
 *              System.out.println("End document");
 *          } else if(eventType == XmlPullParser.START_TAG) {
 *              System.out.println("Start tag "+xpp.getName());
 *          } else if(eventType == XmlPullParser.END_TAG) {
 *              System.out.println("End tag "+xpp.getName());
 *          } else if(eventType == XmlPullParser.TEXT) {
 *              System.out.println("Text "+xpp.getText());
 *          }
 *          eventType = xpp.next();
 *         }
 *     }
 * }
 * 
* *

The above example will generate the following output: *

 * Start document
 * Start tag foo
 * Text Hello World!
 * End tag foo
 * 
* *

For more details on API usage, please refer to the * quick Introduction available at http://www.xmlpull.org * * @see XmlPullParserFactory * @see #defineEntityReplacementText * @see #getName * @see #getNamespace * @see #getText * @see #next * @see #nextToken * @see #setInput * @see #FEATURE_PROCESS_DOCDECL * @see #FEATURE_VALIDATION * @see #START_DOCUMENT * @see #START_TAG * @see #TEXT * @see #END_TAG * @see #END_DOCUMENT * * @author Stefan Haustein * @author Aleksander Slominski */ public interface XmlPullParser { /** This constant represents the default namespace (empty string "") */ String NO_NAMESPACE = ""; // ---------------------------------------------------------------------------- // EVENT TYPES as reported by next() /** * Signalize that parser is at the very beginning of the document * and nothing was read yet. * This event type can only be observed by calling getEvent() * before the first call to next(), nextToken, or nextTag()). * * @see #next * @see #nextToken */ int START_DOCUMENT = 0; /** * Logical end of the xml document. Returned from getEventType, next() * and nextToken() * when the end of the input document has been reached. *

NOTE: calling again * next() or nextToken() * will result in exception being thrown. * * @see #next * @see #nextToken */ int END_DOCUMENT = 1; /** * Returned from getEventType(), * next(), nextToken() when * a start tag was read. * The name of start tag is available from getName(), its namespace and prefix are * available from getNamespace() and getPrefix() * if namespaces are enabled. * See getAttribute* methods to retrieve element attributes. * See getNamespace* methods to retrieve newly declared namespaces. * * @see #next * @see #nextToken * @see #getName * @see #getPrefix * @see #getNamespace * @see #getAttributeCount * @see #getDepth * @see #getNamespaceCount * @see #getNamespace * @see #FEATURE_PROCESS_NAMESPACES */ int START_TAG = 2; /** * Returned from getEventType(), next(), or * nextToken() when an end tag was read. * The name of start tag is available from getName(), its * namespace and prefix are * available from getNamespace() and getPrefix(). * * @see #next * @see #nextToken * @see #getName * @see #getPrefix * @see #getNamespace * @see #FEATURE_PROCESS_NAMESPACES */ int END_TAG = 3; /** * Character data was read and will is available by calling getText(). *

Please note: next() will * accumulate multiple * events into one TEXT event, skipping IGNORABLE_WHITESPACE, * PROCESSING_INSTRUCTION and COMMENT events, * In contrast, nextToken() will stop reading * text when any other event is observed. * Also, when the state was reached by calling next(), the text value will * be normalized, whereas getText() will * return unnormalized content in the case of nextToken(). This allows * an exact roundtrip without chnanging line ends when examining low * level events, whereas for high level applications the text is * normalized apropriately. * * @see #next * @see #nextToken * @see #getText */ int TEXT = 4; // ---------------------------------------------------------------------------- // additional events exposed by lower level nextToken() /** * A CDATA sections was just read; * this token is available only from calls to nextToken(). * A call to next() will accumulate various text events into a single event * of type TEXT. The text contained in the CDATA section is available * by callling getText(). * * @see #nextToken * @see #getText */ int CDSECT = 5; /** * An entity reference was just read; * this token is available from nextToken() * only. The entity name is available by calling getName(). If available, * the replacement text can be obtained by calling getTextt(); otherwise, * the user is responsibile for resolving the entity reference. * This event type is never returned from next(); next() will * accumulate the replacement text and other text * events to a single TEXT event. * * @see #nextToken * @see #getText */ int ENTITY_REF = 6; /** * Ignorable whitespace was just read. * This token is available only from nextToken()). * For non-validating * parsers, this event is only reported by nextToken() when outside * the root element. * Validating parsers may be able to detect ignorable whitespace at * other locations. * The ignorable whitespace string is available by calling getText() * *

NOTE: this is different from calling the * isWhitespace() method, since text content * may be whitespace but not ignorable. * * Ignorable whitespace is skipped by next() automatically; this event * type is never returned from next(). * * @see #nextToken * @see #getText */ int IGNORABLE_WHITESPACE = 7; /** * An XML processing instruction declaration was just read. This * event type is available only via nextToken(). * getText() will return text that is inside the processing instruction. * Calls to next() will skip processing instructions automatically. * @see #nextToken * @see #getText */ int PROCESSING_INSTRUCTION = 8; /** * An XML comment was just read. This event type is this token is * available via nextToken() only; * calls to next() will skip comments automatically. * The content of the comment can be accessed using the getText() * method. * * @see #nextToken * @see #getText */ int COMMENT = 9; /** * An XML document type declaration was just read. This token is * available from nextToken() only. * The unparsed text inside the doctype is available via * the getText() method. * * @see #nextToken * @see #getText */ int DOCDECL = 10; /** * This array can be used to convert the event type integer constants * such as START_TAG or TEXT to * to a string. For example, the value of TYPES[START_TAG] is * the string "START_TAG". * * This array is intended for diagnostic output only. Relying * on the contents of the array may be dangerous since malicous * applications may alter the array, although it is final, due * to limitations of the Java language. */ String [] TYPES = { "START_DOCUMENT", "END_DOCUMENT", "START_TAG", "END_TAG", "TEXT", "CDSECT", "ENTITY_REF", "IGNORABLE_WHITESPACE", "PROCESSING_INSTRUCTION", "COMMENT", "DOCDECL" }; // ---------------------------------------------------------------------------- // namespace related features /** * This feature determines whether the parser processes * namespaces. As for all features, the default value is false. *

NOTE: The value can not be changed during * parsing an must be set before parsing. * * @see #getFeature * @see #setFeature */ String FEATURE_PROCESS_NAMESPACES = "http://xmlpull.org/v1/doc/features.html#process-namespaces"; /** * This feature determines whether namespace attributes are * exposed via the attribute access methods. Like all features, * the default value is false. This feature cannot be changed * during parsing. * * @see #getFeature * @see #setFeature */ String FEATURE_REPORT_NAMESPACE_ATTRIBUTES = "http://xmlpull.org/v1/doc/features.html#report-namespace-prefixes"; /** * This feature determines whether the document declaration * is processed. If set to false, * the DOCDECL event type is reported by nextToken() * and ignored by next(). * * If this featue is activated, then the document declaration * must be processed by the parser. * *

Please note: If the document type declaration * was ignored, entity references may cause exceptions * later in the parsing process. * The default value of this feature is false. It cannot be changed * during parsing. * * @see #getFeature * @see #setFeature */ String FEATURE_PROCESS_DOCDECL = "http://xmlpull.org/v1/doc/features.html#process-docdecl"; /** * If this feature is activated, all validation errors as * defined in the XML 1.0 sepcification are reported. * This implies that FEATURE_PROCESS_DOCDECL is true and both, the * internal and external document type declaration will be processed. *

Please Note: This feature can not be changed * during parsing. The default value is false. * * @see #getFeature * @see #setFeature */ String FEATURE_VALIDATION = "http://xmlpull.org/v1/doc/features.html#validation"; /** * Use this call to change the general behaviour of the parser, * such as namespace processing or doctype declaration handling. * This method must be called before the first call to next or * nextToken. Otherwise, an exception is thrown. *

Example: call setFeature(FEATURE_PROCESS_NAMESPACES, true) in order * to switch on namespace processing. The initial settings correspond * to the properties requested from the XML Pull Parser factory. * If none were requested, all feautures are deactivated by default. * * @exception XmlPullParserException If the feature is not supported or can not be set * @exception IllegalArgumentException If string with the feature name is null */ void setFeature(String name, boolean state) throws XmlPullParserException; /** * Returns the current value of the given feature. *

Please note: unknown features are * always returned as false. * * @param name The name of feature to be retrieved. * @return The value of the feature. * @exception IllegalArgumentException if string the feature name is null */ boolean getFeature(String name); /** * Set the value of a property. * * The property name is any fully-qualified URI. * * @exception XmlPullParserException If the property is not supported or can not be set * @exception IllegalArgumentException If string with the property name is null */ void setProperty(String name, Object value) throws XmlPullParserException; /** * Look up the value of a property. * * The property name is any fully-qualified URI. *

NOTE: unknown properties are always * returned as null. * * @param name The name of property to be retrieved. * @return The value of named property. */ Object getProperty(String name); /** * Set the input source for parser to the given reader and * resets the parser. The event type is set to the initial value * START_DOCUMENT. * Setting the reader to null will just stop parsing and * reset parser state, * allowing the parser to free internal resources * such as parsing buffers. */ void setInput(Reader in) throws XmlPullParserException; /** * Sets the input stream the parser is going to process. * This call resets the parser state and sets the event type * to the initial value START_DOCUMENT. * *

NOTE: If an input encoding string is passed, * it MUST be used. Otherwise, * if inputEncoding is null, the parser SHOULD try to determine * input encoding following XML 1.0 specification (see below). * If encoding detection is supported then following feature * http://xmlpull.org/v1/doc/features.html#detect-encoding * MUST be true amd otherwise it must be false * * @param inputStream contains a raw byte input stream of possibly * unknown encoding (when inputEncoding is null). * * @param inputEncoding if not null it MUST be used as encoding for inputStream */ void setInput(InputStream inputStream, String inputEncoding) throws XmlPullParserException; /** * Returns the input encoding if known, null otherwise. * If setInput(InputStream, inputEncoding) was called with an inputEncoding * value other than null, this value must be returned * from this method. Otherwise, if inputEncoding is null and * the parser suppports the encoding detection feature * (http://xmlpull.org/v1/doc/features.html#detect-encoding), * it must return the detected encoding. * If setInput(Reader) was called, null is returned. * After first call to next if XML declaration was present this method * will return encoding declared. */ String getInputEncoding(); /** * Set new value for entity replacement text as defined in * XML 1.0 Section 4.5 * Construction of Internal Entity Replacement Text. * If FEATURE_PROCESS_DOCDECL or FEATURE_VALIDATION are set, calling this * function will result in an exception -- when processing of DOCDECL is * enabled, there is no need to the entity replacement text manually. * *

The motivation for this function is to allow very small * implementations of XMLPULL that will work in J2ME environments. * Though these implementations may not be able to process the document type * declaration, they still can work with known DTDs by using this function. * *

Please notes: The given value is used literally as replacement text * and it corresponds to declaring entity in DTD that has all special characters * escaped: left angle bracket is replaced with &lt;, ampersnad with &amp; * and so on. * *

Note: The given value is the literal replacement text and must not * contain any other entity reference (if it contains any entity reference * there will be no further replacement). * *

Note: The list of pre-defined entity names will * always contain standard XML entities such as * amp (&amp;), lt (&lt;), gt (&gt;), quot (&quot;), and apos (&apos;). * Those cannot be redefined by this method! * * @see #setInput * @see #FEATURE_PROCESS_DOCDECL * @see #FEATURE_VALIDATION */ void defineEntityReplacementText( String entityName, String replacementText ) throws XmlPullParserException; /** * Returns the numbers of elements in the namespace stack for the given * depth. * If namespaces are not enabled, 0 is returned. * *

NOTE: when parser is on END_TAG then it is allowed to call * this function with getDepth()+1 argument to retrieve position of namespace * prefixes and URIs that were declared on corresponding START_TAG. *

NOTE: to retrieve lsit of namespaces declared in current element:

     *       XmlPullParser pp = ...
     *       int nsStart = pp.getNamespaceCount(pp.getDepth()-1);
     *       int nsEnd = pp.getNamespaceCount(pp.getDepth());
     *       for (int i = nsStart; i < nsEnd; i++) {
     *          String prefix = pp.getNamespacePrefix(i);
     *          String ns = pp.getNamespaceUri(i);
     *           // ...
     *      }
     * 
* * @see #getNamespacePrefix * @see #getNamespaceUri * @see #getNamespace() * @see #getNamespace(String) */ int getNamespaceCount(int depth) throws XmlPullParserException; /** * Returns the namespace prefixe for the given position * in the namespace stack. * Default namespace declaration (xmlns='...') will have null as prefix. * If the given index is out of range, an exception is thrown. *

Please note: when the parser is on an END_TAG, * namespace prefixes that were declared * in the corresponding START_TAG are still accessible * although they are no longer in scope. */ String getNamespacePrefix(int pos) throws XmlPullParserException; /** * Returns the namespace URI for the given position in the * namespace stack * If the position is out of range, an exception is thrown. *

NOTE: when parser is on END_TAG then namespace prefixes that were declared * in corresponding START_TAG are still accessible even though they are not in scope */ String getNamespaceUri(int pos) throws XmlPullParserException; /** * Returns the URI corresponding to the given prefix, * depending on current state of the parser. * *

If the prefix was not declared in the current scope, * null is returned. The default namespace is included * in the namespace table and is available via * getNamespace (null). * *

This method is a convenience method for * *

     *  for (int i = getNamespaceCount(getDepth ())-1; i >= 0; i--) {
     *   if (getNamespacePrefix(i).equals( prefix )) {
     *     return getNamespaceUri(i);
     *   }
     *  }
     *  return null;
     * 
* *

Please note: parser implementations * may provide more efifcient lookup, e.g. using a Hashtable. * The 'xml' prefix is bound to "http://www.w3.org/XML/1998/namespace", as * defined in the * Namespaces in XML * specification. Analogous, the 'xmlns' prefix is resolved to * http://www.w3.org/2000/xmlns/ * * @see #getNamespaceCount * @see #getNamespacePrefix * @see #getNamespaceUri */ String getNamespace (String prefix); // -------------------------------------------------------------------------- // miscellaneous reporting methods /** * Returns the current depth of the element. * Outside the root element, the depth is 0. The * depth is incremented by 1 when a start tag is reached. * The depth is decremented AFTER the end tag * event was observed. * *

     * <!-- outside -->     0
     * <root>                  1
     *   sometext                 1
     *     <foobar>         2
     *     </foobar>        2
     * </root>              1
     * <!-- outside -->     0
     * 
*/ int getDepth(); /** * Returns a short text describing the current parser state, including * the position, a * description of the current event and the data source if known. * This method is especially useful to provide meaningful * error messages and for debugging purposes. */ String getPositionDescription (); /** * Returns the current line number, starting from 1. * When the parser does not know the current line number * or can not determine it, -1 is returned (e.g. for WBXML). * * @return current line number or -1 if unknown. */ int getLineNumber(); /** * Returns the current column number, starting from 0. * When the parser does not know the current column number * or can not determine it, -1 is returned (e.g. for WBXML). * * @return current column number or -1 if unknown. */ int getColumnNumber(); // -------------------------------------------------------------------------- // TEXT related methods /** * Checks whether the current TEXT event contains only whitespace * characters. * For IGNORABLE_WHITESPACE, this is always true. * For TEXT and CDSECT, false is returned when the current event text * contains at least one non-white space character. For any other * event type an exception is thrown. * *

Please note: non-validating parsers are not * able to distinguish whitespace and ignorable whitespace, * except from whitespace outside the root element. Ignorable * whitespace is reported as separate event, which is exposed * via nextToken only. * */ boolean isWhitespace() throws XmlPullParserException; /** * Returns the text content of the current event as String. * The value returned depends on current event type, * for example for TEXT event it is element content * (this is typical case when next() is used). * * See description of nextToken() for detailed description of * possible returned values for different types of events. * *

NOTE: in case of ENTITY_REF, this method returns * the entity replacement text (or null if not available). This is * the only case where * getText() and getTextCharacters() return different values. * * @see #getEventType * @see #next * @see #nextToken */ String getText (); /** * Returns the buffer that contains the text of the current event, * as well as the start offset and length relevant for the current * event. See getText(), next() and nextToken() for description of possible returned values. * *

Please note: this buffer must not * be modified and its content MAY change after a call to * next() or nextToken(). This method will always return the * same value as getText(), except for ENTITY_REF. In the case * of ENTITY ref, getText() returns the replacement text and * this method returns the actual input buffer containing the * entity name. * If getText() returns null, this method returns null as well and * the values returned in the holder array MUST be -1 (both start * and length). * * @see #getText * @see #next * @see #nextToken * * @param holderForStartAndLength Must hold an 2-element int array * into which the start offset and length values will be written. * @return char buffer that contains the text of the current event * (null if the current event has no text associated). */ char[] getTextCharacters(int [] holderForStartAndLength); // -------------------------------------------------------------------------- // START_TAG / END_TAG shared methods /** * Returns the namespace URI of the current element. * The default namespace is represented * as empty string. * If namespaces are not enabled, an empty String ("") is always returned. * The current event must be START_TAG or END_TAG; otherwise, * null is returned. */ String getNamespace (); /** * For START_TAG or END_TAG events, the (local) name of the current * element is returned when namespaces are enabled. When namespace * processing is disabled, the raw name is returned. * For ENTITY_REF events, the entity name is returned. * If the current event is not START_TAG, END_TAG, or ENTITY_REF, * null is returned. *

Please note: To reconstruct the raw element name * when namespaces are enabled and the prefix is not null, * you will need to add the prefix and a colon to localName.. * */ String getName(); /** * Returns the prefix of the current element. * If the element is in the default namespace (has no prefix), * null is returned. * If namespaces are not enabled, or the current event * is not START_TAG or END_TAG, null is returned. */ String getPrefix(); /** * Returns true if the current event is START_TAG and the tag * is degenerated * (e.g. <foobar/>). *

NOTE: if the parser is not on START_TAG, an exception * will be thrown. */ boolean isEmptyElementTag() throws XmlPullParserException; // -------------------------------------------------------------------------- // START_TAG Attributes retrieval methods /** * Returns the number of attributes of the current start tag, or * -1 if the current event type is not START_TAG * * @see #getAttributeNamespace * @see #getAttributeName * @see #getAttributePrefix * @see #getAttributeValue */ int getAttributeCount(); /** * Returns the namespace URI of the attribute * with the given index (starts from 0). * Returns an empty string ("") if namespaces are not enabled * or the attribute has no namespace. * Throws an IndexOutOfBoundsException if the index is out of range * or the current event type is not START_TAG. * *

NOTE: if FEATURE_REPORT_NAMESPACE_ATTRIBUTES is set * then namespace attributes (xmlns:ns='...') must be reported * with namespace * http://www.w3.org/2000/xmlns/ * (visit this URL for description!). * The default namespace attribute (xmlns="...") will be reported with empty namespace. *

NOTE:The xml prefix is bound as defined in * Namespaces in XML * specification to "http://www.w3.org/XML/1998/namespace". * * @param zero based index of attribute * @return attribute namespace, * empty string ("") is returned if namesapces processing is not enabled or * namespaces processing is enabled but attribute has no namespace (it has no prefix). */ String getAttributeNamespace (int index); /** * Returns the local name of the specified attribute * if namespaces are enabled or just attribute name if namespaces are disabled. * Throws an IndexOutOfBoundsException if the index is out of range * or current event type is not START_TAG. * * @param zero based index of attribute * @return attribute name (null is never returned) */ String getAttributeName (int index); /** * Returns the prefix of the specified attribute * Returns null if the element has no prefix. * If namespaces are disabled it will always return null. * Throws an IndexOutOfBoundsException if the index is out of range * or current event type is not START_TAG. * * @param zero based index of attribute * @return attribute prefix or null if namespaces processing is not enabled. */ String getAttributePrefix(int index); /** * Returns the type of the specified attribute * If parser is non-validating it MUST return CDATA. * * @param zero based index of attribute * @return attribute type (null is never returned) */ String getAttributeType(int index); /** * Returns if the specified attribute was not in input was declared in XML. * If parser is non-validating it MUST always return false. * This information is part of XML infoset: * * @param zero based index of attribute * @return false if attribute was in input */ boolean isAttributeDefault(int index); /** * Returns the given attributes value. * Throws an IndexOutOfBoundsException if the index is out of range * or current event type is not START_TAG. * *

NOTE: attribute value must be normalized * (including entity replacement text if PROCESS_DOCDECL is false) as described in * XML 1.0 section * 3.3.3 Attribute-Value Normalization * * @see #defineEntityReplacementText * * @param zero based index of attribute * @return value of attribute (null is never returned) */ String getAttributeValue(int index); /** * Returns the attributes value identified by namespace URI and namespace localName. * If namespaces are disabled namespace must be null. * If current event type is not START_TAG then IndexOutOfBoundsException will be thrown. * *

NOTE: attribute value must be normalized * (including entity replacement text if PROCESS_DOCDECL is false) as described in * XML 1.0 section * 3.3.3 Attribute-Value Normalization * * @see #defineEntityReplacementText * * @param namespace Namespace of the attribute if namespaces are enabled otherwise must be null * @param name If namespaces enabled local name of attribute otherwise just attribute name * @return value of attribute or null if attribute with given name does not exist */ String getAttributeValue(String namespace, String name); // -------------------------------------------------------------------------- // actual parsing methods /** * Returns the type of the current event (START_TAG, END_TAG, TEXT, etc.) * * @see #next() * @see #nextToken() */ int getEventType() throws XmlPullParserException; /** * Get next parsing event - element content wil be coalesced and only one * TEXT event must be returned for whole element content * (comments and processing instructions will be ignored and emtity references * must be expanded or exception mus be thrown if entity reerence can not be exapnded). * If element content is empty (content is "") then no TEXT event will be reported. * *

NOTE: empty element (such as <tag/>) will be reported * with two separate events: START_TAG, END_TAG - it must be so to preserve * parsing equivalency of empty element to <tag></tag>. * (see isEmptyElementTag ()) * * @see #isEmptyElementTag * @see #START_TAG * @see #TEXT * @see #END_TAG * @see #END_DOCUMENT */ int next() throws XmlPullParserException, IOException; /** * This method works similarly to next() but will expose * additional event types (COMMENT, CDSECT, DOCDECL, ENTITY_REF, PROCESSING_INSTRUCTION, or * IGNORABLE_WHITESPACE) if they are available in input. * *

If special feature * FEATURE_XML_ROUNDTRIP * (identified by URI: http://xmlpull.org/v1/doc/features.html#xml-roundtrip) * is enabled it is possible to do XML document round trip ie. reproduce * exectly on output the XML input using getText(): * returned content is always unnormalized (exactly as in input). * Otherwise returned content is end-of-line normalized as described * XML 1.0 End-of-Line Handling * and. Also when this feature is enabled exact content of START_TAG, END_TAG, * DOCDECL and PROCESSING_INSTRUCTION is available. * *

Here is the list of tokens that can be returned from nextToken() * and what getText() and getTextCharacters() returns:

*
START_DOCUMENT
null *
END_DOCUMENT
null *
START_TAG
null unless FEATURE_XML_ROUNDTRIP * enabled and then returns XML tag, ex: <tag attr='val'> *
END_TAG
null unless FEATURE_XML_ROUNDTRIP * id enabled and then returns XML tag, ex: </tag> *
TEXT
return element content. *
Note: that element content may be delivered in multiple consecutive TEXT events. *
IGNORABLE_WHITESPACE
return characters that are determined to be ignorable white * space. If the FEATURE_XML_ROUNDTRIP is enabled all whitespace content outside root * element will always reported as IGNORABLE_WHITESPACE otherise rteporting is optional. *
Note: that element content may be delevered in multiple consecutive IGNORABLE_WHITESPACE events. *
CDSECT
* return text inside CDATA * (ex. 'fo<o' from <!CDATA[fo<o]]>) *
PROCESSING_INSTRUCTION
* if FEATURE_XML_ROUNDTRIP is true * return exact PI content ex: 'pi foo' from <?pi foo?> * otherwise it may be exact PI content or concatenation of PI target, * space and data so for example for * <?target data?> string "target data" may * be returned if FEATURE_XML_ROUNDTRIP is false. *
COMMENT
return comment content ex. 'foo bar' from <!--foo bar--> *
ENTITY_REF
getText() MUST return entity replacement text if PROCESS_DOCDECL is false * otherwise getText() MAY return null, * additionally getTextCharacters() MUST return entity name * (for example 'entity_name' for &entity_name;). *
NOTE: this is the only place where value returned from getText() and * getTextCharacters() are different *
NOTE: it is user responsibility to resolve entity reference * if PROCESS_DOCDECL is false and there is no entity replacement text set in * defineEntityReplacementText() method (getText() will be null) *
NOTE: character entities (ex. &#32;) and standard entities such as * &amp; &lt; &gt; &quot; &apos; are reported as well * and are not reported as TEXT tokens but as ENTITY_REF tokens! * This requirement is added to allow to do roundtrip of XML documents! *
DOCDECL
* if FEATURE_XML_ROUNDTRIP is true or PROCESS_DOCDECL is false * then return what is inside of DOCDECL for example it returns:
     * " titlepage SYSTEM "http://www.foo.bar/dtds/typo.dtd"
     * [<!ENTITY % active.links "INCLUDE">]"
*

for input document that contained:

     * <!DOCTYPE titlepage SYSTEM "http://www.foo.bar/dtds/typo.dtd"
     * [<!ENTITY % active.links "INCLUDE">]>
* otherwise if FEATURE_XML_ROUNDTRIP is false and PROCESS_DOCDECL is true * then what is returned is undefined (it may be even null) *
*
* *

NOTE: there is no gurantee that there will only one TEXT or * IGNORABLE_WHITESPACE event from nextToken() as parser may chose to deliver element content in * multiple tokens (dividing element content into chunks) * *

NOTE: whether returned text of token is end-of-line normalized * is depending on FEATURE_XML_ROUNDTRIP. * *

NOTE: XMLDecl (<?xml ...?>) is not reported but its content * is available through optional properties (see class description above). * * @see #next * @see #START_TAG * @see #TEXT * @see #END_TAG * @see #END_DOCUMENT * @see #COMMENT * @see #DOCDECL * @see #PROCESSING_INSTRUCTION * @see #ENTITY_REF * @see #IGNORABLE_WHITESPACE */ int nextToken() throws XmlPullParserException, IOException; //----------------------------------------------------------------------------- // utility methods to mak XML parsing easier ... /** * Test if the current event is of the given type and if the * namespace and name do match. null will match any namespace * and any name. If the test is not passed, an exception is * thrown. The exception text indicates the parser position, * the expected event and the current event that is not meeting the * requirement. * *

Essentially it does this *

     *  if (type != getEventType()
     *  || (namespace != null &&  !namespace.equals( getNamespace () ) )
     *  || (name != null &&  !name.equals( getName() ) ) )
     *     throw new XmlPullParserException( "expected "+ TYPES[ type ]+getPositionDescription());
     * 
*/ void require(int type, String namespace, String name) throws XmlPullParserException, IOException; /** * If current event is START_TAG then if next element is TEXT then element content is returned * or if next event is END_TAG then empty string is returned, otherwise exception is thrown. * After calling this function successfully parser will be positioned on END_TAG. * *

The motivation for this function is to allow to parse consistently both * empty elements and elements that has non empty content, for example for input:

    *
  1. <tag>foo</tag> *
  2. <tag></tag> (which is equivalent to <tag/> * both input can be parsed with the same code: *
         *   p.nextTag()
         *   p.requireEvent(p.START_TAG, "", "tag");
         *   String content = p.nextText();
         *   p.requireEvent(p.END_TAG, "", "tag");
         * 
    * This function together with nextTag make it very easy to parse XML that has * no mixed content. * * *

    Essentially it does this *

         *  if(getEventType() != START_TAG) {
         *     throw new XmlPullParserException(
         *       "parser must be on START_TAG to read next text", this, null);
         *  }
         *  int eventType = next();
         *  if(eventType == TEXT) {
         *     String result = getText();
         *     eventType = next();
         *     if(eventType != END_TAG) {
         *       throw new XmlPullParserException(
         *          "event TEXT it must be immediately followed by END_TAG", this, null);
         *      }
         *      return result;
         *  } else if(eventType == END_TAG) {
         *     return "";
         *  } else {
         *     throw new XmlPullParserException(
         *       "parser must be on START_TAG or TEXT to read text", this, null);
         *  }
         * 
    */ String nextText() throws XmlPullParserException, IOException; /** * Call next() and return event if it is START_TAG or END_TAG * otherwise throw an exception. * It will skip whitespace TEXT before actual tag if any. * *

    essentially it does this *

         *   int eventType = next();
         *   if(eventType == TEXT &&  isWhitespace()) {   // skip whitespace
         *      eventType = next();
         *   }
         *   if (eventType != START_TAG &&  eventType != END_TAG) {
         *      throw new XmlPullParserException("expected start or end tag", this, null);
         *   }
         *   return eventType;
         * 
    */ int nextTag() throws XmlPullParserException, IOException; // /** // * Skip sub tree on which the parser is currently positioned on. // *
    NOTE: parser must be on START_TAG and when function returns // * parser will be positioned on matching END_TAG // * // * This method is typically optimized by parser but the its logic should follow this: // * // * require(XmlPullParser.START_TAG, null, null); // * int level = 1; // * while(level > 0) { // * int eventType = next(); // * if(eventType == XmlPullParser.END_TAG) { // * --level; // * } else if(eventType == XmlPullParser.START_TAG) { // * ++level; // * } // * } // * // */ // public void skipSubTree() throws XmlPullParserException, IOException; } xpp3-1.1.4c/src/java/api/org/xmlpull/v1/XmlPullParserException.java100644 0 0 4334 10525225062 24241 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package org.xmlpull.v1; /** * This exception is thrown to signal XML Pull Parser related faults. * * @author Aleksander Slominski */ public class XmlPullParserException extends Exception { protected Throwable detail; protected int row = -1; protected int column = -1; /* public XmlPullParserException() { }*/ public XmlPullParserException(String s) { super(s); } /* public XmlPullParserException(String s, Throwable thrwble) { super(s); this.detail = thrwble; } public XmlPullParserException(String s, int row, int column) { super(s); this.row = row; this.column = column; } */ public XmlPullParserException(String msg, XmlPullParser parser, Throwable chain) { super ((msg == null ? "" : msg+" ") + (parser == null ? "" : "(position:"+parser.getPositionDescription()+") ") + (chain == null ? "" : "caused by: "+chain)); if (parser != null) { this.row = parser.getLineNumber(); this.column = parser.getColumnNumber(); } this.detail = chain; } public Throwable getDetail() { return detail; } // public void setDetail(Throwable cause) { this.detail = cause; } public int getLineNumber() { return row; } public int getColumnNumber() { return column; } /* public String getMessage() { if(detail == null) return super.getMessage(); else return super.getMessage() + "; nested exception is: \n\t" + detail.getMessage(); } */ //NOTE: code that prints this and detail is difficult in J2ME public void printStackTrace() { if (detail == null) { super.printStackTrace(); } else { synchronized(System.err) { System.err.println(super.getMessage() + "; nested exception is:"); detail.printStackTrace(); } } } } xpp3-1.1.4c/src/java/api/org/xmlpull/v1/XmlPullParserFactory.java100644 0 0 31406 10525225062 23732 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package org.xmlpull.v1; import java.io.InputStream; import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; /** * This class is used to create implementations of XML Pull Parser defined in XMPULL V1 API. * The name of actual factory class will be determined based on several parameters. * It works similar to JAXP but tailored to work in J2ME environments * (no access to system properties or file system) so name of parser class factory to use * and its class used for loading (no class loader - on J2ME no access to context class loaders) * must be passed explicitly. If no name of parser factory was passed (or is null) * it will try to find name by searching in CLASSPATH for * META-INF/services/org.xmlpull.v1.XmlPullParserFactory resource that should contain * a comma separated list of class names of factories or parsers to try (in order from * left to the right). If none found, it will throw an exception. * *
    NOTE:In J2SE or J2EE environments, you may want to use * newInstance(property, classLoaderCtx) * where first argument is * System.getProperty(XmlPullParserFactory.PROPERTY_NAME) * and second is Thread.getContextClassLoader().getClass() . * * @see XmlPullParser * * @author Aleksander Slominski * @author Stefan Haustein */ public class XmlPullParserFactory { /** used as default class to server as context class in newInstance() */ final static Class referenceContextClass; static { XmlPullParserFactory f = new XmlPullParserFactory(); referenceContextClass = f.getClass(); } /** Name of the system or midlet property that should be used for a system property containing a comma separated list of factory or parser class names (value: org.xmlpull.v1.XmlPullParserFactory). */ public static final String PROPERTY_NAME = "org.xmlpull.v1.XmlPullParserFactory"; private static final String RESOURCE_NAME = "/META-INF/services/" + PROPERTY_NAME; // public static final String DEFAULT_PROPERTY = // "org.xmlpull.xpp3.XmlPullParser,org.kxml2.io.KXmlParser"; protected Vector parserClasses; protected String classNamesLocation; protected Vector serializerClasses; // features are kept there protected Hashtable features = new Hashtable(); /** * Protected constructor to be called by factory implementations. */ protected XmlPullParserFactory() { } /** * Set the features to be set when XML Pull Parser is created by this factory. *

    NOTE: factory features are not used for XML Serializer. * * @param name string with URI identifying feature * @param state if true feature will be set; if false will be ignored */ public void setFeature(String name, boolean state) throws XmlPullParserException { features.put(name, new Boolean(state)); } /** * Return the current value of the feature with given name. *

    NOTE: factory features are not used for XML Serializer. * * @param name The name of feature to be retrieved. * @return The value of named feature. * Unknown features are always returned as false */ public boolean getFeature (String name) { Boolean value = (Boolean) features.get(name); return value != null ? value.booleanValue() : false; } /** * Specifies that the parser produced by this factory will provide * support for XML namespaces. * By default the value of this is set to false. * * @param awareness true if the parser produced by this code * will provide support for XML namespaces; false otherwise. */ public void setNamespaceAware(boolean awareness) { features.put (XmlPullParser.FEATURE_PROCESS_NAMESPACES, new Boolean (awareness)); } /** * Indicates whether or not the factory is configured to produce * parsers which are namespace aware * (it simply set feature XmlPullParser.FEATURE_PROCESS_NAMESPACES to true or false). * * @return true if the factory is configured to produce parsers * which are namespace aware; false otherwise. */ public boolean isNamespaceAware() { return getFeature (XmlPullParser.FEATURE_PROCESS_NAMESPACES); } /** * Specifies that the parser produced by this factory will be validating * (it simply set feature XmlPullParser.FEATURE_VALIDATION to true or false). * * By default the value of this is set to false. * * @param validating - if true the parsers created by this factory must be validating. */ public void setValidating(boolean validating) { features.put (XmlPullParser.FEATURE_VALIDATION, new Boolean (validating)); } /** * Indicates whether or not the factory is configured to produce parsers * which validate the XML content during parse. * * @return true if the factory is configured to produce parsers * which validate the XML content during parse; false otherwise. */ public boolean isValidating() { return getFeature (XmlPullParser.FEATURE_VALIDATION); } /** * Creates a new instance of a XML Pull Parser * using the currently configured factory features. * * @return A new instance of a XML Pull Parser. * @throws XmlPullParserException if a parser cannot be created which satisfies the * requested configuration. */ public XmlPullParser newPullParser() throws XmlPullParserException { if (parserClasses == null) throw new XmlPullParserException ("Factory initialization was incomplete - has not tried "+classNamesLocation); if (parserClasses.size() == 0) throw new XmlPullParserException ("No valid parser classes found in "+classNamesLocation); final StringBuffer issues = new StringBuffer (); for (int i = 0; i < parserClasses.size (); i++) { final Class ppClass = (Class) parserClasses.elementAt (i); try { final XmlPullParser pp = (XmlPullParser) ppClass.newInstance(); // if( ! features.isEmpty() ) { //Enumeration keys = features.keys(); // while(keys.hasMoreElements()) { for (Enumeration e = features.keys (); e.hasMoreElements ();) { final String key = (String) e.nextElement(); final Boolean value = (Boolean) features.get(key); if(value != null && value.booleanValue()) { pp.setFeature(key, true); } } return pp; } catch(Exception ex) { issues.append (ppClass.getName () + ": "+ ex.toString ()+"; "); } } throw new XmlPullParserException ("could not create parser: "+issues); } /** * Creates a new instance of a XML Serializer. * *

    NOTE: factory features are not used for XML Serializer. * * @return A new instance of a XML Serializer. * @throws XmlPullParserException if a parser cannot be created which satisfies the * requested configuration. */ public XmlSerializer newSerializer() throws XmlPullParserException { if (serializerClasses == null) { throw new XmlPullParserException ("Factory initialization incomplete - has not tried "+classNamesLocation); } if(serializerClasses.size() == 0) { throw new XmlPullParserException ("No valid serializer classes found in "+classNamesLocation); } final StringBuffer issues = new StringBuffer (); for (int i = 0; i < serializerClasses.size (); i++) { final Class ppClass = (Class) serializerClasses.elementAt (i); try { final XmlSerializer ser = (XmlSerializer) ppClass.newInstance(); // for (Enumeration e = features.keys (); e.hasMoreElements ();) { // String key = (String) e.nextElement(); // Boolean value = (Boolean) features.get(key); // if(value != null && value.booleanValue()) { // ser.setFeature(key, true); // } // } return ser; } catch(Exception ex) { issues.append (ppClass.getName () + ": "+ ex.toString ()+"; "); } } throw new XmlPullParserException ("could not create serializer: "+issues); } /** * Create a new instance of a PullParserFactory that can be used * to create XML pull parsers (see class description for more * details). * * @return a new instance of a PullParserFactory, as returned by newInstance (null, null); */ public static XmlPullParserFactory newInstance () throws XmlPullParserException { return newInstance(null, null); } public static XmlPullParserFactory newInstance (String classNames, Class context) throws XmlPullParserException { if (context == null) { //NOTE: make sure context uses the same class loader as API classes // this is the best we can do without having access to context classloader in J2ME // if API is in the same classloader as implementation then this will work context = referenceContextClass; } String classNamesLocation = null; if (classNames == null || classNames.length() == 0 || "DEFAULT".equals(classNames)) { try { InputStream is = context.getResourceAsStream (RESOURCE_NAME); if (is == null) throw new XmlPullParserException ("resource not found: "+RESOURCE_NAME +" make sure that parser implementing XmlPull API is available"); final StringBuffer sb = new StringBuffer(); while (true) { final int ch = is.read(); if (ch < 0) break; else if (ch > ' ') sb.append((char) ch); } is.close (); classNames = sb.toString (); } catch (Exception e) { throw new XmlPullParserException (null, null, e); } classNamesLocation = "resource "+RESOURCE_NAME+" that contained '"+classNames+"'"; } else { classNamesLocation = "parameter classNames to newInstance() that contained '"+classNames+"'"; } XmlPullParserFactory factory = null; final Vector parserClasses = new Vector (); final Vector serializerClasses = new Vector (); int pos = 0; while (pos < classNames.length ()) { int cut = classNames.indexOf (',', pos); if (cut == -1) cut = classNames.length (); final String name = classNames.substring (pos, cut); Class candidate = null; Object instance = null; try { candidate = Class.forName (name); // necessary because of J2ME .class issue instance = candidate.newInstance (); } catch (Exception e) {} if (candidate != null) { boolean recognized = false; if (instance instanceof XmlPullParser) { parserClasses.addElement (candidate); recognized = true; } if (instance instanceof XmlSerializer) { serializerClasses.addElement (candidate); recognized = true; } if (instance instanceof XmlPullParserFactory) { if (factory == null) { factory = (XmlPullParserFactory) instance; } recognized = true; } if (!recognized) { throw new XmlPullParserException ("incompatible class: "+name); } } pos = cut + 1; } if (factory == null) { factory = new XmlPullParserFactory (); } factory.parserClasses = parserClasses; factory.serializerClasses = serializerClasses; factory.classNamesLocation = classNamesLocation; return factory; } } xpp3-1.1.4c/src/java/api/org/xmlpull/v1/XmlSerializer.java100644 0 0 35067 10525225062 22431 0ustaraslomewww 0 0 package org.xmlpull.v1; import java.io.IOException; import java.io.OutputStream; import java.io.Writer; /** * Define an interface to serialziation of XML Infoset. * This interface abstracts away if serialized XML is XML 1.0 comaptible text or * other formats of XML 1.0 serializations (such as binary XML for example with WBXML). * *

    PLEASE NOTE: This interface will be part of XmlPull 1.2 API. * It is included as basis for discussion. It may change in any way. * *

    Exceptions that may be thrown are: IOException or runtime exception * (more runtime exceptions can be thrown but are not declared and as such * have no semantics defined for this interface): *

      *
    • IllegalArgumentException - for almost all methods to signal that * argument is illegal *
    • IllegalStateException - to signal that call has good arguments but * is not expected here (violation of contract) and for features/properties * when requesting setting unimplemented feature/property * (UnsupportedOperationException would be better but it is not in MIDP) *
    * *

    NOTE: writing CDSECT, ENTITY_REF, IGNORABLE_WHITESPACE, * PROCESSING_INSTRUCTION, COMMENT, and DOCDECL in some implementations * may not be supported (for example when serializing to WBXML). * In such case IllegalStateException will be thrown and it is recommened * to use an optional feature to signal that implementation is not * supporting this kind of output. */ public interface XmlSerializer { /** * Set feature identified by name (recommended to be URI for uniqueness). * Some well known optional features are defined in * * http://www.xmlpull.org/v1/doc/features.html. * * If feature is not recocgnized or can not be set * then IllegalStateException MUST be thrown. * * @exception IllegalStateException If the feature is not supported or can not be set */ void setFeature(String name, boolean state) throws IllegalArgumentException, IllegalStateException; /** * Return the current value of the feature with given name. *

    NOTE: unknown properties are always returned as null * * @param name The name of feature to be retrieved. * @return The value of named feature. * @exception IllegalArgumentException if feature string is null */ boolean getFeature(String name); /** * Set the value of a property. * (the property name is recommened to be URI for uniqueness). * Some well known optional properties are defined in * * http://www.xmlpull.org/v1/doc/properties.html. * * If property is not recocgnized or can not be set * then IllegalStateException MUST be thrown. * * @exception IllegalStateException if the property is not supported or can not be set */ void setProperty(String name, Object value) throws IllegalArgumentException, IllegalStateException; /** * Look up the value of a property. * * The property name is any fully-qualified URI. I *

    NOTE: unknown properties are always returned as null * * @param name The name of property to be retrieved. * @return The value of named property. */ Object getProperty(String name); /** * Set to use binary output stream with given encoding. */ void setOutput (OutputStream os, String encoding) throws IOException, IllegalArgumentException, IllegalStateException; /** * Set the output to the given writer. *

    WARNING no information about encoding is available! */ void setOutput (Writer writer) throws IOException, IllegalArgumentException, IllegalStateException; /** * Write <?xml declaration with encoding (if encoding not null) * and standalone flag (if standalone not null) * This method can only be called just after setOutput. */ void startDocument (String encoding, Boolean standalone) throws IOException, IllegalArgumentException, IllegalStateException; /** * Finish writing. All unclosed start tags will be closed and output * will be flushed. After calling this method no more output can be * serialized until next call to setOutput() */ void endDocument () throws IOException, IllegalArgumentException, IllegalStateException; /** * Binds the given prefix to the given namespace. * This call is valid for the next element including child elements. * The prefix and namespace MUST be always declared even if prefix * is not used in element (startTag() or attribute()) - for XML 1.0 * it must result in declaring xmlns:prefix='namespace' * (or xmlns:prefix="namespace" depending what character is used * to quote attribute value). * *

    NOTE: this method MUST be called directly before startTag() * and if anything but startTag() or setPrefix() is called next there will be exception. *

    NOTE: prefixes "xml" and "xmlns" are already bound * and can not be redefined see: * Namespaces in XML Errata. *

    NOTE: to set default namespace use as prefix empty string. * * @param prefix must be not null (or IllegalArgumentException is thrown) * @param namespace must be not null */ void setPrefix (String prefix, String namespace) throws IOException, IllegalArgumentException, IllegalStateException; /** * Return namespace that corresponds to given prefix * If there is no prefix bound to this namespace return null * but if generatePrefix is false then return generated prefix. * *

    NOTE: if the prefix is empty string "" and defualt namespace is bound * to this prefix then empty string ("") is returned. * *

    NOTE: prefixes "xml" and "xmlns" are already bound * will have values as defined * Namespaces in XML specification */ String getPrefix (String namespace, boolean generatePrefix) throws IllegalArgumentException; /** * Returns the current depth of the element. * Outside the root element, the depth is 0. The * depth is incremented by 1 when startTag() is called. * The depth is decremented after the call to endTag() * event was observed. * *

         * <!-- outside -->     0
         * <root>               1
         *   sometext                 1
         *     <foobar>         2
         *     </foobar>        2
         * </root>              1
         * <!-- outside -->     0
         * 
    */ int getDepth(); /** * Returns the namespace URI of the current element as set by startTag(). * *

    NOTE: that measn in particaulr that:

      *
    • if there was startTag("", ...) then getNamespace() returns "" *
    • if there was startTag(null, ...) then getNamespace() returns null *
    * * @return namespace set by startTag() that is currently in scope */ String getNamespace (); /** * Returns the name of the current element as set by startTag(). * It can only be null before first call to startTag() * or when last endTag() is called to close first startTag(). * * @return namespace set by startTag() that is currently in scope */ String getName(); /** * Writes a start tag with the given namespace and name. * If there is no prefix defined for the given namespace, * a prefix will be defined automatically. * The explicit prefixes for namespaces can be established by calling setPrefix() * immediately before this method. * If namespace is null no namespace prefix is printed but just name. * If namespace is empty string then serialzier will make sure that * default empty namespace is declared (in XML 1.0 xmlns='') * or throw IllegalStateException if default namespace is already bound * to non-empty string. */ XmlSerializer startTag (String namespace, String name) throws IOException, IllegalArgumentException, IllegalStateException; /** * Write an attribute. Calls to attribute() MUST follow a call to * startTag() immediately. If there is no prefix defined for the * given namespace, a prefix will be defined automatically. * If namespace is null or empty string * no namespace prefix is printed but just name. */ XmlSerializer attribute (String namespace, String name, String value) throws IOException, IllegalArgumentException, IllegalStateException; /** * Write end tag. Repetition of namespace and name is just for avoiding errors. *

    Background: in kXML endTag had no arguments, and non matching tags were * very difficult to find... * If namespace is null no namespace prefix is printed but just name. * If namespace is empty string then serialzier will make sure that * default empty namespace is declared (in XML 1.0 xmlns=''). */ XmlSerializer endTag (String namespace, String name) throws IOException, IllegalArgumentException, IllegalStateException; // /** // * Writes a start tag with the given namespace and name. // *
    If there is no prefix defined (prefix == null) for the given namespace, // * a prefix will be defined automatically. // *
    If explicit prefixes is passed (prefix != null) then it will be used // *and namespace declared if not already declared or // * throw IllegalStateException the same prefix was already set on this // * element (setPrefix()) and was bound to different namespace. // *
    If namespace is null then prefix must be null too or IllegalStateException is thrown. // *
    If namespace is null then no namespace prefix is printed but just name. // *
    If namespace is empty string then serializer will make sure that // * default empty namespace is declared (in XML 1.0 xmlns='') // * or throw IllegalStateException if default namespace is already bound // * to non-empty string. // */ // XmlSerializer startTag (String prefix, String namespace, String name) // throws IOException, IllegalArgumentException, IllegalStateException; // // /** // * Write an attribute. Calls to attribute() MUST follow a call to // * startTag() immediately. // *
    If there is no prefix defined (prefix == null) for the given namespace, // * a prefix will be defined automatically. // *
    If explicit prefixes is passed (prefix != null) then it will be used // * and namespace declared if not already declared or // * throw IllegalStateException the same prefix was already set on this // * element (setPrefix()) and was bound to different namespace. // *
    If namespace is null then prefix must be null too or IllegalStateException is thrown. // *
    If namespace is null then no namespace prefix is printed but just name. // *
    If namespace is empty string then serializer will make sure that // * default empty namespace is declared (in XML 1.0 xmlns='') // * or throw IllegalStateException if default namespace is already bound // * to non-empty string. // */ // XmlSerializer attribute (String prefix, String namespace, String name, String value) // throws IOException, IllegalArgumentException, IllegalStateException; // // /** // * Write end tag. Repetition of namespace, prefix, and name is just for avoiding errors. // *
    If namespace or name arguments are different from corresponding startTag call // * then IllegalArgumentException is thrown, if prefix argument is not null and is different // * from corresponding starTag then IllegalArgumentException is thrown. // *
    If namespace is null then prefix must be null too or IllegalStateException is thrown. // *
    If namespace is null then no namespace prefix is printed but just name. // *
    If namespace is empty string then serializer will make sure that // * default empty namespace is declared (in XML 1.0 xmlns=''). // *

    Background: in kXML endTag had no arguments, and non matching tags were // * very difficult to find...

    // */ // ALEK: This is really optional as prefix in end tag MUST correspond to start tag but good for error checking // XmlSerializer endTag (String prefix, String namespace, String name) // throws IOException, IllegalArgumentException, IllegalStateException; /** * Writes text, where special XML chars are escaped automatically */ XmlSerializer text (String text) throws IOException, IllegalArgumentException, IllegalStateException; /** * Writes text, where special XML chars are escaped automatically */ XmlSerializer text (char [] buf, int start, int len) throws IOException, IllegalArgumentException, IllegalStateException; void cdsect (String text) throws IOException, IllegalArgumentException, IllegalStateException; void entityRef (String text) throws IOException, IllegalArgumentException, IllegalStateException; void processingInstruction (String text) throws IOException, IllegalArgumentException, IllegalStateException; void comment (String text) throws IOException, IllegalArgumentException, IllegalStateException; void docdecl (String text) throws IOException, IllegalArgumentException, IllegalStateException; void ignorableWhitespace (String text) throws IOException, IllegalArgumentException, IllegalStateException; /** * Write all pending output to the stream. * If method startTag() or attribute() was called then start tag is closed (final >) * before flush() is called on underlying output stream. * *

    NOTE: if there is need to close start tag * (so no more attribute() calls are allowed) but without flushinging output * call method text() with empty string (text("")). * */ void flush () throws IOException; } xpp3-1.1.4c/src/java/builder/javax/xml/namespace/QName.java100644 0 0 21435 10525225063 22543 0ustaraslomewww 0 0 /* * The Apache Software License, Version 1.1 * * * Copyright (c) 2001-2003 The Apache Software Foundation. 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 following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Axis" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * 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 APACHE SOFTWARE FOUNDATION 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. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . */ package javax.xml.namespace; import java.io.IOException; import java.io.ObjectInputStream; import java.io.Serializable; /** * NOTE: copied from Apache AXIS until QName is really standard in some JDK version ... * * QName class represents the value of a qualified name * as specified in XML * Schema Part2: Datatypes specification. *

    * The value of a QName contains a namespaceURI, a localPart and a prefix. * The localPart provides the local part of the qualified name. The * namespaceURI is a URI reference identifying the namespace. * * @version 1.1 */ public class QName implements Serializable { /** comment/shared empty string */ private static final String emptyString = "".intern(); /** Field namespaceURI */ private String namespaceURI; /** Field localPart */ private String localPart; /** Field prefix */ private String prefix; /** * Constructor for the QName. * * @param localPart Local part of the QName */ public QName(String localPart) { this(emptyString, localPart, emptyString); } /** * Constructor for the QName. * * @param namespaceURI Namespace URI for the QName * @param localPart Local part of the QName. */ public QName(String namespaceURI, String localPart) { this(namespaceURI, localPart, emptyString); } /** * Constructor for the QName. * * @param namespaceURI Namespace URI for the QName * @param localPart Local part of the QName. * @param prefix Prefix of the QName. */ public QName(String namespaceURI, String localPart, String prefix) { this.namespaceURI = (namespaceURI == null) ? emptyString : namespaceURI.intern(); if (localPart == null) { throw new IllegalArgumentException("invalid QName local part"); } else { this.localPart = localPart.intern(); } if (prefix == null) { throw new IllegalArgumentException("invalid QName prefix"); } else { this.prefix = prefix.intern(); } } /** * Gets the Namespace URI for this QName * * @return Namespace URI */ public String getNamespaceURI() { return namespaceURI; } /** * Gets the Local part for this QName * * @return Local part */ public String getLocalPart() { return localPart; } /** * Gets the Prefix for this QName * * @return Prefix */ public String getPrefix() { return prefix; } /** * Returns a string representation of this QName * * @return a string representation of the QName */ public String toString() { return ((namespaceURI == emptyString) ? localPart : '{' + namespaceURI + '}' + localPart); } /** * Tests this QName for equality with another object. *

    * If the given object is not a QName or is null then this method * returns false. *

    * For two QNames to be considered equal requires that both * localPart and namespaceURI must be equal. This method uses * String.equals to check equality of localPart * and namespaceURI. Any class that extends QName is required * to satisfy this equality contract. *

    * This method satisfies the general contract of the Object.equals method. * * @param obj the reference object with which to compare * * @return true if the given object is identical to this * QName: false otherwise. */ public final boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof QName)) { return false; } if ((namespaceURI == ((QName) obj).namespaceURI) && (localPart == ((QName) obj).localPart)) { return true; } return false; } /** * Returns a QName holding the value of the specified String. *

    * The string must be in the form returned by the QName.toString() * method, i.e. "{namespaceURI}localPart", with the "{namespaceURI}" * part being optional. *

    * This method doesn't do a full validation of the resulting QName. * In particular, it doesn't check that the resulting namespace URI * is a legal URI (per RFC 2396 and RFC 2732), nor that the resulting * local part is a legal NCName per the XML Namespaces specification. * * @param s the string to be parsed * @throws java.lang.IllegalArgumentException If the specified String cannot be parsed as a QName * @return QName corresponding to the given String */ public static QName valueOf(String s) { if ((s == null) || s.equals("")) { throw new IllegalArgumentException("invalid QName literal"); } if (s.charAt(0) == '{') { int i = s.indexOf('}'); if (i == -1) { throw new IllegalArgumentException("invalid QName literal"); } if (i == s.length() - 1) { throw new IllegalArgumentException("invalid QName literal"); } else { return new QName(s.substring(1, i), s.substring(i + 1)); } } else { return new QName(s); } } /** * Returns a hash code value for this QName object. The hash code * is based on both the localPart and namespaceURI parts of the * QName. This method satisfies the general contract of the * Object.hashCode method. * * @return a hash code value for this Qname object */ public final int hashCode() { return namespaceURI.hashCode() ^ localPart.hashCode(); } /** * Ensure that deserialization properly interns the results. * @param in the ObjectInputStream to be read */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); namespaceURI = namespaceURI.intern(); localPart = localPart.intern(); prefix = prefix.intern(); } } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/Iterable.java100644 0 0 553 10525225063 23622 0ustaraslomewww 0 0 package org.xmlpull.v1.builder; import java.util.Iterator; //JDK15 remove and replace usage with real Iterable /** * Use java.lang.Iterable instead when JDK 1.5 comes out ...* * * @version $Revision: 1.3 $ * @author Aleksander Slominski */ public interface Iterable { public Iterator iterator(); } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/XmlAttribute.java100644 0 0 3034 10525225063 24534 0ustaraslomewww 0 0 package org.xmlpull.v1.builder; /** * This is immutable value object that represents * Attribute * Information Item * with exception of references property. * Note: namespace and prefix properties are folded into XmlNamespace value object. * * @version $Revision: 1.6 $ * @author Aleksander Slominski */ public interface XmlAttribute extends Cloneable { /** * Method clone * * @return an Object * * @exception CloneNotSupportedException * */ public Object clone() throws CloneNotSupportedException; /** * XML Infoset [owner element] property */ public XmlElement getOwner(); //public XmlElement setOwner(XmlElement newOwner); //public String getPrefix(); /** * return XML Infoset [namespace name] property (namespaceName from getNamespace() * or null if attribute has no namespace */ public String getNamespaceName(); /** * Combination of XML Infoset [namespace name] and [prefix] properties */ public XmlNamespace getNamespace(); /** * XML Infoset [local name] property */ public String getName(); /** * XML Infoset [normalized value] property */ public String getValue(); /** * XML Infoset [attribute type] */ public String getType(); /** * XML Infoset [specified] flag */ public boolean isSpecified(); } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/XmlBuilderException.java100644 0 0 3434 10525225063 26042 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package org.xmlpull.v1.builder; /** * This exception is thrown to signal XB1 related exceptions. * * @version $Revision: 1.2 $ * @author Aleksander Slominski */ public class XmlBuilderException extends RuntimeException { protected Throwable detail; //protected int row = -1; //protected int column = -1; public XmlBuilderException(String s) { super(s); } public XmlBuilderException(String s, Throwable thrwble) { super(s); this.detail = thrwble; } public Throwable getDetail() { return detail; } // public void setDetail(Throwable cause) { this.detail = cause; } public String getMessage() { if(detail == null) return super.getMessage(); else return super.getMessage() + "; nested exception is: \n\t" + detail.getMessage(); } public void printStackTrace(java.io.PrintStream ps) { if (detail == null) { super.printStackTrace(ps); } else { synchronized(ps) { //ps.println(this); ps.println(super.getMessage() + "; nested exception is:"); detail.printStackTrace(ps); } } } public void printStackTrace() { printStackTrace(System.err); } public void printStackTrace(java.io.PrintWriter pw){ if (detail == null) { super.printStackTrace(pw); } else { synchronized(pw) { //pw.println(this); pw.println(super.getMessage() + "; nested exception is:"); detail.printStackTrace(pw); } } } } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/XmlCharacters.java100644 0 0 1020 10525225063 24641 0ustaraslomewww 0 0 package org.xmlpull.v1.builder; /** * Represents otrdered colection of * Character Information Items * where character code properties are put together into Java String. * * @version $Revision: 1.5 $ * @author Aleksander Slominski */ public interface XmlCharacters extends XmlContained { public String getText(); public Boolean isWhitespaceContent(); //public XmlElement getParent(); } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/XmlComment.java100644 0 0 1136 10525225063 24174 0ustaraslomewww 0 0 package org.xmlpull.v1.builder; /** * Represents * Comment Information Item. * * * @version $Revision: 1.5 $ * @author Aleksander Slominski */ public interface XmlComment //extends XmlContainer { /** * A string representing the content of the comment. */ public String getContent(); /** * The document or element information item which contains this information item * in its [children] property. */ public XmlContainer getParent(); } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/XmlContained.java100644 0 0 1160 10525225063 24473 0ustaraslomewww 0 0 package org.xmlpull.v1.builder; /** * Common abstraction to represent XML infoset item that are contained in other infoet items * This is useful so parent can be updated on contained items when container is cloned ... * * @version $Revision: 1.3 $ * @author Aleksander Slominski */ public interface XmlContained { //Object getPrent() -- requires covariant return to work both in /// XmlElement (returns XmlContainer) and XmlComment (returns XmlContainer) ... public XmlContainer getParent(); public void setParent(XmlContainer el); } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/XmlContainer.java100644 0 0 646 10525225063 24501 0ustaraslomewww 0 0 package org.xmlpull.v1.builder; /** * Common abstraction shared between XmlElement, XmlDocument and XmlDoctype * to represent XML Infoset item that can contain other Infoset items * This is useful so getParent() operation will return this instead of Object ... * * @version $Revision: 1.4 $ * @author Aleksander Slominski */ public interface XmlContainer { } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/XmlDoctype.java100644 0 0 3737 10525225063 24212 0ustaraslomewww 0 0 package org.xmlpull.v1.builder; import java.util.Iterator; /** * Represents * Document Type Declaration * Information Item. * If the XML document has a document type declaration, * then the information set contains a single document type declaration information item. * Note that entities and notations are provided as properties of the document information item, * not the document type declaration information item. * * @version $Revision: 1.2 $ * @author Aleksander Slominski */ public interface XmlDoctype extends XmlContainer { /** * The system identifier of the external subset, as it appears in the DOCTYPE declaration, * without any additional URI escaping applied by the processor. * If there is no external subset this property has no value. */ public String getSystemIdentifier(); /** * The public identifier of the external subset, normalized as described in * 4.2.2 External Entities [XML]. * If there is no external subset or if it has no public identifier, * this property has no value. */ public String getPublicIdentifier(); /** * An ordered list of processing instruction information items representing processing * instructions appearing in the DTD, in the original document order. * Items from the internal DTD subset appear before those in the external subset. */ public Iterator children(); /** * The document information item. */ public XmlDocument getParent(); // manipulate children /** * Add to list of children (only processing instruction information items are allowed). */ public XmlProcessingInstruction addProcessingInstruction(String target, String content); /** * Remove all children. */ public void removeAllProcessingInstructions(); } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/XmlDocument.java100644 0 0 6402 10525225063 24351 0ustaraslomewww 0 0 package org.xmlpull.v1.builder; /** * Represents * Document Information Item * . * * @version $Revision: 1.6 $ * @author Aleksander Slominski */ public interface XmlDocument extends XmlContainer, Cloneable { //JDK15 covariant public XmlDocument clone() throws CloneNotSupportedException public Object clone() throws CloneNotSupportedException; /** * An ordered list of child information items, in document order. * The list contains exactly one element information item. * The list also contains one processing instruction information item * for each processing instruction outside the document element, * and one comment information item for each comment outside the document element. * Processing instructions and comments within the DTD are excluded. * If there is a document type declaration, * the list also contains a document type declaration information item. */ public Iterable children(); public XmlElement getDocumentElement(); public XmlElement requiredElement(XmlNamespace n, String name); public XmlElement element(XmlNamespace n, String name); public XmlElement element(XmlNamespace n, String name, boolean create); /** * An unordered set of notation information items, * one for each notation declared in the DTD. */ public Iterable notations(); /** * An unordered set of unparsed entity information items, * one for each unparsed entity declared in the DTD. */ public Iterable unparsedEntities(); public String getBaseUri(); public String getCharacterEncodingScheme(); public void setCharacterEncodingScheme(String characterEncoding); public Boolean isStandalone(); public String getVersion(); //public String setVersion(); public boolean isAllDeclarationsProcessed(); // manipulate children public void setDocumentElement(XmlElement rootElement); public void addChild(Object child); public void insertChild(int pos, Object child); //removeChild public void removeAllChildren(); public XmlComment newComment(String content); public XmlComment addComment(String content); public XmlDoctype newDoctype(String systemIdentifier, String publicIdentifier); public XmlDoctype addDoctype(String systemIdentifier, String publicIdentifier); //public XmlElement newDocumentElement(String name); public XmlElement addDocumentElement(String name); public XmlElement addDocumentElement(XmlNamespace namespace, String name); public XmlProcessingInstruction newProcessingInstruction(String target, String content); public XmlProcessingInstruction addProcessingInstruction(String target, String content); //addDoctype // manipulate unparsed entities //addUnparsedEntity public void removeAllUnparsedEntities(); // manipulate notations public XmlNotation addNotation(String name, String systemIdentifier, String publicIdentifier, String declarationBaseUri); public void removeAllNotations(); } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/XmlElement.java100644 0 0 41776 10525225063 24221 0ustaraslomewww 0 0 package org.xmlpull.v1.builder; import java.util.Iterator; //setText() instead of replaceChildrenWithText //setAttribute*() instead of addAtrribute*() //TODO add method attributeValue( "id" ); //TODO add method requiredAttribute( "id" ); //TODO add method requiredAttributeValue( "id" ); //TODO setAttributeValue(key, value) //create attribute if necessary //TODO setAttributeValue(attribute) //replace exisiting attribute if necessary //TODO add XmlElement requiredFirstElement() in Adapter? //TODO add XmlElement requiredOneElement() in AdpateR? /** * Represents * Element Information Item * except for in-scope namespaces that can be reconstructed by visiting this element parent, * checking its namespaces, then grandparent and so on. For convenience there are * methods to resolve namespace prefix for given namespace name. * *
    NOTE: this representaiton is optimized for streaming - iterator approach that * allows gradual visiting of nodes is preferred over indexed access. * * @version $Revision: 1.25 $ * @author Aleksander Slominski */ public interface XmlElement extends XmlContainer, XmlContained, Cloneable { public static final String NO_NAMESPACE = ""; //JDK15 covariant public XmlElement clone() throws CloneNotSupportedException /** * Method clone * * @return an Object * * @exception CloneNotSupportedException * */ public Object clone() throws CloneNotSupportedException; //---------------------------------------------------------------------------------------------- // Element properties /** * XML Infoset [base URI] property * * @return a String * */ public String getBaseUri(); /** * XML Infoset [base URI] property * * @param baseUri a String * */ public void setBaseUri(String baseUri); /** * Get top most container that is either XmlDocument or XmlElement (may be event this element!!!) */ public XmlContainer getRoot(); /** * XML Infoset [parent] property. * If current element is not child of containing parent XmlElement or XmlDocument * then builder exception will be thrown */ public XmlContainer getParent(); /** * Method setParent * * @param parent a XmlContainer * */ public void setParent(XmlContainer parent); /** * Return namespace of current element * (XML Infoset [namespace name] and [prefix] properties combined) * null is only returned if * element was created without namespace * */ public XmlNamespace getNamespace(); /** * Return namespace name (XML Infoset [namespace name]property * or null if element has no namespace */ public String getNamespaceName(); /** * Set namespace ot use for theis element. * Note: namespace prefix is always ignored. */ public void setNamespace(XmlNamespace namespace); // public String getPrefix(); // public void setPrefix(String prefix); /** * XML Infoset [local name] property. * * @return a String * */ public String getName(); /** * XML Infoset [local name] property. * * @param name a String * */ public void setName(String name); //---------------------------------------------------------------------------------------------- // Attributes management //JDK15 Iterable /** Return Iterator - null is never returned if there is no children then iteraotr over empty collection is returned */ public Iterator attributes(); /** * Add attribute (adds it to the XML Infoset [namespace attributes] set) * Attribute mist * * @param attributeValueToAdd a XmlAttribute * * @return a XmlAttribute * */ public XmlAttribute addAttribute(XmlAttribute attributeValueToAdd); /** * addAttribute * * @param name a String * @param value a String * * @return a XmlAttribute * */ public XmlAttribute addAttribute(String name, String value); /** * Method addAttribute * * @param namespace a XmlNamespace * @param name a String * @param value a String * * @return a XmlAttribute * */ public XmlAttribute addAttribute(XmlNamespace namespace, String name, String value); /** * Method addAttribute * * @param type a String * @param namespace a XmlNamespace * @param name a String * @param value a String * * @return a XmlAttribute * */ public XmlAttribute addAttribute(String type, XmlNamespace namespace, String name, String value); /** * Method addAttribute * * @param type a String * @param namespace a XmlNamespace * @param name a String * @param value a String * @param specified a boolean * * @return a XmlAttribute * */ public XmlAttribute addAttribute(String type, XmlNamespace namespace, String name, String value, boolean specified); /** * Method addAttribute * * @param attributeType a String * @param attributePrefix a String * @param attributeNamespace a String * @param attributeName a String * @param attributeValue a String * @param specified a boolean * * @return a XmlAttribute * */ public XmlAttribute addAttribute(String attributeType, String attributePrefix, String attributeNamespace, String attributeName, String attributeValue, boolean specified); /** * Method ensureAttributeCapacity * * @param minCapacity an int * */ public void ensureAttributeCapacity(int minCapacity) ; //TODO add attributeValue(name) //TODO add attributeValue(XmlNamespace, name) /** * Method getAttributeValue * * @param attributeNamespaceNamea String * @param attributeName a String * * @return a String * */ public String getAttributeValue(String attributeNamespaceName, String attributeName); /** * Find attribute that matches given name or namespace * Returns null if not found. * Will match only attribute that have no namesapce. */ public XmlAttribute attribute(String attributeName); /** * Find attribute that matches given name or namespace * Returns null if not found. * NOTE: if namespace is null in this case it will match only * attributes that have no namespace. * */ public XmlAttribute attribute(XmlNamespace attributeNamespaceName, String attributeName); /** * Find attribute that matches given name or namespace * Returns null if not found. * NOTE: if namespace is null in this case it will match only * attributes that has no namespace. * @deprecated Use attribute() */ public XmlAttribute findAttribute(String attributeNamespaceName, String attributeName); /** * Method hasAttributes * * @return a boolean * */ public boolean hasAttributes(); /** * Method removeAttribute * * @param attr a XmlAttribute * */ public void removeAttribute(XmlAttribute attr); /** * Method removeAllAttributes * */ public void removeAllAttributes(); //---------------------------------------------------------------------------------------------- // Namespaces management //JDK15 Iterable /** Return Iterator - null is never returned if there is no children then iteraotr over empty collection is returned */ public Iterator namespaces(); /** * Create new namespace with prefix and namespace name (both must be not null) * and add it to current element. */ public XmlNamespace declareNamespace(String prefix, String namespaceName); /** * Add namespace to current element (both prefix and namespace name must be not null) */ public XmlNamespace declareNamespace(XmlNamespace namespace); /** * Method ensureNamespaceDeclarationsCapacity * * @param minCapacity an int * */ public void ensureNamespaceDeclarationsCapacity(int minCapacity); /** * Method hasNamespaceDeclarations * * @return a boolean * */ public boolean hasNamespaceDeclarations(); /** * Find namespace (will have non empty prefix) corresponding to namespace prefix * checking first current elemen and if not found continue in parent (if element has parent) * and so on. */ public XmlNamespace lookupNamespaceByPrefix(String namespacePrefix); /** * Find namespace (will have non empty prefix) corresponding to namespace name * checking first current elemen and if not found continue in parent (if element has parent). * and so on. */ public XmlNamespace lookupNamespaceByName(String namespaceName); /** * Create new namespace with null prefix (namespace name must be not null). */ public XmlNamespace newNamespace(String namespaceName); /** * Create new namespace with prefix and namespace name (both must be not null). */ public XmlNamespace newNamespace(String prefix, String namespaceName); /** * Method removeAllNamespaceDeclarations * */ public void removeAllNamespaceDeclarations(); //---------------------------------------------------------------------------------------------- // Children management (element content) //JDK15 Iterable /** Return Iterator - null is never returned if there is no children then iteraotr over empty collection is returned */ public Iterator children(); /** * NOTE: =child added is _not_ checked if it XmlContainer, caller must manually fix * parent in child by calling setParent() !!!! */ public void addChild(Object child); /** * Method addChild * * @param pos an int (starting from 0) * @param child an Object * */ public void addChild(int pos, Object child); /** * NOTE: the child element must unattached to be added * (it is atttached if it is XmlContainer of recognized type and getParent() != null) */ public XmlElement addElement(XmlElement el); /** * Method addElement * * @param pos an int (starting from 0) * @param child a XmlElement * * @return a XmlElement * */ public XmlElement addElement(int pos, XmlElement child); /** * Method addElement * * @param name a String * * @return a XmlElement * */ public XmlElement addElement(String name); /** * Method addElement * * @param namespace a XmlNamespace * @param name a String * * @return a XmlElement * */ public XmlElement addElement(XmlNamespace namespace, String name); /** * Method hasChildren * * @return a boolean * */ public boolean hasChildren(); /** * Method hasChild * * @param child an Object * * @return a boolean * */ public boolean hasChild(Object child); /** * Method ensureChildrenCapacity * * @param minCapacity an int * */ public void ensureChildrenCapacity(int minCapacity); /** * @deprecated see element() */ public XmlElement findElementByName(String name); /** * @deprecated see element() */ public XmlElement findElementByName(String namespaceName, String name); /** * @deprecated see elements() */ public XmlElement findElementByName(String name, XmlElement elementToStartLooking); /** * @deprecated see elements() */ public XmlElement findElementByName(String namespaceName, String name, XmlElement elementToStartLooking); /** * return element at poition (0..count-1) or IndexOutOfBoundsException if positon incorrect */ public XmlElement element(int position); //int count() //int countElement() //XmlElement element(String name) //return first element matching, null if not found! /** * call element(n, name) and if null was returnedthrow XmlBuilderException */ public XmlElement requiredElement(XmlNamespace n, String name) throws XmlBuilderException; /** * find first element with name and namespace (if namespace is null it is ignored in search) * */ public XmlElement element(XmlNamespace n, String name); /** * find first element with name and namespace (if namespace is null it is ignored in search) * if no matching element is found then new element is created, appended to children, and returned * */ public XmlElement element(XmlNamespace n, String name, boolean create); //Iterable elements(String name); //Iterable elements(XmlNamespace n, String name); /** Return all elements that has namespace and name (null is never returned but empty iteraotr) */ public Iterable elements(XmlNamespace n, String name); public void insertChild(int pos, Object childToInsert); /** * Create unattached element */ public XmlElement newElement(String name); /** * Method newElement * * @param namespace a XmlNamespace * @param name a String * * @return a XmlElement * */ public XmlElement newElement(XmlNamespace namespace, String name); /** * Method newElement * * @param namespaceName a String * @param name a String * * @return a XmlElement * */ public XmlElement newElement(String namespaceName, String name); /** * Removes all children - every child that was * implementing XmlNode will have set parent to null. */ public void removeAllChildren(); /** * Method removeChild * * @param child an Object * */ public void removeChild(Object child); /** * Method replaceChild * * @param newChild an Object * @param oldChild an Object * */ public void replaceChild(Object newChild, Object oldChild); //public void remove(int pos); //public void set(int index, Object child); //---------------------------------------------------------------------------------------------- // Utility methods to make manipulating Infoset easier for typical use cases //JDK15 Iterable /** Return Iterator - that represents all XmlElement content. * When used exception will be thrown if non white space children are found * (as expected no mixed content!). */ public Iterable requiredElementContent(); /**return children content as text - if there are any no text children throw exception */ public String requiredTextContent(); /** * Remove all children and then add this text as only child. */ public void replaceChildrenWithText(String textContent); //public Iterable elementsContent(); //public Iterable elementsContent(String name); //public Iterable elementsContent(XmlNamespace n String name); //String text() //children must map to text only nodes!!! //public String requiredTextContent(); //selectNodes(String xpath) //public XmlNamespace getNamespacePrefix(String namespaceName, boolean generate) //public XmlNamespace findNamespace(String prefix, String namespace) /** it may need to reconsruct whole subtree to get count ... */ //public int getChildrenCount(); //public Object getFirstChild() throws XmlPullParserException; //public Object getNextSibling() throws XmlPullParserException; //public Object getChildByName(String namespace, String name); } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/XmlInfosetBuilder.java100644 0 0 42453 10525225063 25537 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package org.xmlpull.v1.builder; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.Reader; import java.io.StringWriter; import java.io.Writer; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlSerializer; import org.xmlpull.v1.builder.impl.XmlInfosetBuilderImpl; // private XmlInfosetBuilder builder = XmlInfosetBuilder.newInstance(); // (XmlPullParser) // builder.setUseAllTokens(true) //comments, PIs, doctype // setIgnoreComments // setIgnoreProcessingInstructions // builder.setNamespaceAware(true) // builder.setBuildCompleteTree(true) // builder.setWrapCharacters(true) // XmlDocument doc = builder.parseUrl( url ); /** * By default builder is using non-validating pull parser with next() method * without namespaces to build tree consisting only of XmlDocument, XmlElemenet * and String nodes. Additional options are available to change builder behaviour * and to generate any deseired subset of * XML Information Set * * @version $Revision: 1.8 $ * @author Aleksander Slominski */ public abstract class XmlInfosetBuilder { protected XmlPullParserFactory factory; /** * Create a new instance of the builder. */ public static XmlInfosetBuilder newInstance() throws XmlBuilderException { XmlInfosetBuilder impl = new XmlInfosetBuilderImpl(); try { impl.factory = XmlPullParserFactory.newInstance( System.getProperty(XmlPullParserFactory.PROPERTY_NAME), null); impl.factory.setNamespaceAware(true); } catch(XmlPullParserException ex) { throw new XmlBuilderException("could not create XmlPull factory:"+ex, ex); } return impl; } public static XmlInfosetBuilder newInstance(XmlPullParserFactory factory) throws XmlBuilderException { if(factory == null) throw new IllegalArgumentException(); XmlInfosetBuilder impl = new XmlInfosetBuilderImpl(); impl.factory = factory; //try { impl.factory.setNamespaceAware(true); //} catch(XmlPullParserException ex) { // throw new XmlBuilderException("could not create XmlPull factory:"+ex, ex); //} return impl; } /** * Method get XmlPull factory that is ued by this builder. */ public XmlPullParserFactory getFactory() throws XmlBuilderException {return factory; } // --- create directly\ /** * Create a new document. */ public XmlDocument newDocument() throws XmlBuilderException { return newDocument(null, null, null); } /** * Create a new document with given XML prolog. * * @param version a String * @param standalone a Boolean * @param characterEncoding a String * * @return a XmlDocument * * @exception XmlBuilderException * */ public abstract XmlDocument newDocument(String version, Boolean standalone, String characterEncoding) throws XmlBuilderException; /** * Create XML fragment that is not associated with any document. * * @param elementName name of element * * @return a XmlElement * * @exception XmlBuilderException * */ public abstract XmlElement newFragment(String elementName) throws XmlBuilderException; /** * Create XML fragment that is not associated with any document. * * @param elementNamespace namespace of element * @param elementName name of element * * @return a XmlElement * * @exception XmlBuilderException * */ public abstract XmlElement newFragment(String elementNamespace, String elementName) throws XmlBuilderException; /** * Create XML fragment that is not associated with any document. * * @param elementNamespace a XmlNamespace * @param elementName a String * * @return a XmlElement * * @exception XmlBuilderException * */ public abstract XmlElement newFragment(XmlNamespace elementNamespace, String elementName) throws XmlBuilderException; /** * Create a new namespace that is not associated with any XML document. * * @param namespaceName a String * * @return a XmlNamespace * * @exception XmlBuilderException * */ public abstract XmlNamespace newNamespace(String namespaceName) throws XmlBuilderException; /** * Create a new namespace that is not associated with any XML document. * * @param prefix a String * @param namespaceName a String * * @return a XmlNamespace * * @exception XmlBuilderException * */ public abstract XmlNamespace newNamespace(String prefix, String namespaceName) throws XmlBuilderException; // --- parsing //public abstract XmlElement newFragment(String elementNamespace, String elementName, XmlNamespace[] context); //public abstract XmlElement parse(XmlPullParser sourceForNode,boolean addAllNamespaces); /** * Parse document - parser must be in START_DOCUMENT state. */ public abstract XmlDocument parse(XmlPullParser sourceForDocument) throws XmlBuilderException; /** * Will convert current parser state into event rerpresenting XML infoset item:
      *
    • START_Document: XmlDocument without root element *
    • START_TAG: XmlElement without children *
    • TEXT: String or XmlCHaracters depending on builder mode *
    • additiona states to corresponding XML infoset items (when implemented!) *
    */ public abstract Object parseItem(XmlPullParser pp) throws XmlBuilderException; /** * Parser must be on START_TAG and this method will convert START_TAG content into * XmlELement. Parser location is not chnaged. */ public abstract XmlElement parseStartTag(XmlPullParser pp) throws XmlBuilderException; /** * Parse input stream to create XML document. * * @param is an InputStream * * @return a XmlDocument * * @exception XmlBuilderException * */ public XmlDocument parseInputStream(InputStream is) throws XmlBuilderException { XmlPullParser pp = null; try { pp = factory.newPullParser(); pp.setInput(is, null); //set options ... } catch (XmlPullParserException e) { throw new XmlBuilderException("could not start parsing input stream", e); } return parse(pp); } /** * Parse input stream to create XML document using specified encoding. * * @param is an InputStream * @param encoding a String * * @return a XmlDocument * * @exception XmlBuilderException * */ public XmlDocument parseInputStream(InputStream is, String encoding) throws XmlBuilderException { XmlPullParser pp = null; try { pp = factory.newPullParser(); pp.setInput(is, encoding); //set options ... } catch (XmlPullParserException e) { throw new XmlBuilderException("could not start parsing input stream (encoding="+encoding+")", e); } return parse(pp); } /** * Parse reader to create XML document. * * @param reader a Reader * * @return a XmlDocument * * @exception XmlBuilderException * */ public XmlDocument parseReader(Reader reader) throws XmlBuilderException { XmlPullParser pp = null; try { pp = factory.newPullParser(); pp.setInput(reader); //set options ... } catch (XmlPullParserException e) { throw new XmlBuilderException("could not start parsing input from reader", e); } return parse(pp); } /** * Parse input from URL location to create XML document. * * @param locationUrl a String * * @return a XmlDocument * * @exception XmlBuilderException * */ public abstract XmlDocument parseLocation(String locationUrl) throws XmlBuilderException; /** * Parse fragment - parser must be on START_TAG. After parsing is on corresponding END_TAG. */ public abstract XmlElement parseFragment(XmlPullParser sourceForXml) throws XmlBuilderException; /** * Parse input stream to create XML fragment. * * @param is an InputStream * * @return a XmlElement * * @exception XmlBuilderException * */ public XmlElement parseFragmentFromInputStream(InputStream is) throws XmlBuilderException { XmlPullParser pp = null; try { pp = factory.newPullParser(); pp.setInput(is, null); //set options ... try { pp.nextTag(); } catch (IOException e) { throw new XmlBuilderException( "IO error when starting to parse input stream", e); } } catch (XmlPullParserException e) { throw new XmlBuilderException("could not start parsing input stream", e); } return parseFragment(pp); } /** * Parse input stream to create XML fragment using specified encoding. * * @param is an InputStream * @param encoding a String * * @return a XmlElement * * @exception XmlBuilderException * */ public XmlElement parseFragementFromInputStream(InputStream is, String encoding) throws XmlBuilderException { XmlPullParser pp = null; try { pp = factory.newPullParser(); pp.setInput(is, encoding); //set options ... try { pp.nextTag(); } catch (IOException e) { throw new XmlBuilderException( "IO error when starting to parse input stream (encoding="+encoding+")", e); } } catch (XmlPullParserException e) { throw new XmlBuilderException("could not start parsing input stream (encoding="+encoding+")", e); } return parseFragment(pp); } /** * Parse reader to create XML fragment. * * @param reader a Reader * * @return a XmlElement * * @exception XmlBuilderException * */ public XmlElement parseFragmentFromReader(Reader reader) throws XmlBuilderException { XmlPullParser pp = null; try { pp = factory.newPullParser(); pp.setInput(reader); //set options ... try { pp.nextTag(); } catch (IOException e) { throw new XmlBuilderException( "IO error when starting to parse from reader", e); } } catch (XmlPullParserException e) { throw new XmlBuilderException("could not start parsing input from reader", e); } return parseFragment(pp); } /** * Move parser from START_TAG to the corresponding END_TAG which means * that XML sub tree is skipped. * * @param pp a XmlPullParser * * @exception XmlBuilderException * */ public void skipSubTree(XmlPullParser pp) throws XmlBuilderException { try { pp.require(XmlPullParser.START_TAG, null, null); int level = 1; while(level > 0) { int eventType = pp.next(); if(eventType == XmlPullParser.END_TAG) { --level; } else if(eventType == XmlPullParser.START_TAG) { ++level; } } } catch (XmlPullParserException e) { throw new XmlBuilderException("could not skip subtree", e); } catch (IOException e) { throw new XmlBuilderException("IO error when skipping subtree", e); } } // --- serialization /** * Write XML start tag with information provided in XML element. * * @param el a XmlElement * @param ser a XmlSerializer * * @exception XmlBuilderException * */ public abstract void serializeStartTag(XmlElement el, XmlSerializer ser) throws XmlBuilderException; /** * Write XML end tag with information provided in XML element. * * @param el a XmlElement * @param ser a XmlSerializer * * @exception XmlBuilderException * */ public abstract void serializeEndTag(XmlElement el, XmlSerializer ser) throws XmlBuilderException; /** * Serialize XML infoset item including serializing of children. * If item is Collection all items in collection are serialized by * recursively calling this function. * This method assumes that item is either interface defined in XB1 API, class String, * or that item implements XmlSerializable otherwise IllegalArgumentException * is thrown. */ public abstract void serialize(Object item, XmlSerializer serializer) throws XmlBuilderException; //throws XmlPullParserException, IOException, IllegalArgumentException; /** * Serialize XML infoset item without serializing any of children. * This method assumes that item is either interface defined in XB1 API, class String, * or item that implements XmlSerializable otherwise IllegalArgumentException * is thrown. */ public abstract void serializeItem(Object item, XmlSerializer serializer) throws XmlBuilderException; /** * Serialize item using default UTF8 encoding. * * @see serializeItem */ public void serializeToOutputStream(Object item, //XmlContainer node, OutputStream os) throws XmlBuilderException //throws XmlPullParserException, IOException, IllegalArgumentException { serializeToOutputStream(item, os, "UTF8"); } /** * Serialize item to given output stream using given character encoding. * * @param item an Object * @param os an OutputStream * @param encoding a String * * @exception XmlBuilderException * * @see serializeItem * */ public void serializeToOutputStream(Object item, //XmlContainer node, OutputStream os, String encoding) throws XmlBuilderException //throws XmlPullParserException, IOException, IllegalArgumentException { XmlSerializer ser = null; try { ser = factory.newSerializer(); ser.setOutput(os, encoding); } catch (Exception e) { throw new XmlBuilderException("could not serialize node to output stream" +" (encoding="+encoding+")", e); } serialize(item, ser); try { ser.flush(); } catch (IOException e) { throw new XmlBuilderException("could not flush output", e); } } /** * Serialize item to given writer. * * @param item an Object * @param writer a Writer * * @exception XmlBuilderException * */ public void serializeToWriter(Object item, //XmlContainer node, Writer writer) //throws XmlPullParserException, IOException, IllegalArgumentException throws XmlBuilderException { XmlSerializer ser = null; try { ser = factory.newSerializer(); ser.setOutput(writer); } catch (Exception e) { throw new XmlBuilderException("could not serialize node to writer", e); } serialize(item, ser); try { ser.flush(); } catch (IOException e) { throw new XmlBuilderException("could not flush output", e); } } /** * Convert item into String representing XML content. * * @param item an Object * * @return a String * * @exception XmlBuilderException * */ public String serializeToString(Object item) //XmlContainer node) //throws XmlPullParserException, IOException, IllegalArgumentException throws XmlBuilderException { StringWriter sw = new StringWriter(); serializeToWriter(item, sw); return sw.toString(); } } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/XmlNamespace.java100644 0 0 1510 10525225063 24462 0ustaraslomewww 0 0 package org.xmlpull.v1.builder; /** * Represents * Namespace Information Item * . * * @version $Revision: 1.2 $ * @author Aleksander Slominski */ public interface XmlNamespace { /** * Prefix can be null. * In this case it will be looked up from XML tree * and used if available * otherwise it will be automatically created only for serializaiton. * TODO: If prefix is empty string it will be used to indicate default namespace. */ public String getPrefix(); /** * Namespace name. * Never null. * Only allowed to be empty string if prefix is also empty string * (used to undeclare default namespace) */ public String getNamespaceName(); } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/XmlNotation.java100644 0 0 2507 10525225063 24370 0ustaraslomewww 0 0 package org.xmlpull.v1.builder; /** * Represents * Notation Information Item. * There is a notation information item for each notation declared in the DTD. * * @version $Revision: 1.3 $ * @author Aleksander Slominski */ public interface XmlNotation //extends XmlContainer { /** * The name of the notation. */ public String getName(); /** * The system identifier of the notation, * as it appears in the declaration of the notation, * without any additional URI escaping applied by the processor. * If no system identifier was specified, this property has no value. */ public String getSystemIdentifier(); /** * The public identifier of the notation, normalized as described in * 4.2.2 External Entities [XML]. * If the notation has no public identifier, this property has no value. */ public String getPublicIdentifier(); //TOOD how to implement this ... /** * The base URI relative to which the system identifier should be resolved * (i.e. the base URI of the resource within which the notation declaration occurs). */ public String getDeclarationBaseUri(); } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/XmlProcessingInstruction.java100644 0 0 4104 10525225063 27146 0ustaraslomewww 0 0 package org.xmlpull.v1.builder; /** * Represents * Processing Instruction Information Item * . * There is a processing instruction information item * for each processing instruction in the document. * The XML declaration and text declarations for external parsed entities * are not considered processing instructions. * * @version $Revision: 1.3 $ * @author Aleksander Slominski */ public interface XmlProcessingInstruction //extends XmlContainer { /** * A string representing the target part of the processing instruction (an XML name). */ public String getTarget(); /** * A string representing the content of the processing instruction, * excluding the target and any white space immediately following it. * If there is no such content, the value of this property will be an empty string. */ public String getContent(); //TODO: not clear how this should be implemented ... /** * The base URI of the PI. Note that if an infoset is serialized as an XML document, * it will not be possible to preserve the base URI * of any PI that originally appeared at the top level of an external entity, * since there is no syntax for PIs corresponding to the xml:base attribute on elements. */ public String getBaseUri(); //TODO: not clear how this should be implemented ... /** * The notation information item named by the target. * If there is no declaration for a notation with that name, * this property has no value. If no declaration has been read, * but the [all declarations processed] property of the document information item is false * (so there may be an unread declaration), then the value of this property is unknown. */ public XmlNotation getNotation(); /** * The document, element, or document type definition information item * which contains this information item in its [children] property. */ public XmlContainer getParent(); } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/XmlSerializable.java100644 0 0 671 10525225063 25163 0ustaraslomewww 0 0 package org.xmlpull.v1.builder; import java.io.IOException; import org.xmlpull.v1.XmlSerializer; /** * This interface is used during serialization by XmlInfosetBuilder * for children that are not in XML infoset. * * @version $Revision: 1.4 $ * @author Aleksander Slominski */ public interface XmlSerializable { public void serialize(XmlSerializer ser) throws IOException; } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/XmlUnexpandedEntityReference.java100644 0 0 1050 10525225063 27674 0ustaraslomewww 0 0 package org.xmlpull.v1.builder; /** * Represents * Unexpanded Entity Reference * Information Item * . * * @version $Revision: 1.3 $ * @author Aleksander Slominski */ public interface XmlUnexpandedEntityReference //extends XmlContainer { public String getName(); public String getSystemIdentifier(); public String getPublicIdentifier(); public String getDeclarationBaseUri(); public XmlElement getParent(); } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/XmlUnparsedEntity.java100644 0 0 1105 10525225063 25544 0ustaraslomewww 0 0 package org.xmlpull.v1.builder; /** * Represents * Unparsed Entity * Information Item * . * * @version $Revision: 1.3 $ * @author Aleksander Slominski */ public interface XmlUnparsedEntity //extends XmlContainer { public String getName(); public String getSystemIdentifier(); public String getPublicIdentifier(); public String getDeclarationBaseUri(); public String getNotationName(); public XmlNotation getNotation(); } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/adapter/XmlAttributeAdapter.java100644 0 0 2656 10525225063 27466 0ustaraslomewww 0 0 package org.xmlpull.v1.builder.adapter; //import java.util.IdentityHashMap; import org.xmlpull.v1.builder.XmlAttribute; import org.xmlpull.v1.builder.XmlNamespace; import org.xmlpull.v1.builder.XmlElement; /** * Wraps XML attribute - allows overriding and other nice things. */ public class XmlAttributeAdapter implements XmlAttribute { private XmlAttribute target; //JDK15 covariant public XmlElementAdapter clone() throws CloneNotSupportedException; public Object clone() throws CloneNotSupportedException { XmlAttributeAdapter ela = (XmlAttributeAdapter) super.clone(); ela.target = (XmlAttribute) target.clone(); return ela; } public XmlAttributeAdapter(XmlAttribute target) { this.target = target; } public XmlElement getOwner() { return target.getOwner(); } public String getNamespaceName() { return target.getNamespaceName(); } public XmlNamespace getNamespace() { return target.getNamespace(); } public String getName() { return target.getName(); } public String getValue() { return target.getValue(); } public String getType() { return target.getType(); } public boolean isSpecified() { return target.isSpecified(); } // public void serialize(XmlSerializer ser) throws IOException { // // TODO // } } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/adapter/XmlDocumentAdapter.java100644 0 0 11337 10525225063 27315 0ustaraslomewww 0 0 package org.xmlpull.v1.builder.adapter; import org.xmlpull.v1.builder.Iterable; import org.xmlpull.v1.builder.XmlContainer; import org.xmlpull.v1.builder.XmlDocument; import org.xmlpull.v1.builder.XmlElement; import org.xmlpull.v1.builder.XmlNamespace; import org.xmlpull.v1.builder.XmlNotation; import org.xmlpull.v1.builder.XmlComment; import org.xmlpull.v1.builder.XmlProcessingInstruction; import org.xmlpull.v1.builder.XmlDoctype; /** */ public class XmlDocumentAdapter implements XmlDocument { private XmlDocument target; //JDK15 covariant public XmlElementAdapter clone() throws CloneNotSupportedException; public Object clone() throws CloneNotSupportedException { XmlDocumentAdapter ela = (XmlDocumentAdapter) super.clone(); ela.target = (XmlDocument) target.clone(); return ela; } public XmlDocumentAdapter(XmlDocument target) { this.target = target; // new "wrapping" parent replaces old parent for children fixImportedChildParent(target.getDocumentElement()); //target.setParent(null); //IdentityHashMap id = nul; } private void fixImportedChildParent(Object child) { if(child instanceof XmlElement) { XmlElement childEl = (XmlElement) child; XmlContainer childElParent = childEl.getParent(); if(childElParent == target) { childEl.setParent(this); } } } public Iterable children() { return target.children(); } public XmlElement getDocumentElement() { return target.getDocumentElement(); } public XmlElement requiredElement(XmlNamespace n, String name) { return target.requiredElement(n, name); } public XmlElement element(XmlNamespace n, String name) { return target.element(n, name); } public XmlElement element(XmlNamespace n, String name, boolean create) { return target.element(n, name, create); } public Iterable notations() { return target.notations(); } public Iterable unparsedEntities() { return target.unparsedEntities(); } public String getBaseUri() { return target.getBaseUri(); } public String getCharacterEncodingScheme() { return target.getCharacterEncodingScheme(); } public void setCharacterEncodingScheme(String characterEncoding) { target.setCharacterEncodingScheme(characterEncoding); } public Boolean isStandalone() { return target.isStandalone(); } public String getVersion() { return target.getVersion(); } public boolean isAllDeclarationsProcessed() { return target.isAllDeclarationsProcessed(); } public void setDocumentElement(XmlElement rootElement) { target.setDocumentElement(rootElement); } public void addChild(Object child) { target.addChild(child); } public void insertChild(int pos, Object child) { target.insertChild(pos, child); } public void removeAllChildren() { target.removeAllChildren(); } public XmlComment newComment(String content) { return target.newComment(content); } public XmlComment addComment(String content) { return target.addComment(content); } public XmlDoctype newDoctype(String systemIdentifier, String publicIdentifier) { return target.newDoctype(systemIdentifier, publicIdentifier); } public XmlDoctype addDoctype(String systemIdentifier, String publicIdentifier) { return target.addDoctype(systemIdentifier, publicIdentifier); } public XmlElement addDocumentElement(String name) { return target.addDocumentElement(name); } public XmlElement addDocumentElement(XmlNamespace namespace, String name) { return target.addDocumentElement(namespace, name); } public XmlProcessingInstruction newProcessingInstruction(String target, String content) { return this.target.newProcessingInstruction(target, content); } public XmlProcessingInstruction addProcessingInstruction(String target, String content) { return this.target.addProcessingInstruction(target, content); } public void removeAllUnparsedEntities() { target.removeAllUnparsedEntities(); } public XmlNotation addNotation(String name, String systemIdentifier, String publicIdentifier, String declarationBaseUri) { return target.addNotation(name, systemIdentifier, publicIdentifier, declarationBaseUri); } public void removeAllNotations() { target.removeAllNotations(); } } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/adapter/XmlElementAdapter.java100644 0 0 34546 10525225063 27137 0ustaraslomewww 0 0 package org.xmlpull.v1.builder.adapter; //import java.util.IdentityHashMap; import java.util.Iterator; import org.xmlpull.v1.builder.Iterable; import org.xmlpull.v1.builder.XmlAttribute; import org.xmlpull.v1.builder.XmlBuilderException; import org.xmlpull.v1.builder.XmlContainer; import org.xmlpull.v1.builder.XmlDocument; import org.xmlpull.v1.builder.XmlElement; import org.xmlpull.v1.builder.XmlNamespace; /** */ public class XmlElementAdapter implements XmlElement { private XmlElementAdapter topAdapter; private XmlElement target; private XmlContainer parent; public XmlElementAdapter(XmlElement target) { setTarget(target); } private void setTarget(XmlElement target) { this.target = target; if(target.getParent() != null) { // //throw new XmlBuilderException("element to wrap must have no parent to be wrapped"); //XmlContainer parent = target.getParent(); parent = target.getParent(); if(parent instanceof XmlDocument) { XmlDocument doc = (XmlDocument) parent; doc.setDocumentElement(this); } if(parent instanceof XmlElement) { XmlElement parentEl = (XmlElement) parent; parentEl.replaceChild(this, target); } } // new "wrapping" parent replaces old parent for children Iterator iter = target.children(); while (iter.hasNext()) { Object child = iter.next(); fixImportedChildParent(child); } //target.setParent(null); //IdentityHashMap id = nul; } //JDK15 covariant public XmlElementAdapter clone() throws CloneNotSupportedException; public Object clone() throws CloneNotSupportedException { XmlElementAdapter ela = (XmlElementAdapter) super.clone(); ela.parent = null; ela.target = (XmlElement) target.clone(); return ela; } public XmlElement getTarget() { return target; } public XmlElementAdapter getTopAdapter() { return topAdapter != null ? topAdapter : this; } public void setTopAdapter(XmlElementAdapter adapter) { this.topAdapter = adapter; if(target instanceof XmlElementAdapter) { ((XmlElementAdapter)target).setTopAdapter(adapter); } } //JDK15 T castOrWrap() ?! public static XmlElementAdapter castOrWrap(XmlElement el, Class adapterClass) { if(el == null) { throw new IllegalArgumentException("null element can not be wrapped"); } if(XmlElementAdapter.class.isAssignableFrom(adapterClass) == false) { throw new IllegalArgumentException("class for cast/wrap must extend "+XmlElementAdapter.class); } if(el instanceof XmlElementAdapter) { XmlElementAdapter currentAdap = (XmlElementAdapter) el; Class currentAdapClass = currentAdap.getClass(); if(adapterClass.isAssignableFrom(currentAdapClass)) { return currentAdap; } // visit chain XmlElementAdapter topAdapter = currentAdap = currentAdap.getTopAdapter(); while(currentAdap.topAdapter != null) { currentAdapClass = currentAdap.getClass(); if(currentAdapClass.isAssignableFrom(adapterClass)) { return currentAdap; } if(currentAdap.target instanceof XmlElementAdapter) { currentAdap = (XmlElementAdapter) currentAdap.target; } else { break; } } try { // do wrapping currentAdap.topAdapter = (XmlElementAdapter) adapterClass.getConstructor(new Class[]{XmlElement.class}) .newInstance(new Object[]{topAdapter}); currentAdap.topAdapter.setTopAdapter(currentAdap.topAdapter); return currentAdap.topAdapter; } catch (Exception e) { throw new XmlBuilderException("could not create wrapper of "+adapterClass, e); } } else { // just do simple wrapping ... try { XmlElementAdapter t = (XmlElementAdapter) adapterClass.getConstructor(new Class[]{XmlElement.class}) .newInstance(new Object[]{el}); return t; } catch (Exception e) { throw new XmlBuilderException("could not wrap element "+el, e); } } } private void fixImportedChildParent(Object child) { if(child instanceof XmlElement) { XmlElement childEl = (XmlElement) child; XmlContainer childElParent = childEl.getParent(); if(childElParent == target) { childEl.setParent(this); } } } private XmlElement fixElementParent(XmlElement el) { el.setParent(this); return el; } public XmlContainer getRoot() { XmlContainer root = target.getRoot(); if(root == target) { root = this; } return root; } public XmlContainer getParent() { return parent; //target.getParent(); } public void setParent(XmlContainer parent) { this.parent = parent; //target.setParent(parent); } public XmlNamespace newNamespace(String prefix, String namespaceName) { return target.newNamespace(prefix, namespaceName); } public XmlAttribute attribute(String attributeName) { return target.attribute(attributeName); } public XmlAttribute attribute(XmlNamespace attributeNamespaceName, String attributeName) { return target.attribute(attributeNamespaceName, attributeName); } public XmlAttribute findAttribute(String attributeNamespaceName, String attributeName) { return target.findAttribute(attributeNamespaceName, attributeName); } public Iterator attributes() { return target.attributes() ; } public void removeAllChildren() { target.removeAllChildren(); } public XmlAttribute addAttribute(String attributeType, String attributePrefix, String attributeNamespace, String attributeName, String attributeValue, boolean specified) { return target.addAttribute(attributeType, attributePrefix, attributeNamespace, attributeName, attributeValue, specified); } public String getAttributeValue(String attributeNamespaceName, String attributeName) { return target.getAttributeValue(attributeNamespaceName, attributeName); } public XmlAttribute addAttribute(XmlNamespace namespace, String name, String value) { return target.addAttribute(namespace, name, value); } public String getNamespaceName() { return target.getNamespaceName(); } public void ensureChildrenCapacity(int minCapacity) { target.ensureChildrenCapacity(minCapacity); } public Iterator namespaces() { return target.namespaces(); } public void removeAllAttributes() { target.removeAllAttributes(); } public XmlNamespace getNamespace() { return target.getNamespace(); } public String getBaseUri() { return target.getBaseUri(); } public void removeAttribute(XmlAttribute attr) { target.removeAttribute(attr); } public XmlNamespace declareNamespace(String prefix, String namespaceName) { return target.declareNamespace(prefix, namespaceName); } public void removeAllNamespaceDeclarations() { target.removeAllNamespaceDeclarations(); } public boolean hasAttributes() { return target.hasAttributes(); } public XmlAttribute addAttribute(String type, XmlNamespace namespace, String name, String value, boolean specified) { return target.addAttribute(type, namespace, name, value, specified); } public XmlNamespace declareNamespace(XmlNamespace namespace) { return target.declareNamespace(namespace); } public XmlAttribute addAttribute(String name, String value) { return target.addAttribute(name, value); } public boolean hasNamespaceDeclarations() { return target.hasNamespaceDeclarations(); } public XmlNamespace lookupNamespaceByName(String namespaceName) { XmlNamespace ns = target.lookupNamespaceByName(namespaceName); if(ns == null) { // needed as parent in target may not be set correctly ... XmlContainer p = getParent(); if(p instanceof XmlElement) { XmlElement e = (XmlElement) p; return e.lookupNamespaceByName(namespaceName); } } return ns; } public XmlNamespace lookupNamespaceByPrefix(String namespacePrefix) { XmlNamespace ns = target.lookupNamespaceByPrefix(namespacePrefix); if(ns == null) { // needed as parent in target may not be set correctly ... XmlContainer p = getParent(); if(p instanceof XmlElement) { XmlElement e = (XmlElement) p; return e.lookupNamespaceByPrefix(namespacePrefix); } } return ns; } public XmlNamespace newNamespace(String namespaceName) { return target.newNamespace(namespaceName); } public void setBaseUri(String baseUri) { target.setBaseUri(baseUri); } public void setNamespace(XmlNamespace namespace) { target.setNamespace(namespace); } public void ensureNamespaceDeclarationsCapacity(int minCapacity) { target.ensureNamespaceDeclarationsCapacity(minCapacity); } // public String getPrefix() { // return target.getPrefix(); // } // // public void setPrefix(String prefix) { // target.setPrefix(prefix); // } public String getName() { return target.getName(); } public void setName(String name) { target.setName(name); } public XmlAttribute addAttribute(String type, XmlNamespace namespace, String name, String value) { return target.addAttribute(type, namespace, name, value); } public void ensureAttributeCapacity(int minCapacity) { target.ensureAttributeCapacity(minCapacity); } public XmlAttribute addAttribute(XmlAttribute attributeValueToAdd) { return target.addAttribute(attributeValueToAdd); } // --- children public XmlElement element(int position) { return target.element(position); } public XmlElement requiredElement(XmlNamespace n, String name) { return target.requiredElement(n, name); } public XmlElement element(XmlNamespace n, String name) { return target.element(n, name); } public XmlElement element(XmlNamespace n, String name, boolean create) { return target.element(n, name, create); } public Iterable elements(XmlNamespace n, String name) { return target.elements(n, name); } public XmlElement findElementByName(String name, XmlElement elementToStartLooking) { return target.findElementByName(name, elementToStartLooking); } public XmlElement newElement(XmlNamespace namespace, String name) { return target.newElement(namespace, name); } public XmlElement addElement(XmlElement child) { return fixElementParent( target.addElement(child) ); } public XmlElement addElement(int pos, XmlElement child) { return fixElementParent( target.addElement(pos, child) ); } public XmlElement addElement(String name) { return fixElementParent( target.addElement(name) ); } public XmlElement findElementByName(String namespaceName, String name) { return target.findElementByName(namespaceName, name); } public void addChild(Object child) { target.addChild(child); fixImportedChildParent(child); } public void insertChild(int pos, Object childToInsert) { target.insertChild(pos, childToInsert); fixImportedChildParent(childToInsert); } public XmlElement findElementByName(String name) { return target.findElementByName(name); } public XmlElement findElementByName(String namespaceName, String name, XmlElement elementToStartLooking) { return target.findElementByName(namespaceName, name, elementToStartLooking); } public void removeChild(Object child) { target.removeChild(child); } public Iterator children() { return target.children(); } public Iterable requiredElementContent() { return target.requiredElementContent(); } public String requiredTextContent() { return target.requiredTextContent(); } public boolean hasChild(Object child) { return target.hasChild(child); } public XmlElement newElement(String namespaceName, String name) { return target.newElement(namespaceName, name); } public XmlElement addElement(XmlNamespace namespace, String name) { return fixElementParent( target.addElement(namespace, name) ); } public boolean hasChildren() { return target.hasChildren(); } public void addChild(int pos, Object child) { target.addChild(pos, child); fixImportedChildParent(child); } public void replaceChild(Object newChild, Object oldChild) { target.replaceChild(newChild, oldChild); fixImportedChildParent(newChild); } public XmlElement newElement(String name) { return target.newElement(name); } public void replaceChildrenWithText(String textContent) { target.replaceChildrenWithText(textContent); } } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/impl/XmlAttributeImpl.java100644 0 0 6367 10525225063 26333 0ustaraslomewww 0 0 package org.xmlpull.v1.builder.impl; import org.xmlpull.v1.builder.XmlAttribute; import org.xmlpull.v1.builder.XmlElement; import org.xmlpull.v1.builder.XmlNamespace; /** * Simple implementation. * * @author Aleksander Slominski */ public class XmlAttributeImpl implements XmlAttribute { private XmlElement owner_; private String prefix_; private XmlNamespace namespace_; private String name_; private String value_; private String type_ = "CDATA"; private boolean default_; public Object clone() throws CloneNotSupportedException{ XmlAttributeImpl cloned = (XmlAttributeImpl) super.clone(); cloned.owner_ = null; // now do deep clone cloned.prefix_ = prefix_; cloned.namespace_ = namespace_; cloned.name_ = name_; cloned.value_ = value_; cloned.default_ = default_; return cloned; } XmlAttributeImpl(XmlElement owner, String name, String value) { this.owner_ = owner; this.name_ = name; if(value == null) throw new IllegalArgumentException("attribute value can not be null"); this.value_ = value; } XmlAttributeImpl(XmlElement owner, XmlNamespace namespace, String name, String value) { this(owner, name, value); this.namespace_ = namespace; } XmlAttributeImpl(XmlElement owner, String type, XmlNamespace namespace, String name, String value) { this(owner, namespace, name, value); this.type_ = type; } XmlAttributeImpl(XmlElement owner, String type, XmlNamespace namespace, String name, String value, boolean specified) { this(owner, namespace, name, value); if(type == null) { throw new IllegalArgumentException("attribute type can not be null"); } //TODO: better checking for allowed attribute types this.type_ = type; this.default_ = !specified; } public XmlElement getOwner() { return owner_; } //public String getPrefix() //{ // return prefix_; //} public XmlNamespace getNamespace() { return namespace_; } public String getNamespaceName() { return namespace_ != null ? namespace_.getNamespaceName() : null; } public String getName() { return name_; } public String getValue() { return value_; } public String getType() { return type_; } public boolean isSpecified() { return !default_; } public boolean equals(Object other) { if(other == this) return true; if(other == null) return false; if(!(other instanceof XmlAttribute)) return false; XmlAttribute otherAttr = (XmlAttribute) other; return getNamespaceName().equals(otherAttr.getNamespaceName()) && getName().equals(otherAttr.getName()) && getValue().equals(otherAttr.getValue()); } public String toString() { return "name=" + name_ + " value=" + value_; } } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/impl/XmlCommentImpl.java100644 0 0 1324 10525225063 25756 0ustaraslomewww 0 0 package org.xmlpull.v1.builder.impl; import org.xmlpull.v1.builder.XmlComment; import org.xmlpull.v1.builder.XmlContainer; /** * Simple implementation. * * @author Aleksander Slominski */ public class XmlCommentImpl implements XmlComment { private XmlContainer owner_; private String content_; XmlCommentImpl(XmlContainer owner, String content) { this.owner_ = owner; this.content_ = content; if(content == null) throw new IllegalArgumentException("comment content can not be null"); } public String getContent() { return content_; } public XmlContainer getParent() { return owner_; } } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/impl/XmlDocumentImpl.java100644 0 0 23705 10525225063 26161 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package org.xmlpull.v1.builder.impl; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.xmlpull.v1.builder.Iterable; import org.xmlpull.v1.builder.XmlBuilderException; import org.xmlpull.v1.builder.XmlComment; import org.xmlpull.v1.builder.XmlDoctype; import org.xmlpull.v1.builder.XmlDocument; import org.xmlpull.v1.builder.XmlElement; import org.xmlpull.v1.builder.XmlNamespace; import org.xmlpull.v1.builder.XmlNotation; import org.xmlpull.v1.builder.XmlProcessingInstruction; public class XmlDocumentImpl implements XmlDocument { private List children = new ArrayList(); private XmlElement root; private String version; private Boolean standalone; private String characterEncoding; public Object clone() throws CloneNotSupportedException{ XmlDocumentImpl cloned = (XmlDocumentImpl) super.clone(); // now do deep clone cloned.root = null; cloned.children = cloneList(cloned, children); int pos = cloned.findDocumentElement(); if(pos >= 0) { cloned.root = (XmlElement) cloned.children.get(pos); cloned.root.setParent(cloned); } return cloned; } private List cloneList(XmlDocumentImpl cloned, List list) throws CloneNotSupportedException { if(list == null) { return null; } List newList = new ArrayList(list.size()); //JDK15 for(Object member: list) { for (int i = 0; i < list.size(); i++) { Object member = list.get(i); Object newMember; // = null; if(member instanceof XmlElement) { XmlElement el = (XmlElement) member; newMember = el.clone(); } else if(member instanceof java.lang.Cloneable) { //use reflection to call clone() -- this is getting ugly!!!! // more background on this in http://www.artima.com/intv/issues3.html "The clone Dilemma" try { newMember = member.getClass().getMethod("clone", null).invoke(member, null); } catch (Exception e) { throw new CloneNotSupportedException("failed to call clone() on "+member+e); } } else { throw new CloneNotSupportedException("could not clone "+member+" of " +(member != null ? member.getClass().toString() : "")); } newList.add(newMember); } return newList; } public XmlDocumentImpl(String version, Boolean standalone, String characterEncoding) { this.version = version; this.standalone = standalone; this.characterEncoding = characterEncoding; } /** */ public String getVersion() { return version; } /** * */ public Boolean isStandalone() { return standalone; } /** * */ public String getCharacterEncodingScheme() { return characterEncoding; } public void setCharacterEncodingScheme(String characterEncoding) { this.characterEncoding = characterEncoding; } /** */ public XmlProcessingInstruction newProcessingInstruction(String target, String content) { // TODO throw new XmlBuilderException("not implemented"); } /** */ public XmlProcessingInstruction addProcessingInstruction(String target, String content) { // TODO throw new XmlBuilderException("not implemented"); } /** * An ordered list of child information items, in document order. * The list contains exactly one element information item. * The list also contains one processing instruction information item * for each processing instruction outside the document element, * and one comment information item for each comment outside the document element. * Processing instructions and comments within the DTD are excluded. * If there is a document type declaration, * the list also contains a document type declaration information item. */ public Iterable children() { //throw new XmlBuilderException("not implemented"); return new Iterable() { public Iterator iterator() { return children.iterator(); } }; } /** */ public void removeAllUnparsedEntities() { // TODO throw new XmlBuilderException("not implemented"); } /** */ public void setDocumentElement(XmlElement rootElement) { // replace with existing root element int pos = findDocumentElement(); if(pos >= 0) { children.set(pos, rootElement); } else { children.add(rootElement); } this.root = rootElement; rootElement.setParent(this); //TOOD: nice assertion that htere is only one XmlElement in children ... } private int findDocumentElement() { for (int i = 0; i < children.size(); i++) { Object element = children.get(i); if(element instanceof XmlElement) { return i; } } return -1; } public XmlElement requiredElement(XmlNamespace n, String name) { XmlElement el = element(n, name); if(el == null) { //TODO:CTX throw new XmlBuilderException("document does not contain element with name "+name +" in namespace "+n.getNamespaceName()); } return el; } public XmlElement element(XmlNamespace n, String name) { return element(n, name, false); } public XmlElement element(XmlNamespace namespace, String name, boolean create) { XmlElement e = getDocumentElement(); if(e == null) { return null; } String eNamespaceName = e.getNamespace() != null ? e.getNamespace().getNamespaceName() : null; if (namespace != null) { if ((name.equals(e.getName())) && (eNamespaceName != null && eNamespaceName.equals(namespace.getNamespaceName()))) { return e; } } else { if ((name.equals(e.getName())) && (eNamespaceName == null)) { return e; } } if(create) { return addDocumentElement(namespace, name); } else { return null; } } /** */ public void insertChild(int pos, Object child) { // TODO throw new XmlBuilderException("not implemented"); } /** */ public XmlComment addComment(String content) { // TODO //throw new XmlBuilderException("not implemented"); XmlComment comment = new XmlCommentImpl(this, content); children.add(comment); return comment; } /** * */ public XmlDoctype newDoctype(String systemIdentifier, String publicIdentifier) { // TODO throw new XmlBuilderException("not implemented"); } /** * An unordered set of unparsed entity information items, * one for each unparsed entity declared in the DTD. */ public Iterable unparsedEntities() { // TODO throw new XmlBuilderException("not implemented"); } /** * */ public void removeAllChildren() { // TODO throw new XmlBuilderException("not implemented"); } /** * */ public XmlComment newComment(String content) { //throw new XmlBuilderException("not implemented"); return new XmlCommentImpl(null, content); } /** * Method removeAllNotations * */ public void removeAllNotations() { // TODO throw new XmlBuilderException("not implemented"); } /** * Method addDoctype * */ public XmlDoctype addDoctype(String systemIdentifier, String publicIdentifier) { // TODO throw new XmlBuilderException("not implemented"); } /** * */ public void addChild(Object child) { // TODO throw new XmlBuilderException("not implemented"); } /** * Method addNotation * */ public XmlNotation addNotation(String name, String systemIdentifier, String publicIdentifier, String declarationBaseUri) { // TODO throw new XmlBuilderException("not implemented"); } // public XmlElement newDocumentElement(String name) { // // TODO // return null; // } /** * */ public String getBaseUri() { // TODO throw new XmlBuilderException("not implemented"); } /** * An unordered set of notation information items, * one for each notation declared in the DTD. */ public Iterable notations() { // TODO throw new XmlBuilderException("not implemented"); } /** * */ public XmlElement addDocumentElement(String name) { return addDocumentElement(null, name); } public XmlElement addDocumentElement(XmlNamespace namespace, String name) { XmlElement el = new XmlElementImpl(namespace, name); if(getDocumentElement() != null) { throw new XmlBuilderException("document already has root element"); } setDocumentElement(el); return el; } /** * */ public boolean isAllDeclarationsProcessed() { // TODO throw new XmlBuilderException("not implemented"); } /** * */ public XmlElement getDocumentElement() { // TODO return root; } } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/impl/XmlElementImpl.java100644 0 0 76533 10525225063 26003 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package org.xmlpull.v1.builder.impl; import org.xmlpull.v1.builder.*; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.xmlpull.v1.builder.Iterable; //import org.xmlpull.v1.builder.SimpleIterator; /** * This is implementation if XML Infoset Element Information Item. * * @version $Revision: 1.41 $ * @author Aleksander Slominski */ public class XmlElementImpl implements XmlElement { private XmlContainer parent; private XmlNamespace namespace; //private String prefix; private String name; private List attrs; private List nsList; //NOTE: optimize for one child: Object oneChild; or create ElementWithChild???? private List children; //JDK15 covariant public XmlElement clone() throws CloneNotSupportedException public Object clone() throws CloneNotSupportedException { XmlElementImpl cloned = (XmlElementImpl) super.clone(); cloned.parent = null; // now do deep clone cloned.attrs = cloneList(cloned, attrs); cloned.nsList = cloneList(cloned, nsList); ///TODO should duplicate ALL in-scope namespaces? cloned.children = cloneList(cloned, children); //fix parent -- if needs fixing ... if(cloned.children != null) { for (int i = 0; i < cloned.children.size(); i++) { Object member = cloned.children.get(i); // if(member instanceof XmlElement) { // XmlElement el = (XmlElement) member; // if(el.getParent() == this) { // el.setParent(null); // el.setParent(cloned); // } // } if(member instanceof XmlContained) { XmlContained contained = (XmlContained ) member; if(contained.getParent() == this) { contained.setParent(null); contained.setParent(cloned); } } } } return cloned; } private List cloneList(XmlElementImpl cloned, List list) throws CloneNotSupportedException { if(list == null) { return null; } List newList = new ArrayList(list.size()); //JDK15 for(Object member: list) { for (int i = 0; i < list.size(); i++) { Object member = list.get(i); Object newMember; // = null; if((member instanceof XmlNamespace) || (member instanceof String)) { // immutable and has no owner - no need to clone newMember = member; } else if(member instanceof XmlElement) { // XmlElement el = (XmlElement) member; // newMember = el.clone(); XmlElement el = (XmlElement) member; newMember = el.clone(); } else if(member instanceof XmlAttribute) { XmlAttribute attr = (XmlAttribute) member; newMember = new XmlAttributeImpl(cloned, attr.getType(), attr.getNamespace(), attr.getName(), attr.getValue(), attr.isSpecified()); } else if(member instanceof java.lang.Cloneable) { //use reflection to call clone() -- this is getting ugly!!!! // more background on this in http://www.artima.com/intv/issues3.html "The clone Dilemma" try { newMember = member.getClass().getMethod("clone", null).invoke(member, null); } catch (Exception e) { throw new CloneNotSupportedException("failed to call clone() on "+member+e); } } else { throw new CloneNotSupportedException(); } newList.add(newMember); } return newList; } /**package**/ XmlElementImpl(String name) { this.name = name; } /**package**/ XmlElementImpl(XmlNamespace namespace, String name) { this.namespace = namespace; this.name = name; } /**package**/ XmlElementImpl(String namespaceName, String name) { if(namespaceName != null) { this.namespace = new XmlNamespaceImpl(null, namespaceName); } this.name = name; } public XmlContainer getRoot() { XmlContainer root = this; while(true) { if(! ( root instanceof XmlElement )) { break; } XmlElement el = (XmlElement) root; if(el.getParent() != null) { root= el.getParent(); } else { break; } } return root; } //----- generic methods public XmlContainer getParent() { return parent; } public void setParent(XmlContainer parent) { if(parent != null) { // check that parent has me as child // if(parent instanceof XmlElement) { // Iterator iter = ((XmlElement)parent).children(); // boolean found = false; // while (iter.hasNext()) // { // Object element = iter.next(); // if(element == this) { // found = true; // break; // } // } // if(!found) { // throw new XmlBuilderException( // "this element must be child of parent to set its parent"); // } // } else if(parent instanceof XmlDocument) { XmlDocument doc = (XmlDocument) parent; if(doc.getDocumentElement() != this) { throw new XmlBuilderException( "this element must be root document element to have document set as parent" +" but already different element is set as root document element"); } } } this.parent = parent; } public XmlNamespace getNamespace() { return namespace; } public String getNamespaceName() { return namespace != null ? namespace.getNamespaceName() : null; } public void setNamespace(XmlNamespace namespace) { this.namespace = namespace; } // public String getPrefix() { // return prefix; // } // // public void setPrefix(String prefix) { // this.prefix = prefix; // } public String getName() { return name; } public void setName(String name) { this.name = name; } public String toString() { return "name[" + name + "]" + (namespace != null ? " namespace[" + namespace.getNamespaceName() + "]" : ""); } public String getBaseUri() { // TODO throw new XmlBuilderException("not implemented"); } public void setBaseUri(String baseUri) { // TODO throw new XmlBuilderException("not implemented"); } //Attributes public Iterator attributes() { if(attrs == null) { return EMPTY_ITERATOR; } return attrs.iterator(); } public XmlAttribute addAttribute(XmlAttribute attributeValueToAdd) { if(attrs == null) ensureAttributeCapacity(5); //TODO: check that there is no attribute duplication (including namespaces?) attrs.add(attributeValueToAdd); return attributeValueToAdd; } public XmlAttribute addAttribute(XmlNamespace namespace, String name, String value) { return addAttribute("CDATA", namespace, name, value, false); } public XmlAttribute addAttribute(String name, String value) { return addAttribute("CDATA", null, name, value, false); } public XmlAttribute addAttribute(String attributeType, XmlNamespace namespace, String name, String value) { return addAttribute(attributeType, namespace, name, value, false); } public XmlAttribute addAttribute(String attributeType, XmlNamespace namespace, String name, String value, boolean specified) { XmlAttribute a = new XmlAttributeImpl(this, attributeType, namespace, name, value, specified); return addAttribute(a); } public XmlAttribute addAttribute(String attributeType, String attributePrefix, String attributeNamespace, String attributeName, String attributeValue, boolean specified) { XmlNamespace n = newNamespace(attributePrefix, attributeNamespace); return addAttribute(attributeType, n, attributeName, attributeValue, specified); } public void ensureAttributeCapacity(int minCapacity) { if(attrs == null) { attrs = new ArrayList(minCapacity); } else { ((ArrayList)attrs).ensureCapacity(minCapacity); } } public String getAttributeValue(String attributeNamespaceName, String attributeName) { XmlAttribute xat = findAttribute(attributeNamespaceName, attributeName); if(xat != null) { return xat.getValue(); } return null; } public boolean hasAttributes() { return attrs != null && attrs.size() > 0; } public XmlAttribute attribute(String attributeName) { return attribute(null, attributeName); } public XmlAttribute attribute(XmlNamespace attributeNamespace, String attributeName) { return findAttribute( attributeNamespace!= null ? attributeNamespace.getNamespaceName() : null, attributeName); } //todo: verify me //if you enforce that namespace "" and null are equivalent this could be //rewritten /** * @deprecated */ public XmlAttribute findAttribute(String attributeNamespace, String attributeName) { if(attributeName == null) { throw new IllegalArgumentException("attribute name ca not ber null"); } //addtional condition ---> test if there are some attrs if (attrs == null) { return null; } int length = attrs.size(); for (int i = 0; i < length; i++) { XmlAttribute a = (XmlAttribute) attrs.get(i); String aName = a.getName(); if(aName == attributeName // fast if strings are itnerned || attributeName.equals(aName)) { if(attributeNamespace != null) { String aNamespace = a.getNamespaceName(); if (attributeNamespace.equals(aNamespace)) { return a; } else if ((attributeNamespace == "") && (aNamespace == null)) { return a; } // XmlNamespace aNamespace = a.getNamespace(); // if(aNamespace != null) { // String aNamespaceName = aNamespace.getNamespaceName(); // if(aNamespaceName == attributeName // || aNamespace.equals(aNamespaceName)) // { // return a; // } // } } else { if (a.getNamespace() == null) { return a; } else { if (a.getNamespace().getNamespaceName() == "") { return a; } } } } } return null; } public void removeAllAttributes() { attrs = null; } public void removeAttribute(XmlAttribute attr) { if(attrs == null) { throw new XmlBuilderException("this element has no attributes to remove"); } for (int i = 0; i < attrs.size(); i++) { if (attrs.get(i).equals(attr)) { attrs.remove(i); break; } } } //------------ Namespaces public XmlNamespace declareNamespace(String prefix, String namespaceName) { if(prefix == null) { throw new XmlBuilderException("namespace added to element must have not null prefix"); } XmlNamespace n = newNamespace(prefix, namespaceName); return declareNamespace(n); } public XmlNamespace declareNamespace(XmlNamespace n) { if(n.getPrefix() == null) { throw new XmlBuilderException("namespace added to element must have not null prefix"); } if(nsList == null) ensureNamespaceDeclarationsCapacity(5); //TODO check for duplicates nsList.add(n); return n; } public boolean hasNamespaceDeclarations() { return nsList != null && nsList.size() >0; } public XmlNamespace lookupNamespaceByPrefix(String namespacePrefix) { if(namespacePrefix == null) { throw new IllegalArgumentException("namespace prefix can not be null"); } if(hasNamespaceDeclarations()) { int length = nsList.size(); for (int i = 0; i < length; i++) { XmlNamespace n = (XmlNamespace) nsList.get(i); if(namespacePrefix.equals(n.getPrefix()) ){ return n; } } } if(parent != null && parent instanceof XmlElement) { return ((XmlElement)parent).lookupNamespaceByPrefix(namespacePrefix); } else { return null; } } public XmlNamespace lookupNamespaceByName(String namespaceName) { if(namespaceName == null) { throw new IllegalArgumentException("namespace name can not ber null"); } if(hasNamespaceDeclarations()) { int length = nsList.size(); for (int i = 0; i < length; i++) { XmlNamespace n = (XmlNamespace) nsList.get(i); if(namespaceName.equals(n.getNamespaceName()) ){ return n; } } } if(parent != null && parent instanceof XmlElement) { return ((XmlElement)parent).lookupNamespaceByName(namespaceName); } else { return null; } } public Iterator namespaces() { if(nsList == null) { return EMPTY_ITERATOR; } return nsList.iterator(); } public XmlNamespace newNamespace(String namespaceName) { return newNamespace(null, namespaceName); } public XmlNamespace newNamespace(String prefix, String namespaceName) { return new XmlNamespaceImpl(prefix, namespaceName); } public void ensureNamespaceDeclarationsCapacity(int minCapacity) { // if(attrs == null) { if(nsList == null) { nsList = new ArrayList(minCapacity); } else { ((ArrayList)nsList).ensureCapacity(minCapacity); } } public void removeAllNamespaceDeclarations() { nsList = null; } //---------------- Elements public void addChild(Object child) { if (child == null) throw new NullPointerException(); if(children == null) ensureChildrenCapacity(1); //checkChildParent(child); children.add(child); //setChildParent(child); } public void addChild(int index, Object child) { if(children == null) ensureChildrenCapacity(1); //checkChildParent(child); children.add(index, child); //setChildParent(child); } private void checkChildParent(Object child) { if(child instanceof XmlContainer) { if(child instanceof XmlElement) { XmlElement elChild = (XmlElement) child; XmlContainer childParent = elChild.getParent(); if(childParent != null) { if(childParent != parent) { throw new XmlBuilderException( "child must have no parent to be added to this node"); } } } else if(child instanceof XmlDocument) { throw new XmlBuilderException("docuemet can not be stored as element child"); } } } private void setChildParent(Object child) { if(child instanceof XmlElement) { XmlElement elChild = (XmlElement) child; elChild.setParent(this); } } public XmlElement addElement(XmlElement element) { checkChildParent(element); addChild(element); setChildParent(element); return element; } public XmlElement addElement(int pos, XmlElement element) { checkChildParent(element); addChild(pos, element); setChildParent(element); return element; } public XmlElement addElement(XmlNamespace namespace, String name) { XmlElement el = newElement(namespace, name); addChild(el); setChildParent(el); return el; } public XmlElement addElement(String name) { return addElement(null, name); } public Iterator children() { if(children == null) { return EMPTY_ITERATOR; } return children.iterator(); } public Iterable requiredElementContent() { if(children == null) { return EMPTY_ITERABLE; } return new Iterable() { public Iterator iterator() { return new RequiredElementContentIterator(children.iterator()); } }; } public String requiredTextContent() { if(children == null) { // throw new XmlBuilderException("element {"+getNamespace().getNamespaceName()+"}" // +getName()+" has no content"); return ""; } if(children.size() == 0) { return ""; } else if(children.size() == 1) { Object child = children.get(0); if(child instanceof String) { return child.toString(); } else if(child instanceof XmlCharacters) { return ((XmlCharacters)child).getText(); } else { throw new XmlBuilderException("expected text content and not " +(child != null ? child.getClass() : null) +" with '"+child+"'"); } } Iterator i = children(); StringBuffer buf = new StringBuffer(); while(i.hasNext()) { Object child = i.next(); if(child instanceof String) { buf.append(child.toString()); } else if(child instanceof XmlCharacters) { buf.append(((XmlCharacters)child).getText()); } else { throw new XmlBuilderException("expected text content and not "+child.getClass() +" with '"+child+"'"); } } return buf.toString(); } public void ensureChildrenCapacity(int minCapacity) { if(children == null) { children = new ArrayList(minCapacity); } else { ((ArrayList)children).ensureCapacity(minCapacity); } } public XmlElement element(int position) { if(children == null) return null; int length = children.size(); int count = 0; if(position >= 0 && position < (length + 1)) { int pos = 0; while(pos < length) { Object child = children.get(pos); if(child instanceof XmlElement) { ++count; if(count == position) { return (XmlElement) child; } } ++pos; } } else { //TODO:CTX throw new IndexOutOfBoundsException( "position "+position+" bigger or equal to "+length+" children"); } //TODO:CTX throw new IndexOutOfBoundsException( "position "+position+" too big as only "+count+" element(s) available"); } public XmlElement requiredElement(XmlNamespace n, String name) throws XmlBuilderException { XmlElement el = element(n, name); if(el == null) { //TODO:CTX throw new XmlBuilderException("could not find element with name "+name +" in namespace "+(n !=null ? n.getNamespaceName() : null)); } return el; } public XmlElement element(XmlNamespace n, String name) { return element(n, name, false); } public XmlElement element(XmlNamespace n, String name, boolean create) { XmlElement e = n != null ? findElementByName(n.getNamespaceName(), name) : findElementByName(name); if(e != null) { return e; } //e =new XmlElementImpl(n, name); if(create) { return addElement(n, name); } else { return null; } } public Iterable elements(final XmlNamespace n, final String name) { return new Iterable() { public Iterator iterator() { return new ElementsSimpleIterator(n, name, children()); } }; } public XmlElement findElementByName(String name) { if(children == null) return null; int length = children.size(); for (int i = 0; i < length; i++) { Object child = children.get(i); if(child instanceof XmlElement) { XmlElement childEl = (XmlElement) child; if(name.equals(childEl.getName())) { return childEl; } } } return null; } public XmlElement findElementByName(String namespaceName, String name, XmlElement elementToStartLooking) { // TODO throw new UnsupportedOperationException(); } public XmlElement findElementByName(String name, XmlElement elementToStartLooking) { // TODO throw new UnsupportedOperationException(); } public XmlElement findElementByName(String namespaceName, String name) { if(children == null) return null; int length = children.size(); for (int i = 0; i < length; i++) { Object child = children.get(i); if(child instanceof XmlElement) { XmlElement childEl = (XmlElement) child; XmlNamespace namespace = childEl.getNamespace(); if (namespace != null) { if ((name.equals(childEl.getName())) && (namespaceName.equals(namespace.getNamespaceName()))) { return childEl; } } else { if ((name.equals(childEl.getName())) && (namespaceName == null)) { return childEl; } } } } return null; } public boolean hasChild(Object child) { if(children == null) { return false; } for (int i = 0; i < children.size(); i++) { if(children.get(i) == child) { return true; } } return false; } public boolean hasChildren() { return children != null && children.size() > 0; } public void insertChild(int pos, Object childToInsert) { // children.set(pos, childToInsert); if (children == null) ensureChildrenCapacity(1); children.add(pos, childToInsert); } public XmlElement newElement(String name) { return newElement((XmlNamespace)null, name); } public XmlElement newElement(String namespace, String name) { return new XmlElementImpl(namespace, name); } public XmlElement newElement(XmlNamespace namespace, String name) { return new XmlElementImpl(namespace, name); } public void replaceChild(Object newChild, Object oldChild) { if(newChild == null) { throw new IllegalArgumentException("new child to replace can not be null"); } if(oldChild == null) { throw new IllegalArgumentException("old child to replace can not be null"); } if(!hasChildren()) { throw new XmlBuilderException("no children available for replacement"); } int pos = children.indexOf(oldChild); if(pos == -1) { throw new XmlBuilderException("could not find child to replace"); } children.set(pos, newChild); } public void removeAllChildren() { children = null; } public void removeChild(Object child) { if(child == null) { throw new IllegalArgumentException("child to remove can not be null"); } if(!hasChildren()) { throw new XmlBuilderException("no children to remove"); } int pos = children.indexOf(child); if(pos != -1) { children.remove(pos); } // int length = children.size(); // for (int i = 0; i < length; i++) // { // Object o = children.get(i); // if(o == child) { // } // } } public void replaceChildrenWithText(String textContent) { removeAllChildren(); addChild(textContent); } private static final boolean isWhiteSpace(String txt) { for (int i = 0; i < txt.length(); i++) { if ( (txt.charAt(i) != ' ') && (txt.charAt(i) != '\n') && (txt.charAt(i) != '\t') && (txt.charAt(i) != '\r')) { return false; } } return true; } private class ElementsSimpleIterator implements Iterator { private Iterator children; private XmlElement currentEl; private XmlNamespace n; private String name; ElementsSimpleIterator(final XmlNamespace n, final String name, Iterator children) { this.children = children; this.n = n; this.name = name; findNextEl(); } private void findNextEl() { currentEl = null; while(children.hasNext()) { Object child = children.next(); if(child instanceof XmlElement) { XmlElement el = (XmlElement) child; if( (name == null || el.getName() == name || name.equals(el.getName())) && (n == null || el.getNamespace() == n || n.equals(el.getNamespace())) ) { currentEl = el; break; } } } } public boolean hasNext() { return currentEl != null; } public Object next() { if(currentEl == null) { throw new XmlBuilderException( "this iterator has no content and next() is not allowed"); } XmlElement el = currentEl; findNextEl(); return el; } public void remove() { throw new XmlBuilderException( "this element iterator does nto support remove()"); } } private static class RequiredElementContentIterator implements Iterator { private Iterator children; private XmlElement currentEl; RequiredElementContentIterator(Iterator children) { this.children = children; findNextEl(); } private void findNextEl() { currentEl = null; while(children.hasNext()) { Object child = children.next(); if(child instanceof XmlElement) { currentEl = (XmlElement) child; break; } else if(child instanceof String) { String s = child.toString(); if(false == isWhiteSpace(s)) { throw new XmlBuilderException( //TODO parent.getPositionDesc() ... "only whitespace string children allowed for non mixed element content"); } } else if(child instanceof XmlCharacters) { XmlCharacters xc = (XmlCharacters) child; if(!Boolean.TRUE.equals(xc.isWhitespaceContent()) || false == isWhiteSpace(xc.getText()) ) { throw new XmlBuilderException( //TODO parent.getPositionDesc() ... "only whitespace characters children allowed for non mixed element content"); } } else { throw new XmlBuilderException( //TODO parent.getPositionDesc() ... "only whitespace characters and element children allowed "+ "for non mixed element content and not "+child.getClass()); } } } public boolean hasNext() { return currentEl != null; } public Object next() { if(currentEl == null) { throw new XmlBuilderException( "this iterator has no content and next() is not allowed"); } XmlElement el = currentEl; findNextEl(); return el; } public void remove() { throw new XmlBuilderException( "this iterator does nto support remove()"); } } private static class EmptyIterator implements Iterator { public boolean hasNext() { return false; } public Object next() { throw new XmlBuilderException( "this iterator has no content and next() is not allowed"); } public void remove() { throw new XmlBuilderException( "this iterator has no content and remove() is not allowed"); } } private static final Iterator EMPTY_ITERATOR = new EmptyIterator(); private static final Iterable EMPTY_ITERABLE = new Iterable() { public Iterator iterator() { return EMPTY_ITERATOR; } }; } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/impl/XmlInfosetBuilderImpl.java100644 0 0 40177 10525225063 27323 0ustaraslomewww 0 0 package org.xmlpull.v1.builder.impl; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.Collection; import java.util.Iterator; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlSerializer; import org.xmlpull.v1.builder.XmlAttribute; import org.xmlpull.v1.builder.XmlBuilderException; import org.xmlpull.v1.builder.XmlComment; import org.xmlpull.v1.builder.XmlContainer; import org.xmlpull.v1.builder.XmlDocument; import org.xmlpull.v1.builder.XmlElement; import org.xmlpull.v1.builder.XmlNamespace; import org.xmlpull.v1.builder.XmlInfosetBuilder; import org.xmlpull.v1.builder.XmlSerializable; import org.xmlpull.v1.builder.XmlCharacters; //TODO: add equals() and hashcode() //TODO: think about how to do gernali XmlSerialziable (to simplify serialzie() //TODO: in XmlElement use String namespaceName and do not use XmlNamespace namespace (except for getNamespace()? // NOTE: that XML infoset requires prefix informatio to be present even if not needed .... /** * Implementation of generic buuilder that uses XmlPull API to access * current default XmlPullParser and XmlSerializer. * * @author Aleksander Slominski */ public class XmlInfosetBuilderImpl extends XmlInfosetBuilder { private final static String PROPERTY_XMLDECL_STANDALONE = "http://xmlpull.org/v1/doc/properties.html#xmldecl-standalone"; private final static String PROPERTY_XMLDECL_VERSION = "http://xmlpull.org/v1/doc/properties.html#xmldecl-version"; //private boolean useNamespaces; public XmlInfosetBuilderImpl() {} public XmlDocument newDocument(String version, Boolean standalone, String characterEncoding) { return new XmlDocumentImpl(version, standalone, characterEncoding); } public XmlElement newFragment(String elementName) { return new XmlElementImpl((XmlNamespace)null, elementName); } public XmlElement newFragment(String elementNamespaceName, String elementName) { return new XmlElementImpl(elementNamespaceName, elementName); } public XmlElement newFragment(XmlNamespace elementNamespace, String elementName) { return new XmlElementImpl(elementNamespace, elementName); } //public abstract XmlNamespace newNamespace(String namespaceName); //public abstract XmlNamespace newNamespace(String prefix, String namespaceName); public XmlNamespace newNamespace(String namespaceName) { return new XmlNamespaceImpl(null, namespaceName); } public XmlNamespace newNamespace(String prefix, String namespaceName) { return new XmlNamespaceImpl(prefix, namespaceName); } public XmlDocument parse(XmlPullParser pp) { XmlDocument doc = parseDocumentStart(pp); XmlElement root = parseFragment(pp); doc.setDocumentElement(root); //TODO parseDocumentEnd() - parse epilog with nextToken(); return doc; } public Object parseItem(XmlPullParser pp) { try { int eventType = pp.getEventType(); if(eventType == XmlPullParser.START_TAG) { return parseStartTag(pp); } else if(eventType == XmlPullParser.TEXT) { return pp.getText(); } else if(eventType == XmlPullParser.START_DOCUMENT) { return parseDocumentStart(pp); } else { throw new XmlBuilderException("currently unsupported event type " +XmlPullParser.TYPES[eventType]+pp.getPositionDescription()); } } catch (XmlPullParserException e) { throw new XmlBuilderException("could not parse XML item" ,e); } } private XmlDocument parseDocumentStart(XmlPullParser pp) //throws XmlPullParserException, IOException { //sourceForNode.next(); XmlDocument doc = null; try { if(pp.getEventType() != XmlPullParser.START_DOCUMENT) { throw new XmlBuilderException("parser must be positioned on beginning of document" +" and not "+pp.getPositionDescription()); } // TODO use nextToken() pp.next(); String xmlDeclVersion = (String) pp.getProperty(PROPERTY_XMLDECL_VERSION); Boolean xmlDeclStandalone = (Boolean) pp.getProperty(PROPERTY_XMLDECL_STANDALONE);; String characterEncoding = pp.getInputEncoding(); doc = new XmlDocumentImpl(xmlDeclVersion, xmlDeclStandalone, characterEncoding); } catch (XmlPullParserException e) { throw new XmlBuilderException("could not parse XML document prolog" ,e); } catch (IOException e) { throw new XmlBuilderException("could not read XML document prolog" ,e); } return doc; } public XmlElement parseFragment(XmlPullParser pp) { try { int depth = pp.getDepth(); int eventType = pp.getEventType(); if(eventType != XmlPullParser.START_TAG) { throw new XmlBuilderException( "expected parser to be on start tag and not "+XmlPullParser.TYPES[ eventType ] +pp.getPositionDescription()); } //int level = depth + 1; XmlElement curElem = parseStartTag(pp); while(true) { eventType = pp.next(); if(eventType == XmlPullParser.START_TAG) { XmlElement child = parseStartTag(pp); curElem.addElement(child); curElem = child; } else if(eventType == XmlPullParser.END_TAG) { XmlContainer parent = curElem.getParent(); if(parent == null) { if(pp.getDepth() != depth) { throw new XmlBuilderException( "unbalanced input"+pp.getPositionDescription()); } return curElem; } curElem = (XmlElement) parent; //--level; //curElem = curElem.parent; } else if(eventType == XmlPullParser.TEXT) { curElem.addChild(pp.getText()); } } } catch (XmlPullParserException e) { throw new XmlBuilderException("could not build tree from XML" ,e); } catch (IOException e) { throw new XmlBuilderException("could not read XML tree content" ,e); } } public XmlElement parseStartTag(XmlPullParser pp) { try { //assert pp.getEventType() == XmlPullParser.START_TAG; if(pp.getEventType() != XmlPullParser.START_TAG) { throw new XmlBuilderException( "parser must be on START_TAG and not "+pp.getPositionDescription()); } String elNsPrefix = pp.getPrefix(); XmlNamespace elementNs = new XmlNamespaceImpl(elNsPrefix, pp.getNamespace()) ; XmlElement el = new XmlElementImpl(elementNs, pp.getName()); //add namespaces declarations (if any) for (int i = pp.getNamespaceCount(pp.getDepth()-1); i < pp.getNamespaceCount(pp.getDepth()); i++) { // TODO think about changing XmlPull to return "" in this case ... or not String prefix = pp.getNamespacePrefix(i); el.declareNamespace(prefix == null ? "" : prefix, pp.getNamespaceUri(i)); } //add attributes and namespaces for (int i = 0; i < pp.getAttributeCount(); i++) { el.addAttribute(pp.getAttributeType(i), pp.getAttributePrefix(i), pp.getAttributeNamespace(i), pp.getAttributeName(i), pp.getAttributeValue(i), pp.isAttributeDefault(i) == false); } return el; } catch (XmlPullParserException e) { throw new XmlBuilderException("could not parse XML start tag" ,e); //} catch (IOException e) { // throw new XmlBuilderException("could not read XML start tag" ,e); } } public XmlDocument parseLocation(String locationUrl) { // TODO: if first is "/" try opening file URL url = null; try { url = new URL(locationUrl); } catch (MalformedURLException e) { throw new XmlBuilderException("could not parse URL "+locationUrl, e); } try { return parseInputStream(url.openStream()); } catch (IOException e) { throw new XmlBuilderException("could not open connection to URL "+locationUrl, e); } } public void serialize(Object item, XmlSerializer serializer) { if(item instanceof Collection) { Collection c = (Collection) item; for(Iterator i = c.iterator() ; i.hasNext(); ) { serialize(i.next(), serializer); } } else if(item instanceof XmlContainer) { serializeContainer((XmlContainer)item, serializer); } else { serializeItem(item, serializer); } } private void serializeContainer(XmlContainer node, XmlSerializer serializer) { if(node instanceof XmlSerializable) { try { ((XmlSerializable)node).serialize(serializer); } catch (IOException e) { throw new XmlBuilderException("could not serialize node "+node+": "+e, e); } } else if(node instanceof XmlDocument) { serializeDocument((XmlDocument)node, serializer); } else if(node instanceof XmlElement) { serializeFragment((XmlElement)node, serializer); } else { throw new IllegalArgumentException( "could not serialzie unknown XML container "+node.getClass()); } } public void serializeItem(Object item, XmlSerializer ser) { try { if(item instanceof XmlSerializable) { //((XmlSerializable)item).serialize(ser); try { ((XmlSerializable)item).serialize(ser); } catch (IOException e) { throw new XmlBuilderException("could not serialize item "+item+": "+e, e); } } else if(item instanceof String) { ser.text(item.toString()); } else if(item instanceof XmlCharacters) { ser.text(((XmlCharacters)item).getText()); } else if(item instanceof XmlComment) { ser.comment(((XmlComment)item).getContent()); } else { throw new IllegalArgumentException("could not serialize "+(item != null ? item.getClass() : item)); } } catch (IOException e) { throw new XmlBuilderException("serializing XML start tag failed", e); } } public void serializeStartTag(XmlElement el, XmlSerializer ser) { try { //declare namespaces XmlNamespace elNamespace = el.getNamespace(); String elPrefix = (elNamespace != null) ? elNamespace.getPrefix() : ""; if(elPrefix == null) { elPrefix = ""; } String nToDeclare = null; if(el.hasNamespaceDeclarations()) { Iterator iter = el.namespaces(); while (iter.hasNext()) { XmlNamespace n = (XmlNamespace) iter.next(); String nPrefix = n.getPrefix(); if(!elPrefix.equals(nPrefix)) { ser.setPrefix(nPrefix, n.getNamespaceName()); } else { nToDeclare = n.getNamespaceName(); } } } // make sure that preferred element prefix is declared last so it is picked up by serializer if(nToDeclare != null) { ser.setPrefix(elPrefix, nToDeclare); } else { if(elNamespace != null) { // first check that it needs to be declared - will declaring change anything? String namespaceName = elNamespace.getNamespaceName(); if(namespaceName == null) { namespaceName = ""; } String serPrefix = null; if(namespaceName.length() > 0) { ser.getPrefix(namespaceName, false); } if(serPrefix==null){ serPrefix=""; } if(serPrefix != elPrefix && !serPrefix.equals(elPrefix)){ // the prefix was not declared on current elment but just to enforce prefix choice ... ser.setPrefix(elPrefix, namespaceName); } } } ser.startTag(el.getNamespaceName(), el.getName()); if(el.hasAttributes()) { Iterator iter = el.attributes(); while (iter.hasNext()) { XmlAttribute a = (XmlAttribute) iter.next(); if(a instanceof XmlSerializable) { ((XmlSerializable) a).serialize(ser); } else { ser.attribute(a.getNamespaceName(), a.getName(), a.getValue()); } } } } catch (IOException e) { throw new XmlBuilderException("serializing XML start tag failed", e); } } public void serializeEndTag(XmlElement el, XmlSerializer ser) { try { ser.endTag(el.getNamespaceName(), el.getName()); } catch (IOException e) { throw new XmlBuilderException("serializing XML end tag failed", e); } } //TODO: would iit be simple make XmlContainer serialziable and use it to serialize .... //TODO but would it be more flexible? private void serializeDocument(XmlDocument doc, XmlSerializer ser) { try { ser.startDocument(doc.getCharacterEncodingScheme(), doc.isStandalone()); } catch (IOException e) { throw new XmlBuilderException("serializing XML document start failed", e); } if(doc.getDocumentElement() != null) { serializeFragment(doc.getDocumentElement(), ser); } else { throw new XmlBuilderException("could not serialize document without root element "+doc+": "); } try { ser.endDocument(); } catch (IOException e) { throw new XmlBuilderException("serializing XML document end failed", e); } } private void serializeFragment(XmlElement el, XmlSerializer ser) { serializeStartTag(el, ser); //try { if(el.hasChildren()) { Iterator iter = el.children(); while (iter.hasNext()) { Object child = iter.next(); if(child instanceof XmlSerializable) { //((XmlSerializable)child).serialize(ser); try { ((XmlSerializable)child).serialize(ser); } catch (IOException e) { throw new XmlBuilderException("could not serialize item "+child+": "+e, e); } } else if(child instanceof XmlElement) { serializeFragment((XmlElement)child, ser); } else { serializeItem(child, ser); } } } //} catch (IOException e) { // throw new XmlBuilderException("serializing XML element children failed", e); //} serializeEndTag(el, ser); } } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/impl/XmlNamespaceImpl.java100644 0 0 3646 10525225063 26261 0ustaraslomewww 0 0 package org.xmlpull.v1.builder.impl; import org.xmlpull.v1.builder.XmlNamespace; import org.xmlpull.v1.builder.XmlBuilderException; /** * Simple implementation. * * @author Aleksander Slominski */ public class XmlNamespaceImpl implements XmlNamespace { //final static XmlNamespace NULL_NAMESPACE = new XmlNamespaceImpl(null, null); private String namespaceName; private String prefix; XmlNamespaceImpl(String namespaceName) { if(namespaceName == null) { throw new XmlBuilderException("namespace name can not be null"); } this.namespaceName = namespaceName; } XmlNamespaceImpl(String prefix, String namespaceName) { this.prefix = prefix; if(namespaceName == null) { throw new XmlBuilderException("namespace name can not be null"); } if(prefix != null) { if(prefix.indexOf(':') != -1) { throw new XmlBuilderException( "prefix '"+prefix+"' for namespace '"+namespaceName+"' can not contain colon (:)"); } } this.namespaceName = namespaceName; } public String getPrefix() { return prefix; } public String getNamespaceName() { return namespaceName; } public boolean equals(Object other) { if(other == this) return true; if(other == null) return false; if(!(other instanceof XmlNamespace)) return false; XmlNamespace otherNamespace = (XmlNamespace) other; return getNamespaceName().equals(otherNamespace.getNamespaceName()); } public String toString() { //String klazzName = getClass().getName(); //return klazzName+"{prefix='"+prefix+"',namespaceName='"+namespaceName+"'}"; return "{prefix='"+prefix+"',namespaceName='"+namespaceName+"'}"; } } xpp3-1.1.4c/src/java/builder/org/xmlpull/v1/builder/package.html100644 0 0 4601 10525225063 23527 0ustaraslomewww 0 0 This package defines API modeled after XML Information Set for building incrmentally XML trees from events streamed from pull parser (user can start navigating tree before whole XML input was parsed!) and has an unique ability to bypass tree building for selected sub trees to work directly with underlying event stream. This coupled with ability to create XML tree that can mix in any Java Object allows to represent objects derived from XML (databinding) in the XML tree.

    Features

    • unique ability to achieve high performance that is common in streaming parsers and ease of use associated with tree approaches in the same API by provising very precise control over XML tree creation and access to underlying streaming parser during tree creation (API users needs to do it if and only if they do want to bypass default tree creation and replace it with their customized object tree, work directly with XML events or just skip unneded parts of XML that do not need to be in XML node tree).
    • easy to use: modeled after XML Information Set to build on well established abstract model to represent XML
    • small: only few classes and interfaces
    • fast: builds on the most powerful XmlPull API that makes possible to create high perfromance parser implemntations
    • flexible: based on the state of the art interface-implementation approach allowing anybody to modify and extend easily API

    Overview

    API is directly modeled on XML Information Set with few minor exceptions but expands on it to provide additional functions to create and manipulate XML Information Set (essentially providing Synthetic Infoset).

    TODO:

    • when generics are supported in JDK upgrade API to use Iterator<T> instead of Enumeration ...


      Aleksander Slominski

      Last modified: $Id: package.html,v 1.1 2003/04/13 00:59:23 aslom Exp $ xpp3-1.1.4c/src/java/dom2_builder/org/xmlpull/v1/dom2_builder/DOM2XmlPullBuilder.java100644 0 0 22003 10525225063 27315 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package org.xmlpull.v1.dom2_builder; import java.io.IOException; import java.io.Reader; import java.io.StringReader; import java.io.StringWriter; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.FactoryConfigurationError; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Attr; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; import org.w3c.dom.Text; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; import org.w3c.dom.DOMException; //TOOD add parse method that will usenextToken() to reconstruct complete XML Infoset /** * Simplistic DOM2 builder that should be enough to do support most cases. * Requires JAXP DOMBuilder to provide DOM2 implementation. *

      NOTE:this class is stateless factory and it is safe to share between multiple threads. *

      * * @author Aleksander Slominski */ public class DOM2XmlPullBuilder { //protected XmlPullParser pp; //protected XmlPullParserFactory factory; public DOM2XmlPullBuilder() { //throws XmlPullParserException { //factory = XmlPullParserFactory.newInstance(); } //public DOM2XmlPullBuilder(XmlPullParser pp) throws XmlPullParserException { //public DOM2XmlPullBuilder(XmlPullParserFactory factory)throws XmlPullParserException //{ // this.factory = factory; //} protected Document newDoc() throws XmlPullParserException { try { // if you see dreaded "java.lang.NoClassDefFoundError: org/w3c/dom/ranges/DocumentRange" // add the newest xercesImpl and apis JAR file to JRE/lib/endorsed // for more deatils see: http://java.sun.com/j2se/1.4.2/docs/guide/standards/index.html DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = domFactory.newDocumentBuilder(); DOMImplementation impl = builder.getDOMImplementation(); return builder.newDocument(); } catch (FactoryConfigurationError ex) { throw new XmlPullParserException( "could not configure factory JAXP DocumentBuilderFactory: "+ex, null, ex); } catch (ParserConfigurationException ex) { throw new XmlPullParserException( "could not configure parser JAXP DocumentBuilderFactory: "+ex, null, ex); } } protected XmlPullParser newParser() throws XmlPullParserException { XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); return factory.newPullParser(); } public Element parse(Reader reader) throws XmlPullParserException, IOException { Document docFactory = newDoc(); return parse(reader, docFactory); } public Element parse(Reader reader, Document docFactory) throws XmlPullParserException, IOException { XmlPullParser pp = newParser(); pp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); pp.setInput(reader); pp.next(); return parse(pp, docFactory); } public Element parse(XmlPullParser pp, Document docFactory) throws XmlPullParserException, IOException { Element root = parseSubTree(pp, docFactory); return root; } public Element parseSubTree(XmlPullParser pp) throws XmlPullParserException, IOException { Document doc = newDoc(); Element root = parseSubTree(pp, doc); return root; } public Element parseSubTree(XmlPullParser pp, Document docFactory) throws XmlPullParserException, IOException { BuildProcess process = new BuildProcess(); return process.parseSubTree(pp, docFactory); } static class BuildProcess { private XmlPullParser pp; private Document docFactory; private boolean scanNamespaces = true; private BuildProcess() { } public Element parseSubTree(XmlPullParser pp, Document docFactory) throws XmlPullParserException, IOException { this.pp = pp; this.docFactory = docFactory; return parseSubTree(); } private Element parseSubTree() throws XmlPullParserException, IOException { pp.require( XmlPullParser.START_TAG, null, null); String name = pp.getName(); String ns = pp.getNamespace( ); String prefix = pp.getPrefix(); String qname = prefix != null ? prefix+":"+name : name; Element parent = docFactory.createElementNS(ns, qname); //declare namespaces - quite painful and easy to fail process in DOM2 declareNamespaces(pp, parent); // process attributes for (int i = 0; i < pp.getAttributeCount(); i++) { String attrNs = pp.getAttributeNamespace(i); String attrName = pp.getAttributeName(i); String attrValue = pp.getAttributeValue(i); if(attrNs == null || attrNs.length() == 0) { parent.setAttribute(attrName, attrValue); } else { String attrPrefix = pp.getAttributePrefix(i); String attrQname = attrPrefix != null ? attrPrefix+":"+attrName : attrName; parent.setAttributeNS(attrNs, attrQname, attrValue); } } // process children while( pp.next() != XmlPullParser.END_TAG ) { if (pp.getEventType() == XmlPullParser.START_TAG) { Element el = parseSubTree(pp, docFactory); parent.appendChild(el); } else if (pp.getEventType() == XmlPullParser.TEXT) { String text = pp.getText(); Text textEl = docFactory.createTextNode(text); parent.appendChild(textEl); } else { throw new XmlPullParserException( "unexpected event "+XmlPullParser.TYPES[ pp.getEventType() ], pp, null); } } pp.require( XmlPullParser.END_TAG, ns, name); return parent; } private void declareNamespaces(XmlPullParser pp, Element parent) throws DOMException, XmlPullParserException { if(scanNamespaces) { scanNamespaces = false; int top = pp.getNamespaceCount(pp.getDepth()) - 1; // this loop computes list of all in-scope prefixes LOOP: for (int i = top; i >= pp.getNamespaceCount(0); --i) { // make sure that no prefix is duplicated String prefix = pp.getNamespacePrefix(i); for (int j = top; j > i; --j) { String prefixJ = pp.getNamespacePrefix(j); if((prefix != null && prefix.equals(prefixJ)) || (prefix != null && prefix == prefixJ) ) { // prefix is already declared -- skip it continue LOOP; } } declareOneNamespace(pp, i, parent); } } else { for (int i = pp.getNamespaceCount(pp.getDepth()-1); i < pp.getNamespaceCount(pp.getDepth()); ++i) { declareOneNamespace(pp, i, parent); } } } private void declareOneNamespace(XmlPullParser pp, int i, Element parent) throws DOMException, XmlPullParserException { String xmlnsPrefix = pp.getNamespacePrefix(i); String xmlnsUri = pp.getNamespaceUri(i); String xmlnsDecl = (xmlnsPrefix != null) ? "xmlns:"+xmlnsPrefix : "xmlns"; parent.setAttributeNS("http://www.w3.org/2000/xmlns/", xmlnsDecl, xmlnsUri); } } private static void assertEquals(String expected, String s) { if((expected != null && !expected.equals(s)) || (expected == null && s == null)) { throw new RuntimeException("expected '"+expected+"' but got '"+s+"'"); } } private static void assertNotNull(Object o) { if(o == null) { throw new RuntimeException("expected no null value"); } } /** * Minimal inline test */ public static void main(String[] args) throws Exception { } } xpp3-1.1.4c/src/java/mxp1_min/META-INF/services/org.xmlpull.v1.XmlPullParserFactory100644 0 0 103 10525225062 26677 0ustaraslomewww 0 0 org.xmlpull.mxp1.MXParser,org.xmlpull.mxp1_serializer.MXSerializer xpp3-1.1.4c/src/java/mxp1_min/org/xmlpull/mxp1/MXParser.java100644 0 0 406210 10525225062 22666 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ /* * Copyright (c) 2003 Extreme! Lab, Indiana University. All rights reserved. * * This software is open source. See the bottom of this file for the license. * * $Id: MXParser.java,v 1.52 2006/11/09 18:29:37 aslom Exp $ */ package org.xmlpull.mxp1; import java.io.EOFException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.UnsupportedEncodingException; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; //TODO best handling of interning issues // have isAllNewStringInterned ??? //TODO handling surrogate pairs: http://www.unicode.org/unicode/faq/utf_bom.html#6 //TODO review code for use of bufAbsoluteStart when keeping pos between next()/fillBuf() /** * Absolutely minimal implementation of XMLPULL V1 API * * @author Aleksander Slominski */ public class MXParser implements XmlPullParser { //NOTE: no interning of those strings --> by Java lang spec they MUST be already interned protected final static String XML_URI = "http://www.w3.org/XML/1998/namespace"; protected final static String XMLNS_URI = "http://www.w3.org/2000/xmlns/"; protected final static String FEATURE_XML_ROUNDTRIP= //"http://xmlpull.org/v1/doc/features.html#xml-roundtrip"; "http://xmlpull.org/v1/doc/features.html#xml-roundtrip"; protected final static String FEATURE_NAMES_INTERNED = "http://xmlpull.org/v1/doc/features.html#names-interned"; protected final static String PROPERTY_XMLDECL_VERSION = "http://xmlpull.org/v1/doc/properties.html#xmldecl-version"; protected final static String PROPERTY_XMLDECL_STANDALONE = "http://xmlpull.org/v1/doc/properties.html#xmldecl-standalone"; protected final static String PROPERTY_XMLDECL_CONTENT = "http://xmlpull.org/v1/doc/properties.html#xmldecl-content"; protected final static String PROPERTY_LOCATION = "http://xmlpull.org/v1/doc/properties.html#location"; /** * Implementation notice: * the is instance variable that controls if newString() is interning. *

      NOTE: newStringIntern always returns interned strings * and newString MAY return interned String depending on this variable. *

      NOTE: by default in this minimal implementation it is false! */ protected boolean allStringsInterned; protected void resetStringCache() { //System.out.println("resetStringCache() minimum called"); } protected String newString(char[] cbuf, int off, int len) { return new String(cbuf, off, len); } protected String newStringIntern(char[] cbuf, int off, int len) { return (new String(cbuf, off, len)).intern(); } private static final boolean TRACE_SIZING = false; // NOTE: features are not resettable and typically defaults to false ... protected boolean processNamespaces; protected boolean roundtripSupported; // global parser state protected String location; protected int lineNumber; protected int columnNumber; protected boolean seenRoot; protected boolean reachedEnd; protected int eventType; protected boolean emptyElementTag; // element stack protected int depth; protected char[] elRawName[]; protected int elRawNameEnd[]; protected int elRawNameLine[]; protected String elName[]; protected String elPrefix[]; protected String elUri[]; //protected String elValue[]; protected int elNamespaceCount[]; /** * Make sure that we have enough space to keep element stack if passed size. * It will always create one additional slot then current depth */ protected void ensureElementsCapacity() { final int elStackSize = elName != null ? elName.length : 0; if( (depth + 1) >= elStackSize) { // we add at least one extra slot ... final int newSize = (depth >= 7 ? 2 * depth : 8) + 2; // = lucky 7 + 1 //25 if(TRACE_SIZING) { System.err.println("TRACE_SIZING elStackSize "+elStackSize+" ==> "+newSize); } final boolean needsCopying = elStackSize > 0; String[] arr = null; // reuse arr local variable slot arr = new String[newSize]; if(needsCopying) System.arraycopy(elName, 0, arr, 0, elStackSize); elName = arr; arr = new String[newSize]; if(needsCopying) System.arraycopy(elPrefix, 0, arr, 0, elStackSize); elPrefix = arr; arr = new String[newSize]; if(needsCopying) System.arraycopy(elUri, 0, arr, 0, elStackSize); elUri = arr; int[] iarr = new int[newSize]; if(needsCopying) { System.arraycopy(elNamespaceCount, 0, iarr, 0, elStackSize); } else { // special initialization iarr[0] = 0; } elNamespaceCount = iarr; //TODO: avoid using element raw name ... iarr = new int[newSize]; if(needsCopying) { System.arraycopy(elRawNameEnd, 0, iarr, 0, elStackSize); } elRawNameEnd = iarr; iarr = new int[newSize]; if(needsCopying) { System.arraycopy(elRawNameLine, 0, iarr, 0, elStackSize); } elRawNameLine = iarr; final char[][] carr = new char[newSize][]; if(needsCopying) { System.arraycopy(elRawName, 0, carr, 0, elStackSize); } elRawName = carr; // arr = new String[newSize]; // if(needsCopying) System.arraycopy(elLocalName, 0, arr, 0, elStackSize); // elLocalName = arr; // arr = new String[newSize]; // if(needsCopying) System.arraycopy(elDefaultNs, 0, arr, 0, elStackSize); // elDefaultNs = arr; // int[] iarr = new int[newSize]; // if(needsCopying) System.arraycopy(elNsStackPos, 0, iarr, 0, elStackSize); // for (int i = elStackSize; i < iarr.length; i++) // { // iarr[i] = (i > 0) ? -1 : 0; // } // elNsStackPos = iarr; //assert depth < elName.length; } } // attribute stack protected int attributeCount; protected String attributeName[]; protected int attributeNameHash[]; //protected int attributeNameStart[]; //protected int attributeNameEnd[]; protected String attributePrefix[]; protected String attributeUri[]; protected String attributeValue[]; //protected int attributeValueStart[]; //protected int attributeValueEnd[]; /** * Make sure that in attributes temporary array is enough space. */ protected void ensureAttributesCapacity(int size) { final int attrPosSize = attributeName != null ? attributeName.length : 0; if(size >= attrPosSize) { final int newSize = size > 7 ? 2 * size : 8; // = lucky 7 + 1 //25 if(TRACE_SIZING) { System.err.println("TRACE_SIZING attrPosSize "+attrPosSize+" ==> "+newSize); } final boolean needsCopying = attrPosSize > 0; String[] arr = null; arr = new String[newSize]; if(needsCopying) System.arraycopy(attributeName, 0, arr, 0, attrPosSize); attributeName = arr; arr = new String[newSize]; if(needsCopying) System.arraycopy(attributePrefix, 0, arr, 0, attrPosSize); attributePrefix = arr; arr = new String[newSize]; if(needsCopying) System.arraycopy(attributeUri, 0, arr, 0, attrPosSize); attributeUri = arr; arr = new String[newSize]; if(needsCopying) System.arraycopy(attributeValue, 0, arr, 0, attrPosSize); attributeValue = arr; if( ! allStringsInterned ) { final int[] iarr = new int[newSize]; if(needsCopying) System.arraycopy(attributeNameHash, 0, iarr, 0, attrPosSize); attributeNameHash = iarr; } arr = null; // //assert attrUri.length > size } } // namespace stack protected int namespaceEnd; protected String namespacePrefix[]; protected int namespacePrefixHash[]; protected String namespaceUri[]; protected void ensureNamespacesCapacity(int size) { final int namespaceSize = namespacePrefix != null ? namespacePrefix.length : 0; if(size >= namespaceSize) { final int newSize = size > 7 ? 2 * size : 8; // = lucky 7 + 1 //25 if(TRACE_SIZING) { System.err.println("TRACE_SIZING namespaceSize "+namespaceSize+" ==> "+newSize); } final String[] newNamespacePrefix = new String[newSize]; final String[] newNamespaceUri = new String[newSize]; if(namespacePrefix != null) { System.arraycopy( namespacePrefix, 0, newNamespacePrefix, 0, namespaceEnd); System.arraycopy( namespaceUri, 0, newNamespaceUri, 0, namespaceEnd); } namespacePrefix = newNamespacePrefix; namespaceUri = newNamespaceUri; if( ! allStringsInterned ) { final int[] newNamespacePrefixHash = new int[newSize]; if(namespacePrefixHash != null) { System.arraycopy( namespacePrefixHash, 0, newNamespacePrefixHash, 0, namespaceEnd); } namespacePrefixHash = newNamespacePrefixHash; } //prefixesSize = newSize; // //assert nsPrefixes.length > size && nsPrefixes.length == newSize } } /** * simplistic implementation of hash function that has constant * time to compute - so it also means diminishing hash quality for long strings * but for XML parsing it should be good enough ... */ protected static final int fastHash( char ch[], int off, int len ) { if(len == 0) return 0; //assert len >0 int hash = ch[off]; // hash at beginning //try { hash = (hash << 7) + ch[ off + len - 1 ]; // hash at the end //} catch(ArrayIndexOutOfBoundsException aie) { // aie.printStackTrace(); //should never happen ... // throw new RuntimeException("this is violation of pre-condition"); //} if(len > 16) hash = (hash << 7) + ch[ off + (len / 4)]; // 1/4 from beginning if(len > 8) hash = (hash << 7) + ch[ off + (len / 2)]; // 1/2 of string size ... // notice that hash is at most done 3 times <<7 so shifted by 21 bits 8 bit value // so max result == 29 bits so it is quite just below 31 bits for long (2^32) ... //assert hash >= 0; return hash; } // entity replacement stack protected int entityEnd; protected String entityName[]; protected char[] entityNameBuf[]; protected String entityReplacement[]; protected char[] entityReplacementBuf[]; protected int entityNameHash[]; protected void ensureEntityCapacity() { final int entitySize = entityReplacementBuf != null ? entityReplacementBuf.length : 0; if(entityEnd >= entitySize) { final int newSize = entityEnd > 7 ? 2 * entityEnd : 8; // = lucky 7 + 1 //25 if(TRACE_SIZING) { System.err.println("TRACE_SIZING entitySize "+entitySize+" ==> "+newSize); } final String[] newEntityName = new String[newSize]; final char[] newEntityNameBuf[] = new char[newSize][]; final String[] newEntityReplacement = new String[newSize]; final char[] newEntityReplacementBuf[] = new char[newSize][]; if(entityName != null) { System.arraycopy(entityName, 0, newEntityName, 0, entityEnd); System.arraycopy(entityNameBuf, 0, newEntityNameBuf, 0, entityEnd); System.arraycopy(entityReplacement, 0, newEntityReplacement, 0, entityEnd); System.arraycopy(entityReplacementBuf, 0, newEntityReplacementBuf, 0, entityEnd); } entityName = newEntityName; entityNameBuf = newEntityNameBuf; entityReplacement = newEntityReplacement; entityReplacementBuf = newEntityReplacementBuf; if( ! allStringsInterned ) { final int[] newEntityNameHash = new int[newSize]; if(entityNameHash != null) { System.arraycopy(entityNameHash, 0, newEntityNameHash, 0, entityEnd); } entityNameHash = newEntityNameHash; } } } // input buffer management protected static final int READ_CHUNK_SIZE = 8*1024; //max data chars in one read() call protected Reader reader; protected String inputEncoding; protected InputStream inputStream; protected int bufLoadFactor = 95; // 99% //protected int bufHardLimit; // only matters when expanding protected char buf[] = new char[ Runtime.getRuntime().freeMemory() > 1000000L ? READ_CHUNK_SIZE : 256 ]; protected int bufSoftLimit = ( bufLoadFactor * buf.length ) /100; // desirable size of buffer protected boolean preventBufferCompaction; protected int bufAbsoluteStart; // this is buf protected int bufStart; protected int bufEnd; protected int pos; protected int posStart; protected int posEnd; protected char pc[] = new char[ Runtime.getRuntime().freeMemory() > 1000000L ? READ_CHUNK_SIZE : 64 ]; protected int pcStart; protected int pcEnd; // parsing state //protected boolean needsMore; //protected boolean seenMarkup; protected boolean usePC; protected boolean seenStartTag; protected boolean seenEndTag; protected boolean pastEndTag; protected boolean seenAmpersand; protected boolean seenMarkup; protected boolean seenDocdecl; // transient variable set during each call to next/Token() protected boolean tokenize; protected String text; protected String entityRefName; protected String xmlDeclVersion; protected Boolean xmlDeclStandalone; protected String xmlDeclContent; protected void reset() { //System.out.println("reset() called"); location = null; lineNumber = 1; columnNumber = 0; seenRoot = false; reachedEnd = false; eventType = START_DOCUMENT; emptyElementTag = false; depth = 0; attributeCount = 0; namespaceEnd = 0; entityEnd = 0; reader = null; inputEncoding = null; preventBufferCompaction = false; bufAbsoluteStart = 0; bufEnd = bufStart = 0; pos = posStart = posEnd = 0; pcEnd = pcStart = 0; usePC = false; seenStartTag = false; seenEndTag = false; pastEndTag = false; seenAmpersand = false; seenMarkup = false; seenDocdecl = false; xmlDeclVersion = null; xmlDeclStandalone = null; xmlDeclContent = null; resetStringCache(); } public MXParser() { } /** * Method setFeature * * @param name a String * @param state a boolean * * @throws XmlPullParserException * */ public void setFeature(String name, boolean state) throws XmlPullParserException { if(name == null) throw new IllegalArgumentException("feature name should not be null"); if(FEATURE_PROCESS_NAMESPACES.equals(name)) { if(eventType != START_DOCUMENT) throw new XmlPullParserException( "namespace processing feature can only be changed before parsing", this, null); processNamespaces = state; // } else if(FEATURE_REPORT_NAMESPACE_ATTRIBUTES.equals(name)) { // if(type != START_DOCUMENT) throw new XmlPullParserException( // "namespace reporting feature can only be changed before parsing", this, null); // reportNsAttribs = state; } else if(FEATURE_NAMES_INTERNED.equals(name)) { if(state != false) { throw new XmlPullParserException( "interning names in this implementation is not supported"); } } else if(FEATURE_PROCESS_DOCDECL.equals(name)) { if(state != false) { throw new XmlPullParserException( "processing DOCDECL is not supported"); } //} else if(REPORT_DOCDECL.equals(name)) { // paramNotifyDoctype = state; } else if(FEATURE_XML_ROUNDTRIP.equals(name)) { //if(state == false) { // throw new XmlPullParserException( // "roundtrip feature can not be switched off"); //} roundtripSupported = state; } else { throw new XmlPullParserException("unsupported feature "+name); } } /** Unknown properties are always returned as false */ public boolean getFeature(String name) { if(name == null) throw new IllegalArgumentException("feature name should not be null"); if(FEATURE_PROCESS_NAMESPACES.equals(name)) { return processNamespaces; // } else if(FEATURE_REPORT_NAMESPACE_ATTRIBUTES.equals(name)) { // return reportNsAttribs; } else if(FEATURE_NAMES_INTERNED.equals(name)) { return false; } else if(FEATURE_PROCESS_DOCDECL.equals(name)) { return false; //} else if(REPORT_DOCDECL.equals(name)) { // return paramNotifyDoctype; } else if(FEATURE_XML_ROUNDTRIP.equals(name)) { //return true; return roundtripSupported; } return false; } public void setProperty(String name, Object value) throws XmlPullParserException { if(PROPERTY_LOCATION.equals(name)) { location = (String) value; } else { throw new XmlPullParserException("unsupported property: '"+name+"'"); } } public Object getProperty(String name) { if(name == null) throw new IllegalArgumentException("property name should not be null"); if(PROPERTY_XMLDECL_VERSION.equals(name)) { return xmlDeclVersion; } else if(PROPERTY_XMLDECL_STANDALONE.equals(name)) { return xmlDeclStandalone; } else if(PROPERTY_XMLDECL_CONTENT.equals(name)) { return xmlDeclContent; } else if(PROPERTY_LOCATION.equals(name)) { return location; } return null; } public void setInput(Reader in) throws XmlPullParserException { reset(); reader = in; } public void setInput(java.io.InputStream inputStream, String inputEncoding) throws XmlPullParserException { if(inputStream == null) { throw new IllegalArgumentException("input stream can not be null"); } this.inputStream = inputStream; Reader reader; //if(inputEncoding != null) { try { if(inputEncoding != null) { reader = new InputStreamReader(inputStream, inputEncoding); } else { //by default use UTF-8 (InputStreamReader(inputStream)) would use OS default ... reader = new InputStreamReader(inputStream, "UTF-8"); } } catch (UnsupportedEncodingException une) { throw new XmlPullParserException( "could not create reader for encoding "+inputEncoding+" : "+une, this, une); } //} else { // reader = new InputStreamReader(inputStream); //} setInput(reader); //must be here as reest() was called in setInput() and has set this.inputEncoding to null ... this.inputEncoding = inputEncoding; } public String getInputEncoding() { return inputEncoding; } public void defineEntityReplacementText(String entityName, String replacementText) throws XmlPullParserException { // throw new XmlPullParserException("not allowed"); //protected char[] entityReplacement[]; ensureEntityCapacity(); // this is to make sure that if interning works we will take advantage of it ... this.entityName[entityEnd] = newString(entityName.toCharArray(), 0, entityName.length()); entityNameBuf[entityEnd] = entityName.toCharArray(); entityReplacement[entityEnd] = replacementText; entityReplacementBuf[entityEnd] = replacementText.toCharArray(); if(!allStringsInterned) { entityNameHash[ entityEnd ] = fastHash(entityNameBuf[entityEnd], 0, entityNameBuf[entityEnd].length); } ++entityEnd; //TODO disallow < or & in entity replacement text (or ]]>???) // TOOD keepEntityNormalizedForAttributeValue cached as well ... } public int getNamespaceCount(int depth) throws XmlPullParserException { if(processNamespaces == false || depth == 0) { return 0; } //int maxDepth = eventType == END_TAG ? this.depth + 1 : this.depth; //if(depth < 0 || depth > maxDepth) throw new IllegalArgumentException( if(depth < 0 || depth > this.depth) throw new IllegalArgumentException( "allowed namespace depth 0.."+this.depth+" not "+depth); return elNamespaceCount[ depth ]; } public String getNamespacePrefix(int pos) throws XmlPullParserException { //int end = eventType == END_TAG ? elNamespaceCount[ depth + 1 ] : namespaceEnd; //if(pos < end) { if(pos < namespaceEnd) { return namespacePrefix[ pos ]; } else { throw new XmlPullParserException( "position "+pos+" exceeded number of available namespaces "+namespaceEnd); } } public String getNamespaceUri(int pos) throws XmlPullParserException { //int end = eventType == END_TAG ? elNamespaceCount[ depth + 1 ] : namespaceEnd; //if(pos < end) { if(pos < namespaceEnd) { return namespaceUri[ pos ]; } else { throw new XmlPullParserException( "position "+pos+" exceeded number of available namespaces "+namespaceEnd); } } public String getNamespace( String prefix ) //throws XmlPullParserException { //int count = namespaceCount[ depth ]; if(prefix != null) { for( int i = namespaceEnd -1; i >= 0; i--) { if( prefix.equals( namespacePrefix[ i ] ) ) { return namespaceUri[ i ]; } } if("xml".equals( prefix )) { return XML_URI; } else if("xmlns".equals( prefix )) { return XMLNS_URI; } } else { for( int i = namespaceEnd -1; i >= 0; i--) { if( namespacePrefix[ i ] == null) { //"") { //null ) { //TODO check FIXME Alek return namespaceUri[ i ]; } } } return null; } public int getDepth() { return depth; } private static int findFragment(int bufMinPos, char[] b, int start, int end) { //System.err.println("bufStart="+bufStart+" b="+printable(new String(b, start, end - start))+" start="+start+" end="+end); if(start < bufMinPos) { start = bufMinPos; if(start > end) start = end; return start; } if(end - start > 65) { start = end - 10; // try to find good location } int i = start + 1; while(--i > bufMinPos) { if((end - i) > 65) break; final char c = b[i]; if(c == '<' && (start - i) > 10) break; } return i; } /** * Return string describing current position of parsers as * text 'STATE [seen %s...] @line:column'. */ public String getPositionDescription () { String fragment = null; if(posStart <= pos) { final int start = findFragment(0, buf, posStart, pos); //System.err.println("start="+start); if(start < pos) { fragment = new String(buf, start, pos - start); } if(bufAbsoluteStart > 0 || start > 0) fragment = "..." + fragment; } // return " at line "+tokenizerPosRow // +" and column "+(tokenizerPosCol-1) // +(fragment != null ? " seen "+printable(fragment)+"..." : ""); return " "+TYPES[ eventType ] + (fragment != null ? " seen "+printable(fragment)+"..." : "") +" "+(location != null ? location : "") +"@"+getLineNumber()+":"+getColumnNumber(); } public int getLineNumber() { return lineNumber; } public int getColumnNumber() { return columnNumber; } public boolean isWhitespace() throws XmlPullParserException { if(eventType == TEXT || eventType == CDSECT) { if(usePC) { for (int i = pcStart; i = 0; i--) { // if( prefix.equals( namespacePrefix[ i ] ) ) { // return namespaceUri[ i ]; // } // } // } else { // for( int i = namespaceEnd -1; i >= 0; i--) { // if( namespacePrefix[ i ] == null ) { // return namespaceUri[ i ]; // } // } // // } // return ""; } public String getName() { if(eventType == START_TAG) { //return elName[ depth - 1 ] ; return elName[ depth ] ; } else if(eventType == END_TAG) { return elName[ depth ] ; } else if(eventType == ENTITY_REF) { if(entityRefName == null) { entityRefName = newString(buf, posStart, posEnd - posStart); } return entityRefName; } else { return null; } } public String getPrefix() { if(eventType == START_TAG) { //return elPrefix[ depth - 1 ] ; return elPrefix[ depth ] ; } else if(eventType == END_TAG) { return elPrefix[ depth ] ; } return null; // if(eventType != START_TAG && eventType != END_TAG) return null; // int maxDepth = eventType == END_TAG ? depth : depth - 1; // return elPrefix[ maxDepth ]; } public boolean isEmptyElementTag() throws XmlPullParserException { if(eventType != START_TAG) throw new XmlPullParserException( "parser must be on START_TAG to check for empty element", this, null); return emptyElementTag; } public int getAttributeCount() { if(eventType != START_TAG) return -1; return attributeCount; } public String getAttributeNamespace(int index) { if(eventType != START_TAG) throw new IndexOutOfBoundsException( "only START_TAG can have attributes"); if(processNamespaces == false) return NO_NAMESPACE; if(index < 0 || index >= attributeCount) throw new IndexOutOfBoundsException( "attribute position must be 0.."+(attributeCount-1)+" and not "+index); return attributeUri[ index ]; } public String getAttributeName(int index) { if(eventType != START_TAG) throw new IndexOutOfBoundsException( "only START_TAG can have attributes"); if(index < 0 || index >= attributeCount) throw new IndexOutOfBoundsException( "attribute position must be 0.."+(attributeCount-1)+" and not "+index); return attributeName[ index ]; } public String getAttributePrefix(int index) { if(eventType != START_TAG) throw new IndexOutOfBoundsException( "only START_TAG can have attributes"); if(processNamespaces == false) return null; if(index < 0 || index >= attributeCount) throw new IndexOutOfBoundsException( "attribute position must be 0.."+(attributeCount-1)+" and not "+index); return attributePrefix[ index ]; } public String getAttributeType(int index) { if(eventType != START_TAG) throw new IndexOutOfBoundsException( "only START_TAG can have attributes"); if(index < 0 || index >= attributeCount) throw new IndexOutOfBoundsException( "attribute position must be 0.."+(attributeCount-1)+" and not "+index); return "CDATA"; } public boolean isAttributeDefault(int index) { if(eventType != START_TAG) throw new IndexOutOfBoundsException( "only START_TAG can have attributes"); if(index < 0 || index >= attributeCount) throw new IndexOutOfBoundsException( "attribute position must be 0.."+(attributeCount-1)+" and not "+index); return false; } public String getAttributeValue(int index) { if(eventType != START_TAG) throw new IndexOutOfBoundsException( "only START_TAG can have attributes"); if(index < 0 || index >= attributeCount) throw new IndexOutOfBoundsException( "attribute position must be 0.."+(attributeCount-1)+" and not "+index); return attributeValue[ index ]; } public String getAttributeValue(String namespace, String name) { if(eventType != START_TAG) throw new IndexOutOfBoundsException( "only START_TAG can have attributes"+getPositionDescription()); if(name == null) { throw new IllegalArgumentException("attribute name can not be null"); } // TODO make check if namespace is interned!!! etc. for names!!! if(processNamespaces) { if(namespace == null) { namespace = ""; } for(int i = 0; i < attributeCount; ++i) { if((namespace == attributeUri[ i ] || namespace.equals(attributeUri[ i ]) ) //(namespace != null && namespace.equals(attributeUri[ i ])) // taking advantage of String.intern() && name.equals(attributeName[ i ]) ) { return attributeValue[i]; } } } else { if(namespace != null && namespace.length() == 0) { namespace = null; } if(namespace != null) throw new IllegalArgumentException( "when namespaces processing is disabled attribute namespace must be null"); for(int i = 0; i < attributeCount; ++i) { if(name.equals(attributeName[i])) { return attributeValue[i]; } } } return null; } public int getEventType() throws XmlPullParserException { return eventType; } public void require(int type, String namespace, String name) throws XmlPullParserException, IOException { if(processNamespaces == false && namespace != null) { throw new XmlPullParserException( "processing namespaces must be enabled on parser (or factory)"+ " to have possible namespaces declared on elements" +(" (position:"+ getPositionDescription())+")"); } if (type != getEventType() || (namespace != null && !namespace.equals (getNamespace())) || (name != null && !name.equals (getName ())) ) { throw new XmlPullParserException ( "expected event "+TYPES[ type ] +(name != null ? " with name '"+name+"'" : "") +(namespace != null && name != null ? " and" : "") +(namespace != null ? " with namespace '"+namespace+"'" : "") +" but got" +(type != getEventType() ? " "+TYPES[ getEventType() ] : "") +(name != null && getName() != null && !name.equals (getName ()) ? " name '"+getName()+"'" : "") +(namespace != null && name != null && getName() != null && !name.equals (getName ()) && getNamespace() != null && !namespace.equals (getNamespace()) ? " and" : "") +(namespace != null && getNamespace() != null && !namespace.equals (getNamespace()) ? " namespace '"+getNamespace()+"'" : "") +(" (position:"+ getPositionDescription())+")"); } } /** * Skip sub tree that is currently parser positioned on. *
      NOTE: parser must be on START_TAG and when function returns * parser will be positioned on corresponding END_TAG */ public void skipSubTree() throws XmlPullParserException, IOException { require(START_TAG, null, null); int level = 1; while(level > 0) { int eventType = next(); if(eventType == END_TAG) { --level; } else if(eventType == START_TAG) { ++level; } } } // public String readText() throws XmlPullParserException, IOException // { // if (getEventType() != TEXT) return ""; // String result = getText(); // next(); // return result; // } public String nextText() throws XmlPullParserException, IOException { // String result = null; // boolean onStartTag = false; // if(eventType == START_TAG) { // onStartTag = true; // next(); // } // if(eventType == TEXT) { // result = getText(); // next(); // } else if(onStartTag && eventType == END_TAG) { // result = ""; // } else { // throw new XmlPullParserException( // "parser must be on START_TAG or TEXT to read text", this, null); // } // if(eventType != END_TAG) { // throw new XmlPullParserException( // "event TEXT it must be immediately followed by END_TAG", this, null); // } // return result; if(getEventType() != START_TAG) { throw new XmlPullParserException( "parser must be on START_TAG to read next text", this, null); } int eventType = next(); if(eventType == TEXT) { final String result = getText(); eventType = next(); if(eventType != END_TAG) { throw new XmlPullParserException( "TEXT must be immediately followed by END_TAG and not " +TYPES[ getEventType() ], this, null); } return result; } else if(eventType == END_TAG) { return ""; } else { throw new XmlPullParserException( "parser must be on START_TAG or TEXT to read text", this, null); } } public int nextTag() throws XmlPullParserException, IOException { next(); if(eventType == TEXT && isWhitespace()) { // skip whitespace next(); } if (eventType != START_TAG && eventType != END_TAG) { throw new XmlPullParserException("expected START_TAG or END_TAG not " +TYPES[ getEventType() ], this, null); } return eventType; } public int next() throws XmlPullParserException, IOException { tokenize = false; return nextImpl(); } public int nextToken() throws XmlPullParserException, IOException { tokenize = true; return nextImpl(); } protected int nextImpl() throws XmlPullParserException, IOException { text = null; pcEnd = pcStart = 0; usePC = false; bufStart = posEnd; if(pastEndTag) { pastEndTag = false; --depth; namespaceEnd = elNamespaceCount[ depth ]; // less namespaces available } if(emptyElementTag) { emptyElementTag = false; pastEndTag = true; return eventType = END_TAG; } // [1] document ::= prolog element Misc* if(depth > 0) { if(seenStartTag) { seenStartTag = false; return eventType = parseStartTag(); } if(seenEndTag) { seenEndTag = false; return eventType = parseEndTag(); } // ASSUMPTION: we are _on_ first character of content or markup!!!! // [43] content ::= CharData? ((element | Reference | CDSect | PI | Comment) CharData?)* char ch; if(seenMarkup) { // we have read ahead ... seenMarkup = false; ch = '<'; } else if(seenAmpersand) { seenAmpersand = false; ch = '&'; } else { ch = more(); } posStart = pos - 1; // VERY IMPORTANT: this is correct start of event!!! // when true there is some potential event TEXT to return - keep gathering boolean hadCharData = false; // when true TEXT data is not continual (like ) and requires PC merging boolean needsMerging = false; MAIN_LOOP: while(true) { // work on MARKUP if(ch == '<') { if(hadCharData) { //posEnd = pos - 1; if(tokenize) { seenMarkup = true; return eventType = TEXT; } } ch = more(); if(ch == '/') { if(!tokenize && hadCharData) { seenEndTag = true; //posEnd = pos - 2; return eventType = TEXT; } return eventType = parseEndTag(); } else if(ch == '!') { ch = more(); if(ch == '-') { // note: if(tokenize == false) posStart/End is NOT changed!!!! parseComment(); if(tokenize) return eventType = COMMENT; if( !usePC && hadCharData ) { needsMerging = true; } else { posStart = pos; //completely ignore comment } } else if(ch == '[') { //posEnd = pos - 3; // must remember previous posStart/End as it merges with content of CDATA //int oldStart = posStart + bufAbsoluteStart; //int oldEnd = posEnd + bufAbsoluteStart; parseCDSect(hadCharData); if(tokenize) return eventType = CDSECT; final int cdStart = posStart; final int cdEnd = posEnd; final int cdLen = cdEnd - cdStart; if(cdLen > 0) { // was there anything inside CDATA section? hadCharData = true; if(!usePC) { needsMerging = true; } } // posStart = oldStart; // posEnd = oldEnd; // if(cdLen > 0) { // was there anything inside CDATA section? // if(hadCharData) { // // do merging if there was anything in CDSect!!!! // // if(!usePC) { // // // posEnd is correct already!!! // // if(posEnd > posStart) { // // joinPC(); // // } else { // // usePC = true; // // pcStart = pcEnd = 0; // // } // // } // // if(pcEnd + cdLen >= pc.length) ensurePC(pcEnd + cdLen); // // // copy [cdStart..cdEnd) into PC // // System.arraycopy(buf, cdStart, pc, pcEnd, cdLen); // // pcEnd += cdLen; // if(!usePC) { // needsMerging = true; // posStart = cdStart; // posEnd = cdEnd; // } // } else { // if(!usePC) { // needsMerging = true; // posStart = cdStart; // posEnd = cdEnd; // hadCharData = true; // } // } // //hadCharData = true; // } else { // if( !usePC && hadCharData ) { // needsMerging = true; // } // } } else { throw new XmlPullParserException( "unexpected character in markup "+printable(ch), this, null); } } else if(ch == '?') { parsePI(); if(tokenize) return eventType = PROCESSING_INSTRUCTION; if( !usePC && hadCharData ) { needsMerging = true; } else { posStart = pos; //completely ignore PI } } else if( isNameStartChar(ch) ) { if(!tokenize && hadCharData) { seenStartTag = true; //posEnd = pos - 2; return eventType = TEXT; } return eventType = parseStartTag(); } else { throw new XmlPullParserException( "unexpected character in markup "+printable(ch), this, null); } // do content compaction if it makes sense!!!! } else if(ch == '&') { // work on ENTITTY //posEnd = pos - 1; if(tokenize && hadCharData) { seenAmpersand = true; return eventType = TEXT; } final int oldStart = posStart + bufAbsoluteStart; final int oldEnd = posEnd + bufAbsoluteStart; final char[] resolvedEntity = parseEntityRef(); if(tokenize) return eventType = ENTITY_REF; // check if replacement text can be resolved !!! if(resolvedEntity == null) { if(entityRefName == null) { entityRefName = newString(buf, posStart, posEnd - posStart); } throw new XmlPullParserException( "could not resolve entity named '"+printable(entityRefName)+"'", this, null); } //int entStart = posStart; //int entEnd = posEnd; posStart = oldStart - bufAbsoluteStart; posEnd = oldEnd - bufAbsoluteStart; if(!usePC) { if(hadCharData) { joinPC(); // posEnd is already set correctly!!! needsMerging = false; } else { usePC = true; pcStart = pcEnd = 0; } } //assert usePC == true; // write into PC replacement text - do merge for replacement text!!!! for (int i = 0; i < resolvedEntity.length; i++) { if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = resolvedEntity[ i ]; } hadCharData = true; //assert needsMerging == false; } else { if(needsMerging) { //assert usePC == false; joinPC(); // posEnd is already set correctly!!! //posStart = pos - 1; needsMerging = false; } //no MARKUP not ENTITIES so work on character data ... // [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*) hadCharData = true; boolean normalizedCR = false; final boolean normalizeInput = tokenize == false || roundtripSupported == false; // use loop locality here!!!! boolean seenBracket = false; boolean seenBracketBracket = false; do { // check that ]]> does not show in if(ch == ']') { if(seenBracket) { seenBracketBracket = true; } else { seenBracket = true; } } else if(seenBracketBracket && ch == '>') { throw new XmlPullParserException( "characters ]]> are not allowed in content", this, null); } else { if(seenBracket) { seenBracketBracket = seenBracket = false; } // assert seenTwoBrackets == seenBracket == false; } if(normalizeInput) { // deal with normalization issues ... if(ch == '\r') { normalizedCR = true; posEnd = pos -1; // posEnd is already is set if(!usePC) { if(posEnd > posStart) { joinPC(); } else { usePC = true; pcStart = pcEnd = 0; } } //assert usePC == true; if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = '\n'; } else if(ch == '\n') { // if(!usePC) { joinPC(); } else { if(pcEnd >= pc.length) ensurePC(); } if(!normalizedCR && usePC) { if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = '\n'; } normalizedCR = false; } else { if(usePC) { if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = ch; } normalizedCR = false; } } ch = more(); } while(ch != '<' && ch != '&'); posEnd = pos - 1; continue MAIN_LOOP; // skip ch = more() from below - we are alreayd ahead ... } ch = more(); } // endless while(true) } else { if(seenRoot) { return parseEpilog(); } else { return parseProlog(); } } } protected int parseProlog() throws XmlPullParserException, IOException { // [2] prolog: ::= XMLDecl? Misc* (doctypedecl Misc*)? and look for [39] element char ch; if(seenMarkup) { ch = buf[ pos - 1 ]; } else { ch = more(); } if(eventType == START_DOCUMENT) { // bootstrap parsing with getting first character input! // deal with BOM // detect BOM and drop it (Unicode int Order Mark) if(ch == '\uFFFE') { throw new XmlPullParserException( "first character in input was UNICODE noncharacter (0xFFFE)"+ "- input requires int swapping", this, null); } if(ch == '\uFEFF') { // skipping UNICODE int Order Mark (so called BOM) ch = more(); } } seenMarkup = false; boolean gotS = false; posStart = pos - 1; final boolean normalizeIgnorableWS = tokenize == true && roundtripSupported == false; boolean normalizedCR = false; while(true) { // deal with Misc // [27] Misc ::= Comment | PI | S // deal with docdecl --> mark it! // else parseStartTag seen <[^/] if(ch == '<') { if(gotS && tokenize) { posEnd = pos - 1; seenMarkup = true; return eventType = IGNORABLE_WHITESPACE; } ch = more(); if(ch == '?') { // check if it is 'xml' // deal with XMLDecl if(parsePI()) { // make sure to skip XMLDecl if(tokenize) { return eventType = PROCESSING_INSTRUCTION; } } else { // skip over - continue tokenizing posStart = pos; gotS = false; } } else if(ch == '!') { ch = more(); if(ch == 'D') { if(seenDocdecl) { throw new XmlPullParserException( "only one docdecl allowed in XML document", this, null); } seenDocdecl = true; parseDocdecl(); if(tokenize) return eventType = DOCDECL; } else if(ch == '-') { parseComment(); if(tokenize) return eventType = COMMENT; } else { throw new XmlPullParserException( "unexpected markup posStart) { joinPC(); } else { usePC = true; pcStart = pcEnd = 0; } } //assert usePC == true; if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = '\n'; } else if(ch == '\n') { if(!normalizedCR && usePC) { if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = '\n'; } normalizedCR = false; } else { if(usePC) { if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = ch; } normalizedCR = false; } } } else { throw new XmlPullParserException( "only whitespace content allowed before start tag and not "+printable(ch), this, null); } ch = more(); } } protected int parseEpilog() throws XmlPullParserException, IOException { if(eventType == END_DOCUMENT) { throw new XmlPullParserException("already reached end of XML input", this, null); } if(reachedEnd) { return eventType = END_DOCUMENT; } boolean gotS = false; final boolean normalizeIgnorableWS = tokenize == true && roundtripSupported == false; boolean normalizedCR = false; try { // epilog: Misc* char ch; if(seenMarkup) { ch = buf[ pos - 1 ]; } else { ch = more(); } seenMarkup = false; posStart = pos - 1; if(!reachedEnd) { while(true) { // deal with Misc // [27] Misc ::= Comment | PI | S if(ch == '<') { if(gotS && tokenize) { posEnd = pos - 1; seenMarkup = true; return eventType = IGNORABLE_WHITESPACE; } ch = more(); if(reachedEnd) { break; } if(ch == '?') { // check if it is 'xml' // deal with XMLDecl parsePI(); if(tokenize) return eventType = PROCESSING_INSTRUCTION; } else if(ch == '!') { ch = more(); if(reachedEnd) { break; } if(ch == 'D') { parseDocdecl(); //FIXME if(tokenize) return eventType = DOCDECL; } else if(ch == '-') { parseComment(); if(tokenize) return eventType = COMMENT; } else { throw new XmlPullParserException( "unexpected markup posStart) { joinPC(); } else { usePC = true; pcStart = pcEnd = 0; } } //assert usePC == true; if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = '\n'; } else if(ch == '\n') { if(!normalizedCR && usePC) { if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = '\n'; } normalizedCR = false; } else { if(usePC) { if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = ch; } normalizedCR = false; } } } else { throw new XmlPullParserException( "in epilog non whitespace content is not allowed but got "+printable(ch), this, null); } ch = more(); if(reachedEnd) { break; } } } // throw Exception("unexpected content in epilog // catch EOFException return END_DOCUEMENT //try { } catch(EOFException ex) { reachedEnd = true; } if(reachedEnd) { if(tokenize && gotS) { posEnd = pos; // well - this is LAST available character pos return eventType = IGNORABLE_WHITESPACE; } return eventType = END_DOCUMENT; } else { throw new XmlPullParserException("internal error in parseEpilog"); } } public int parseEndTag() throws XmlPullParserException, IOException { //ASSUMPTION ch is past "' char ch = more(); if(!isNameStartChar(ch)) { throw new XmlPullParserException( "expected name start and not "+printable(ch), this, null); } posStart = pos - 3; final int nameStart = pos - 1 + bufAbsoluteStart; do { ch = more(); } while(isNameChar(ch)); // now we go one level down -- do checks //--depth; //FIXME // check that end tag name is the same as start tag //String name = new String(buf, nameStart - bufAbsoluteStart, // (pos - 1) - (nameStart - bufAbsoluteStart)); //int last = pos - 1; int off = nameStart - bufAbsoluteStart; //final int len = last - off; final int len = (pos - 1) - off; final char[] cbuf = elRawName[depth]; if(elRawNameEnd[depth] != len) { // construct strings for exception final String startname = new String(cbuf, 0, elRawNameEnd[depth]); final String endname = new String(buf, off, len); throw new XmlPullParserException( "end tag name must match start tag name <"+startname+">" +" from line "+elRawNameLine[depth], this, null); } for (int i = 0; i < len; i++) { if(buf[off++] != cbuf[i]) { // construct strings for exception final String startname = new String(cbuf, 0, len); final String endname = new String(buf, off - i - 1, len); throw new XmlPullParserException( "end tag name must be the same as start tag <"+startname+">" +" from line "+elRawNameLine[depth], this, null); } } while(isS(ch)) { ch = more(); } // skip additional white spaces if(ch != '>') { throw new XmlPullParserException( "expected > to finish end tag not "+printable(ch) +" from line "+elRawNameLine[depth], this, null); } //namespaceEnd = elNamespaceCount[ depth ]; //FIXME posEnd = pos; pastEndTag = true; return eventType = END_TAG; } public int parseStartTag() throws XmlPullParserException, IOException { //ASSUMPTION ch is past ' // [44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>' ++depth; //FIXME posStart = pos - 2; emptyElementTag = false; attributeCount = 0; // retrieve name final int nameStart = pos - 1 + bufAbsoluteStart; int colonPos = -1; char ch = buf[ pos - 1]; if(ch == ':' && processNamespaces) throw new XmlPullParserException( "when namespaces processing enabled colon can not be at element name start", this, null); while(true) { ch = more(); if(!isNameChar(ch)) break; if(ch == ':' && processNamespaces) { if(colonPos != -1) throw new XmlPullParserException( "only one colon is allowed in name of element when namespaces are enabled", this, null); colonPos = pos - 1 + bufAbsoluteStart; } } // retrieve name ensureElementsCapacity(); //TODO check for efficient interning and then use elRawNameInterned!!!! int elLen = (pos - 1) - (nameStart - bufAbsoluteStart); if(elRawName[ depth ] == null || elRawName[ depth ].length < elLen) { elRawName[ depth ] = new char[ 2 * elLen ]; } System.arraycopy(buf, nameStart - bufAbsoluteStart, elRawName[ depth ], 0, elLen); elRawNameEnd[ depth ] = elLen; elRawNameLine[ depth ] = lineNumber; String name = null; // work on prefixes and namespace URI String prefix = null; if(processNamespaces) { if(colonPos != -1) { prefix = elPrefix[ depth ] = newString(buf, nameStart - bufAbsoluteStart, colonPos - nameStart); name = elName[ depth ] = newString(buf, colonPos + 1 - bufAbsoluteStart, //(pos -1) - (colonPos + 1)); pos - 2 - (colonPos - bufAbsoluteStart)); } else { prefix = elPrefix[ depth ] = null; name = elName[ depth ] = newString(buf, nameStart - bufAbsoluteStart, elLen); } } else { name = elName[ depth ] = newString(buf, nameStart - bufAbsoluteStart, elLen); } while(true) { while(isS(ch)) { ch = more(); } // skip additional white spaces if(ch == '>') { break; } else if(ch == '/') { if(emptyElementTag) throw new XmlPullParserException( "repeated / in tag declaration", this, null); emptyElementTag = true; ch = more(); if(ch != '>') throw new XmlPullParserException( "expected > to end empty tag not "+printable(ch), this, null); break; } else if(isNameStartChar(ch)) { ch = parseAttribute(); ch = more(); continue; } else { throw new XmlPullParserException( "start tag unexpected character "+printable(ch), this, null); } //ch = more(); // skip space } // now when namespaces were declared we can resolve them if(processNamespaces) { String uri = getNamespace(prefix); if(uri == null) { if(prefix == null) { // no prefix and no uri => use default namespace uri = NO_NAMESPACE; } else { throw new XmlPullParserException( "could not determine namespace bound to element prefix "+prefix, this, null); } } elUri[ depth ] = uri; //String uri = getNamespace(prefix); //if(uri == null && prefix == null) { // no prefix and no uri => use default namespace // uri = ""; //} // resolve attribute namespaces for (int i = 0; i < attributeCount; i++) { final String attrPrefix = attributePrefix[ i ]; if(attrPrefix != null) { final String attrUri = getNamespace(attrPrefix); if(attrUri == null) { throw new XmlPullParserException( "could not determine namespace bound to attribute prefix "+attrPrefix, this, null); } attributeUri[ i ] = attrUri; } else { attributeUri[ i ] = NO_NAMESPACE; } } //TODO //[ WFC: Unique Att Spec ] // check attribute uniqueness constraint for attributes that has namespace!!! for (int i = 1; i < attributeCount; i++) { for (int j = 0; j < i; j++) { if( attributeUri[j] == attributeUri[i] && (allStringsInterned && attributeName[j].equals(attributeName[i]) || (!allStringsInterned && attributeNameHash[ j ] == attributeNameHash[ i ] && attributeName[j].equals(attributeName[i])) ) ) { // prepare data for nice error message? String attr1 = attributeName[j]; if(attributeUri[j] != null) attr1 = attributeUri[j]+":"+attr1; String attr2 = attributeName[i]; if(attributeUri[i] != null) attr2 = attributeUri[i]+":"+attr2; throw new XmlPullParserException( "duplicated attributes "+attr1+" and "+attr2, this, null); } } } } else { // ! processNamespaces //[ WFC: Unique Att Spec ] // check raw attribute uniqueness constraint!!! for (int i = 1; i < attributeCount; i++) { for (int j = 0; j < i; j++) { if((allStringsInterned && attributeName[j].equals(attributeName[i]) || (!allStringsInterned && attributeNameHash[ j ] == attributeNameHash[ i ] && attributeName[j].equals(attributeName[i])) ) ) { // prepare data for nice error message? final String attr1 = attributeName[j]; final String attr2 = attributeName[i]; throw new XmlPullParserException( "duplicated attributes "+attr1+" and "+attr2, this, null); } } } } elNamespaceCount[ depth ] = namespaceEnd; posEnd = pos; return eventType = START_TAG; } protected char parseAttribute() throws XmlPullParserException, IOException { // parse attribute // [41] Attribute ::= Name Eq AttValue // [WFC: No External Entity References] // [WFC: No < in Attribute Values] final int prevPosStart = posStart + bufAbsoluteStart; final int nameStart = pos - 1 + bufAbsoluteStart; int colonPos = -1; char ch = buf[ pos - 1 ]; if(ch == ':' && processNamespaces) throw new XmlPullParserException( "when namespaces processing enabled colon can not be at attribute name start", this, null); boolean startsWithXmlns = processNamespaces && ch == 'x'; int xmlnsPos = 0; ch = more(); while(isNameChar(ch)) { if(processNamespaces) { if(startsWithXmlns && xmlnsPos < 5) { ++xmlnsPos; if(xmlnsPos == 1) { if(ch != 'm') startsWithXmlns = false; } else if(xmlnsPos == 2) { if(ch != 'l') startsWithXmlns = false; } else if(xmlnsPos == 3) { if(ch != 'n') startsWithXmlns = false; } else if(xmlnsPos == 4) { if(ch != 's') startsWithXmlns = false; } else if(xmlnsPos == 5) { if(ch != ':') throw new XmlPullParserException( "after xmlns in attribute name must be colon" +"when namespaces are enabled", this, null); //colonPos = pos - 1 + bufAbsoluteStart; } } if(ch == ':') { if(colonPos != -1) throw new XmlPullParserException( "only one colon is allowed in attribute name" +" when namespaces are enabled", this, null); colonPos = pos - 1 + bufAbsoluteStart; } } ch = more(); } ensureAttributesCapacity(attributeCount); // --- start processing attributes String name = null; String prefix = null; // work on prefixes and namespace URI if(processNamespaces) { if(xmlnsPos < 4) startsWithXmlns = false; if(startsWithXmlns) { if(colonPos != -1) { //prefix = attributePrefix[ attributeCount ] = null; final int nameLen = pos - 2 - (colonPos - bufAbsoluteStart); if(nameLen == 0) { throw new XmlPullParserException( "namespace prefix is required after xmlns: " +" when namespaces are enabled", this, null); } name = //attributeName[ attributeCount ] = newString(buf, colonPos - bufAbsoluteStart + 1, nameLen); //pos - 1 - (colonPos + 1 - bufAbsoluteStart) } } else { if(colonPos != -1) { int prefixLen = colonPos - nameStart; prefix = attributePrefix[ attributeCount ] = newString(buf, nameStart - bufAbsoluteStart,prefixLen); //colonPos - (nameStart - bufAbsoluteStart)); int nameLen = pos - 2 - (colonPos - bufAbsoluteStart); name = attributeName[ attributeCount ] = newString(buf, colonPos - bufAbsoluteStart + 1, nameLen); //pos - 1 - (colonPos + 1 - bufAbsoluteStart)); //name.substring(0, colonPos-nameStart); } else { prefix = attributePrefix[ attributeCount ] = null; name = attributeName[ attributeCount ] = newString(buf, nameStart - bufAbsoluteStart, pos - 1 - (nameStart - bufAbsoluteStart)); } if(!allStringsInterned) { attributeNameHash[ attributeCount ] = name.hashCode(); } } } else { // retrieve name name = attributeName[ attributeCount ] = newString(buf, nameStart - bufAbsoluteStart, pos - 1 - (nameStart - bufAbsoluteStart)); ////assert name != null; if(!allStringsInterned) { attributeNameHash[ attributeCount ] = name.hashCode(); } } // [25] Eq ::= S? '=' S? while(isS(ch)) { ch = more(); } // skip additional spaces if(ch != '=') throw new XmlPullParserException( "expected = after attribute name", this, null); ch = more(); while(isS(ch)) { ch = more(); } // skip additional spaces // [10] AttValue ::= '"' ([^<&"] | Reference)* '"' // | "'" ([^<&'] | Reference)* "'" final char delimit = ch; if(delimit != '"' && delimit != '\'') throw new XmlPullParserException( "attribute value must start with quotation or apostrophe not " +printable(delimit), this, null); // parse until delimit or < and resolve Reference //[67] Reference ::= EntityRef | CharRef //int valueStart = pos + bufAbsoluteStart; boolean normalizedCR = false; usePC = false; pcStart = pcEnd; posStart = pos; while(true) { ch = more(); if(ch == delimit) { break; } if(ch == '<') { throw new XmlPullParserException( "markup not allowed inside attribute value - illegal < ", this, null); } if(ch == '&') { // extractEntityRef posEnd = pos - 1; if(!usePC) { final boolean hadCharData = posEnd > posStart; if(hadCharData) { // posEnd is already set correctly!!! joinPC(); } else { usePC = true; pcStart = pcEnd = 0; } } //assert usePC == true; final char[] resolvedEntity = parseEntityRef(); // check if replacement text can be resolved !!! if(resolvedEntity == null) { if(entityRefName == null) { entityRefName = newString(buf, posStart, posEnd - posStart); } throw new XmlPullParserException( "could not resolve entity named '"+printable(entityRefName)+"'", this, null); } // write into PC replacement text - do merge for replacement text!!!! for (int i = 0; i < resolvedEntity.length; i++) { if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = resolvedEntity[ i ]; } } else if(ch == '\t' || ch == '\n' || ch == '\r') { // do attribute value normalization // as described in http://www.w3.org/TR/REC-xml#AVNormalize // TODO add test for it form spec ... // handle EOL normalization ... if(!usePC) { posEnd = pos - 1; if(posEnd > posStart) { joinPC(); } else { usePC = true; pcEnd = pcStart = 0; } } //assert usePC == true; if(pcEnd >= pc.length) ensurePC(pcEnd); if(ch != '\n' || !normalizedCR) { pc[pcEnd++] = ' '; //'\n'; } } else { if(usePC) { if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = ch; } } normalizedCR = ch == '\r'; } if(processNamespaces && startsWithXmlns) { String ns = null; if(!usePC) { ns = newStringIntern(buf, posStart, pos - 1 - posStart); } else { ns = newStringIntern(pc, pcStart, pcEnd - pcStart); } ensureNamespacesCapacity(namespaceEnd); int prefixHash = -1; if(colonPos != -1) { if(ns.length() == 0) { throw new XmlPullParserException( "non-default namespace can not be declared to be empty string", this, null); } // declare new namespace namespacePrefix[ namespaceEnd ] = name; if(!allStringsInterned) { prefixHash = namespacePrefixHash[ namespaceEnd ] = name.hashCode(); } } else { // declare new default namespace ... namespacePrefix[ namespaceEnd ] = null; //""; //null; //TODO check FIXME Alek if(!allStringsInterned) { prefixHash = namespacePrefixHash[ namespaceEnd ] = -1; } } namespaceUri[ namespaceEnd ] = ns; // detect duplicate namespace declarations!!! final int startNs = elNamespaceCount[ depth - 1 ]; for (int i = namespaceEnd - 1; i >= startNs; --i) { if(((allStringsInterned || name == null) && namespacePrefix[ i ] == name) || (!allStringsInterned && name != null && namespacePrefixHash[ i ] == prefixHash && name.equals(namespacePrefix[ i ]) )) { final String s = name == null ? "default" : "'"+name+"'"; throw new XmlPullParserException( "duplicated namespace declaration for "+s+" prefix", this, null); } } ++namespaceEnd; } else { if(!usePC) { attributeValue[ attributeCount ] = new String(buf, posStart, pos - 1 - posStart); } else { attributeValue[ attributeCount ] = new String(pc, pcStart, pcEnd - pcStart); } ++attributeCount; } posStart = prevPosStart - bufAbsoluteStart; return ch; } protected char[] charRefOneCharBuf = new char[1]; protected char[] parseEntityRef() throws XmlPullParserException, IOException { // entity reference http://www.w3.org/TR/2000/REC-xml-20001006#NT-Reference // [67] Reference ::= EntityRef | CharRef // ASSUMPTION just after & entityRefName = null; posStart = pos; char ch = more(); if(ch == '#') { // parse character reference char charRef = 0; ch = more(); if(ch == 'x') { //encoded in hex while(true) { ch = more(); if(ch >= '0' && ch <= '9') { charRef = (char)(charRef * 16 + (ch - '0')); } else if(ch >= 'a' && ch <= 'f') { charRef = (char)(charRef * 16 + (ch - ('a' - 10))); } else if(ch >= 'A' && ch <= 'F') { charRef = (char)(charRef * 16 + (ch - ('A' - 10))); } else if(ch == ';') { break; } else { throw new XmlPullParserException( "character reference (with hex value) may not contain " +printable(ch), this, null); } } } else { // encoded in decimal while(true) { if(ch >= '0' && ch <= '9') { charRef = (char)(charRef * 10 + (ch - '0')); } else if(ch == ';') { break; } else { throw new XmlPullParserException( "character reference (with decimal value) may not contain " +printable(ch), this, null); } ch = more(); } } posEnd = pos - 1; charRefOneCharBuf[0] = charRef; if(tokenize) { text = newString(charRefOneCharBuf, 0, 1); } return charRefOneCharBuf; } else { // [68] EntityRef ::= '&' Name ';' // scan name until ; if(!isNameStartChar(ch)) { throw new XmlPullParserException( "entity reference names can not start with character '" +printable(ch)+"'", this, null); } while(true) { ch = more(); if(ch == ';') { break; } if(!isNameChar(ch)) { throw new XmlPullParserException( "entity reference name can not contain character " +printable(ch)+"'", this, null); } } posEnd = pos - 1; // determine what name maps to final int len = posEnd - posStart; if(len == 2 && buf[posStart] == 'l' && buf[posStart+1] == 't') { if(tokenize) { text = "<"; } charRefOneCharBuf[0] = '<'; return charRefOneCharBuf; //if(paramPC || isParserTokenizing) { // if(pcEnd >= pc.length) ensurePC(); // pc[pcEnd++] = '<'; //} } else if(len == 3 && buf[posStart] == 'a' && buf[posStart+1] == 'm' && buf[posStart+2] == 'p') { if(tokenize) { text = "&"; } charRefOneCharBuf[0] = '&'; return charRefOneCharBuf; } else if(len == 2 && buf[posStart] == 'g' && buf[posStart+1] == 't') { if(tokenize) { text = ">"; } charRefOneCharBuf[0] = '>'; return charRefOneCharBuf; } else if(len == 4 && buf[posStart] == 'a' && buf[posStart+1] == 'p' && buf[posStart+2] == 'o' && buf[posStart+3] == 's') { if(tokenize) { text = "'"; } charRefOneCharBuf[0] = '\''; return charRefOneCharBuf; } else if(len == 4 && buf[posStart] == 'q' && buf[posStart+1] == 'u' && buf[posStart+2] == 'o' && buf[posStart+3] == 't') { if(tokenize) { text = "\""; } charRefOneCharBuf[0] = '"'; return charRefOneCharBuf; } else { final char[] result = lookuEntityReplacement(len); if(result != null) { return result; } } if(tokenize) text = null; return null; } } protected char[] lookuEntityReplacement(int entitNameLen) throws XmlPullParserException, IOException { if(!allStringsInterned) { final int hash = fastHash(buf, posStart, posEnd - posStart); LOOP: for (int i = entityEnd - 1; i >= 0; --i) { if(hash == entityNameHash[ i ] && entitNameLen == entityNameBuf[ i ].length) { final char[] entityBuf = entityNameBuf[ i ]; for (int j = 0; j < entitNameLen; j++) { if(buf[posStart + j] != entityBuf[j]) continue LOOP; } if(tokenize) text = entityReplacement[ i ]; return entityReplacementBuf[ i ]; } } } else { entityRefName = newString(buf, posStart, posEnd - posStart); for (int i = entityEnd - 1; i >= 0; --i) { // take advantage that interning for newStirng is enforced if(entityRefName == entityName[ i ]) { if(tokenize) text = entityReplacement[ i ]; return entityReplacementBuf[ i ]; } } } return null; } protected void parseComment() throws XmlPullParserException, IOException { // implements XML 1.0 Section 2.5 Comments //ASSUMPTION: seen ch = more(); if(seenDashDash && ch != '>') { throw new XmlPullParserException( "in comment after two dashes (--) next character must be >" +" not "+printable(ch), this, null); } if(ch == '-') { if(!seenDash) { seenDash = true; } else { seenDashDash = true; seenDash = false; } } else if(ch == '>') { if(seenDashDash) { break; // found end sequence!!!! } else { seenDashDash = false; } seenDash = false; } else { seenDash = false; } if(normalizeIgnorableWS) { if(ch == '\r') { normalizedCR = true; //posEnd = pos -1; //joinPC(); // posEnd is already set if(!usePC) { posEnd = pos -1; if(posEnd > posStart) { joinPC(); } else { usePC = true; pcStart = pcEnd = 0; } } //assert usePC == true; if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = '\n'; } else if(ch == '\n') { if(!normalizedCR && usePC) { if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = '\n'; } normalizedCR = false; } else { if(usePC) { if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = ch; } normalizedCR = false; } } } } catch(EOFException ex) { // detect EOF and create meaningful error ... throw new XmlPullParserException( "comment started on line "+curLine+" and column "+curColumn+" was not closed", this, ex); } if(tokenize) { posEnd = pos - 3; if(usePC) { pcEnd -= 2; } } } protected boolean parsePI() throws XmlPullParserException, IOException { // implements XML 1.0 Section 2.6 Processing Instructions // [16] PI ::= '' Char*)))? '?>' // [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l')) //ASSUMPTION: seen //ch = more(); if(ch == '?') { seenQ = true; } else if(ch == '>') { if(seenQ) { break; // found end sequence!!!! } seenQ = false; } else { if(piTargetEnd == -1 && isS(ch)) { piTargetEnd = pos - 1 + bufAbsoluteStart; // [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l')) if((piTargetEnd - piTargetStart) == 3) { if((buf[piTargetStart] == 'x' || buf[piTargetStart] == 'X') && (buf[piTargetStart+1] == 'm' || buf[piTargetStart+1] == 'M') && (buf[piTargetStart+2] == 'l' || buf[piTargetStart+2] == 'L') ) { if(piTargetStart > 3) { // posStart) { joinPC(); } else { usePC = true; pcStart = pcEnd = 0; } } //assert usePC == true; if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = '\n'; } else if(ch == '\n') { if(!normalizedCR && usePC) { if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = '\n'; } normalizedCR = false; } else { if(usePC) { if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = ch; } normalizedCR = false; } } ch = more(); } } catch(EOFException ex) { // detect EOF and create meaningful error ... throw new XmlPullParserException( "processing instruction started on line "+curLine+" and column "+curColumn +" was not closed", this, ex); } if(piTargetEnd == -1) { piTargetEnd = pos - 2 + bufAbsoluteStart; //throw new XmlPullParserException( // "processing instruction must have PITarget name", this, null); } piTargetStart -= bufAbsoluteStart; piTargetEnd -= bufAbsoluteStart; if(tokenize) { posEnd = pos - 2; if(normalizeIgnorableWS) { --pcEnd; } } return true; } // protected final static char[] VERSION = {'v','e','r','s','i','o','n'}; // protected final static char[] NCODING = {'n','c','o','d','i','n','g'}; // protected final static char[] TANDALONE = {'t','a','n','d','a','l','o','n','e'}; // protected final static char[] YES = {'y','e','s'}; // protected final static char[] NO = {'n','o'}; protected final static char[] VERSION = "version".toCharArray(); protected final static char[] NCODING = "ncoding".toCharArray(); protected final static char[] TANDALONE = "tandalone".toCharArray(); protected final static char[] YES = "yes".toCharArray(); protected final static char[] NO = "no".toCharArray(); protected void parseXmlDecl(char ch) throws XmlPullParserException, IOException { // [23] XMLDecl ::= '' // first make sure that relative positions will stay OK preventBufferCompaction = true; bufStart = 0; // necessary to keep pos unchanged during expansion! // --- parse VersionInfo // [24] VersionInfo ::= S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"') // parse is positioned just on first S past 'z') && (ch < 'A' || ch > 'Z') && (ch < '0' || ch > '9') && ch != '_' && ch != '.' && ch != ':' && ch != '-') { throw new XmlPullParserException( " 'z') && (ch < 'A' || ch > 'Z')) { throw new XmlPullParserException( " 'z') && (ch < 'A' || ch > 'Z') && (ch < '0' || ch > '9') && ch != '.' && ch != '_' && ch != '-') { throw new XmlPullParserException( " as last part of ') { throw new XmlPullParserException( "expected ?> as last part of ' int bracketLevel = 0; final boolean normalizeIgnorableWS = tokenize == true && roundtripSupported == false; boolean normalizedCR = false; while(true) { ch = more(); if(ch == '[') ++bracketLevel; if(ch == ']') --bracketLevel; if(ch == '>' && bracketLevel == 0) break; if(normalizeIgnorableWS) { if(ch == '\r') { normalizedCR = true; //posEnd = pos -1; //joinPC(); // posEnd is alreadys set if(!usePC) { posEnd = pos -1; if(posEnd > posStart) { joinPC(); } else { usePC = true; pcStart = pcEnd = 0; } } //assert usePC == true; if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = '\n'; } else if(ch == '\n') { if(!normalizedCR && usePC) { if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = '\n'; } normalizedCR = false; } else { if(usePC) { if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = ch; } normalizedCR = false; } } } posEnd = pos - 1; } protected void parseCDSect(boolean hadCharData) throws XmlPullParserException, IOException { // implements XML 1.0 Section 2.7 CDATA Sections // [18] CDSect ::= CDStart CData CDEnd // [19] CDStart ::= '' Char*)) // [21] CDEnd ::= ']]>' //ASSUMPTION: seen posStart) { joinPC(); } else { usePC = true; pcStart = pcEnd = 0; } } } } boolean seenBracket = false; boolean seenBracketBracket = false; boolean normalizedCR = false; while(true) { // scan until it hits "]]>" ch = more(); if(ch == ']') { if(!seenBracket) { seenBracket = true; } else { seenBracketBracket = true; //seenBracket = false; } } else if(ch == '>') { if(seenBracket && seenBracketBracket) { break; // found end sequence!!!! } else { seenBracketBracket = false; } seenBracket = false; } else { if(seenBracket) { seenBracket = false; } } if(normalizeInput) { // deal with normalization issues ... if(ch == '\r') { normalizedCR = true; posStart = cdStart - bufAbsoluteStart; posEnd = pos - 1; // posEnd is alreadys set if(!usePC) { if(posEnd > posStart) { joinPC(); } else { usePC = true; pcStart = pcEnd = 0; } } //assert usePC == true; if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = '\n'; } else if(ch == '\n') { if(!normalizedCR && usePC) { if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = '\n'; } normalizedCR = false; } else { if(usePC) { if(pcEnd >= pc.length) ensurePC(pcEnd); pc[pcEnd++] = ch; } normalizedCR = false; } } } } catch(EOFException ex) { // detect EOF and create meaningful error ... throw new XmlPullParserException( "CDATA section started on line "+curLine+" and column "+curColumn+" was not closed", this, ex); } if(normalizeInput) { if(usePC) { pcEnd = pcEnd - 2; } } posStart = cdStart - bufAbsoluteStart; posEnd = pos - 3; } protected void fillBuf() throws IOException, XmlPullParserException { if(reader == null) throw new XmlPullParserException( "reader must be set before parsing is started"); // see if we are in compaction area if(bufEnd > bufSoftLimit) { // expand buffer it makes sense!!!! boolean compact = bufStart > bufSoftLimit; boolean expand = false; if(preventBufferCompaction) { compact = false; expand = true; } else if(!compact) { //freeSpace if(bufStart < buf.length / 2) { // less then half buffer available forcompactin --> expand instead!!! expand = true; } else { // at least half of buffer can be reclaimed --> worthwhile effort!!! compact = true; } } // if buffer almost full then compact it if(compact) { //TODO: look on trashing // //assert bufStart > 0 System.arraycopy(buf, bufStart, buf, 0, bufEnd - bufStart); if(TRACE_SIZING) System.out.println( "TRACE_SIZING fillBuf() compacting "+bufStart +" bufEnd="+bufEnd +" pos="+pos+" posStart="+posStart+" posEnd="+posEnd +" buf first 100 chars:"+new String(buf, bufStart, bufEnd - bufStart < 100 ? bufEnd - bufStart : 100 )); } else if(expand) { final int newSize = 2 * buf.length; final char newBuf[] = new char[ newSize ]; if(TRACE_SIZING) System.out.println("TRACE_SIZING fillBuf() "+buf.length+" => "+newSize); System.arraycopy(buf, bufStart, newBuf, 0, bufEnd - bufStart); buf = newBuf; if(bufLoadFactor > 0) { //bufSoftLimit = ( bufLoadFactor * buf.length ) /100; bufSoftLimit = (int) (( ((long) bufLoadFactor) * buf.length ) /100); } } else { throw new XmlPullParserException("internal error in fillBuffer()"); } bufEnd -= bufStart; pos -= bufStart; posStart -= bufStart; posEnd -= bufStart; bufAbsoluteStart += bufStart; bufStart = 0; if(TRACE_SIZING) System.out.println( "TRACE_SIZING fillBuf() after bufEnd="+bufEnd +" pos="+pos+" posStart="+posStart+" posEnd="+posEnd +" buf first 100 chars:"+new String(buf, 0, bufEnd < 100 ? bufEnd : 100)); } // at least one character must be read or error final int len = buf.length - bufEnd > READ_CHUNK_SIZE ? READ_CHUNK_SIZE : buf.length - bufEnd; final int ret = reader.read(buf, bufEnd, len); if(ret > 0) { bufEnd += ret; if(TRACE_SIZING) System.out.println( "TRACE_SIZING fillBuf() after filling in buffer" +" buf first 100 chars:"+new String(buf, 0, bufEnd < 100 ? bufEnd : 100)); return; } if(ret == -1) { if(bufAbsoluteStart == 0 && pos == 0) { throw new EOFException("input contained no data"); } else { if(seenRoot && depth == 0) { // inside parsing epilog!!! reachedEnd = true; return; } else { StringBuffer expectedTagStack = new StringBuffer(); if(depth > 0) { //final char[] cbuf = elRawName[depth]; //final String startname = new String(cbuf, 0, elRawNameEnd[depth]); expectedTagStack.append(" - expected end tag"); if(depth > 1) { expectedTagStack.append("s"); //more than one end tag } expectedTagStack.append(" "); for (int i = depth; i > 0; i--) { String tagName = new String(elRawName[i], 0, elRawNameEnd[i]); expectedTagStack.append("'); } expectedTagStack.append(" to close"); for (int i = depth; i > 0; i--) { if(i != depth) { expectedTagStack.append(" and"); //more than one end tag } String tagName = new String(elRawName[i], 0, elRawNameEnd[i]); expectedTagStack.append(" start tag <"+tagName+">"); expectedTagStack.append(" from line "+elRawNameLine[i]); } expectedTagStack.append(", parser stopped on"); } throw new EOFException("no more data available" +expectedTagStack.toString()+getPositionDescription()); } } } else { throw new IOException("error reading input, returned "+ret); } } protected char more() throws IOException, XmlPullParserException { if(pos >= bufEnd) { fillBuf(); // this return value should be ignonored as it is used in epilog parsing ... if(reachedEnd) return (char)-1; } final char ch = buf[pos++]; //line/columnNumber if(ch == '\n') { ++lineNumber; columnNumber = 1; } else { ++columnNumber; } //System.out.print(ch); return ch; } // /** // * This function returns position of parser in XML input stream // * (how many characters were processed. // *

      NOTE: this logical position and not byte offset as encodings // * such as UTF8 may use more than one byte to encode one character. // */ // public int getCurrentInputPosition() { // return pos + bufAbsoluteStart; // } protected void ensurePC(int end) { //assert end >= pc.length; final int newSize = end > READ_CHUNK_SIZE ? 2 * end : 2 * READ_CHUNK_SIZE; final char[] newPC = new char[ newSize ]; if(TRACE_SIZING) System.out.println("TRACE_SIZING ensurePC() "+pc.length+" ==> "+newSize+" end="+end); System.arraycopy(pc, 0, newPC, 0, pcEnd); pc = newPC; //assert end < pc.length; } protected void joinPC() { //assert usePC == false; //assert posEnd > posStart; final int len = posEnd - posStart; final int newEnd = pcEnd + len + 1; if(newEnd >= pc.length) ensurePC(newEnd); // add 1 for extra space for one char //assert newEnd < pc.length; System.arraycopy(buf, posStart, pc, pcEnd, len); pcEnd += len; usePC = true; } protected char requireInput(char ch, char[] input) throws XmlPullParserException, IOException { for (int i = 0; i < input.length; i++) { if(ch != input[i]) { throw new XmlPullParserException( "expected "+printable(input[i])+" in "+new String(input) +" and not "+printable(ch), this, null); } ch = more(); } return ch; } protected char requireNextS() throws XmlPullParserException, IOException { final char ch = more(); if(!isS(ch)) { throw new XmlPullParserException( "white space is required and not "+printable(ch), this, null); } return skipS(ch); } protected char skipS(char ch) throws XmlPullParserException, IOException { while(isS(ch)) { ch = more(); } // skip additional spaces return ch; } // nameStart / name lookup tables based on XML 1.1 http://www.w3.org/TR/2001/WD-xml11-20011213/ protected static final int LOOKUP_MAX = 0x400; protected static final char LOOKUP_MAX_CHAR = (char)LOOKUP_MAX; // protected static int lookupNameStartChar[] = new int[ LOOKUP_MAX_CHAR / 32 ]; // protected static int lookupNameChar[] = new int[ LOOKUP_MAX_CHAR / 32 ]; protected static boolean lookupNameStartChar[] = new boolean[ LOOKUP_MAX ]; protected static boolean lookupNameChar[] = new boolean[ LOOKUP_MAX ]; private static final void setName(char ch) //{ lookupNameChar[ (int)ch / 32 ] |= (1 << (ch % 32)); } { lookupNameChar[ ch ] = true; } private static final void setNameStart(char ch) //{ lookupNameStartChar[ (int)ch / 32 ] |= (1 << (ch % 32)); setName(ch); } { lookupNameStartChar[ ch ] = true; setName(ch); } static { setNameStart(':'); for (char ch = 'A'; ch <= 'Z'; ++ch) setNameStart(ch); setNameStart('_'); for (char ch = 'a'; ch <= 'z'; ++ch) setNameStart(ch); for (char ch = '\u00c0'; ch <= '\u02FF'; ++ch) setNameStart(ch); for (char ch = '\u0370'; ch <= '\u037d'; ++ch) setNameStart(ch); for (char ch = '\u037f'; ch < '\u0400'; ++ch) setNameStart(ch); setName('-'); setName('.'); for (char ch = '0'; ch <= '9'; ++ch) setName(ch); setName('\u00b7'); for (char ch = '\u0300'; ch <= '\u036f'; ++ch) setName(ch); } //private final static boolean isNameStartChar(char ch) { protected boolean isNameStartChar(char ch) { return (ch < LOOKUP_MAX_CHAR && lookupNameStartChar[ ch ]) || (ch >= LOOKUP_MAX_CHAR && ch <= '\u2027') || (ch >= '\u202A' && ch <= '\u218F') || (ch >= '\u2800' && ch <= '\uFFEF') ; // if(ch < LOOKUP_MAX_CHAR) return lookupNameStartChar[ ch ]; // else return ch <= '\u2027' // || (ch >= '\u202A' && ch <= '\u218F') // || (ch >= '\u2800' && ch <= '\uFFEF') // ; //return false; // return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || ch == ':' // || (ch >= '0' && ch <= '9'); // if(ch < LOOKUP_MAX_CHAR) return (lookupNameStartChar[ (int)ch / 32 ] & (1 << (ch % 32))) != 0; // if(ch <= '\u2027') return true; // //[#x202A-#x218F] // if(ch < '\u202A') return false; // if(ch <= '\u218F') return true; // // added pairts [#x2800-#xD7FF] | [#xE000-#xFDCF] | [#xFDE0-#xFFEF] | [#x10000-#x10FFFF] // if(ch < '\u2800') return false; // if(ch <= '\uFFEF') return true; // return false; // else return (supportXml11 && ( (ch < '\u2027') || (ch > '\u2029' && ch < '\u2200') ... } //private final static boolean isNameChar(char ch) { protected boolean isNameChar(char ch) { //return isNameStartChar(ch); // if(ch < LOOKUP_MAX_CHAR) return (lookupNameChar[ (int)ch / 32 ] & (1 << (ch % 32))) != 0; return (ch < LOOKUP_MAX_CHAR && lookupNameChar[ ch ]) || (ch >= LOOKUP_MAX_CHAR && ch <= '\u2027') || (ch >= '\u202A' && ch <= '\u218F') || (ch >= '\u2800' && ch <= '\uFFEF') ; //return false; // return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || ch == ':' // || (ch >= '0' && ch <= '9'); // if(ch < LOOKUP_MAX_CHAR) return (lookupNameStartChar[ (int)ch / 32 ] & (1 << (ch % 32))) != 0; //else return // else if(ch <= '\u2027') return true; // //[#x202A-#x218F] // else if(ch < '\u202A') return false; // else if(ch <= '\u218F') return true; // // added pairts [#x2800-#xD7FF] | [#xE000-#xFDCF] | [#xFDE0-#xFFEF] | [#x10000-#x10FFFF] // else if(ch < '\u2800') return false; // else if(ch <= '\uFFEF') return true; //else return false; } protected boolean isS(char ch) { return (ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t'); // || (supportXml11 && (ch == '\u0085' || ch == '\u2028'); } //protected boolean isChar(char ch) { return (ch < '\uD800' || ch > '\uDFFF') // ch != '\u0000' ch < '\uFFFE' //protected char printable(char ch) { return ch; } protected String printable(char ch) { if(ch == '\n') { return "\\n"; } else if(ch == '\r') { return "\\r"; } else if(ch == '\t') { return "\\t"; } else if(ch == '\'') { return "\\'"; } if(ch > 127 || ch < 32) { return "\\u"+Integer.toHexString((int)ch); } return ""+ch; } protected String printable(String s) { if(s == null) return null; final int sLen = s.length(); StringBuffer buf = new StringBuffer(sLen + 10); for(int i = 0; i < sLen; ++i) { buf.append(printable(s.charAt(i))); } s = buf.toString(); return s; } } /* * Indiana University Extreme! Lab Software License, Version 1.2 * * Copyright (C) 2003 The Trustees of Indiana University. * 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) All redistributions of source code must retain the above * copyright notice, the list of authors in the original source * code, this list of conditions and the disclaimer listed in this * license; * * 2) All redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the disclaimer * listed in this license in the documentation and/or other * materials provided with the distribution; * * 3) Any documentation included with all redistributions must include * the following acknowledgement: * * "This product includes software developed by the Indiana * University Extreme! Lab. For further information please visit * http://www.extreme.indiana.edu/" * * Alternatively, this acknowledgment may appear in the software * itself, and wherever such third-party acknowledgments normally * appear. * * 4) The name "Indiana University" or "Indiana University * Extreme! Lab" shall not be used to endorse or promote * products derived from this software without prior written * permission from Indiana University. For written permission, * please contact http://www.extreme.indiana.edu/. * * 5) Products derived from this software may not use "Indiana * University" name nor may "Indiana University" appear in their name, * without prior written permission of the Indiana University. * * Indiana University provides no reassurances that the source code * provided does not infringe the patent or any other intellectual * property rights of any other entity. Indiana University disclaims any * liability to any recipient for claims brought by any other entity * based on infringement of intellectual property rights or otherwise. * * LICENSEE UNDERSTANDS THAT SOFTWARE IS PROVIDED "AS IS" FOR WHICH * NO WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. INDIANA * UNIVERSITY GIVES NO WARRANTIES AND MAKES NO REPRESENTATION THAT * SOFTWARE IS FREE OF INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR * OTHER PROPRIETARY RIGHTS. INDIANA UNIVERSITY MAKES NO WARRANTIES THAT * SOFTWARE IS FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP * DOORS", "WORMS", OR OTHER HARMFUL CODE. LICENSEE ASSUMES THE ENTIRE * RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR ASSOCIATED MATERIALS, * AND TO THE PERFORMANCE AND VALIDITY OF INFORMATION GENERATED USING * SOFTWARE. */ xpp3-1.1.4c/src/java/mxp1_min/org/xmlpull/mxp1/package.html100644 0 0 520 10525225062 22515 0ustaraslomewww 0 0

      Contains MXP1 parser minimal implementation that should work on J2ME and implementation of  XMLPULL V1 API. xpp3-1.1.4c/src/java/mxp1_standard/META-INF/services/org.xmlpull.v1.XmlPullParserFactory100644 0 0 41 10525225062 27675 0ustaraslomewww 0 0 org.xmlpull.mxp1.MXParserFactory xpp3-1.1.4c/src/java/mxp1_standard/org/xmlpull/mxp1/MXParserCachingStrings.java100644 0 0 41163 10525225062 26514 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ /* * Copyright (c) 2002-2004 Extreme! Lab, Indiana University. All rights reserved. * * This software is open source. See the bottom of this file for the licence. * * $Id: MXParserCachingStrings.java,v 1.11 2006/10/23 13:36:27 aslom Exp $ */ package org.xmlpull.mxp1; import java.io.Reader; import org.xmlpull.v1.XmlPullParserException; /** * Extend MXP parser to use string cache of char[] to interned String *

      NOTE: it is not non-validaint parser as there is no supporting internal DTD parsing * no full XML 1.0 (or 1.1) character classes are supported. * * @author Aleksander Slominski */ public class MXParserCachingStrings extends MXParser implements Cloneable { protected final static boolean CACHE_STATISTICS = false; protected final static boolean TRACE_SIZING = false; protected final static int INITIAL_CAPACITY = 13; protected int cacheStatCalls; protected int cacheStatWalks; protected int cacheStatResets; protected int cacheStatRehash; /** NOTE: implemented as integers and not flot to allow to work on J2ME. */ protected static final int CACHE_LOAD = 77; //in % ie. 77% == 77/100 protected int cacheEntriesCount; protected int cacheEntriesThreshold; //entries are kept in a simple linear list protected char[][] keys; protected String[] values; // private boolean global; // // as it is shared state ALL access to those varaibles must be synchronized! // // global cache variables shadow per-instance variables for maximum performance // // as cache is alway growing the access is optimized for really fast unsychronized lookups // private static int globalCacheEntriesCount; // private static int globalCacheEntriesThreshold; // private static char[][] globalKeys; // private static String[] globalValues; public Object clone() throws CloneNotSupportedException { if(reader != null) { if(!(reader instanceof Cloneable)) { throw new CloneNotSupportedException("reader used in parser must implement Cloneable!"); } } MXParserCachingStrings cloned = (MXParserCachingStrings) super.clone(); //protected Reader reader; if(reader != null) { // why Cloneable has no clone() inside? good question and needs for stupid CloneableReader ... //cloned.reader = (Reader) ((Cloneable)reader).clone(); //BING BONG doe snot work ... //use reflection to call clone() -- this is getting ugly!!!! // more background on this in http://www.artima.com/intv/issues3.html "The clone Dilemma" try { Object o = reader.getClass().getMethod("clone", null).invoke(reader, null); cloned.reader = (Reader) o; } catch (Exception e) { //throw new CloneNotSupportedException("failed to call clone() on reader "+reader+e); CloneNotSupportedException ee = new CloneNotSupportedException("failed to call clone() on reader "+reader+":"+e); ee.initCause(e); throw ee; } } // NOTE: "A clone of a multidimensional array is shallow, which is to say that // "it creates only a single new array. Subarrays are shared, ..." // http://java.sun.com/docs/books/jls/second_edition/html/arrays.doc.html#64347 // protected char[][] keys; if(keys != null) { //TODO REVISIT: it seems cloneCCArr() is not needed cloned.keys = (char[][]) keys.clone(); } // protected String[] values; if(values != null) { cloned.values = (String[]) values.clone(); } //---- base class // protected char[] elRawName[]; if(elRawName != null) { cloned.elRawName = cloneCCArr(elRawName); } // protected int elRawNameEnd[]; if(elRawNameEnd != null) { cloned.elRawNameEnd = (int[]) elRawNameEnd.clone(); } // protected int elRawNameLine[]; if(elRawNameLine != null) { cloned.elRawNameLine = (int[]) elRawNameLine.clone(); } // protected String elName[]; if(elName != null) { cloned.elName = (String[]) elName.clone(); } // protected String elPrefix[]; if(elPrefix != null) { cloned.elPrefix = (String[]) elPrefix.clone(); } // protected String elUri[]; if(elUri != null) { cloned.elUri = (String[]) elUri.clone(); } // protected int elNamespaceCount[]; if(elNamespaceCount != null) { cloned.elNamespaceCount = (int[]) elNamespaceCount.clone(); } // protected String attributeName[]; if(attributeName != null) { cloned.attributeName = (String[]) attributeName.clone(); } // protected int attributeNameHash[]; if(attributeNameHash != null) { cloned.attributeNameHash = (int[]) attributeNameHash.clone(); } // protected String attributePrefix[]; if(attributePrefix != null) { cloned.attributePrefix = (String[]) attributePrefix.clone(); } // protected String attributeUri[]; if(attributeUri != null) { cloned.attributeUri = (String[]) attributeUri.clone(); } // protected String attributeValue[]; if(attributeValue != null) { cloned.attributeValue = (String[]) attributeValue.clone(); } // protected String namespacePrefix[]; if(namespacePrefix != null) { cloned.namespacePrefix = (String[]) namespacePrefix.clone(); } // protected int namespacePrefixHash[]; if(namespacePrefixHash != null) { cloned.namespacePrefixHash = (int[]) namespacePrefixHash.clone(); } // protected String namespaceUri[]; if(namespaceUri != null) { cloned.namespaceUri = (String[]) namespaceUri.clone(); } // protected String entityName[]; if(entityName != null) { cloned.entityName = (String[]) entityName.clone(); } // protected char[] entityNameBuf[]; if(entityNameBuf != null) { cloned.entityNameBuf = cloneCCArr(entityNameBuf); } // protected int entityNameHash[]; if(entityNameHash != null) { cloned.entityNameHash = (int[]) entityNameHash.clone(); } // protected char[] entityReplacementBuf[]; if(entityReplacementBuf != null) { cloned.entityReplacementBuf = cloneCCArr(entityReplacementBuf); } // protected String entityReplacement[]; if(entityReplacement != null) { cloned.entityReplacement = (String[]) entityReplacement.clone(); } // protected char buf[]; if(buf != null) { cloned.buf = (char[]) buf.clone(); } // protected char pc[]; if(pc != null) { cloned.pc = (char[]) pc.clone(); } // protected char[] charRefOneCharBuf; if(charRefOneCharBuf != null) { cloned.charRefOneCharBuf = (char[]) charRefOneCharBuf.clone(); } return cloned; } private char[][] cloneCCArr(char[][] ccarr) { char[][] cca = (char[][]) ccarr.clone(); for (int i = 0; i < cca.length; i++) { if(cca[i] != null) { cca[i] = (char[]) cca[i].clone(); } } return cca; } public MXParserCachingStrings() { super(); allStringsInterned = true; initStringCache(); } /** * This allows to change name iterning property in this enhanced impl. */ public void setFeature(String name, boolean state) throws XmlPullParserException { if(FEATURE_NAMES_INTERNED.equals(name)) { if(eventType != START_DOCUMENT) throw new XmlPullParserException( "interning names feature can only be changed before parsing", this, null); allStringsInterned = state; if(state == false) { if(keys != null) resetStringCache(); } } else { super.setFeature(name, state); } } public boolean getFeature(String name) { if(FEATURE_NAMES_INTERNED.equals(name)) { return allStringsInterned; } else { return super.getFeature(name); } } /** * Hook to GC finalization to print statistics about pool cache impl. perf. */ public void finalize() { if(CACHE_STATISTICS) { if( cacheStatCalls > 0) { System.out.println("statistics: average walk:"+cacheStatWalks+"/"+cacheStatCalls+ " ("+((double)cacheStatWalks)/cacheStatCalls+")"+ " resets="+cacheStatResets+" rehash="+cacheStatRehash); } else { System.out.println("statistics: cache was not used"); } } } /** * If feature name interning is enabled then this funtion * MUST return interned string. */ protected String newString(char[] cbuf, int off, int len) { if(allStringsInterned) { return newStringIntern(cbuf, off, len); } else { return super.newString(cbuf, off, len); } } /** * This is efficient implementation of pool that returns * interned String based on char[] input. */ protected String newStringIntern(char[] cbuf, int off, int len) { //return (new String(cbuf, off, len)).intern(); if(CACHE_STATISTICS) ++cacheStatCalls; if (cacheEntriesCount >= cacheEntriesThreshold) { rehash(); } int offset = fastHash(cbuf, off, len) % keys.length; char[] k = null; while( (k = keys[offset]) != null && !keysAreEqual(k, 0, k.length, cbuf, off, len)) { offset = (offset + 1) % keys.length; if(CACHE_STATISTICS) ++cacheStatWalks; } if (k != null) { return values[offset]; } else { k = new char[len]; System.arraycopy(cbuf, off, k, 0, len); final String v = new String(k).intern(); keys[offset] = k; values[offset] = v; ++cacheEntriesCount; return v; } } protected void initStringCache() { if(keys == null) { //int initialCapacity = 13; if(INITIAL_CAPACITY < 0) { throw new IllegalArgumentException("Illegal initial capacity: " + INITIAL_CAPACITY); } if(CACHE_LOAD < 0 || CACHE_LOAD > 99) { throw new IllegalArgumentException("Illegal load factor: " + CACHE_LOAD); } cacheEntriesThreshold = (int)((INITIAL_CAPACITY * CACHE_LOAD)/100); if(cacheEntriesThreshold >= INITIAL_CAPACITY) throw new RuntimeException( "internal error: threshold must be less than capacity: "+INITIAL_CAPACITY); keys = new char[INITIAL_CAPACITY][]; values = new String[INITIAL_CAPACITY]; cacheEntriesCount = 0; } } protected void resetStringCache() { //System.out.println("reset string cache()"); if(CACHE_STATISTICS) ++cacheStatResets; initStringCache(); } private void rehash() { if(CACHE_STATISTICS) ++cacheStatRehash; final int newSize = 2 * keys.length + 1; cacheEntriesThreshold = (int)((newSize * CACHE_LOAD)/100); if(cacheEntriesThreshold >= newSize) throw new RuntimeException( "internal error: threshold must be less than capacity: "+newSize); if(TRACE_SIZING) System.err.println("resized "+keys.length+" => "+newSize); final char[][] newKeys = new char[newSize][]; final String[] newValues = new String[newSize]; for(int i = 0; i < keys.length; i++) { final char[] k = keys[i]; keys[i] = null; final String v = values[i]; values[i] = null; if(k != null) { int newOffset = fastHash(k, 0, k.length) % newSize; char[] newk = null; while((newk = newKeys[newOffset]) != null) { if(keysAreEqual(newk, 0, newk.length, k, 0, k.length)) { throw new RuntimeException("internal cache error: duplicated keys: "+ new String(newk)+" and "+new String(k)); } newOffset = (newOffset + 1) % newSize; } newKeys[newOffset] = k; newValues[newOffset] = v; } } keys = newKeys; values = newValues; } private static final boolean keysAreEqual (char[] a, int astart, int alength, char[] b, int bstart, int blength) { if(alength != blength) { return false; } else { for(int i = 0; i < alength; i++) { if(a[astart + i] != b[bstart + i]) { return false; } } return true; } } } /* * Indiana University Extreme! Lab Software License, Version 1.2 * * Copyright (c) 2002-2004 The Trustees of Indiana University. * 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) All redistributions of source code must retain the above * copyright notice, the list of authors in the original source * code, this list of conditions and the disclaimer listed in this * license; * * 2) All redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the disclaimer * listed in this license in the documentation and/or other * materials provided with the distribution; * * 3) Any documentation included with all redistributions must include * the following acknowledgement: * * "This product includes software developed by the Indiana * University Extreme! Lab. For further information please visit * http://www.extreme.indiana.edu/" * * Alternatively, this acknowledgment may appear in the software * itself, and wherever such third-party acknowledgments normally * appear. * * 4) The name "Indiana University" or "Indiana University * Extreme! Lab" shall not be used to endorse or promote * products derived from this software without prior written * permission from Indiana University. For written permission, * please contact http://www.extreme.indiana.edu/. * * 5) Products derived from this software may not use "Indiana * University" name nor may "Indiana University" appear in their name, * without prior written permission of the Indiana University. * * Indiana University provides no reassurances that the source code * provided does not infringe the patent or any other intellectual * property rights of any other entity. Indiana University disclaims any * liability to any recipient for claims brought by any other entity * based on infringement of intellectual property rights or otherwise. * * LICENSEE UNDERSTANDS THAT SOFTWARE IS PROVIDED "AS IS" FOR WHICH * NO WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. INDIANA * UNIVERSITY GIVES NO WARRANTIES AND MAKES NO REPRESENTATION THAT * SOFTWARE IS FREE OF INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR * OTHER PROPRIETARY RIGHTS. INDIANA UNIVERSITY MAKES NO WARRANTIES THAT * SOFTWARE IS FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP * DOORS", "WORMS", OR OTHER HARMFUL CODE. LICENSEE ASSUMES THE ENTIRE * RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR ASSOCIATED MATERIALS, * AND TO THE PERFORMANCE AND VALIDITY OF INFORMATION GENERATED USING * SOFTWARE. */ xpp3-1.1.4c/src/java/mxp1_standard/org/xmlpull/mxp1/MXParserFactory.java100644 0 0 10604 10525225062 25211 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ /* * Copyright (c) 2002-2004 Extreme! Lab, Indiana University. All rights reserved. * * This software is open source. See the bottom of this file for the licence. * * $Id: MXParserFactory.java,v 1.6 2004/03/02 09:14:41 aslom Exp $ */ package org.xmlpull.mxp1; import java.util.Enumeration; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlSerializer; import org.xmlpull.mxp1_serializer.MXSerializer; /** * Simple facotry to speed up creation process. * * @author Aleksander Slominski */ public class MXParserFactory extends XmlPullParserFactory { protected static boolean stringCachedParserAvailable = true; public XmlPullParser newPullParser() throws XmlPullParserException { XmlPullParser pp = null; if(stringCachedParserAvailable) { try { pp = new MXParserCachingStrings(); } catch(Exception ex) { stringCachedParserAvailable = false; } } if(pp == null) { pp = new MXParser(); } for (Enumeration e = features.keys (); e.hasMoreElements ();) { final String key = (String) e.nextElement(); final Boolean value = (Boolean) features.get(key); if(value != null && value.booleanValue()) { pp.setFeature(key, true); } } return pp; } public XmlSerializer newSerializer() throws XmlPullParserException { return new MXSerializer(); } } /* * Indiana University Extreme! Lab Software License, Version 1.2 * * Copyright (c) 2002-2004 The Trustees of Indiana University. * 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) All redistributions of source code must retain the above * copyright notice, the list of authors in the original source * code, this list of conditions and the disclaimer listed in this * license; * * 2) All redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the disclaimer * listed in this license in the documentation and/or other * materials provided with the distribution; * * 3) Any documentation included with all redistributions must include * the following acknowledgement: * * "This product includes software developed by the Indiana * University Extreme! Lab. For further information please visit * http://www.extreme.indiana.edu/" * * Alternatively, this acknowledgment may appear in the software * itself, and wherever such third-party acknowledgments normally * appear. * * 4) The name "Indiana University" or "Indiana University * Extreme! Lab" shall not be used to endorse or promote * products derived from this software without prior written * permission from Indiana University. For written permission, * please contact http://www.extreme.indiana.edu/. * * 5) Products derived from this software may not use "Indiana * University" name nor may "Indiana University" appear in their name, * without prior written permission of the Indiana University. * * Indiana University provides no reassurances that the source code * provided does not infringe the patent or any other intellectual * property rights of any other entity. Indiana University disclaims any * liability to any recipient for claims brought by any other entity * based on infringement of intellectual property rights or otherwise. * * LICENSEE UNDERSTANDS THAT SOFTWARE IS PROVIDED "AS IS" FOR WHICH * NO WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. INDIANA * UNIVERSITY GIVES NO WARRANTIES AND MAKES NO REPRESENTATION THAT * SOFTWARE IS FREE OF INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR * OTHER PROPRIETARY RIGHTS. INDIANA UNIVERSITY MAKES NO WARRANTIES THAT * SOFTWARE IS FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP * DOORS", "WORMS", OR OTHER HARMFUL CODE. LICENSEE ASSUMES THE ENTIRE * RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR ASSOCIATED MATERIALS, * AND TO THE PERFORMANCE AND VALIDITY OF INFORMATION GENERATED USING * SOFTWARE. */ xpp3-1.1.4c/src/java/mxp1_standard/org/xmlpull/mxp1/MXParserNonValidating.java100644 0 0 33703 10525225062 26344 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ /* * Copyright (c) 2002-2004 Extreme! Lab, Indiana University. All rights reserved. * * This software is open source. See the bottom of this file for the licence. * * $Id: MXParserNonValidating.java,v 1.6 2004/03/02 09:14:41 aslom Exp $ */ package org.xmlpull.mxp1; import java.io.IOException; import org.xmlpull.v1.XmlPullParserException; /** * Extend MXP parser to be full non validating XML 1.0 parser * (added internal DTD parsing and support for full XML 1.0 (or 1.1) character classes). * * @author Aleksander Slominski */ public class MXParserNonValidating extends MXParserCachingStrings { private boolean processDocDecl; public MXParserNonValidating() { super(); } /** * This allows to change processing DOCDECL (controls if parser is non-validating). */ public void setFeature(String name, boolean state) throws XmlPullParserException { if(FEATURE_PROCESS_DOCDECL.equals(name)) { if(eventType != START_DOCUMENT) throw new XmlPullParserException( "process DOCDECL feature can only be changed before parsing", this, null); processDocDecl = state; if(state == false) { // } } else { super.setFeature(name, state); } } public boolean getFeature(String name) { if(FEATURE_PROCESS_DOCDECL.equals(name)) { return processDocDecl; } else { return super.getFeature(name); } } // will need to overwrite more() and processEntityRef ... protected char more() throws IOException, XmlPullParserException { return super.more(); } protected char[] lookuEntityReplacement(int entitNameLen) throws XmlPullParserException, IOException { if(!allStringsInterned) { final int hash = fastHash(buf, posStart, posEnd - posStart); LOOP: for (int i = entityEnd - 1; i >= 0; --i) { if(hash == entityNameHash[ i ] && entitNameLen == entityNameBuf[ i ].length) { final char[] entityBuf = entityNameBuf[ i ]; for (int j = 0; j < entitNameLen; j++) { if(buf[posStart + j] != entityBuf[j]) continue LOOP; } if(tokenize) text = entityReplacement[ i ]; return entityReplacementBuf[ i ]; } } } else { entityRefName = newString(buf, posStart, posEnd - posStart); for (int i = entityEnd - 1; i >= 0; --i) { // take advantage that interning for newStirng is enforced if(entityRefName == entityName[ i ]) { if(tokenize) text = entityReplacement[ i ]; return entityReplacementBuf[ i ]; } } } return null; } protected void parseDocdecl() throws XmlPullParserException, IOException { //make sure that tokenize flag is disabled temporarily!!!! final boolean oldTokenize = tokenize; try { //ASSUMPTION: seen ' ch = requireNextS(); int nameStart = pos; ch = readName(ch); int nameEnd = pos; ch = skipS(ch); // [75] ExternalID ::= 'SYSTEM' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral if(ch == 'S' || ch == 'P') { ch = processExternalId(ch); ch = skipS(ch); } if(ch == '[') { processInternalSubset(); } ch = skipS(ch); if(ch != '>') { throw new XmlPullParserException( "expected > to finish <[DOCTYPE but got "+printable(ch), this, null); } posEnd = pos - 1; } finally { tokenize = oldTokenize; } } protected char processExternalId(char ch) throws XmlPullParserException, IOException { // [75] ExternalID ::= 'SYSTEM' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral // [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'") // [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'" // [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%] //TODO return ch; } protected void processInternalSubset() throws XmlPullParserException, IOException { // [28] ... (markupdecl | DeclSep)* ']' // [WFC: External Subset] // [28a] DeclSep ::= PEReference | S // [WFC: PE Between Declarations] // [69] PEReference ::= '%' Name ';' //[WFC: No Recursion] [WFC: In DTD] while(true) { char ch = more(); // firs ttime called it will skip initial "[" if(ch == ']') break; if(ch == '%') { processPEReference(); } else if(isS(ch)) { ch = skipS(ch); } else { processMarkupDecl(ch); } } } protected void processPEReference() throws XmlPullParserException, IOException { //TODO } protected void processMarkupDecl(char ch) throws XmlPullParserException, IOException { // [29] markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment // [WFC: PEs in Internal Subset] //BIG SWITCH statement if(ch != '<') { throw new XmlPullParserException("expected < for markupdecl in DTD not "+printable(ch), this, null); } ch = more(); if(ch == '?') { parsePI(); } else if(ch == '!') { ch = more(); if(ch == '-') { // note: if(tokenize == false) posStart/End is NOT changed!!!! parseComment(); } else { ch = more(); if(ch == 'A') { processAttlistDecl(ch); //A-TTLIST } else if(ch == 'E') { ch = more(); if(ch == 'L') { processElementDecl(ch); //EL-EMENT } else if(ch == 'N') { processEntityDecl(ch); // EN-TITY } else { throw new XmlPullParserException( "expected ELEMENT or ENTITY after ' //???? [VC: Unique Element Type Declaration] // [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children // [47] children ::= (choice | seq) ('?' | '*' | '+')? // [48] cp ::= (Name | choice | seq) ('?' | '*' | '+')? // [49] choice ::= '(' S? cp ( S? '|' S? cp )+ S? ')' // [50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')' // [51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*' // | '(' S? '#PCDATA' S? ')' //assert ch == 'L' ch = requireNextS(); readName(ch); ch = requireNextS(); // readContentSpec(ch); } protected void processAttlistDecl(char ch) throws XmlPullParserException, IOException { // [52] AttlistDecl ::= '' // [53] AttDef ::= S Name S AttType S DefaultDecl // [54] AttType ::= StringType | TokenizedType | EnumeratedType // [55] StringType ::= 'CDATA' // [56] TokenizedType ::= 'ID' | 'IDREF' | 'IDREFS' | 'ENTITY' | 'ENTITIES' | 'NMTOKEN' // | 'NMTOKENS' // [57] EnumeratedType ::= NotationType | Enumeration // [58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')' // [59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')' // [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue) // [WFC: No < in Attribute Values] //assert ch == 'A' } protected void processEntityDecl(char ch) throws XmlPullParserException, IOException { // [70] EntityDecl ::= GEDecl | PEDecl // [71] GEDecl ::= '' // [72] PEDecl ::= '' // [73] EntityDef ::= EntityValue | (ExternalID NDataDecl?) // [74] PEDef ::= EntityValue | ExternalID // [75] ExternalID ::= 'SYSTEM' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral //[9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"' // | "'" ([^%&'] | PEReference | Reference)* "'" //assert ch == 'N' } protected void processNotationDecl(char ch) throws XmlPullParserException, IOException { // [82] NotationDecl ::= '' // [83] PublicID ::= 'PUBLIC' S PubidLiteral //assert ch == 'N' } protected char readName(char ch) throws XmlPullParserException, IOException { if(isNameStartChar(ch)) { throw new XmlPullParserException( "XML name must start with name start character not "+printable(ch), this, null); } while(isNameChar(ch)) { ch = more(); } return ch; } } /* * Indiana University Extreme! Lab Software License, Version 1.2 * * Copyright (c) 2002-2004 The Trustees of Indiana University. * 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) All redistributions of source code must retain the above * copyright notice, the list of authors in the original source * code, this list of conditions and the disclaimer listed in this * license; * * 2) All redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the disclaimer * listed in this license in the documentation and/or other * materials provided with the distribution; * * 3) Any documentation included with all redistributions must include * the following acknowledgement: * * "This product includes software developed by the Indiana * University Extreme! Lab. For further information please visit * http://www.extreme.indiana.edu/" * * Alternatively, this acknowledgment may appear in the software * itself, and wherever such third-party acknowledgments normally * appear. * * 4) The name "Indiana University" or "Indiana University * Extreme! Lab" shall not be used to endorse or promote * products derived from this software without prior written * permission from Indiana University. For written permission, * please contact http://www.extreme.indiana.edu/. * * 5) Products derived from this software may not use "Indiana * University" name nor may "Indiana University" appear in their name, * without prior written permission of the Indiana University. * * Indiana University provides no reassurances that the source code * provided does not infringe the patent or any other intellectual * property rights of any other entity. Indiana University disclaims any * liability to any recipient for claims brought by any other entity * based on infringement of intellectual property rights or otherwise. * * LICENSEE UNDERSTANDS THAT SOFTWARE IS PROVIDED "AS IS" FOR WHICH * NO WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. INDIANA * UNIVERSITY GIVES NO WARRANTIES AND MAKES NO REPRESENTATION THAT * SOFTWARE IS FREE OF INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR * OTHER PROPRIETARY RIGHTS. INDIANA UNIVERSITY MAKES NO WARRANTIES THAT * SOFTWARE IS FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP * DOORS", "WORMS", OR OTHER HARMFUL CODE. LICENSEE ASSUMES THE ENTIRE * RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR ASSOCIATED MATERIALS, * AND TO THE PERFORMANCE AND VALIDITY OF INFORMATION GENERATED USING * SOFTWARE. */ xpp3-1.1.4c/src/java/mxp1_standard/org/xmlpull/mxp1/package.html100644 0 0 424 10525225062 23535 0ustaraslomewww 0 0

      Contains XPP3 implementation of XMLPULL V1 API. xpp3-1.1.4c/src/java/parser_pool/org/xmlpull/v1/parser_pool/XmlPullParserPool.java100644 0 0 4677 10525225063 27330 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package org.xmlpull.v1.parser_pool; import java.util.ArrayList; import java.util.List; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; // add aging so parser used more than X times is not resused ... /** * Very simple utility to make pooling of XmlPull parsers easy. * * @author Aleksander Slominski */ public class XmlPullParserPool { protected List pool = new ArrayList(); protected XmlPullParserFactory factory; public XmlPullParserPool() throws XmlPullParserException { this(XmlPullParserFactory.newInstance()); } public XmlPullParserPool(XmlPullParserFactory factory) { if(factory == null) throw new IllegalArgumentException(); this.factory = factory; } protected XmlPullParser newParser() throws XmlPullParserException { return factory.newPullParser(); } public XmlPullParser getPullParserFromPool() throws XmlPullParserException { XmlPullParser pp = null; if(pool.size() > 0) { synchronized(pool) { if(pool.size() > 0) { pp = (XmlPullParser) pool.remove(pool.size() - 1); } } } if(pp == null) { pp = newParser(); //System.err.println("new parser instance created pp="+pp); } return pp; } public void returnPullParserToPool(XmlPullParser pp) { if(pp == null) throw new IllegalArgumentException(); synchronized(pool) { pool.add(pp); } } // simple inline test public static void main(String[] args) throws Exception { //XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); //XmlPullParserPool pool = new XmlPullParserPool(factory); XmlPullParserPool pool = new XmlPullParserPool(); XmlPullParser p1 = pool.getPullParserFromPool(); pool.returnPullParserToPool(p1); XmlPullParser p2 = pool.getPullParserFromPool(); //assert p1 == p2; if(p1 != p2) throw new RuntimeException(); pool.returnPullParserToPool(p2); System.out.println(pool.getClass()+" OK"); } } xpp3-1.1.4c/src/java/samples/BestDeal.java100644 0 0 11250 10525225062 17367 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) import org.xmlpull.v1.*; import java.io.*; import java.text.MessageFormat; /** * Rewritten http://www-106.ibm.com/developerworks/xml/library/x-saxapi/listing4.html * to make easy to comapre how to "natutal is to manage state with SAX and with XMLPULL API. * For details see: http://www-106.ibm.com/developerworks/xml/library/x-saxapi/ */ public class BestDeal { protected static final String MESSAGE = "The best deal is proposed by {0}. " + "A(n) {1} delivered in {2,number,integer} days for " + "{3,number,currency}"; protected static final String NAMESPACE_URI = "http://www.psol.com/xbe2/listing8.3"; /** * properties we are collecting: best price, delivery time, * product and vendor names */ public double price = Double.MAX_VALUE; public int delivery = Integer.MAX_VALUE; public String product = null; public String vendor = null; /** * target delivery value (refuse elements above this target) */ protected int targetDelivery; /** * creates an "empty" BestDeal with the given target for delivery * @param td the target for delivery */ public BestDeal(int td) { targetDelivery = td; } /** * updates the best deal from the given list in the format */ public void update(XmlPullParser parser) throws IOException, XmlPullParserException { parser.require(XmlPullParser.START_DOCUMENT, null, null); parser.nextTag(); parser.require(XmlPullParser.START_TAG, NAMESPACE_URI, "price-list"); parser.nextTag(); parser.require(XmlPullParser.START_TAG, NAMESPACE_URI, "name"); product = parser.nextText(); parser.require(XmlPullParser.END_TAG, NAMESPACE_URI, "name"); while (parser.nextTag() == XmlPullParser.START_TAG) { checkVendor(parser); } parser.require(XmlPullParser.END_TAG, NAMESPACE_URI, "price-list"); parser.next(); parser.require(XmlPullParser.END_DOCUMENT, null, null); } /** subroutine handling a single vendor */ public void checkVendor(XmlPullParser parser) throws IOException, XmlPullParserException { parser.require(XmlPullParser.START_TAG, NAMESPACE_URI, "vendor"); String currentVendor = null; while (parser.nextTag() == XmlPullParser.START_TAG) { parser.require(XmlPullParser.START_TAG, NAMESPACE_URI, null); String name = parser.getName(); if (name.equals("name")) { currentVendor = parser.nextText(); } else if (name.equals("price-quote")) { int currentDelivery = Integer.parseInt(parser.getAttributeValue("", "delivery")); double currentPrice = Double.parseDouble(parser.nextText()); if (currentDelivery < targetDelivery && currentPrice < price) { vendor = currentVendor; price = currentPrice; delivery = currentDelivery; } } else { System.out.println("trying to skip unknwon element: "+ name); String content = parser.nextText(); System.out.println("skipped element content:" + content); } parser.require(XmlPullParser.END_TAG, NAMESPACE_URI, name); } parser.require(XmlPullParser.END_TAG, NAMESPACE_URI, "vendor"); } /** * main() method * decodes command-line parameters and invoke the parser * @param args command-line argument * @throw Exception catch-all for underlying exceptions */ public static void main(String[] args) throws IOException, XmlPullParserException { if (args.length < 2) { System.out.println("BestDeal "); return; } BestDeal bestDeal = new BestDeal(Integer.parseInt(args[1])); XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); factory.setNamespaceAware(true); XmlPullParser parser = factory.newPullParser(); InputStream is = new FileInputStream(args[0]); parser.setInput(is, null); bestDeal.update(parser); is.close(); Object[] objects = new Object[] { bestDeal.vendor, bestDeal.product, new Integer(bestDeal.delivery), new Double(bestDeal.price)}; System.out.println(MessageFormat.format(MESSAGE, objects)); } } xpp3-1.1.4c/src/java/samples/LICENSE.txt100644 0 0 562 10525225062 16630 0ustaraslomewww 0 0 XMLPULL API IS FREE ------------------- All of the XMLPULL API source code, compiled code, and documentation contained in this distribution *except* for tests (see separate LICENSE_TESTS.txt) are in the Public Domain. XMLPULL API comes with NO WARRANTY or guarantee of fitness for any purpose. Initial authors: Stefan Haustein Aleksander Slominski 2001-12-12 xpp3-1.1.4c/src/java/samples/MyXmlPullApp.java100644 0 0 11150 10525225062 20247 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) import java.io.FileReader; import java.io.IOException; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; /** * An example of an application that uses XMLPULL V1 API. * * @author Aleksander Slominski */ public class MyXmlPullApp { public final static String SAMPLE_XML = "\n"+ "\n"+ "\n"+ "Roses are Red\n"+ "Roses are red,\n"+ "Violets are blue;\n"+ "Sugar is sweet,\n"+ "And I love you.\n"+ ""; public static void main (String args[]) throws XmlPullParserException, IOException { XmlPullParserFactory factory = XmlPullParserFactory.newInstance( System.getProperty(XmlPullParserFactory.PROPERTY_NAME), null); //factory.setNamespaceAware(true); factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); XmlPullParser xpp = factory.newPullParser(); System.out.println("parser implementation class is "+xpp.getClass()); MyXmlPullApp app = new MyXmlPullApp(); if(args.length == 0) { System.out.println("Parsing simple sample XML");//:\n"+ SAMPLE_XML); xpp.setInput( new StringReader( SAMPLE_XML ) ); app.processDocument(xpp); } else { for (int i = 0; i < args.length; i++) { System.out.println("Parsing file: "+args[i]); xpp.setInput ( new FileReader ( args [i] ) ); //xpp.setInput ( new InputStreamReader( new FileInputStream ( args [i] ) ) ); //xpp.setInput ( new FileInputStream ( args [i] ), "UTF8" ); app.processDocument(xpp); } } } public void processDocument(XmlPullParser xpp) throws XmlPullParserException, IOException { int eventType = xpp.getEventType(); do { if(eventType == XmlPullParser.START_DOCUMENT) { System.out.println("Start document"); } else if(eventType == XmlPullParser.END_DOCUMENT) { System.out.println("End document"); } else if(eventType == XmlPullParser.START_TAG) { processStartElement(xpp); } else if(eventType == XmlPullParser.END_TAG) { processEndElement(xpp); } else if(eventType == XmlPullParser.TEXT) { processText(xpp); } eventType = xpp.next(); } while (eventType != XmlPullParser.END_DOCUMENT); } public void processStartElement (XmlPullParser xpp) { String name = xpp.getName(); String uri = xpp.getNamespace(); if ("".equals (uri)) { System.out.println("Start element: " + name); } else { System.out.println("Start element: {" + uri + "}" + name); } } public void processEndElement (XmlPullParser xpp) { String name = xpp.getName(); String uri = xpp.getNamespace(); if ("".equals (uri)) System.out.println("End element: " + name); else System.out.println("End element: {" + uri + "}" + name); } int holderForStartAndLength[] = new int[2]; public void processText (XmlPullParser xpp) throws XmlPullParserException { char ch[] = xpp.getTextCharacters(holderForStartAndLength); int start = holderForStartAndLength[0]; int length = holderForStartAndLength[1]; System.out.print("Characters: \""); for (int i = start; i < start + length; i++) { switch (ch[i]) { case '\\': System.out.print("\\\\"); break; case '"': System.out.print("\\\""); break; case '\n': System.out.print("\\n"); break; case '\r': System.out.print("\\r"); break; case '\t': System.out.print("\\t"); break; default: System.out.print(ch[i]); break; } } System.out.print("\"\n"); } } xpp3-1.1.4c/src/java/samples/MyXmlWriteApp.java100644 0 0 7276 10525225062 20423 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) import java.io.IOException; import java.io.PrintWriter; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlSerializer; /** * An example of an application that uses XmlPull v1 API to write XML. * * @author Aleksander Slominski */ public class MyXmlWriteApp { private final static String NAMESPACE = "http://www.megginson.com/ns/exp/poetry"; public static void main (String args[]) throws XmlPullParserException, IOException { XmlPullParserFactory factory = XmlPullParserFactory.newInstance( System.getProperty(XmlPullParserFactory.PROPERTY_NAME), null); XmlSerializer serializer = factory.newSerializer(); System.out.println("serializer implementation class is "+serializer.getClass()); boolean addNewLine = false; int argPos = 0; while(argPos < args.length) { String arg = args[argPos]; if("-n".equals(arg) ) { addNewLine = true; } else if("-i".equals(arg)) { // set indentation to number of spaces passed as argument String s = args[++argPos]; int indentSize = Integer.parseInt(s); StringBuffer buf = new StringBuffer(indentSize); for (int i = 0; i < indentSize; i++) { buf.append(' '); } String indent = buf.toString(); // this is optional propery serializer.setProperty( "http://xmlpull.org/v1/doc/properties.html#serializer-indentation", indent); } ++argPos; } // set output serializer.setOutput(new PrintWriter( System.out )); // first write XML declaration serializer.startDocument(null, null); // add some empty lines before first start tag serializer.ignorableWhitespace("\n\n"); // if prefix is not set serializer will generate automatically prefix // we overwrite this mechanism and manually namespace to be default (empty prefix) serializer.setPrefix("", NAMESPACE); serializer.startTag(NAMESPACE, "poem"); if(addNewLine) serializer.text("\n"); serializer.startTag(NAMESPACE, "title"); serializer.text("Roses are Red"); serializer.endTag(NAMESPACE, "title"); if(addNewLine) serializer.text("\n"); serializer.startTag(NAMESPACE, "l") .text("Roses are red,") .endTag(NAMESPACE, "l"); if(addNewLine) serializer.text("\n"); //multiple operations can be also combined to get shorter syntax serializer.startTag(NAMESPACE, "l").text("Violets are blue;").endTag(NAMESPACE, "l"); if(addNewLine) serializer.text("\n"); // or writing can be delegate to specialized functions writeLine(serializer, "Sugar is sweet,", addNewLine); writeLine(serializer, "And I love you.,", addNewLine); serializer.endTag(NAMESPACE, "poem"); // this will ensure that output is flushed and prevent from writing to serializer serializer.endDocument(); } private static void writeLine(XmlSerializer serializer, String line, boolean addNewLine) throws IOException { serializer.startTag(NAMESPACE, "l"); serializer.text(line); serializer.endTag(NAMESPACE, "l"); if(addNewLine) serializer.text("\n"); } } xpp3-1.1.4c/src/java/samples/README.txt100644 0 0 63 10525225062 16457 0ustaraslomewww 0 0 place for samples demonstrating use of XMLPULL API xpp3-1.1.4c/src/java/samples/RSSReader.java100644 0 0 11467 10525225062 17510 0ustaraslomewww 0 0 // modified by Aleksander Slominski // based on http://www.xml.com/pub/a/2002/05/22/parsing.html?page=2 import java.io.*; import java.net.*; import org.xmlpull.v1.*; public class RSSReader { public static void main(String [] args) { // create an instance of RSSReader RSSReader rssreader = new RSSReader(); try { XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); XmlPullParser parser = factory.newPullParser(); String url = args[0]; InputStreamReader stream = new InputStreamReader( new URL(url).openStream()); parser.setInput(stream); XmlSerializer writer = factory.newSerializer(); writer.setOutput(new OutputStreamWriter(System.out)); rssreader.convertRSSToHtml(parser, writer); } catch (Exception e) { e.printStackTrace(System.err); } } public void convertRSSToHtml(XmlPullParser parser, XmlSerializer writer) throws IOException, XmlPullParserException { // if (parser.nextTag() == XmlPullParser.START_TAG && parser.getName().equals("rss")) { writer.startTag(null,"html"); if (parser.nextTag() == XmlPullParser.START_TAG && parser.getName().equals("channel")) { convertChannelToHtml(parser, writer); parser.require(XmlPullParser.END_TAG, null, "channel"); } else { new RuntimeException("expectd channel start tag not "+parser.getPositionDescription()); } parser.nextTag(); parser.require(XmlPullParser.END_TAG, null, "rss"); writer.endTag(null, "html"); writer.flush(); } else { throw new RuntimeException("expectd an RSS document at" + parser.getPositionDescription()); } } public void convertChannelToHtml(XmlPullParser parser, XmlSerializer writer) throws IOException, XmlPullParserException { // boolean seenBody = false; //assumption that title is before items ... while (parser.nextTag() != XmlPullParser.END_TAG) { // this guranteed by well formednes of XML && parser.getName().equals("channel"))) { // if (parser.getEventType() == XmlPullParser.START_TAG) { //guranteed by nextTag // if(parser.getName().equals("title") && !seenBody) { writer.startTag(null,"head"); writer.startTag(null,"title").text(parser.nextText()).endTag(null,"title"); writer.endTag(null,"head"); } else if(parser.getName().equals("item")) { if(!seenBody) { writer.startTag(null, "body"); seenBody = true; } convertItemToHtml(parser, writer); } else { // skip any element content including sub elements... int level = 1; while (level > 0) { switch(parser.next()) { case XmlPullParser.START_TAG: ++level; break; case XmlPullParser.END_TAG: --level; break; } } } } if(seenBody) writer.endTag(null, "body"); } public void convertItemToHtml(XmlPullParser parser, XmlSerializer writer) throws IOException, XmlPullParserException { writer.startTag(null, "p"); // String title = null, link = null, description = null; while (parser.nextTag() != XmlPullParser.END_TAG) { if (parser.getName().equals("title")) { title = parser.nextText(); } else if (parser.getName().equals("link")) { link = parser.nextText(); } else if (parser.getName().equals("description")) { description = parser.nextText(); } } //HashMap attributes = new HashMap(1); //if(link != null) attributes.put("href", link); //writer.beginElement("a",attributes); writer.startTag(null, "a"); writer.attribute(null, "href", link); if(title != null) { writer.text(title); } else { writer.text(link); } writer.endTag(null,"a"); //writer.writeEmptyElement("br"); writer.startTag(null, "br").endTag(null, "br"); if(description != null) writer.text(description); writer.endTag(null, "p"); // end the "p" element } } xpp3-1.1.4c/src/java/samples/Roundtrip.java100644 0 0 14505 10525225062 17700 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) //package org.xmlpull.v1.samples; import java.io.*; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlSerializer; /** * This sample demonstrates how to roundtrip XML document * (roundtrip is not exact but infoset level) */ public class Roundtrip { private final static String PROPERTY_XMLDECL_STANDALONE = "http://xmlpull.org/v1/doc/features.html#xmldecl-standalone"; private final static String PROPERTY_SERIALIZER_INDENTATION = "http://xmlpull.org/v1/doc/properties.html#serializer-indentation"; private XmlPullParser parser; private XmlSerializer serializer; private Roundtrip (XmlPullParser parser, XmlSerializer serializer) { this.parser = parser; this.serializer = serializer; } private void writeStartTag () throws XmlPullParserException, IOException { //check for case when feature xml roundtrip is supported //if (parser.getFeature (FEATURE_XML_ROUNDTRIP)) { if (!parser.getFeature (XmlPullParser.FEATURE_REPORT_NAMESPACE_ATTRIBUTES)) { for (int i = parser.getNamespaceCount (parser.getDepth ()-1); i <= parser.getNamespaceCount (parser.getDepth ())-1; i++) { serializer.setPrefix (parser.getNamespacePrefix (i), parser.getNamespaceUri (i)); } } serializer.startTag(parser.getNamespace (), parser.getName ()); for (int i = 0; i < parser.getAttributeCount (); i++) { serializer.attribute (parser.getAttributeNamespace (i), parser.getAttributeName (i), parser.getAttributeValue (i)); } //serializer.closeStartTag(); } private void writeToken (int eventType) throws XmlPullParserException, IOException { switch (eventType) { case XmlPullParser.START_DOCUMENT: //use Boolean.TRUE to make it standalone Boolean standalone = (Boolean) parser.getProperty(PROPERTY_XMLDECL_STANDALONE); serializer.startDocument(parser.getInputEncoding(), standalone); break; case XmlPullParser.END_DOCUMENT: serializer.endDocument(); break; case XmlPullParser.START_TAG: writeStartTag (); break; case XmlPullParser.END_TAG: serializer.endTag(parser.getNamespace (), parser.getName ()); break; case XmlPullParser.IGNORABLE_WHITESPACE: //comment it to remove ignorable whtespaces from XML infoset String s = parser.getText (); serializer.ignorableWhitespace (s); break; case XmlPullParser.TEXT: serializer.text (parser.getText ()); break; case XmlPullParser.ENTITY_REF: serializer.entityRef (parser.getName ()); break; case XmlPullParser.CDSECT: serializer.cdsect( parser.getText () ); break; case XmlPullParser.PROCESSING_INSTRUCTION: serializer.processingInstruction( parser.getText ()); break; case XmlPullParser.COMMENT: serializer.comment (parser.getText ()); break; case XmlPullParser.DOCDECL: serializer.docdecl (parser.getText ()); break; } } private void roundTrip() throws XmlPullParserException, IOException { parser.nextToken(); // read first token writeToken (XmlPullParser.START_DOCUMENT); // write optional XMLDecl if present while (parser.getEventType () != XmlPullParser.END_DOCUMENT) { writeToken ( parser.getEventType () ); parser.nextToken (); } writeToken (XmlPullParser.END_DOCUMENT); } private static void roundTrip(Reader reader, Writer writer, String indent) throws XmlPullParserException, IOException { XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); factory.setNamespaceAware(true); XmlPullParser pp = factory.newPullParser(); pp.setInput(reader); XmlSerializer serializer = factory.newSerializer(); serializer.setOutput( writer ); if(indent != null) { serializer.setProperty(PROPERTY_SERIALIZER_INDENTATION, indent); } (new Roundtrip(pp, serializer)).roundTrip(); } // public static void main(String[] args) throws Exception { // String XML = "fdf"; // Reader r = new StringReader(XML); // Writer w = new StringWriter(); // roundTrip(r, w, " "); // System.out.println("indented XML="+w); // } private static void roundTrip(XmlPullParserFactory factory, String loc) throws XmlPullParserException, IOException { roundTrip(factory, loc, null); } private static void roundTrip(XmlPullParserFactory factory, String loc, String indent) throws XmlPullParserException, IOException { XmlPullParser pp = factory.newPullParser(); pp.setInput(new java.net.URL(loc).openStream(), null); XmlSerializer serializer = factory.newSerializer(); serializer.setOutput( System.out, null); if(indent != null) { serializer.setProperty(PROPERTY_SERIALIZER_INDENTATION, indent); } (new Roundtrip(pp, serializer)).roundTrip(); } public static void main(String[] args) throws Exception { //for (int i = 0; i < args.length; i++) XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); factory.setNamespaceAware(true); for (int i = 0; i < 1; i++) { roundTrip(factory, args[i], " "); } } } xpp3-1.1.4c/src/java/samples/SimpleXmlPullApp.java100644 0 0 3477 10525225062 21110 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) import java.io.IOException; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; /** * Very simple application that demonstrates basics of XMLPULL V1 API. * * @author Aleksander Slominski */ public class SimpleXmlPullApp { public static void main (String args[]) throws XmlPullParserException, IOException { XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); factory.setNamespaceAware(true); //factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); XmlPullParser xpp = factory.newPullParser(); System.out.println("parser implementation class is "+xpp.getClass()); xpp.setInput ( new StringReader ( "Hello World!" ) ); int eventType = xpp.getEventType(); while (eventType != XmlPullParser.END_DOCUMENT) { if(eventType == XmlPullParser.START_DOCUMENT) { System.out.println("Start document"); } else if(eventType == XmlPullParser.END_DOCUMENT) { System.out.println("End document"); } else if(eventType == XmlPullParser.START_TAG) { System.out.println("Start tag "+xpp.getName()); } else if(eventType == XmlPullParser.END_TAG) { System.out.println("End tag "+xpp.getName()); } else if(eventType == XmlPullParser.TEXT) { System.out.println("Text "+xpp.getText()); } eventType = xpp.next(); } } } xpp3-1.1.4c/src/java/samples/XMLRPCDecoder.java100644 0 0 77136 10525225062 20216 0ustaraslomewww 0 0 // // =========================================================================== // // Title: XMLRPCDecoder.java // Description: [Description] // Author: Raphael Szwarc // http://guests.evectors.it/zoe/ // Creation Date: Sun Nov 24 2002 // Legal: Copyright (c) 2002-2004 Raphael Szwarc. All Rights Reserved. // // For license information please see XPP3's LICENSE.txt file // Also available at http://www.xmlpull.org/ // // --------------------------------------------------------------------------- // import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParser; import java.io.Reader; import java.io.InputStreamReader; import java.io.InputStream; import java.io.BufferedInputStream; import java.io.OutputStream; import java.io.BufferedOutputStream; import java.net.URL; import java.net.URLConnection; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Collection; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; public abstract class XMLRPCDecoder extends Object { // =========================================================================== // Constant(s) // --------------------------------------------------------------------------- private static final Class[] Classes = { FaultDecoder.class, MethodDecoder.class, ParametersDecoder.class, ArrayDecoder.class, StructureDecoder.class, ValueDecoder.class, IntegerDecoder.class, BooleanDecoder.class, StringDecoder.class, DoubleDecoder.class, DateDecoder.class, Base64Decoder.class }; // =========================================================================== // Class variable(s) // --------------------------------------------------------------------------- private final static Map _decoders = new HashMap(); // =========================================================================== // Instance variable(s) // --------------------------------------------------------------------------- // =========================================================================== // Constructor method(s) // --------------------------------------------------------------------------- protected XMLRPCDecoder() { super(); } // =========================================================================== // Class initialization method(s) // --------------------------------------------------------------------------- static { Class[] someClasses = XMLRPCDecoder.Classes; int count = someClasses.length; for ( int index = 0; index < count; index++ ) { Class aClass = someClasses[ index ]; try { XMLRPCDecoder aDecoder = (XMLRPCDecoder) aClass.newInstance(); aDecoder.register( _decoders ); } catch (Exception anException) { throw new RuntimeException( "XMLRPCDecoder.decoders: " + anException ); } } } // =========================================================================== // Class method(s) // --------------------------------------------------------------------------- private static Map decoders() { return _decoders; } public static Object decode(Reader aReader) throws Exception { if ( aReader != null ) { Map someDecoders = XMLRPCDecoder.decoders(); XmlPullParserFactory aFactory = XmlPullParserFactory.newInstance(); XmlPullParser aParser = aFactory.newPullParser(); aParser.setInput( aReader ); return XMLRPCDecoder.decode( aParser ); } throw new IllegalArgumentException( "XMLRPCDecoder.decode: null reader." ); } private static XMLRPCDecoder decoderWithName(String aName) { if ( aName != null ) { return (XMLRPCDecoder) XMLRPCDecoder.decoders().get( aName.toUpperCase() ); } throw new IllegalArgumentException( "XMLRPCDecoder.decoderWithName: null name." ); } private static Object decode(XmlPullParser aParser) throws Exception { if ( aParser != null ) { int anEventType = aParser.getEventType(); while ( anEventType != XmlPullParser.END_DOCUMENT ) { if ( anEventType == XmlPullParser.START_TAG ) { String aName = aParser.getName(); XMLRPCDecoder aDecoder = XMLRPCDecoder.decoderWithName( aName ); if ( aDecoder != null ) { return aDecoder.decodeWithParser( aParser ); } else { anEventType = aParser.next(); } } else { anEventType = aParser.next(); } } return null; } throw new IllegalArgumentException( "XMLRPCDecoder.decode: null reader." ); } // =========================================================================== // Instance method(s) // --------------------------------------------------------------------------- protected abstract String[] names(); protected void register(Map aMap) { if ( aMap != null ) { String[] someNames = this.names(); if ( someNames != null ) { int count = someNames.length; for ( int index = 0; index < count; index++ ) { String aName = someNames[ index ]; aMap.put( aName.toUpperCase(), this ); } return; } throw new IllegalStateException( "XMLRPCDecoder.register: null names." ); } throw new IllegalArgumentException( "XMLRPCDecoder.register: null map." ); } protected abstract Object decodeWithParser(XmlPullParser aParser) throws Exception; // =========================================================================== // FaultDecoder method(s) // --------------------------------------------------------------------------- private static final class FaultDecoder extends XMLRPCDecoder { private static final String Name = "fault"; private static final String[] Names = { FaultDecoder.Name }; private static final String FaultStringKey = "faultString"; private static final String FaultCodeKey = "faultCode"; protected FaultDecoder() { super(); } protected String[] names() { return FaultDecoder.Names; } protected Object decodeWithParser(XmlPullParser aParser) throws Exception { if ( aParser != null ) { aParser.require( XmlPullParser.START_TAG, null, FaultDecoder.Name ); aParser.nextTag(); Map aMap = (Map) XMLRPCDecoder.decode( aParser ); Object aValue = null; if ( aMap != null ) { String aDescription = (String) aMap.get( FaultDecoder.FaultStringKey ); Number aCode = (Number) aMap.get( FaultDecoder.FaultCodeKey ); aValue = new RuntimeException( aDescription + "(" + aCode + ")" ); } aParser.require( XmlPullParser.END_TAG, null, FaultDecoder.Name ); aParser.nextTag(); return aValue; } throw new IllegalArgumentException( "XMLRPCDecoder.FaultDecoder.decodeWithParser: null parser." ); } } // =========================================================================== // MethodDecoder method(s) // --------------------------------------------------------------------------- private static final class MethodDecoder extends XMLRPCDecoder { private static final String Name = "methodCall"; private static final String[] Names = { MethodDecoder.Name }; protected MethodDecoder() { super(); } protected String[] names() { return MethodDecoder.Names; } protected Object decodeWithParser(XmlPullParser aParser) throws Exception { if ( aParser != null ) { aParser.require( XmlPullParser.START_TAG, null, MethodDecoder.Name ); aParser.nextTag(); String aMethodName = aParser.nextText(); Collection someArguments = (Collection) XMLRPCDecoder.decode( aParser ); Map aValue = new HashMap(); aValue.put( "methodName", aMethodName ); aValue.put( "parameters", someArguments ); if ( aParser.getEventType() != XmlPullParser.END_DOCUMENT ) { aParser.require( XmlPullParser.END_TAG, null, MethodDecoder.Name ); aParser.next(); } return aValue; } throw new IllegalArgumentException( "XMLRPCDecoder.MethodDecoder.decodeWithParser: null parser." ); } } // =========================================================================== // ParametersDecoder method(s) // --------------------------------------------------------------------------- private static final class ParametersDecoder extends XMLRPCDecoder { private static final String Name = "params"; private static final String ParamName = "param"; private static final String[] Names = { ParametersDecoder.Name }; protected ParametersDecoder() { super(); } protected String[] names() { return ParametersDecoder.Names; } protected Object decodeWithParser(XmlPullParser aParser) throws Exception { if ( aParser != null ) { Collection aCollection = new ArrayList(); aParser.require( XmlPullParser.START_TAG, null, ParametersDecoder.Name ); aParser.nextTag(); while ( ( aParser.getEventType() != XmlPullParser.END_DOCUMENT ) && ( aParser.getEventType() == XmlPullParser.START_TAG ) ) { aParser.require( XmlPullParser.START_TAG, null, ParametersDecoder.ParamName ); aParser.nextTag(); aCollection.add( XMLRPCDecoder.decode( aParser ) ); aParser.require( XmlPullParser.END_TAG, null, ParametersDecoder.ParamName ); aParser.nextTag(); } aParser.require( XmlPullParser.END_TAG, null, ParametersDecoder.Name ); aParser.nextTag(); if ( aCollection.isEmpty() == true ) { aCollection = null; } return aCollection; } throw new IllegalArgumentException( "XMLRPCDecoder.ParametersDecoder.decodeWithParser: null parser." ); } } // =========================================================================== // ArrayDecoder method(s) // --------------------------------------------------------------------------- private static final class ArrayDecoder extends XMLRPCDecoder { private static final String Name = "array"; private static final String DataName = "data"; private static final String[] Names = { ArrayDecoder.Name }; protected ArrayDecoder() { super(); } protected String[] names() { return ArrayDecoder.Names; } protected Object decodeWithParser(XmlPullParser aParser) throws Exception { if ( aParser != null ) { Collection aCollection = new ArrayList(); aParser.require( XmlPullParser.START_TAG, null, ArrayDecoder.Name ); aParser.nextTag(); aParser.require( XmlPullParser.START_TAG, null, ArrayDecoder.DataName ); aParser.nextTag(); while ( ( aParser.getEventType() != XmlPullParser.END_DOCUMENT ) && ( aParser.getEventType() == XmlPullParser.START_TAG ) ) { Object aValue = XMLRPCDecoder.decode( aParser ); aCollection.add( aValue ); } if ( aCollection.isEmpty() == true ) { aCollection = null; } aParser.require( XmlPullParser.END_TAG, null, ArrayDecoder.DataName ); aParser.nextTag(); aParser.require( XmlPullParser.END_TAG, null, ArrayDecoder.Name ); aParser.nextTag(); return aCollection; } throw new IllegalArgumentException( "XMLRPCDecoder.ArrayDecoder.decodeWithParser: null parser." ); } } // =========================================================================== // StructureDecoder method(s) // --------------------------------------------------------------------------- private static final class StructureDecoder extends XMLRPCDecoder { private static final String Name = "struct"; private static final String MemberName = "member"; private static final String NameName = "name"; private static final String[] Names = { StructureDecoder.Name }; protected StructureDecoder() { super(); } protected String[] names() { return StructureDecoder.Names; } protected Object decodeWithParser(XmlPullParser aParser) throws Exception { if ( aParser != null ) { Map aMap = new HashMap(); aParser.require( XmlPullParser.START_TAG, null, StructureDecoder.Name ); aParser.nextTag(); while ( ( aParser.getEventType() != XmlPullParser.END_DOCUMENT ) && ( aParser.getEventType() == XmlPullParser.START_TAG ) ) { Object aKey = null; Object aValue = null; aParser.require( XmlPullParser.START_TAG, null, StructureDecoder.MemberName ); aParser.nextTag(); aParser.require( XmlPullParser.START_TAG, null, StructureDecoder.NameName ); aKey = aParser.nextText(); aParser.require( XmlPullParser.END_TAG, null, StructureDecoder.NameName ); aValue = XMLRPCDecoder.decode( aParser ); aParser.require( XmlPullParser.END_TAG, null, StructureDecoder.MemberName ); aParser.nextTag(); if ( ( aKey != null ) && ( aValue != null ) ) { aMap.put( aKey, aValue ); } } aParser.require( XmlPullParser.END_TAG, null, StructureDecoder.Name ); aParser.nextTag(); if ( aMap.isEmpty() == true ) { aMap = null; } return aMap; } throw new IllegalArgumentException( "XMLRPCDecoder.StructureDecoder.decodeWithParser: null parser." ); } } // =========================================================================== // ArrayDecoder method(s) // --------------------------------------------------------------------------- private static final class ValueDecoder extends XMLRPCDecoder { private static final String Name = "value"; private static final String[] Names = { ValueDecoder.Name }; protected ValueDecoder() { super(); } protected String[] names() { return ValueDecoder.Names; } protected Object decodeWithParser(XmlPullParser aParser) throws Exception { if ( aParser != null ) { Object aValue = null; aParser.require( XmlPullParser.START_TAG, null, ValueDecoder.Name ); aParser.next(); if ( aParser.getEventType() == XmlPullParser.END_TAG ) { aValue = ""; } else //if ( aParser.getEventType() == aParser.TEXT) //{ // aValue = aParser.getText(); // aParser.next(); //} //else { aValue = XMLRPCDecoder.decode( aParser ); } aParser.require( XmlPullParser.END_TAG, null, ValueDecoder.Name ); aParser.nextTag(); return aValue; } throw new IllegalArgumentException( "XMLRPCDecoder.ValueDecoder.decodeWithParser: null parser." ); } } // =========================================================================== // IntegerDecoder method(s) // --------------------------------------------------------------------------- private static final class IntegerDecoder extends XMLRPCDecoder { private static final String IntName = "int"; private static final String I4Name = "i4"; private static final String[] Names = { IntegerDecoder.IntName, IntegerDecoder.I4Name }; protected IntegerDecoder() { super(); } protected String[] names() { return IntegerDecoder.Names; } protected Object decodeWithParser(XmlPullParser aParser) throws Exception { if ( aParser != null ) { String aName = aParser.getName(); aParser.require( XmlPullParser.START_TAG, null, aName ); String aString = aParser.nextText(); Object aValue = null; if ( aString != null ) { try { aValue = new Integer( aString ); } catch(Exception anException) { System.err.println( anException ); } } aParser.require( XmlPullParser.END_TAG, null, aName ); aParser.nextTag(); return aValue; } throw new IllegalArgumentException( "XMLRPCDecoder.IntegerDecoder.decodeWithParser: null parser." ); } } // =========================================================================== // BooleanDecoder method(s) // --------------------------------------------------------------------------- private static final class BooleanDecoder extends XMLRPCDecoder { private static final String Name = "boolean"; private static final String[] Names = { BooleanDecoder.Name }; private static final String False = "0"; protected BooleanDecoder() { super(); } protected String[] names() { return BooleanDecoder.Names; } protected Object decodeWithParser(XmlPullParser aParser) throws Exception { if ( aParser != null ) { aParser.require( XmlPullParser.START_TAG, null, BooleanDecoder.Name ); String aString = aParser.nextText(); Object aValue = Boolean.TRUE; if ( BooleanDecoder.False.equals( aString ) == true ) { aValue = Boolean.FALSE; } aParser.require( XmlPullParser.END_TAG, null, BooleanDecoder.Name ); aParser.next(); return aValue; } throw new IllegalArgumentException( "XMLRPCDecoder.BooleanDecoder.decodeWithParser: null parser." ); } } // =========================================================================== // DoubleDecoder method(s) // --------------------------------------------------------------------------- private static final class DoubleDecoder extends XMLRPCDecoder { private static final String Name = "double"; private static final String[] Names = { DoubleDecoder.Name }; protected DoubleDecoder() { super(); } protected String[] names() { return DoubleDecoder.Names; } protected Object decodeWithParser(XmlPullParser aParser) throws Exception { if ( aParser != null ) { aParser.require( XmlPullParser.START_TAG, null, DoubleDecoder.Name ); String aString = aParser.nextText(); Object aValue = null; if ( aString != null ) { try { aValue = new Double( aString ); } catch(Exception anException) { System.err.println( anException ); } } aParser.require( XmlPullParser.END_TAG, null, DoubleDecoder.Name ); aParser.nextTag(); return aValue; } throw new IllegalArgumentException( "XMLRPCDecoder.DoubleDecoder.decodeWithParser: null parser." ); } } // =========================================================================== // StringDecoder method(s) // --------------------------------------------------------------------------- private static final class StringDecoder extends XMLRPCDecoder { private static final String Name = "string"; private static final String[] Names = { StringDecoder.Name }; protected StringDecoder() { super(); } protected String[] names() { return StringDecoder.Names; } protected Object decodeWithParser(XmlPullParser aParser) throws Exception { if ( aParser != null ) { aParser.require( XmlPullParser.START_TAG, null, StringDecoder.Name ); String aValue = aParser.nextText(); aParser.require( XmlPullParser.END_TAG, null, StringDecoder.Name ); aParser.next(); if ( ( aValue != null ) && ( aValue.length() == 0 ) ) { aValue = null; } return aValue; } throw new IllegalArgumentException( "XMLRPCDecoder.StringDecoder.decodeWithParser: null parser." ); } } // =========================================================================== // DateDecoder method(s) // --------------------------------------------------------------------------- private static final class DateDecoder extends XMLRPCDecoder { private static final String Name = "dateTime.iso8601"; private static final String[] Names = { DateDecoder.Name }; private static final String Format = "yyyyMMdd'T'HH:mm:ss"; protected DateDecoder() { super(); } protected String[] names() { return DateDecoder.Names; } protected Object decodeWithParser(XmlPullParser aParser) throws Exception { if ( aParser != null ) { aParser.require( XmlPullParser.START_TAG, null, DateDecoder.Name ); String aString = aParser.nextText(); Date aValue = null; if ( aString != null ) { try { DateFormat aFormat = new SimpleDateFormat( DateDecoder.Format ); aValue = aFormat.parse( aString ); } catch(Exception anException) { System.err.println( anException ); } } aParser.require( XmlPullParser.END_TAG, null, DateDecoder.Name ); aParser.nextTag(); return aValue; } throw new IllegalArgumentException( "XMLRPCDecoder.DateDecoder.decodeWithParser: null parser." ); } } // =========================================================================== // Base64Decoder method(s) // --------------------------------------------------------------------------- private static final class Base64Decoder extends XMLRPCDecoder { private static final String Name = "base64"; private static final String[] Names = { Base64Decoder.Name }; protected Base64Decoder() { super(); } protected String[] names() { return Base64Decoder.Names; } protected Object decodeWithParser(XmlPullParser aParser) throws Exception { if ( aParser != null ) { aParser.require( XmlPullParser.START_TAG, null, Base64Decoder.Name ); String aString = aParser.nextText(); Object aValue = null; if ( aString != null ) { try { aValue = Base64.decode( aString.getBytes() ); } catch(Exception anException) { System.err.println( aValue ); } } aParser.require( XmlPullParser.END_TAG, null, Base64Decoder.Name ); aParser.nextTag(); return aValue; } throw new IllegalArgumentException( "XMLRPCDecoder.Base64Decoder.decodeWithParser: null parser." ); } } // =========================================================================== // Base64 method(s) // --------------------------------------------------------------------------- public static final class Base64 extends Object { /** * Returns an array of bytes which were encoded in the passed * character array. * * @param data the array of base64-encoded characters * @return decoded data array */ static public byte[] decode( byte[] data ) { int len = ( ( data.length + 3 ) / 4 ) * 3; if ( data.length > 0 && data[ data.length - 1 ] == '=' ) { --len; } if ( data.length > 1 && data[ data.length - 2 ] == '=' ) { --len; } byte[] out = new byte[ len ]; int shift = 0; // # of excess bits stored in accum int accum = 0; // excess bits int index = 0; for ( int ix = 0; ix < data.length; ix++ ) { int value = codes[ data[ ix ] & 0xFF ]; // ignore high byte of char if ( value >= 0 ) { // skip over non-code accum <<= 6; // bits shift up by 6 each time thru shift += 6; // loop, with new bits being put in accum |= value; // at the bottom. if ( shift >= 8 ) { // whenever there are 8 or more shifted in, shift -= 8; // write them out (from the top, leaving any // excess at the bottom for next iteration. out[ index++ ] = ( byte )( ( accum >> shift ) & 0xff ); } } } if ( index != out.length ) { throw new RuntimeException( "Error decoding BASE64 element: Miscalculated data length." ); } return out; } /** Code characters for values 0..63 */ static private char[] alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".toCharArray(); /** Lookup table for converting base64 characters to value in range 0..63 */ static private byte[] codes = new byte[256]; /** Initialize look-up table */ static { for ( int i = 0; i < 256; i++ ) { codes[ i ] = -1; } for ( int i = 'A'; i <= 'Z'; i++ ) { codes[ i ] = ( byte )( i - 'A' ); } for ( int i = 'a'; i <= 'z'; i++ ) { codes[ i ] = ( byte )( 26 + i - 'a' ); } for ( int i = '0'; i <= '9'; i++ ) { codes[ i ] = ( byte )( 52 + i - '0' ); } codes[ '+' ] = 62; codes[ '/' ] = 63; } } // =========================================================================== // Main method(s) // --------------------------------------------------------------------------- public static void main (String args[]) { args= new String[] {"http://www.oreillynet.com/meerkat/xml-rpc/server.php"}; if ( args.length == 1 ) { System.out.println( "Decoding \"" + args[ 0 ] + "\"" ); try { URL anURL = new URL( args[ 0 ] ); byte[] aRequest = "system.listMethods".getBytes(); URLConnection aConnection = anURL.openConnection(); aConnection.setDoInput( true ); aConnection.setDoOutput( true ); aConnection.setUseCaches( false ); aConnection.setAllowUserInteraction( false ); aConnection.setRequestProperty( "Content-Type", "text/xml" ); aConnection.setRequestProperty( "Content-Length", Integer.toString( aRequest.length ) ); OutputStream anOutputStream = new BufferedOutputStream( aConnection.getOutputStream() ); anOutputStream.write( aRequest ); anOutputStream.flush(); InputStream anInputStream = new BufferedInputStream( aConnection.getInputStream() ); Reader aReader = new InputStreamReader( anInputStream ); Object anObject = XMLRPCDecoder.decode( aReader ); System.out.println( "anObject: " + anObject.getClass() ); System.out.println( "anObject: " + anObject ); } catch(Exception anException) { System.err.println( anException ); } return; } System.out.println( "XMLRPCDecoder maps an XML-RPC document into its Java equivalent." ); System.out.println( "This example will send a canned 'system.listMethods' to the target url." ); System.out.println( "Usage: " ); System.out.println( "Example: \"http://www.oreillynet.com/meerkat/xml-rpc/server.php\"" ); } } xpp3-1.1.4c/src/java/samples/XmlCompare.java100644 0 0 14051 10525225062 17755 0ustaraslomewww 0 0 import java.io.FileReader; import java.io.IOException; import java.io.Reader; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; public class XmlCompare { protected static final String FEATURE_XML_ROUNDTRIP = "http://xmlpull.org/v1/doc/features.html#xml-roundtrip"; public static void main (String args[]) throws XmlPullParserException, IOException { XmlPullParserFactory factory = XmlPullParserFactory.newInstance( System.getProperty(XmlPullParserFactory.PROPERTY_NAME), null); factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); XmlPullParser pp = factory.newPullParser(); try { pp.setFeature(FEATURE_XML_ROUNDTRIP, false); } catch(XmlPullParserException ex) { throw new RuntimeException("could nto disable roundtrip feature: "+ex); } System.out.println("parser implementation class is "+pp.getClass()); //pp.setInput(new StringReader(SAMPLE_XML)); final String FILE = "fcked_up2.xml"; pp.setInput(new FileReader(FILE)); //final String NS_URI = "http://whappdev1/bscwebservices/"; String text = getNextElementText(pp); //System.out.println("getNextElementText="+text); //Writer w = new FileWriter("c:/Forge/homepage/xmlpull/f3.xml"); //w.write(text); //w.close(); // now just parse input //pp.nextTag(); //System.out.println("current tag namespace="+pp.getNamespace()+" name="+pp.getName()); //pp.require(XmlPullParser.START_TAG, NS_URI, "string"); //System.out.println("text='"+pp.nextText()+"'"); // note nextText() moved parser to END_TAG //System.out.println("current tag namespace="+pp.getNamespace()+" name="+pp.getName()); //pp.require(XmlPullParser.END_TAG, NS_URI, "string"); compareXmlTwoFiles(new FileReader(FILE), new StringReader(text)); } /** * Returns the next Element in the stream (including all sub elements) as a String * @param parser * @return * @throws org.xmlpull.v1.XmlPullParserException * @throws java.io.IOException */ public static String getNextElementText(XmlPullParser parser) throws XmlPullParserException, IOException { if(parser.getFeature(FEATURE_XML_ROUNDTRIP) == false) { throw new RuntimeException("roundtrip feature must be enabled to get tag content"); } int level = 1; StringBuffer buf = new StringBuffer(); parser.nextTag(); buf.append(parser.getText()); //int [] holderForStartAndLength = new int[2]; while (level > 0) { int event = parser.next(); String text = parser.getText(); if (event == XmlPullParser.START_TAG) { buf.append(text); if(parser.isEmptyElementTag()) { parser.next(); //skip empty tag } else { level++; } } else if (event == XmlPullParser.END_TAG) { // We need to handle tags... ;) returns both START_TAG= and END_TAG= //if (!tmp.endsWith("/>")) buf.append(tmp); buf.append(text); level--; //} else if (!parser.isWhitespace()) { } else if (text.length() > 0) { StringBuffer escapedText = new StringBuffer(text.length()); for (int i = 0; i < text.length(); i++) { char ch = text.charAt(i); if(ch == '<') { escapedText.append("<"); } else if(ch == '&') { escapedText.append("&"); } else if(ch == '"') { escapedText.append("""); } else if(ch == '\'') { escapedText.append("'"); } else { escapedText.append(ch); } } buf.append(escapedText); } } return buf.toString(); } static void compareXmlTwoFiles(Reader rr, Reader rq) throws XmlPullParserException, IOException { XmlPullParserFactory factory = XmlPullParserFactory.newInstance( //System.getProperty(XmlPullParserFactory.PROPERTY_NAME), null); "org.xmlpull.mxp1.MXParserFactory", null); factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); XmlPullParser r = factory.newPullParser(); r.setInput(rr); XmlPullParser q = factory.newPullParser(); q.setInput(rq); while(true) { r.next(); q.next(); if(r.getEventType() != q.getEventType()) { throw new RuntimeException("inconsistent events"); } if(r.getEventType() == XmlPullParser.END_DOCUMENT) { break; } if(r.getEventType() == XmlPullParser.START_TAG || r.getEventType() == XmlPullParser.END_TAG ) { String rName = r.getName(); String qName = q.getName(); if(!rName.equals(qName)) { throw new RuntimeException("element names mismatch"); } if(r.getEventType() == XmlPullParser.START_TAG) { } } else if(r.getEventType() == XmlPullParser.TEXT) { String rText = r.getText(); String qText = q.getText(); if(!rText.equals(qText)) { throw new RuntimeException("text content mismatch '"+rText+"' and '"+qText+"'"); } } else { throw new RuntimeException("unknown event type "+r.getEventType() +r.getPositionDescription()); } System.err.print("."); } System.err.println("\nOK"); } } xpp3-1.1.4c/src/java/samples/XmlPullCount.java100644 0 0 11670 10525225062 20320 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) import java.io.File; import java.io.IOException; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; import java.io.FileInputStream; /** * Simple example that counts XML elements, characters and attributes. * * @author Aleksander Slominski */ public class XmlPullCount { public final static String SAMPLE_XML = "\n"+ "\n"+ "\n"+ "Roses are Red\n"+ "Roses are red,\n"+ "Violets are blue;\n"+ "Sugar is sweet,\n"+ "And I love you.\n"+ ""; int countChars; int countAttribs; int countSTags; boolean verbose; public static void main (String args[]) throws XmlPullParserException, IOException { XmlPullParserFactory factory = XmlPullParserFactory.newInstance( System.getProperty(XmlPullParserFactory.PROPERTY_NAME), null); factory.setNamespaceAware(false); System.err.println("using factory "+factory.getClass()); XmlPullParser xpp = factory.newPullParser(); System.err.println("using parser "+xpp.getClass()); XmlPullCount app = new XmlPullCount(); app.verbose = true; for(int c = 0; c < 2; ++c) { System.err.println("run#"+c); app.resetCounters(); if(args.length == 0) { System.err.println("Parsing simple sample XML length="+SAMPLE_XML.length()); xpp.setInput( new StringReader( SAMPLE_XML ) ); app.countXml(xpp); } else { //r (int i = 0; i < args.length; i++) { File f = new File(args[0]); System.err.println("Parsing file: "+args[0]+" length="+f.length()); //xpp.setInput ( new FileReader ( args [0] ) ); xpp.setInput ( new FileInputStream ( args [0] ), "UTF8" ); app.countXml(xpp); // } app.printReport(); } System.err.println("finished"); } public void resetCounters() { countChars = countSTags = countAttribs = 0; } public void printReport() { System.err.println("characters="+countChars +" elements="+countSTags +" attributes="+countAttribs); } public void countXml(XmlPullParser xpp) throws XmlPullParserException, IOException { int holderForStartAndLength[] = new int[2]; xpp.require(XmlPullParser.START_DOCUMENT, null, null); int eventType = xpp.next(); xpp.require(XmlPullParser.START_TAG, null, null); while (eventType != XmlPullParser.END_DOCUMENT) { //System.err.println("pos="+xpp.getPositionDescription()); if(eventType == XmlPullParser.START_TAG) { ++countSTags; countAttribs += xpp.getAttributeCount(); if(verbose) { System.err.println("START_TAG "+xpp.getName()); } } else if(eventType == XmlPullParser.TEXT) { //char ch[] = xpp.getTextCharacters(holderForStartAndLength); xpp.getTextCharacters(holderForStartAndLength); //int start = holderForStartAndLength[0]; int length = holderForStartAndLength[1]; countChars += length; if(verbose) { System.err.println("TEXT '"+printable(xpp.getText())+"'"); } } else if(eventType == XmlPullParser.END_TAG) { if(verbose) { System.err.println("END_TAG "+xpp.getName()); } } eventType = xpp.next(); } } protected String printable(char ch) { if(ch == '\n') { return "\\n"; } else if(ch == '\r') { return "\\r"; } else if(ch == '\t') { return "\\t"; } if(ch > 127 || ch < 32) { StringBuffer buf = new StringBuffer("\\u"); String hex = Integer.toHexString((int)ch); for (int i = 0; i < 4-hex.length(); i++) { buf.append('0'); } buf.append(hex); return buf.toString(); } return ""+ch; } protected String printable(String s) { if(s == null) return null; StringBuffer buf = new StringBuffer(); for(int i = 0; i < s.length(); ++i) { buf.append(printable(s.charAt(i))); } s = buf.toString(); return s; } } xpp3-1.1.4c/src/java/samples/eventlist/EventList.java100644 0 0 2321 10525225062 21615 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package eventlist; import java.io.*; import org.xmlpull.v1.*; public class EventList { public static void main (String [] args) throws IOException, XmlPullParserException{ XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); factory.setNamespaceAware(true); Reader reader = (args.length > 0) ? new FileReader (args [0]) : (Reader) new StringReader("Hello World!"); XmlPullParser xpp = factory.newPullParser(); xpp.setInput (reader); int eventType; while ((eventType = xpp.next()) != XmlPullParser.END_DOCUMENT) { if(eventType == XmlPullParser.START_TAG) { System.out.println("START_TAG "+xpp.getName()); } else if(eventType == XmlPullParser.END_TAG) { System.out.println("END_TAG "+xpp.getName()); } else if(eventType == XmlPullParser.TEXT) { System.out.println("TEXT "+xpp.getText()); } } } } xpp3-1.1.4c/src/java/samples/pricelist.xml100644 0 0 1532 10525225062 17543 0ustaraslomewww 0 0 XML Training Playfield Training 999.00 899.00 XMLi 2999.00 1499.00 699.00 WriteIT 799.00 899.00 Emailaholic 1999.00 xpp3-1.1.4c/src/java/samples/rss.xml100644 0 0 2442 10525225062 16355 0ustaraslomewww 0 0 mars http://www.example.com/mars Developer news from the MARS community en-us Copyright 2999-3001, MARS team. editor@example.com webmaster@example.com mars http://www.example.com/images/mynetscape3188.gif http://www.example.com 88 31 News, opinions, tips and issues concerning MARS development MARS 1.0 Released http://www.example.com/read?item=3322323 The latest verion of MARS survival toolkit release. Rapid growth of MARS confirmed http://www.example.com/read?item=334300909 Independent office EARTH confirmed that MARS is growing. Another in series of astrounding NONSENSE news! xpp3-1.1.4c/src/java/sax2_driver/README.txt100644 0 0 74 10525225062 17245 0ustaraslomewww 0 0 SAX2 driver that uses XmlPull API to implement XMLReader. xpp3-1.1.4c/src/java/sax2_driver/org/xmlpull/v1/sax2/Driver.java100644 0 0 44327 10525225063 23426 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package org.xmlpull.v1.sax2; import java.io.InputStream; import java.io.IOException; import java.io.Reader; // not J2ME classes -- remove if you want to run in MIDP devices import java.net.URL; import java.net.MalformedURLException; // not J2ME classes import java.io.FileInputStream; import java.io.FileNotFoundException; import org.xml.sax.Attributes; import org.xml.sax.DTDHandler; import org.xml.sax.ContentHandler; import org.xml.sax.EntityResolver; import org.xml.sax.ErrorHandler; import org.xml.sax.InputSource; import org.xml.sax.Locator; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.SAXNotSupportedException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.DefaultHandler; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; /** * SAX2 Driver that pulls events from XmlPullParser * and comverts them into SAX2 callbacks. * * @author Aleksander Slominski */ public class Driver implements Locator, XMLReader, Attributes { protected static final String DECLARATION_HANDLER_PROPERTY = "http://xml.org/sax/properties/declaration-handler"; protected static final String LEXICAL_HANDLER_PROPERTY = "http://xml.org/sax/properties/lexical-handler"; protected static final String NAMESPACES_FEATURE = "http://xml.org/sax/features/namespaces"; protected static final String NAMESPACE_PREFIXES_FEATURE = "http://xml.org/sax/features/namespace-prefixes"; protected static final String VALIDATION_FEATURE = "http://xml.org/sax/features/validation"; protected static final String APACHE_SCHEMA_VALIDATION_FEATURE = "http://apache.org/xml/features/validation/schema"; protected static final String APACHE_DYNAMIC_VALIDATION_FEATURE = "http://apache.org/xml/features/validation/dynamic"; protected ContentHandler contentHandler = new DefaultHandler(); protected ErrorHandler errorHandler = new DefaultHandler();; protected String systemId; protected XmlPullParser pp; //private final static boolean DEBUG = false; /** */ public Driver() throws XmlPullParserException { final XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); factory.setNamespaceAware(true); pp = factory.newPullParser(); } public Driver(XmlPullParser pp) throws XmlPullParserException { this.pp = pp; } // -- Attributes interface public int getLength() { return pp.getAttributeCount(); } public String getURI(int index) { return pp.getAttributeNamespace(index); } public String getLocalName(int index) { return pp.getAttributeName(index); } public String getQName(int index) { final String prefix = pp.getAttributePrefix(index); if(prefix != null) { return prefix+':'+pp.getAttributeName(index); } else { return pp.getAttributeName(index); } } public String getType(int index) { return pp.getAttributeType(index); } public String getValue(int index) { return pp.getAttributeValue(index); } public int getIndex(String uri, String localName) { for (int i = 0; i < pp.getAttributeCount(); i++) { if(pp.getAttributeNamespace(i).equals(uri) && pp.getAttributeName(i).equals(localName)) { return i; } } return -1; } public int getIndex(String qName) { for (int i = 0; i < pp.getAttributeCount(); i++) { if(pp.getAttributeName(i).equals(qName)) { return i; } } return -1; } public String getType(String uri, String localName) { for (int i = 0; i < pp.getAttributeCount(); i++) { if(pp.getAttributeNamespace(i).equals(uri) && pp.getAttributeName(i).equals(localName)) { return pp.getAttributeType(i); } } return null; } public String getType(String qName) { for (int i = 0; i < pp.getAttributeCount(); i++) { if(pp.getAttributeName(i).equals(qName)) { return pp.getAttributeType(i); } } return null; } public String getValue(String uri, String localName) { return pp.getAttributeValue(uri, localName); } public String getValue(String qName) { return pp.getAttributeValue(null, qName); } // -- Locator interface public String getPublicId() { return null; } public String getSystemId() { return systemId; } public int getLineNumber() { return pp.getLineNumber(); } public int getColumnNumber() { return pp.getColumnNumber(); } // --- XMLReader interface public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException { if(NAMESPACES_FEATURE.equals(name)) { return pp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES); } else if(NAMESPACE_PREFIXES_FEATURE.equals(name)) { return pp.getFeature(XmlPullParser.FEATURE_REPORT_NAMESPACE_ATTRIBUTES); } else if(VALIDATION_FEATURE.equals(name)) { return pp.getFeature(XmlPullParser.FEATURE_VALIDATION); // } else if(APACHE_SCHEMA_VALIDATION_FEATURE.equals(name)) { // return false; //TODO // } else if(APACHE_DYNAMIC_VALIDATION_FEATURE.equals(name)) { // return false; //TODO } else { return pp.getFeature(name); //throw new SAXNotRecognizedException("unrecognized feature "+name); } } public void setFeature (String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { try { if(NAMESPACES_FEATURE.equals(name)) { pp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, value); } else if(NAMESPACE_PREFIXES_FEATURE.equals(name)) { if(pp.getFeature(XmlPullParser.FEATURE_REPORT_NAMESPACE_ATTRIBUTES) != value) { pp.setFeature(XmlPullParser.FEATURE_REPORT_NAMESPACE_ATTRIBUTES, value); } } else if(VALIDATION_FEATURE.equals(name)) { pp.setFeature(XmlPullParser.FEATURE_VALIDATION, value); // } else if(APACHE_SCHEMA_VALIDATION_FEATURE.equals(name)) { // // can ignore as validation must be false ... // // if(true == value) { // // throw new SAXNotSupportedException("schema validation is not supported"); // // } // } else if(APACHE_DYNAMIC_VALIDATION_FEATURE.equals(name)) { // if(true == value) { // throw new SAXNotSupportedException("dynamic validation is not supported"); // } } else { pp.setFeature(name, value); //throw new SAXNotRecognizedException("unrecognized feature "+name); } } catch(XmlPullParserException ex) { throw new SAXNotSupportedException("problem with setting feature "+name+": "+ex); } } public Object getProperty (String name) throws SAXNotRecognizedException, SAXNotSupportedException { if(DECLARATION_HANDLER_PROPERTY.equals(name)) { return null; } else if(LEXICAL_HANDLER_PROPERTY.equals(name)) { return null; } else { return pp.getProperty(name); //throw new SAXNotRecognizedException("not recognized get property "+name); } } public void setProperty (String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { // if(DECLARATION_HANDLER_PROPERTY.equals(name)) { throw new SAXNotSupportedException("not supported setting property "+name);//+" to "+value); } else if(LEXICAL_HANDLER_PROPERTY.equals(name)) { throw new SAXNotSupportedException("not supported setting property "+name);//+" to "+value); } else { try { pp.setProperty(name, value); } catch(XmlPullParserException ex) { throw new SAXNotSupportedException("not supported set property "+name+": "+ ex); } //throw new SAXNotRecognizedException("not recognized set property "+name); } } public void setEntityResolver (EntityResolver resolver) {} public EntityResolver getEntityResolver () { return null; } public void setDTDHandler (DTDHandler handler) {} public DTDHandler getDTDHandler () { return null; } public void setContentHandler (ContentHandler handler) { this.contentHandler = handler; } public ContentHandler getContentHandler() { return contentHandler; } public void setErrorHandler(ErrorHandler handler) { this.errorHandler = handler; } public ErrorHandler getErrorHandler() { return errorHandler; } public void parse(InputSource source) throws SAXException, IOException { systemId = source.getSystemId(); contentHandler.setDocumentLocator(this); final Reader reader = source.getCharacterStream(); try { if (reader == null) { InputStream stream = source.getByteStream(); final String encoding = source.getEncoding(); if (stream == null) { systemId = source.getSystemId(); if(systemId == null) { SAXParseException saxException = new SAXParseException( "null source systemId" , this); errorHandler.fatalError(saxException); return; } // NOTE: replace with Connection to run in J2ME environment try { final URL url = new URL(systemId); stream = url.openStream(); } catch (MalformedURLException nue) { try { stream = new FileInputStream(systemId); } catch (FileNotFoundException fnfe) { final SAXParseException saxException = new SAXParseException( "could not open file with systemId "+systemId, this, fnfe); errorHandler.fatalError(saxException); return; } } } pp.setInput(stream, encoding); } else { pp.setInput(reader); } } catch (XmlPullParserException ex) { final SAXParseException saxException = new SAXParseException( "parsing initialization error: "+ex, this, ex); //if(DEBUG) ex.printStackTrace(); errorHandler.fatalError(saxException); return; } // start parsing - move to first start tag try { contentHandler.startDocument(); // get first event pp.next(); // it should be start tag... if(pp.getEventType() != XmlPullParser.START_TAG) { final SAXParseException saxException = new SAXParseException( "expected start tag not"+pp.getPositionDescription(), this); //throw saxException; errorHandler.fatalError(saxException); return; } } catch (XmlPullParserException ex) { final SAXParseException saxException = new SAXParseException( "parsing initialization error: "+ex, this, ex); //ex.printStackTrace(); errorHandler.fatalError(saxException); return; } // now real parsing can start! parseSubTree(pp); // and finished ... contentHandler.endDocument(); } public void parse(String systemId) throws SAXException, IOException { parse(new InputSource(systemId)); } public void parseSubTree(XmlPullParser pp) throws SAXException, IOException { this.pp = pp; final boolean namespaceAware = pp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES); try { if(pp.getEventType() != XmlPullParser.START_TAG) { throw new SAXException( "start tag must be read before skiping subtree"+pp.getPositionDescription()); } final int[] holderForStartAndLength = new int[2]; final StringBuffer rawName = new StringBuffer(16); String prefix = null; String name = null; int level = pp.getDepth() - 1; int type = XmlPullParser.START_TAG; LOOP: do { switch(type) { case XmlPullParser.START_TAG: if(namespaceAware) { final int depth = pp.getDepth() - 1; final int countPrev = (level > depth) ? pp.getNamespaceCount(depth) : 0; //int countPrev = pp.getNamespaceCount(pp.getDepth() - 1); final int count = pp.getNamespaceCount(depth + 1); for (int i = countPrev; i < count; i++) { contentHandler.startPrefixMapping( pp.getNamespacePrefix(i), pp.getNamespaceUri(i) ); } name = pp.getName(); prefix = pp.getPrefix(); if(prefix != null) { rawName.setLength(0); rawName.append(prefix); rawName.append(':'); rawName.append(name); } startElement(pp.getNamespace(), name, prefix != null ? rawName.toString() : name ); } else { startElement(pp.getNamespace(), pp.getName(), pp.getName()); } //++level; break; case XmlPullParser.TEXT: final char[] chars = pp.getTextCharacters(holderForStartAndLength); contentHandler.characters(chars, holderForStartAndLength[0], //start holderForStartAndLength[1] //len ); break; case XmlPullParser.END_TAG: //--level; if(namespaceAware) { name = pp.getName(); prefix = pp.getPrefix(); if(prefix != null) { rawName.setLength(0); rawName.append(prefix); rawName.append(':'); rawName.append(name); } contentHandler.endElement(pp.getNamespace(), name, prefix != null ? rawName.toString() : name ); // when entering show prefixes for all levels!!!! final int depth = pp.getDepth(); final int countPrev = (level > depth) ? pp.getNamespaceCount(pp.getDepth()) : 0; int count = pp.getNamespaceCount(pp.getDepth() - 1); // undeclare them in reverse order for (int i = count - 1; i >= countPrev; i--) { contentHandler.endPrefixMapping( pp.getNamespacePrefix(i) ); } } else { contentHandler.endElement(pp.getNamespace(), pp.getName(), pp.getName() ); } break; case XmlPullParser.END_DOCUMENT: break LOOP; } type = pp.next(); } while(pp.getDepth() > level); } catch (XmlPullParserException ex) { final SAXParseException saxException = new SAXParseException("parsing error: "+ex, this, ex); ex.printStackTrace(); errorHandler.fatalError(saxException); } } /** * Calls {@link ContentHandler.startElement(String, String, String, Attributes) startElement} * on the ContentHandler with this driver object as the * {@link Attributes} implementation. In default implementation * {@link Attributes} object is valid only during this method call and may not * be stored. Sub-classes can overwrite this method to cache attributes. */ protected void startElement(String namespace, String localName, String qName) throws SAXException { contentHandler.startElement(namespace, localName, qName, this); } } xpp3-1.1.4c/src/java/serializer_impl/org/xmlpull/mxp1_serializer/MXSerializer.java100644 0 0 126242 10525225062 27442 0ustaraslomewww 0 0 package org.xmlpull.mxp1_serializer; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Writer; import org.xmlpull.v1.XmlSerializer; /** * Implementation of XmlSerializer interface from XmlPull V1 API. * This implementation is optimzied for performance and low memory footprint. * *

      Implemented features:

        *
      • FEATURE_NAMES_INTERNED - when enabled all returned names * (namespaces, prefixes) will be interned and it is required that * all names passed as arguments MUST be interned *
      • FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE *
      *

      Implemented properties:

        *
      • PROPERTY_SERIALIZER_INDENTATION *
      • PROPERTY_SERIALIZER_LINE_SEPARATOR *
      * */ public class MXSerializer implements XmlSerializer { protected final static String XML_URI = "http://www.w3.org/XML/1998/namespace"; protected final static String XMLNS_URI = "http://www.w3.org/2000/xmlns/"; private static final boolean TRACE_SIZING = false; private static final boolean TRACE_ESCAPING = false; protected final String FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE = "http://xmlpull.org/v1/doc/features.html#serializer-attvalue-use-apostrophe"; protected final String FEATURE_NAMES_INTERNED = "http://xmlpull.org/v1/doc/features.html#names-interned"; protected final String PROPERTY_SERIALIZER_INDENTATION = "http://xmlpull.org/v1/doc/properties.html#serializer-indentation"; protected final String PROPERTY_SERIALIZER_LINE_SEPARATOR = "http://xmlpull.org/v1/doc/properties.html#serializer-line-separator"; protected final static String PROPERTY_LOCATION = "http://xmlpull.org/v1/doc/properties.html#location"; // properties/features protected boolean namesInterned; protected boolean attributeUseApostrophe; protected String indentationString = null; //" "; protected String lineSeparator = "\n"; protected String location; protected Writer out; protected int autoDeclaredPrefixes; protected int depth = 0; // element stack protected String elNamespace[] = new String[ 2 ]; protected String elName[] = new String[ elNamespace.length ]; protected String elPrefix[] = new String[ elNamespace.length ]; protected int elNamespaceCount[] = new int[ elNamespace.length ]; //namespace stack protected int namespaceEnd = 0; protected String namespacePrefix[] = new String[ 8 ]; protected String namespaceUri[] = new String[ namespacePrefix.length ]; protected boolean finished; protected boolean pastRoot; protected boolean setPrefixCalled; protected boolean startTagIncomplete; protected boolean doIndent; protected boolean seenTag; protected boolean seenBracket; protected boolean seenBracketBracket; // buffer output if neede to write escaped String see text(String) private static final int BUF_LEN = Runtime.getRuntime().freeMemory() > 1000000L ? 8*1024 : 256; protected char buf[] = new char[ BUF_LEN ]; protected static final String precomputedPrefixes[]; static { precomputedPrefixes = new String[32]; //arbitrary number ... for (int i = 0; i < precomputedPrefixes.length; i++) { precomputedPrefixes[i] = ("n"+i).intern(); } } private boolean checkNamesInterned = false; private void checkInterning(String name) { if(namesInterned && name != name.intern()) { throw new IllegalArgumentException( "all names passed as arguments must be interned" +"when NAMES INTERNED feature is enabled"); } } protected void reset() { location = null; out = null; autoDeclaredPrefixes = 0; depth = 0; // nullify references on all levels to allow it to be GCed for (int i = 0; i < elNamespaceCount.length; i++) { elName[ i ] = null; elPrefix[ i ] = null; elNamespace[ i ] = null; elNamespaceCount[ i ] = 2; } namespaceEnd = 0; //NOTE: no need to intern() as all literal strings and string-valued constant expressions //are interned. String literals are defined in 3.10.5 of the Java Language Specification // just checking ... //assert "xmlns" == "xmlns".intern(); //assert XMLNS_URI == XMLNS_URI.intern(); //TODO: how to prevent from reporting this namespace? // this is special namespace declared for consistensy with XML infoset namespacePrefix[ namespaceEnd ] = "xmlns"; namespaceUri[ namespaceEnd ] = XMLNS_URI; ++namespaceEnd; namespacePrefix[ namespaceEnd ] = "xml"; namespaceUri[ namespaceEnd ] = XML_URI; ++namespaceEnd; finished = false; pastRoot = false; setPrefixCalled = false; startTagIncomplete = false; //doIntent is not changed seenTag = false; seenBracket = false; seenBracketBracket = false; } protected void ensureElementsCapacity() { final int elStackSize = elName.length; //assert (depth + 1) >= elName.length; // we add at least one extra slot ... final int newSize = (depth >= 7 ? 2 * depth : 8) + 2; // = lucky 7 + 1 //25 if(TRACE_SIZING) { System.err.println( getClass().getName()+" elStackSize "+elStackSize+" ==> "+newSize); } final boolean needsCopying = elStackSize > 0; String[] arr = null; // reuse arr local variable slot arr = new String[newSize]; if(needsCopying) System.arraycopy(elName, 0, arr, 0, elStackSize); elName = arr; arr = new String[newSize]; if(needsCopying) System.arraycopy(elPrefix, 0, arr, 0, elStackSize); elPrefix = arr; arr = new String[newSize]; if(needsCopying) System.arraycopy(elNamespace, 0, arr, 0, elStackSize); elNamespace = arr; final int[] iarr = new int[newSize]; if(needsCopying) { System.arraycopy(elNamespaceCount, 0, iarr, 0, elStackSize); } else { // special initialization iarr[0] = 0; } elNamespaceCount = iarr; } protected void ensureNamespacesCapacity() { //int size) { //int namespaceSize = namespacePrefix != null ? namespacePrefix.length : 0; //assert (namespaceEnd >= namespacePrefix.length); //if(size >= namespaceSize) { //int newSize = size > 7 ? 2 * size : 8; // = lucky 7 + 1 //25 final int newSize = namespaceEnd > 7 ? 2 * namespaceEnd : 8; if(TRACE_SIZING) { System.err.println( getClass().getName()+" namespaceSize "+namespacePrefix.length+" ==> "+newSize); } final String[] newNamespacePrefix = new String[newSize]; final String[] newNamespaceUri = new String[newSize]; if(namespacePrefix != null) { System.arraycopy( namespacePrefix, 0, newNamespacePrefix, 0, namespaceEnd); System.arraycopy( namespaceUri, 0, newNamespaceUri, 0, namespaceEnd); } namespacePrefix = newNamespacePrefix; namespaceUri = newNamespaceUri; // TODO use hashes for quick namespace->prefix lookups // if( ! allStringsInterned ) { // int[] newNamespacePrefixHash = new int[newSize]; // if(namespacePrefixHash != null) { // System.arraycopy( // namespacePrefixHash, 0, newNamespacePrefixHash, 0, namespaceEnd); // } // namespacePrefixHash = newNamespacePrefixHash; // } //prefixesSize = newSize; // ////assert nsPrefixes.length > size && nsPrefixes.length == newSize //} } public void setFeature(String name, boolean state) throws IllegalArgumentException, IllegalStateException { if(name == null) { throw new IllegalArgumentException("feature name can not be null"); } if(FEATURE_NAMES_INTERNED.equals(name)) { namesInterned = state; } else if(FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE.equals(name)) { attributeUseApostrophe = state; } else { throw new IllegalStateException("unsupported feature "+name); } } public boolean getFeature(String name) throws IllegalArgumentException { if(name == null) { throw new IllegalArgumentException("feature name can not be null"); } if(FEATURE_NAMES_INTERNED.equals(name)) { return namesInterned; } else if(FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE.equals(name)) { return attributeUseApostrophe; } else { return false; } } // precomputed variables to simplify writing indentation protected int offsetNewLine; protected int indentationJump; protected char[] indentationBuf; protected int maxIndentLevel; protected boolean writeLineSepartor; //should end-of-line be written protected boolean writeIndentation; // is indentation used? /** * For maximum efficiency when writing indents the required output is pre-computed * This is internal function that recomputes buffer after user requested chnages. */ protected void rebuildIndentationBuf() { if(doIndent == false) return; final int maxIndent = 65; //hardcoded maximum indentation size in characters int bufSize = 0; offsetNewLine = 0; if(writeLineSepartor) { offsetNewLine = lineSeparator.length(); bufSize += offsetNewLine; } maxIndentLevel = 0; if(writeIndentation) { indentationJump = indentationString.length(); maxIndentLevel = maxIndent / indentationJump; bufSize += maxIndentLevel * indentationJump; } if(indentationBuf == null || indentationBuf.length < bufSize) { indentationBuf = new char[bufSize + 8]; } int bufPos = 0; if(writeLineSepartor) { for (int i = 0; i < lineSeparator.length(); i++) { indentationBuf[ bufPos++ ] = lineSeparator.charAt(i); } } if(writeIndentation) { for (int i = 0; i < maxIndentLevel; i++) { for (int j = 0; j < indentationString.length(); j++) { indentationBuf[ bufPos++ ] = indentationString.charAt(j); } } } } // if(doIndent) writeIndent(); protected void writeIndent() throws IOException { final int start = writeLineSepartor ? 0 : offsetNewLine; final int level = (depth > maxIndentLevel) ? maxIndentLevel : depth; out.write( indentationBuf, start, ( (level - 1) * indentationJump) + offsetNewLine); } public void setProperty(String name, Object value) throws IllegalArgumentException, IllegalStateException { if(name == null) { throw new IllegalArgumentException("property name can not be null"); } if(PROPERTY_SERIALIZER_INDENTATION.equals(name)) { indentationString = (String)value; } else if(PROPERTY_SERIALIZER_LINE_SEPARATOR.equals(name)) { lineSeparator = (String)value; } else if(PROPERTY_LOCATION.equals(name)) { location = (String) value; } else { throw new IllegalStateException("unsupported property "+name); } writeLineSepartor = lineSeparator != null && lineSeparator.length() > 0; writeIndentation = indentationString != null && indentationString.length() > 0; // optimize - do not write when nothing to write ... doIndent = indentationString != null && (writeLineSepartor || writeIndentation); //NOTE: when indentationString == null there is no indentation // (even though writeLineSeparator may be true ...) rebuildIndentationBuf(); seenTag = false; // for consistency } public Object getProperty(String name) throws IllegalArgumentException { if(name == null) { throw new IllegalArgumentException("property name can not be null"); } if(PROPERTY_SERIALIZER_INDENTATION.equals(name)) { return indentationString; } else if(PROPERTY_SERIALIZER_LINE_SEPARATOR.equals(name)) { return lineSeparator; } else if(PROPERTY_LOCATION.equals(name)) { return location; } else { return null; } } private String getLocation() { return location != null ? " @"+location : ""; } // this is special method that can be accessed directly to retrieve Writer serializer is using public Writer getWriter() { return out; } public void setOutput(Writer writer) { reset(); out = writer; } public void setOutput(OutputStream os, String encoding) throws IOException { if(os == null) throw new IllegalArgumentException("output stream can not be null"); reset(); if(encoding != null) { out = new OutputStreamWriter(os, encoding); } else { out = new OutputStreamWriter(os); } } public void startDocument (String encoding, Boolean standalone) throws IOException { char apos = attributeUseApostrophe ? '\'' : '"'; if(attributeUseApostrophe) { out.write(""); } public void endDocument() throws IOException { // close all unclosed tag; while(depth > 0) { endTag(elNamespace[ depth ], elName[ depth ]); } //assert depth == 0; //assert startTagIncomplete == false; finished = pastRoot = startTagIncomplete = true; out.flush(); } public void setPrefix(String prefix, String namespace) throws IOException { if(startTagIncomplete) closeStartTag(); //assert prefix != null; //assert namespace != null; if (prefix == null) { prefix = ""; } if(!namesInterned) { prefix = prefix.intern(); //will throw NPE if prefix==null } else if(checkNamesInterned) { checkInterning(prefix); } else if(prefix == null) { throw new IllegalArgumentException("prefix must be not null"+getLocation()); } //check that prefix is not duplicated ... for (int i = elNamespaceCount[ depth ]; i < namespaceEnd; i++) { if(prefix == namespacePrefix[ i ]) { throw new IllegalStateException("duplicated prefix "+printable(prefix)+getLocation()); } } if(!namesInterned) { namespace = namespace.intern(); } else if(checkNamesInterned) { checkInterning(namespace); } else if(namespace == null) { throw new IllegalArgumentException("namespace must be not null"+getLocation()); } if(namespaceEnd >= namespacePrefix.length) { ensureNamespacesCapacity(); } namespacePrefix[ namespaceEnd ] = prefix; namespaceUri[ namespaceEnd ] = namespace; ++namespaceEnd; setPrefixCalled = true; } protected String lookupOrDeclarePrefix( String namespace ) { return getPrefix(namespace, true); } public String getPrefix(String namespace, boolean generatePrefix) { return getPrefix(namespace, generatePrefix, false); } protected String getPrefix(String namespace, boolean generatePrefix, boolean nonEmpty) { //assert namespace != null; if(!namesInterned) { // when String is interned we can do much faster namespace stack lookups ... namespace = namespace.intern(); } else if(checkNamesInterned) { checkInterning(namespace); //assert namespace != namespace.intern(); } if(namespace == null) { throw new IllegalArgumentException("namespace must be not null"+getLocation()); } else if(namespace.length() == 0) { throw new IllegalArgumentException("default namespace cannot have prefix"+getLocation()); } // first check if namespace is already in scope for (int i = namespaceEnd - 1; i >= 0 ; --i) { if(namespace == namespaceUri[ i ]) { final String prefix = namespacePrefix[ i ]; if(nonEmpty && prefix.length() == 0) continue; // now check that prefix is still in scope for (int p = namespaceEnd - 1; p > i ; --p) { if(prefix == namespacePrefix[ p ]) continue; // too bad - prefix is redeclared with different namespace } return prefix; } } // so not found it ... if(!generatePrefix) { return null; } return generatePrefix(namespace); } private String generatePrefix(String namespace) { //assert namespace == namespace.intern(); while(true) { ++autoDeclaredPrefixes; //fast lookup uses table that was pre-initialized in static{} .... final String prefix = autoDeclaredPrefixes < precomputedPrefixes.length ? precomputedPrefixes[autoDeclaredPrefixes] : ("n"+autoDeclaredPrefixes).intern(); // make sure this prefix is not declared in any scope (avoid hiding in-scope prefixes)! for (int i = namespaceEnd - 1; i >= 0 ; --i) { if(prefix == namespacePrefix[ i ]) { continue; // prefix is already declared - generate new and try again } } // declare prefix if(namespaceEnd >= namespacePrefix.length) { ensureNamespacesCapacity(); } namespacePrefix[ namespaceEnd ] = prefix; namespaceUri[ namespaceEnd ] = namespace; ++namespaceEnd; return prefix; } } public int getDepth() { return depth; } public String getNamespace () { return elNamespace[depth]; } public String getName() { return elName[depth]; } public XmlSerializer startTag (String namespace, String name) throws IOException { if(startTagIncomplete) { closeStartTag(); } seenBracket = seenBracketBracket = false; ++depth; if(doIndent && depth > 0 && seenTag) { writeIndent(); } seenTag = true; setPrefixCalled = false; startTagIncomplete = true; if( (depth + 1) >= elName.length) { ensureElementsCapacity(); } ////assert namespace != null; if(checkNamesInterned && namesInterned) checkInterning(namespace); elNamespace[ depth ] = (namesInterned || namespace == null) ? namespace : namespace.intern(); //assert name != null; //elName[ depth ] = name; if(checkNamesInterned && namesInterned) checkInterning(name); elName[ depth ] = (namesInterned || name == null) ? name : name.intern(); if(out == null) { throw new IllegalStateException("setOutput() must called set before serialization can start"); } out.write('<'); if(namespace != null) { if(namespace.length() > 0) { //ALEK: in future make this algo a feature on serializer String prefix = null; if(depth > 0 && (namespaceEnd - elNamespaceCount[depth-1]) == 1) { // if only one prefix was declared un-declare it if the prefix is already declared on parent el with the same URI String uri = namespaceUri[namespaceEnd-1]; if(uri == namespace || uri.equals(namespace)) { String elPfx = namespacePrefix[namespaceEnd-1]; // 2 == to skip predefined namesapces (xml and xmlns ...) for(int pos = elNamespaceCount[depth-1] - 1; pos >= 2; --pos ) { String pf = namespacePrefix[pos]; if(pf == elPfx || pf.equals(elPfx)) { String n = namespaceUri[pos]; if(n == uri || n.equals(uri)) { --namespaceEnd; //un-declare namespace: this is kludge! prefix = elPfx; } break; } } } } if(prefix == null) { prefix = lookupOrDeclarePrefix( namespace ); } //assert prefix != null; // make sure that default ("") namespace to not print ":" if(prefix.length() > 0) { elPrefix[ depth ] = prefix; out.write(prefix); out.write(':'); } else { elPrefix[ depth ] = ""; } } else { // make sure that default namespace can be declared for (int i = namespaceEnd - 1; i >= 0 ; --i) { if(namespacePrefix[ i ] == "") { final String uri = namespaceUri[ i ]; if(uri == null) { // declare default namespace setPrefix("", ""); } else if(uri.length() > 0) { throw new IllegalStateException( "start tag can not be written in empty default namespace "+ "as default namespace is currently bound to '"+uri+"'"+getLocation()); } break; } } elPrefix[ depth ] = ""; } } else { elPrefix[ depth ] = ""; } out.write(name); return this; } public XmlSerializer attribute (String namespace, String name, String value) throws IOException { if(!startTagIncomplete) { throw new IllegalArgumentException("startTag() must be called before attribute()"+getLocation()); } //assert setPrefixCalled == false; out.write(' '); ////assert namespace != null; if(namespace != null && namespace.length() > 0) { //namespace = namespace.intern(); if(!namesInterned) { namespace = namespace.intern(); } else if(checkNamesInterned) { checkInterning(namespace); } String prefix = getPrefix( namespace, false, true ); //assert( prefix != null); //if(prefix.length() == 0) { if(prefix == null) { // needs to declare prefix to hold default namespace //NOTE: attributes such as a='b' are in NO namespace prefix = generatePrefix(namespace); } out.write(prefix); out.write(':'); // if(prefix.length() > 0) { // out.write(prefix); // out.write(':'); // } } //assert name != null; out.write(name); out.write('='); //assert value != null; out.write( attributeUseApostrophe ? '\'' : '"'); writeAttributeValue(value, out); out.write( attributeUseApostrophe ? '\'' : '"'); return this; } protected void closeStartTag() throws IOException { if(finished) { throw new IllegalArgumentException("trying to write past already finished output"+getLocation()); } if(seenBracket) { seenBracket = seenBracketBracket = false; } if( startTagIncomplete || setPrefixCalled ) { if(setPrefixCalled) { throw new IllegalArgumentException( "startTag() must be called immediately after setPrefix()"+getLocation()); } if(!startTagIncomplete) { throw new IllegalArgumentException("trying to close start tag that is not opened"+getLocation()); } // write all namespace delcarations! writeNamespaceDeclarations(); out.write('>'); elNamespaceCount[ depth ] = namespaceEnd; startTagIncomplete = false; } } private void writeNamespaceDeclarations() throws IOException { //int start = elNamespaceCount[ depth - 1 ]; for (int i = elNamespaceCount[ depth - 1 ]; i < namespaceEnd; i++) { if(doIndent && namespaceUri[ i ].length() > 40) { writeIndent(); out.write(" "); } if(namespacePrefix[ i ] != "") { out.write(" xmlns:"); out.write(namespacePrefix[ i ]); out.write('='); } else { out.write(" xmlns="); } out.write( attributeUseApostrophe ? '\'' : '"'); //NOTE: escaping of namespace value the same way as attributes!!!! writeAttributeValue(namespaceUri[ i ], out); out.write( attributeUseApostrophe ? '\'' : '"'); } } public XmlSerializer endTag(String namespace, String name) throws IOException { // check that level is valid ////assert namespace != null; //if(namespace != null) { // namespace = namespace.intern(); //} seenBracket = seenBracketBracket = false; if(namespace != null) { if(!namesInterned) { namespace = namespace.intern(); } else if(checkNamesInterned) { checkInterning(namespace); } } if(namespace != elNamespace[ depth ]) { throw new IllegalArgumentException( "expected namespace "+printable(elNamespace[ depth ]) +" and not "+printable(namespace)+getLocation()); } if(name == null) { throw new IllegalArgumentException("end tag name can not be null"+getLocation()); } if(checkNamesInterned && namesInterned) { checkInterning(name); } String startTagName = elName[ depth ]; if((!namesInterned && !name.equals(startTagName)) || (namesInterned && name != startTagName )) { throw new IllegalArgumentException( "expected element name "+printable(elName[ depth ])+" and not "+printable(name)+getLocation()); } if(startTagIncomplete) { writeNamespaceDeclarations(); out.write(" />"); //space is added to make it easier to work in XHTML!!! --depth; } else { //assert startTagIncomplete == false; if(doIndent && seenTag) { writeIndent(); } out.write(" 0) { out.write(startTagPrefix); out.write(':'); } // if(namespace != null && namespace.length() > 0) { // //TODO prefix should be alredy known from matching start tag ... // final String prefix = lookupOrDeclarePrefix( namespace ); // //assert( prefix != null); // if(prefix.length() > 0) { // out.write(prefix); // out.write(':'); // } // } out.write(name); out.write('>'); --depth; } namespaceEnd = elNamespaceCount[ depth ]; startTagIncomplete = false; seenTag = true; return this; } public XmlSerializer text (String text) throws IOException { //assert text != null; if(startTagIncomplete || setPrefixCalled) closeStartTag(); if(doIndent && seenTag) seenTag = false; writeElementContent(text, out); return this; } public XmlSerializer text (char [] buf, int start, int len) throws IOException { if(startTagIncomplete || setPrefixCalled) closeStartTag(); if(doIndent && seenTag) seenTag = false; writeElementContent(buf, start, len, out); return this; } public void cdsect (String text) throws IOException { if(startTagIncomplete || setPrefixCalled || seenBracket) closeStartTag(); if(doIndent && seenTag) seenTag = false; out.write(""); } public void entityRef (String text) throws IOException { if(startTagIncomplete || setPrefixCalled || seenBracket) closeStartTag(); if(doIndent && seenTag) seenTag = false; out.write('&'); out.write(text); //escape? out.write(';'); } public void processingInstruction (String text) throws IOException { if(startTagIncomplete || setPrefixCalled || seenBracket) closeStartTag(); if(doIndent && seenTag) seenTag = false; out.write(""); } public void comment (String text) throws IOException { if(startTagIncomplete || setPrefixCalled || seenBracket) closeStartTag(); if(doIndent && seenTag) seenTag = false; out.write(""); } public void docdecl (String text) throws IOException { if(startTagIncomplete || setPrefixCalled || seenBracket) closeStartTag(); if(doIndent && seenTag) seenTag = false; out.write(""); } public void ignorableWhitespace (String text) throws IOException { if(startTagIncomplete || setPrefixCalled || seenBracket) closeStartTag(); if(doIndent && seenTag) seenTag = false; if(text.length() == 0) { throw new IllegalArgumentException( "empty string is not allowed for ignorable whitespace"+getLocation()); } out.write(text); //no escape? } public void flush () throws IOException { if(!finished && startTagIncomplete) closeStartTag(); out.flush(); } // --- utility methods protected void writeAttributeValue(String value, Writer out) throws IOException { //.[apostrophe and <, & escaped], final char quot = attributeUseApostrophe ? '\'' : '"'; final String quotEntity = attributeUseApostrophe ? "'" : """; int pos = 0; for (int i = 0; i < value.length(); i++) { char ch = value.charAt(i); if(ch == '&') { if(i > pos) out.write(value.substring(pos, i)); out.write("&"); pos = i + 1; } if(ch == '<') { if(i > pos) out.write(value.substring(pos, i)); out.write("<"); pos = i + 1; }else if(ch == quot) { if(i > pos) out.write(value.substring(pos, i)); out.write(quotEntity); pos = i + 1; } else if(ch < 32) { //in XML 1.0 only legal character are #x9 | #xA | #xD // and they must be escaped otherwise in attribute value they are normalized to spaces if(ch == 13 || ch == 10 || ch == 9) { if(i > pos) out.write(value.substring(pos, i)); out.write("&#"); out.write(Integer.toString(ch)); out.write(';'); pos = i + 1; } else { if(TRACE_ESCAPING) System.err.println(getClass().getName()+" DEBUG ATTR value.len="+value.length()+" "+printable(value)); throw new IllegalStateException( //"character "+Integer.toString(ch)+" is not allowed in output"+getLocation()); "character "+printable(ch)+" ("+Integer.toString(ch)+") is not allowed in output"+getLocation() +" (attr value="+printable(value)+")"); // in XML 1.1 legal are [#x1-#xD7FF] // if(ch > 0) { // if(i > pos) out.write(text.substring(pos, i)); // out.write("&#"); // out.write(Integer.toString(ch)); // out.write(';'); // pos = i + 1; // } else { // throw new IllegalStateException( // "character zero is not allowed in XML 1.1 output"+getLocation()); // } } } } if(pos > 0) { out.write(value.substring(pos)); } else { out.write(value); // this is shortcut to the most common case } } protected void writeElementContent(String text, Writer out) throws IOException { // esccape '<', '&', ']]>', <32 if necessary int pos = 0; for (int i = 0; i < text.length(); i++) { //TODO: check if doing char[] text.getChars() would be faster than getCharAt(i) ... char ch = text.charAt(i); if(ch == ']') { if(seenBracket) { seenBracketBracket = true; } else { seenBracket = true; } } else { if(ch == '&') { if(i > pos) out.write(text.substring(pos, i)); out.write("&"); pos = i + 1; } else if(ch == '<') { if(i > pos) out.write(text.substring(pos, i)); out.write("<"); pos = i + 1; } else if(seenBracketBracket && ch == '>') { if(i > pos) out.write(text.substring(pos, i)); out.write(">"); pos = i + 1; } else if(ch < 32) { //in XML 1.0 only legal character are #x9 | #xA | #xD if( ch == 9 || ch == 10 || ch == 13) { // pass through // } else if(ch == 13) { //escape // if(i > pos) out.write(text.substring(pos, i)); // out.write("&#"); // out.write(Integer.toString(ch)); // out.write(';'); // pos = i + 1; } else { if(TRACE_ESCAPING) System.err.println(getClass().getName()+" DEBUG TEXT value.len="+text.length()+" "+printable(text)); throw new IllegalStateException( "character "+Integer.toString(ch)+" is not allowed in output"+getLocation() +" (text value="+printable(text)+")"); // in XML 1.1 legal are [#x1-#xD7FF] // if(ch > 0) { // if(i > pos) out.write(text.substring(pos, i)); // out.write("&#"); // out.write(Integer.toString(ch)); // out.write(';'); // pos = i + 1; // } else { // throw new IllegalStateException( // "character zero is not allowed in XML 1.1 output"+getLocation()); // } } } if(seenBracket) { seenBracketBracket = seenBracket = false; } } } if(pos > 0) { out.write(text.substring(pos)); } else { out.write(text); // this is shortcut to the most common case } } protected void writeElementContent(char[] buf, int off, int len, Writer out) throws IOException { // esccape '<', '&', ']]>' final int end = off + len; int pos = off; for (int i = off; i < end; i++) { final char ch = buf[i]; if(ch == ']') { if(seenBracket) { seenBracketBracket = true; } else { seenBracket = true; } } else { if(ch == '&') { if(i > pos) { out.write(buf, pos, i - pos); } out.write("&"); pos = i + 1; } else if(ch == '<') { if(i > pos) { out.write(buf, pos, i - pos); } out.write("<"); pos = i + 1; } else if(seenBracketBracket && ch == '>') { if(i > pos) { out.write(buf, pos, i - pos); } out.write(">"); pos = i + 1; } else if(ch < 32) { //in XML 1.0 only legal character are #x9 | #xA | #xD if( ch == 9 || ch == 10 || ch == 13) { // pass through // } else if(ch == 13 ) { //if(ch == '\r') { // if(i > pos) { // out.write(buf, pos, i - pos); // } // out.write("&#"); // out.write(Integer.toString(ch)); // out.write(';'); // pos = i + 1; } else { if(TRACE_ESCAPING) System.err.println( getClass().getName()+" DEBUG TEXT value.len=" +len+" "+printable(new String(buf,off,len))); throw new IllegalStateException( "character "+printable(ch)+" ("+Integer.toString(ch)+") is not allowed in output"+getLocation()); // in XML 1.1 legal are [#x1-#xD7FF] // if(ch > 0) { // if(i > pos) out.write(text.substring(pos, i)); // out.write("&#"); // out.write(Integer.toString(ch)); // out.write(';'); // pos = i + 1; // } else { // throw new IllegalStateException( // "character zero is not allowed in XML 1.1 output"+getLocation()); // } } } if(seenBracket) { seenBracketBracket = seenBracket = false; } // assert seenBracketBracket == seenBracket == false; } } if(end > pos) { out.write(buf, pos, end - pos); } } /** simple utility method -- good for debugging */ protected static final String printable(String s) { if(s == null) return "null"; StringBuffer retval = new StringBuffer(s.length() + 16); retval.append("'"); char ch; for (int i = 0; i < s.length(); i++) { addPrintable(retval, s.charAt(i)); } retval.append("'"); return retval.toString(); } protected static final String printable(char ch) { StringBuffer retval = new StringBuffer(); addPrintable(retval, ch); return retval.toString(); } private static void addPrintable(StringBuffer retval, char ch) { switch (ch) { case '\b': retval.append("\\b"); break; case '\t': retval.append("\\t"); break; case '\n': retval.append("\\n"); break; case '\f': retval.append("\\f"); break; case '\r': retval.append("\\r"); break; case '\"': retval.append("\\\""); break; case '\'': retval.append("\\\'"); break; case '\\': retval.append("\\\\"); break; default: if (ch < 0x20 || ch > 0x7e) { final String ss = "0000" + Integer.toString(ch, 16); retval.append("\\u" + ss.substring(ss.length() - 4, ss.length())); } else { retval.append(ch); } } } } xpp3-1.1.4c/src/java/tests/AllXmlPullApiTests.java100644 0 0 1007 10525225064 21066 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) import org.xmlpull.v1.tests.PackageTests; /** * Just call XML Pull API package tests driver. * * @author Aleksander Slominski */ public class AllXmlPullApiTests { public static void main (String[] args) { PackageTests.main(args); } } xpp3-1.1.4c/src/java/tests/LICENSE_TESTS.txt100644 0 0 61204 10525225064 17352 0ustaraslomewww 0 0 XMLPULL API TESTS LICENSE -------------------------------------- XMLPULL V1 API TESTS Copyright (C) 2002 Aleksander Slominski XMLPULL V1 API TESTS are free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. XMLPULL V1 API TESTS are distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (see below and at http://www.gnu.org/copyleft/lesser.html). NOTE: XMLPULL V1 API TESTS are released under the Lesser GPL (LGPL) license, granting you permission to use them in commercial and non-commercial applications for free. Unlike regular GPL, LGPL does not force you to license your own software under GPL. ------------------------------------------------------------------------------- GNU Lesser Public License Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS xpp3-1.1.4c/src/java/tests/README.txt100644 0 0 156 10525225064 16202 0ustaraslomewww 0 0 This is copy of src/java/tests directory from xmlpull-api-v1 CVS for more details see: http://www.xmlpull.org xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/PackageTests.java100644 0 0 16762 10525225064 23753 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; import junit.framework.Test; import junit.framework.TestResult; import junit.framework.TestSuite; import junit.textui.ResultPrinter; import junit.textui.TestRunner; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlSerializer; // -server -Dorg.xmlpull.v1.XmlPullParserFactory=org.xmlpull.v1.xni2xmlpull1.X2ParserFactory // -Dorg.xmlpull.v1.XmlPullParserFactory=org.xmlpull.v1.xni2xmlpull1.X2ParserFactory // -Dorg.xmlpull.v1.XmlPullParserFactory=org.xmlpull.mxp1.MXParserFactory // -Dorg.xmlpull.v1.tests=org.xmlpull.mxp1.MXParser,org.xmlpull.mxp1_serializer.MXSerializer /** * TODO: add tests for mixed next() with nextToken() * * @author Aleksander Slominski */ public class PackageTests extends TestRunner { private static boolean runAll; public static boolean runnigAllTests() { return runAll; } //public static void setRunnigAllTests(boolean enable) { runAll = enable; } public PackageTests() { super(); } public static Test suite() { TestSuite suite = new TestSuite("XmlPull V1 API TESTS"); suite.addTestSuite(TestFactory.class); suite.addTestSuite(TestSimple.class); suite.addTestSuite(TestSimpleWithNs.class); suite.addTestSuite(TestSerialize.class); suite.addTestSuite(TestSerializeWithNs.class); suite.addTestSuite(TestSimpleToken.class); suite.addTestSuite(TestAttributes.class); suite.addTestSuite(TestEolNormalization.class); suite.addTestSuite(TestEntityReplacement.class); suite.addTestSuite(TestCdsect.class); suite.addTestSuite(TestEvent.class); suite.addTestSuite(TestToken.class); suite.addTestSuite(TestMisc.class); suite.addTestSuite(TestSetInput.class); suite.addTestSuite(TestSimpleProcessDocdecl.class); suite.addTestSuite(TestSimpleValidation.class); suite.addTestSuite(TestProcessDocdecl.class); // finally run tests based on XML input files suite.addTestSuite(TestBootstrapXmlTests.class); suite.addTestSuite(TestXmlSimple.class); suite.addTestSuite(TestXmlTypical.class); suite.addTestSuite(TestXmlCdsect.class); return suite; } public synchronized void tick() { //if(resultPrinter != null) { // resultPrinter.startTest(null); //} else { System.err.print("."); //} } // public synchronized void startTest(Test test) { // writer() // System.err.print("."); // //if (fColumn++ >= 40) { // // writer().println(); // // fColumn= 0; // //} // } private static StringBuffer notes = new StringBuffer(); public static void addNote(String note) { if(PackageTests.runnigAllTests() == false) { System.out.print(note); System.out.flush(); } notes.append(note); } public void runPackageTests(String testFactoryName) { //writer() System.err.println("Executing XmlPull API tests" +(testFactoryName != null ? " for '"+testFactoryName+"'" : "")); notes.setLength(0); XmlPullParserFactory f = null; try { f = UtilTestCase.factoryNewInstance(); addNote("* factory "+f.getClass()+"\n");//+" created from property " //+System.getProperty(XmlPullParserFactory.PROPERTY_NAME)+"\n"); } catch (Exception ex) { System.err.println( "ERROR: tests aborted - could not create instance of XmlPullParserFactory:"); ex.printStackTrace(); System.exit(1); } XmlPullParser parser = null; try { parser=f.newPullParser(); } catch (Exception ex) { System.err.println( "ERROR: tests aborted - could not create instance of XmlPullParser from factory " +f.getClass()); ex.printStackTrace(); System.exit(2); } XmlSerializer serializer = null; try { serializer=f.newSerializer(); } catch (Exception ex) { System.err.println( "ERROR: tests aborted - could not create instance of XmlSerializer from factory " +f.getClass()); ex.printStackTrace(); System.exit(3); } String name = getClass().getName(); name = name.substring(name.lastIndexOf('.')+1); System.out.println(name+" uses factory="+f.getClass().getName() +" parser="+parser.getClass().getName() +" serializer="+serializer.getClass().getName() ); // now run all tests ... //junit.textui.TestRunner.run(suite()); TestRunner aTestRunner= new TestRunner(); try { TestResult r = doRun(suite(), false); if (!r.wasSuccessful()) System.exit(-1); //System.exit(0); } catch(Exception e) { System.err.println(e.getMessage()); System.exit(-2); } if(notes.length() > 0) { //writer(). System.err.println("Test results " +(testFactoryName != null ? "for '"+testFactoryName+"'" : "") +"\n"+notes+"\n"); } } public void printFinalReport() { //writer() System.err.println("\nAll tests were passed."); } public static void main (String[] args) { final PackageTests driver = new PackageTests(); final ResultPrinter resultPrinter = new ResultPrinter(System.err); driver.setPrinter(resultPrinter); final String listOfTests = System.getProperty("org.xmlpull.v1.tests"); final String FACTORY_PROPERTY = XmlPullParserFactory.PROPERTY_NAME; final String DEFAULT_FACTORY_PROPERTY = System.getProperty(FACTORY_PROPERTY); runAll = true; if(listOfTests != null) { int pos = 0; while (pos < listOfTests.length()) { int cut = listOfTests.indexOf(':', pos); if (cut == -1) cut = listOfTests.length(); String testFactoryName = listOfTests.substring(pos, cut); if("DEFAULT".equals(testFactoryName)) { if(DEFAULT_FACTORY_PROPERTY != null) { System.setProperty(FACTORY_PROPERTY, DEFAULT_FACTORY_PROPERTY); } else { // overcoming limitation of System.setProperty not allowing // null or empty values (who knows how to unset property ?!) System.setProperty(FACTORY_PROPERTY, "DEFAULT"); } } else { System.setProperty(FACTORY_PROPERTY, testFactoryName); } driver.runPackageTests(testFactoryName); pos = cut + 1; } driver.printFinalReport(); } else { driver.runPackageTests(null); } System.exit(0); } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestAttributes.java100644 0 0 22636 10525225064 24360 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; //import junit.framework.Test; import junit.framework.TestSuite; import java.io.StringReader; import java.io.IOException; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserException; /** * Test attribute uniqueness is ensured. * * @author Aleksander Slominski */ public class TestAttributes extends UtilTestCase { private XmlPullParserFactory factory; public TestAttributes(String name) { super(name); } protected void setUp() throws XmlPullParserException { factory = factoryNewInstance(); factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); assertEquals(true, factory.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); assertEquals(false, factory.getFeature(XmlPullParser.FEATURE_VALIDATION)); } protected void tearDown() { } public void testAttribs() throws IOException, XmlPullParserException { final String XML_ATTRS = ""+ "my-event"+ ""+ ""; XmlPullParser pp = factory.newPullParser(); pp.setInput(new StringReader(XML_ATTRS)); assertEquals(XmlPullParser.START_TAG, pp.next()); assertEquals("event", pp.getName()); assertEquals(XmlPullParser.START_TAG, pp.next()); assertEquals("type", pp.getName()); assertEquals(XmlPullParser.TEXT, pp.next()); assertEquals("my-event", pp.getText()); assertEquals(pp.next(), XmlPullParser.END_TAG); assertEquals("type", pp.getName()); assertEquals(XmlPullParser.START_TAG, pp.next()); assertEquals("handback", pp.getName()); //assertEquals(XmlPullParser.CONTENT, pp.next()); //assertEquals("", pp.readContent()); String xsiNull = pp.getAttributeValue( "http://www.w3.org/1999/XMLSchema/instance", "null"); assertEquals("1", xsiNull); String xsiType = pp.getAttributeValue( "http://www.w3.org/1999/XMLSchema/instance", "type"); assertEquals("ns2:string", xsiType); String typeName = getQNameLocal(xsiType); assertEquals("string", typeName); String typeNS = getQNameUri(pp, xsiType); assertEquals("http://www.w3.org/1999/XMLSchema", typeNS); assertEquals(pp.next(), XmlPullParser.END_TAG); assertEquals("handback", pp.getName()); assertEquals(pp.next(), XmlPullParser.END_TAG); assertEquals("event", pp.getName()); assertEquals(pp.next(), XmlPullParser.END_DOCUMENT); } private String getQNameLocal(String qname) { if(qname == null) return null; int pos = qname.indexOf(':'); return qname.substring(pos + 1); } private String getQNameUri(XmlPullParser pp, String qname) throws XmlPullParserException { if(qname == null) return null; int pos = qname.indexOf(':'); if(pos == -1) throw new XmlPullParserException( "qname des not have prefix"); String prefix = qname.substring(0, pos); return pp.getNamespace(prefix); } public void testAttribUniq() throws IOException, XmlPullParserException { final String attribsOk = "\n"+ ""; final String duplicateAttribs = "\n"+ ""; final String duplicateNsAttribs = "\n"+ ""; final String duplicateXmlns = "\n"+ ""; final String duplicateAttribXmlnsDefault = "\n"+ ""; XmlPullParser pp = factory.newPullParser(); parseOneElement(pp, attribsOk, false); assertEquals("a", pp.getAttributeValue(null, "a")); assertEquals("b", pp.getAttributeValue(null, "b")); assertEquals("c", pp.getAttributeValue(null, "m:a")); assertEquals("d", pp.getAttributeValue(null, "n:b")); assertEquals("e", pp.getAttributeValue(null, "n:x")); parseOneElement(pp, attribsOk, true); assertEquals("a", pp.getAttributeValue("","a")); assertEquals("b", pp.getAttributeValue("","b")); assertEquals(null, pp.getAttributeValue("", "m:a")); assertEquals(null, pp.getAttributeValue("", "n:b")); assertEquals(null, pp.getAttributeValue("", "n:x")); assertEquals("c", pp.getAttributeValue("Some-Namespace-URI", "a")); assertEquals("d", pp.getAttributeValue("Some-Namespace-URI", "b")); assertEquals("e", pp.getAttributeValue("Some-Namespace-URI", "x")); parseOneElement(pp, duplicateNsAttribs, false); parseOneElement(pp, duplicateAttribXmlnsDefault, false); parseOneElement(pp, duplicateAttribXmlnsDefault, true); Exception ex; ex = null; try { parseOneElement(pp, duplicateAttribs, false); } catch(XmlPullParserException rex) { ex = rex; } assertNotNull(ex); ex = null; try { parseOneElement(pp, duplicateAttribs, true); } catch(XmlPullParserException rex) { ex = rex; } assertNotNull(ex); ex = null; try { parseOneElement(pp, duplicateXmlns, false); } catch(XmlPullParserException rex) { ex = rex; } assertNotNull(ex); ex = null; try { parseOneElement(pp, duplicateXmlns, true); } catch(XmlPullParserException rex) { ex = rex; } assertNotNull(ex); ex = null; try { parseOneElement(pp, duplicateNsAttribs, true); } catch(XmlPullParserException rex) { ex = rex; } assertNotNull(ex); final String declaringDefaultEmptyNs = ""; // allowed when namespaces disabled parseOneElement(pp, declaringDefaultEmptyNs, false); // allowed to redeclare defaut anemspace to empty string, see: // http://www.w3.org/TR/1999/REC-xml-names-19990114/#ns-decl parseOneElement(pp, declaringDefaultEmptyNs, true); final String declaringPrefixedEmptyNs = ""; // allowed when namespaces disabled parseOneElement(pp, declaringPrefixedEmptyNs, false); // otherwise it is error to declare '' for non-default NS as described in // http://www.w3.org/TR/1999/REC-xml-names-19990114/#ns-decl ex = null; try { parseOneElement(pp, declaringPrefixedEmptyNs, true); } catch(XmlPullParserException rex) { ex = rex; } assertNotNull(ex); } private void parseOneElement( final XmlPullParser pp, final String buf, final boolean supportNamespaces) throws IOException, XmlPullParserException { //pp.setInput(buf.toCharArray()); pp.setInput(new StringReader(buf)); //pp.setNamespaceAware(supportNamespaces); pp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, supportNamespaces); //pp.setAllowedMixedContent(false); pp.next(); //pp.readStartTag(stag); if(supportNamespaces) { assertEquals("test", pp.getName()); } else { assertEquals("m:test", pp.getName()); } } public void testAttribValueNormalization() throws IOException, XmlPullParserException { final String XML_ATTRS = ""; XmlPullParser pp = factory.newPullParser(); pp.setInput(new StringReader(XML_ATTRS)); assertEquals(XmlPullParser.START_TAG, pp.next()); assertEquals("javadoc", pp.getName()); assertEquals("${packages}", pp.getAttributeValue(0)); assertEquals("${packages}", pp.getAttributeValue("", "packagenames")); assertEquals( "

      ", pp.getAttributeValue("", "bottom") ); //System.out.println(pp.getAttributeValue("", "bottom")); } public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestAttributes.class)); } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestBootstrapXmlTests.java100644 0 0 16024 10525225064 25705 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; //import junit.framework.Test; //import junit.framework.TestCase; import junit.framework.TestSuite; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserException; /** * Make minimal checks that tests described in XML can be processed. * * @author Aleksander Slominski */ public class TestBootstrapXmlTests extends UtilTestCase { private XmlPullParserFactory factory; public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestBootstrapXmlTests.class)); } public TestBootstrapXmlTests(String name) { super(name); } protected void setUp() throws XmlPullParserException { factory = factoryNewInstance(); factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); assertEquals(true, factory.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); } protected void tearDown() { } final String TEST_NS = "http://xmlpull.org/v1/tests/2002-08.xsd"; final String MINI_TEST_XML = "\n"+ " \r"+ " "+ "<foo/> "+ "\n"+ " \n"+ " "+ " "+ " "+ "\n \n" ; public void testMini() throws Exception { XmlPullParser pp = factory.newPullParser(); pp.setInput( new StringReader( MINI_TEST_XML ) ); pp.next(); pp.require( XmlPullParser.START_TAG, TEST_NS, "tests"); pp.next(); pp.require( XmlPullParser.TEXT, null, null); String text = pp.getText(); assertEquals("\n ", text); pp.next(); pp.require( XmlPullParser.START_TAG, TEST_NS, "test-parser"); // check name pp.nextTag(); pp.require( XmlPullParser.START_TAG, TEST_NS, "create-parser"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, TEST_NS, "create-parser"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, TEST_NS, "input-inline"); text = ""; if(pp.next() == XmlPullParser.TEXT) { text = pp.getText(); pp.next(); } assertEquals(" ", text); pp.require( XmlPullParser.END_TAG, TEST_NS, "input-inline"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, TEST_NS, "next"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, TEST_NS, "next"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, TEST_NS, "expect"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, TEST_NS, "expect"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, TEST_NS, "next"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, TEST_NS, "next"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, TEST_NS, "expect"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, TEST_NS, "expect"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, TEST_NS, "next"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, TEST_NS, "next"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, TEST_NS, "expect"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, TEST_NS, "expect"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, TEST_NS, "test-parser"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, TEST_NS, "tests"); pp.next(); pp.require( XmlPullParser.END_DOCUMENT, null, null); } final String TYPICAL_TEST_XML = "\n"+ " \r"+ " "+ "<foo att="t" att2='a' >&</foo>"+ //"<foo/> "+ "\r\n"+ " http://xmlpull.org/v1/doc/features.html#process-namespaces\r\n"+ " \n"+ " \n"+ " "+ " "+ " "+ "\n \n" ; public void testTypical() throws Exception { XmlPullParser pp = factory.newPullParser(); pp.setInput( new StringReader( TYPICAL_TEST_XML ) ); pp.next(); pp.require( XmlPullParser.START_TAG, TEST_NS, "tests"); pp.next(); pp.require( XmlPullParser.TEXT, null, null); String text = pp.getText(); assertEquals("\n ", text); pp.next(); pp.require( XmlPullParser.START_TAG, TEST_NS, "test-parser"); // check name pp.nextTag(); pp.require( XmlPullParser.START_TAG, TEST_NS, "create-parser"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, TEST_NS, "create-parser"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, TEST_NS, "input-inline"); text = ""; if(pp.next() == XmlPullParser.TEXT) { text = pp.getText(); pp.next(); } assertEquals(" bar&baz &", text); pp.require( XmlPullParser.END_TAG, TEST_NS, "input-inline"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, TEST_NS, "set-feature"); text = pp.nextText(); assertEquals("http://xmlpull.org/v1/doc/features.html#process-namespaces", text); pp.require( XmlPullParser.END_TAG, TEST_NS, "set-feature"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, TEST_NS, "expect"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, TEST_NS, "expect"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, TEST_NS, "next"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, TEST_NS, "next"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, TEST_NS, "expect"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, TEST_NS, "expect"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, TEST_NS, "next-text"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, TEST_NS, "next-text"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, TEST_NS, "next"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, TEST_NS, "next"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, TEST_NS, "expect"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, TEST_NS, "expect"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, TEST_NS, "test-parser"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, TEST_NS, "tests"); pp.next(); pp.require( XmlPullParser.END_DOCUMENT, null, null); } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestCdsect.java100644 0 0 15541 10525225064 23434 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; //import junit.framework.Test; import junit.framework.TestSuite; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserException; /** * Simple test for CDATA parsing. * * @author Aleksander Slominski */ public class TestCdsect extends UtilTestCase { private XmlPullParserFactory factory; public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestCdsect.class)); } public TestCdsect(String name) { super(name); } protected void setUp() throws XmlPullParserException { factory = factoryNewInstance(); factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); assertEquals(true, factory.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); } protected void tearDown() { } public void testCdsect() throws Exception { XmlPullParser xpp = factory.newPullParser(); assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); final String XML = "o"; xpp.setInput(new StringReader(XML)); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "t", null, false/*empty*/, 0); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.TEXT, null, 0, null, null, " foo ", false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "t", null, false, -1); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); } public void testCdsectWithEol() throws Exception { XmlPullParser xpp = factory.newPullParser(); assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); final String XML = " \no\n"; xpp.setInput(new StringReader(XML)); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "t", null, false/*empty*/, 0); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.TEXT, null, 0, null, null, " \nfoo \n\n\n", false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "t", null, false, -1); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); } public void testCdsectWithComment() throws Exception { XmlPullParser xpp = factory.newPullParser(); assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); final String XML = " \n]]>\r"; xpp.setInput(new StringReader(XML)); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "t", null, false/*empty*/, 0); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.TEXT, null, 0, null, null, " \nfoo\n", false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "t", null, false, -1); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); } public void testCdsectSoleContent() throws Exception { XmlPullParser xpp = factory.newPullParser(); assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); final String XML = "]]>"; xpp.setInput(new StringReader(XML)); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "t", null, false/*empty*/, 0); xpp.next(); //System.err.println(getClass()+" text="+printable(xpp.getText())); checkParserStateNs(xpp, 1, XmlPullParser.TEXT, null, 0, null, null, "foo", false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "t", null, false, -1); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); } public void testBigCdsect() throws Exception { testBigCdsect(1); testBigCdsect(10); testBigCdsect(15); testBigCdsect(16); testBigCdsect(100); testBigCdsect(127); testBigCdsect(128); testBigCdsect(1023); testBigCdsect(1024); testBigCdsect(1025); testBigCdsect(16*1024-1); testBigCdsect(16*1024); testBigCdsect(16*1024+1); } public void testBigCdsect(int size) throws Exception { XmlPullParser xpp = factory.newPullParser(); assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); // inspired by http://www.extreme.indiana.edu/bugzilla/show_bug.cgi?id=238 char[] oneToTen = "0123456789".toCharArray(); StringBuffer cdataContent = new StringBuffer(size+16); for (int i = 0; i < size; i++) { char c = oneToTen[i % 10]; cdataContent.append(c); } StringBuffer XML = new StringBuffer(size+16); XML.append(""); xpp.setInput(new StringReader(XML.toString())); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "foo", null, false/*empty*/, 0); xpp.next(); //System.err.println(getClass()+" text="+printable(xpp.getText()+" expected="+cdataContent.toString())); checkParserStateNs(xpp, 1, XmlPullParser.TEXT, null, 0, null, null, cdataContent.toString(), false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "foo", null, false, -1); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestEntityReplacement.java100644 0 0 13624 10525225064 25663 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; //import junit.framework.Test; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import junit.framework.TestSuite; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; /** * Test if entity replacement works ok. * This test is designe to work bboth for validating and non validating parsers! * * @author Aleksander Slominski */ public class TestEntityReplacement extends UtilTestCase { private XmlPullParserFactory factory; public TestEntityReplacement(String name) { super(name); } protected void setUp() throws XmlPullParserException { factory = factoryNewInstance(); factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); assertEquals(true, factory.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); //assertEquals(false, factory.getFeature(XmlPullParser.FEATURE_VALIDATION)); } protected void tearDown() { } public void testEntityReplacement() throws IOException, XmlPullParserException { // taken from http://www.w3.org/TR/REC-xml#sec-entexpand final String XML_ENTITY_EXPANSION = "\n"+ "\n"+ "\n"+ "' >\n"+ "%xx;\n"+ "]>"+ "This sample shows a &tricky; method."; XmlPullParser pp = factory.newPullParser(); // default parser must work!!!! pp.setInput(new StringReader( XML_ENTITY_EXPANSION ) ); if(pp.getFeature( XmlPullParser.FEATURE_PROCESS_DOCDECL ) == false) { pp.defineEntityReplacementText("tricky", "error-prone"); } testEntityReplacement(pp); // now we try for no FEATURE_PROCESS_DOCDECL pp.setInput(new StringReader( XML_ENTITY_EXPANSION ) ); try { pp.setFeature( XmlPullParser.FEATURE_PROCESS_DOCDECL, false ); } catch( Exception ex ){ } if( pp.getFeature( XmlPullParser.FEATURE_PROCESS_DOCDECL ) == false ) { pp.defineEntityReplacementText("tricky", "error-prone"); testEntityReplacement(pp); } // try to use FEATURE_PROCESS_DOCDECL if supported pp.setInput(new StringReader( XML_ENTITY_EXPANSION ) ); try { pp.setFeature( XmlPullParser.FEATURE_PROCESS_DOCDECL, true ); //PackageTests.addNote("* feature "+pp.FEATURE_PROCESS_DOCDECL+" is supported\n"); } catch( Exception ex ){ } if( pp.getFeature( XmlPullParser.FEATURE_PROCESS_DOCDECL ) ) { testEntityReplacement(pp); } // try to use FEATURE_VALIDATION if supported pp.setInput(new StringReader( XML_ENTITY_EXPANSION ) ); try { pp.setFeature( XmlPullParser.FEATURE_VALIDATION, true ); //PackageTests.addNote("* feature "+pp.FEATURE_VALIDATION+" is supported\n"); } catch( Exception ex ){ } if( pp.getFeature( XmlPullParser.FEATURE_VALIDATION ) ) { testEntityReplacement(pp); } } public void testEntityReplacement(XmlPullParser pp) throws IOException, XmlPullParserException { pp.next(); checkParserStateNs(pp, 1, XmlPullParser.START_TAG, null, 0, "", "test", null, false, 0); pp.next(); checkParserStateNs(pp, 1, XmlPullParser.TEXT, null, 0, null, null, "This sample shows a error-prone method.", false, -1); pp.next(); checkParserStateNs(pp, 1, XmlPullParser.END_TAG, null, 0, "", "test", null, false, -1); pp.nextToken(); checkParserStateNs(pp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); } /** * Additional tests to confirm that * Bug 192 * Escaped characters disappear in certain cases * is not present in XmlPull implementations. */ public void testLastEntity(String xml, String expectedText) throws Exception { InputStream stream = new ByteArrayInputStream(xml.getBytes()); XmlPullParser pp = factory.newPullParser(); // default parser must work!!!! pp.setInput(stream, "UTF-8" ); pp.nextTag(); assertEquals(XmlPullParser.START_TAG, pp.getEventType()); //assertEquals("UTF-8", pp.getCharacterEncodingScheme()); //assertEquals("1.0", startdoc.getVersion()); String c = pp.nextText(); assertEquals(expectedText, c); assertEquals(XmlPullParser.END_TAG, pp.getEventType()); } public void testLastEntity() throws Exception { testLastEntity( "<text>", "" ); testLastEntity( "<text> ", " " ); } public void testDefineEntityBeforeSetInput() throws IOException, XmlPullParserException { XmlPullParser pp = factory.newPullParser(); pp.defineEntityReplacementText("foo", "bar"); pp.setInput(new StringReader( "" ) ); } public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestEntityReplacement.class)); } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestEolNormalization.java100644 0 0 12772 10525225064 25520 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; import junit.framework.TestSuite; import java.io.StringReader; import java.io.IOException; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserException; /** * Test end-of-line normalization * * @author Aleksander Slominski */ public class TestEolNormalization extends UtilTestCase { private XmlPullParserFactory factory; public TestEolNormalization(String name) { super(name); } protected void setUp() throws XmlPullParserException { factory = factoryNewInstance(); //factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); factory.setNamespaceAware(true); assertEquals(true, factory.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); assertEquals(false, factory.getFeature(XmlPullParser.FEATURE_VALIDATION)); } protected void tearDown() { } public void testNormalizeLine() throws IOException, XmlPullParserException { XmlPullParser pp = factory.newPullParser(); //----------------------- // ---- simple tests for end of line normalization final String simpleR = "-\n-\r-\r\n-\n\r-"; // element content EOL normalizaton final String tagSimpleR = ""+simpleR+""; final String expectedSimpleN = "-\n-\n-\n-\n\n-"; parseOneElement(pp, tagSimpleR, true); assertEquals(XmlPullParser.TEXT, pp.next()); assertEquals(printable(expectedSimpleN), printable(pp.getText())); // attribute content normalization final String attrSimpleR = ""; final String normalizedSimpleN = "- - - - -"; parseOneElement(pp, attrSimpleR, true); String attrVal = pp.getAttributeValue("","a"); //TODO Xerces2 assertEquals(printable(normalizedSimpleN), printable(attrVal)); //----------------------- // --- more complex example with more line engins together final String firstR = "\r \r\n \n\r \n\n \r\n\r \r\r \r\n\n \n\r\r\n\r"+ ""; // element content final String tagR = ""+ firstR+ "\r\n"; final String expectedN = "\n \n \n\n \n\n \n\n \n\n \n\n \n\n\n\n"; parseOneElement(pp, tagR, true); assertEquals(XmlPullParser.TEXT, pp.next()); assertEquals(printable(expectedN), printable(pp.getText())); // attribute value final String attrR = ""; final String normalizedN = " "; parseOneElement(pp, attrR, true); attrVal = pp.getAttributeValue("","fifi"); //System.err.println("attrNormalized.len="+normalizedN.length()); //System.err.println("attrVal.len="+attrVal.length()); //TODO Xerces2 assertEquals(printable(normalizedN), printable(attrVal)); //----------------------- // --- even more complex final String manyLineBreaks = "fifi\r&\r&\r\n foo &\r bar \n\r\n""+ firstR; final String manyTag = ""+ manyLineBreaks+ "\r\n"; final String manyExpected = "fifi\n&\n&\n foo &\n bar \n\n\""+ expectedN; //"\r \r\n \n\r \n\n \r\n\r \r\r \r\n\n \n\r\r\n\r"; parseOneElement(pp, manyTag, true); assertEquals(XmlPullParser.TEXT, pp.next()); assertEquals(printable(manyExpected), printable(pp.getText())); assertEquals(manyExpected, pp.getText()); assertEquals(pp.next(), XmlPullParser.END_TAG); assertEquals("test", pp.getName()); // having \r\n as last characters is the hardest case //assertEquals(XmlPullParser.CONTENT, pp.next()); //assertEquals("\n", pp.readContent()); assertEquals(pp.next(), XmlPullParser.END_DOCUMENT); final String manyAttr = ""; final String manyNormalized = "fifi & & foo & bar \""+ normalizedN; parseOneElement(pp, manyAttr, true); attrVal = pp.getAttributeValue("","fifi"); //TODO Xerces2 assertEquals(printable(manyNormalized), printable(attrVal)); } private void parseOneElement( final XmlPullParser pp, final String buf, final boolean supportNamespaces) throws IOException, XmlPullParserException { //pp.setInput(buf.toCharArray()); pp.setInput(new StringReader(buf)); //pp.setNamespaceAware(supportNamespaces); pp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, supportNamespaces); //pp.setAllowedMixedContent(false); pp.next(); //pp.readStartTag(stag); if(supportNamespaces) { assertEquals("test", pp.getName()); } else { assertEquals("m:test", pp.getName()); } } public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestEolNormalization.class)); } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestEvent.java100644 0 0 14157 10525225064 23312 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; //import junit.framework.Test; //import junit.framework.TestCase; import junit.framework.TestSuite; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserException; /** * More complete test to verify paring. * * @author Aleksander Slominski */ public class TestEvent extends UtilTestCase { public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestEvent.class)); } public TestEvent(String name) { super(name); } protected XmlPullParserFactory newFactory() throws XmlPullParserException { XmlPullParserFactory factory = factoryNewInstance(); factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); assertEquals(true, factory.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); assertEquals(false, factory.getFeature(XmlPullParser.FEATURE_VALIDATION)); return factory; } protected void tearDown() { } public void testEvent() throws Exception { XmlPullParserFactory factory = newFactory(); XmlPullParser xpp = factory.newPullParser(); xpp.setInput(new StringReader(TEST_XML)); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "root", null, false, 0); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.TEXT, null, 0, null, null, "\n", false, -1); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.START_TAG, null, 0, "", "foo", null, false, 0); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.TEXT, null, 0, null, null, "bar", false, -1); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.END_TAG, null, 0, "", "foo", null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.TEXT, null, 0, null, null, "\n", false, -1); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.START_TAG, null, 1, "http://www.xmlpull.org/temp", "hugo", null, false, 0); checkNamespace(xpp, 0, null, "http://www.xmlpull.org/temp", true); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.TEXT, null, 1, null, null, " \n\n \n ", false, -1); xpp.next(); checkParserStateNs(xpp, 3, XmlPullParser.START_TAG, null, 1, "http://www.xmlpull.org/temp", "hugochild", null, false, 0); xpp.next(); checkParserStateNs(xpp, 3, XmlPullParser.TEXT, null, 1, null, null, "This is in a new namespace", false, -1); xpp.next(); checkParserStateNs(xpp, 3, XmlPullParser.END_TAG, null, 1, "http://www.xmlpull.org/temp", "hugochild", null, false, -1); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.END_TAG, null, 1, "http://www.xmlpull.org/temp", "hugo", null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.TEXT, null, 0, null, null, "\t\n", false, -1); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.START_TAG, null, 0, "", "bar", null, true, 1); checkAttribNs(xpp, 0, null, "", "testattr", "123abc"); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.END_TAG, null, 0, "", "bar", null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "root", null, false, -1); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); } public void testMultiNs() throws Exception { XmlPullParserFactory factory = newFactory(); XmlPullParser xpp = factory.newPullParser(); xpp.setInput(new StringReader("")); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "foo", null, false, 0); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.START_TAG, null, 1, "", "bar", null, true, 0); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.END_TAG, null, 1, "", "bar", null, false, -1); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.START_TAG, null, 1, "", "char", null, false, 0); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.END_TAG, null, 1, "", "char", null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "foo", null, false, -1); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); xpp.setInput(new StringReader("")); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "foo", null, false, 0); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.START_TAG, null, 1, "", "bar", null, false, 0); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.END_TAG, null, 1, "", "bar", null, false, -1); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.START_TAG, null, 1, "", "char", null, false, 0); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.END_TAG, null, 1, "", "char", null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "foo", null, false, -1); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestFactory.java100644 0 0 4212 10525225064 23607 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; import junit.framework.TestSuite; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; /** * Simple test ot verify pull parser factory * * @author Aleksander Slominski */ public class TestFactory extends UtilTestCase { public TestFactory(String name) { super(name); } public void testFactory() throws Exception { XmlPullParserFactory factory = factoryNewInstance(); //System.out.println("factory = "+factory); XmlPullParser xpp = factory.newPullParser(); PackageTests.addNote("* default parser "+xpp.getClass()+"\n"); assertEquals(false, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); xpp = factory.newPullParser(); assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); //factory.setNamespaceAware(false); factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false); //assertEquals(false, factory.isNamespaceAware()); assertEquals(false, factory.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); xpp = factory.newPullParser(); assertEquals(false, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); //factory.setNamespaceAware(true); factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); //assertEquals(true, factory.isNamespaceAware()); assertEquals(true, factory.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); xpp = factory.newPullParser(); assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); PackageTests.addNote("* namespace enabled parser "+xpp.getClass()+"\n"); } public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestFactory.class)); } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestMisc.java100644 0 0 57164 10525225064 23131 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; import junit.framework.TestSuite; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserException; /** * Tests checking miscellaneous features. * * @author Aleksander Slominski */ public class TestMisc extends UtilTestCase { private XmlPullParserFactory factory; public TestMisc(String name) { super(name); } protected void setUp() throws XmlPullParserException { factory = factoryNewInstance(); factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); assertEquals(true, factory.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); } protected void tearDown() { } public void testCharactersLegacy() throws Exception { // [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*) // SGML "legacy" in XML 1.0 as described in http://www.w3.org/TR/REC-xml#syntax // that XML parsers are required to throw error if they encounter ']]>' final String INPUT_XML = " d] ]] > ]> fd\n]]> \n "; XmlPullParser pp = factory.newPullParser(); pp.setInput( new StringReader( INPUT_XML ) ); pp.nextTag(); pp.require( XmlPullParser.START_TAG, null, "t"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, null, "test1"); assertEquals( "d] ]] > ]> fd", pp.nextText() ); pp.require( XmlPullParser.END_TAG, null, "test1"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, null, "test2"); try { pp.nextText(); fail("if TEXT contains ]]> parser must fail"); } catch(XmlPullParserException ex) {} } public void testNextTag() throws Exception { final String INPUT_XML = " foo\n \n "; XmlPullParser pp = factory.newPullParser(); pp.setInput( new StringReader( INPUT_XML ) ); pp.nextTag(); pp.require( XmlPullParser.START_TAG, null, "t"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, null, "test1"); assertEquals( "foo", pp.nextText() ); pp.require( XmlPullParser.END_TAG, null, "test1"); pp.nextTag(); pp.require( XmlPullParser.START_TAG, null, "test2"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, null, "test2"); pp.nextTag(); pp.require( XmlPullParser.END_TAG, null, "t"); pp.next(); pp.require( XmlPullParser.END_DOCUMENT, null, null); } // public void testReadText() throws Exception { // final String INPUT_XML = "foo"; // XmlPullParser pp = factory.newPullParser(); // pp.setInput( new StringReader( INPUT_XML ) ); // assertEquals( "", pp.readText() ); // pp.next(); // assertEquals( "", pp.readText() ); // pp.next(); // assertEquals( "foo", pp.readText() ); // assertEquals( pp.TYPES[ XmlPullParser.END_TAG ], pp.TYPES[ pp.getEventType() ]); // } public void testNextText() throws Exception { final String INPUT_XML = "foobar"; XmlPullParser pp = factory.newPullParser(); pp.setInput( new StringReader( INPUT_XML ) ); pp.next(); pp.require( XmlPullParser.START_TAG, null, "t"); pp.next(); pp.require( XmlPullParser.START_TAG, null, "test1"); assertEquals( "foo", pp.nextText() ); pp.require( XmlPullParser.END_TAG, null, "test1"); pp.next(); pp.require( XmlPullParser.START_TAG, null, "test2"); assertEquals( "", pp.nextText() ); pp.require( XmlPullParser.END_TAG, null, "test2"); pp.next(); pp.require( XmlPullParser.START_TAG, null, "test3"); assertEquals( "", pp.nextText() ); pp.require( XmlPullParser.END_TAG, null, "test3"); pp.next(); pp.require( XmlPullParser.START_TAG, null, "test4"); //pp.next(); //pp.require( XmlPullParser.TEXT, null, null); assertEquals( "bar", pp.nextText() ); pp.require( XmlPullParser.END_TAG, null, "test4"); pp.next(); pp.require( XmlPullParser.END_TAG, null, "t"); pp.next(); pp.require( XmlPullParser.END_DOCUMENT, null, null); // now check for error conditions pp.setInput( new StringReader( INPUT_XML ) ); pp.next(); pp.require( XmlPullParser.START_TAG, null, "t"); pp.next(); pp.require( XmlPullParser.START_TAG, null, "test1"); pp.next(); pp.require( XmlPullParser.TEXT, null, null); try { pp.nextText(); fail("if current tag is TEXT no next text content can be returned!"); } catch(XmlPullParserException ex) {} pp.setInput( new StringReader( INPUT_XML ) ); pp.next(); pp.require( XmlPullParser.START_TAG, null, "t"); try { pp.nextText(); fail("if next tag is START_TAG no text content can be returned!"); } catch(XmlPullParserException ex) {} pp.setInput( new StringReader( INPUT_XML ) ); pp.next(); pp.require( XmlPullParser.START_TAG, null, "t"); pp.next(); pp.require( XmlPullParser.START_TAG, null, "test1"); pp.next(); pp.next(); pp.require( XmlPullParser.END_TAG, null, "test1"); try { pp.nextText(); fail("if current tag is END_TAG no text content can be returned!"); } catch(XmlPullParserException ex) {} } public void testRequire() throws Exception { //public void require (int type, String namespace, String name) final String INPUT_XML = "foo\t"; XmlPullParser pp = factory.newPullParser(); pp.setInput( new StringReader( INPUT_XML ) ); pp.require( XmlPullParser.START_DOCUMENT, null, null); pp.next(); pp.require( XmlPullParser.START_TAG, null, "test"); pp.require( XmlPullParser.START_TAG, "", null); pp.require( XmlPullParser.START_TAG, "", "test"); pp.next(); pp.require( XmlPullParser.START_TAG, "", "t"); pp.next(); pp.require( XmlPullParser.TEXT, null, null); pp.next(); pp.require( XmlPullParser.END_TAG, "", "t"); pp.next(); pp.require( XmlPullParser.START_TAG, "URI", "s"); pp.next(); pp.require( XmlPullParser.TEXT, null, null); assertEquals("\t", pp.getText()); pp.next(); pp.require( XmlPullParser.END_TAG, "URI", "s"); pp.next(); pp.require( XmlPullParser.END_TAG, "", "test"); pp.next(); pp.require( XmlPullParser.END_DOCUMENT, null, null); //now check that require will NOT skip white space pp = factory.newPullParser(); pp.setInput( new StringReader( "\t" ) ); pp.require( XmlPullParser.START_DOCUMENT, null, null); pp.next(); pp.require( XmlPullParser.START_TAG, "URI", "s"); pp.next(); try { pp.require( XmlPullParser.END_TAG, "URI", "s"); fail("require() MUST NOT skip white spaces"); } catch(XmlPullParserException ex){} } public void testXmlDecl() throws Exception { XmlPullParser pp = factory.newPullParser(); pp.setInput( new StringReader( "" ) ); pp.require( XmlPullParser.START_DOCUMENT, null, null); pp.next(); pp.require( XmlPullParser.START_TAG, null, "foo"); pp.next(); pp.require( XmlPullParser.END_TAG, null, "foo"); pp.next(); pp.require( XmlPullParser.END_DOCUMENT, null, null); pp.setInput( new StringReader( "" )); pp.require( XmlPullParser.START_DOCUMENT, null, null); pp.next(); pp.require( XmlPullParser.START_TAG, null, "foo"); pp.setInput( new StringReader( "" )); pp.require( XmlPullParser.START_DOCUMENT, null, null); assertNull(pp.getProperty(PROPERTY_XMLDECL_VERSION)); assertNull(pp.getProperty(PROPERTY_XMLDECL_STANDALONE)); assertNull(pp.getProperty(PROPERTY_XMLDECL_CONTENT)); pp.next(); pp.require( XmlPullParser.START_TAG, null, "foo"); String xmlDeclVersion = (String) pp.getProperty(PROPERTY_XMLDECL_VERSION); if(xmlDeclVersion != null) { assertEquals("XMLDecl version","1.0", xmlDeclVersion); PackageTests.addNote("* optional property "+PROPERTY_XMLDECL_VERSION+" is supported\n"); } Boolean xmlDeclStandalone = (Boolean) pp.getProperty(PROPERTY_XMLDECL_STANDALONE); if(xmlDeclStandalone != null) { assertTrue("XMLDecl standalone",xmlDeclStandalone.booleanValue()); PackageTests.addNote("* optional property "+PROPERTY_XMLDECL_STANDALONE+" is supported\n"); } String xmlDeclContent = (String) pp.getProperty(PROPERTY_XMLDECL_CONTENT); if(xmlDeclContent != null) { String expected = " version=\"1.0\" \t encoding='UTF-8' \nstandalone='yes' "; assertEquals("XMLDecl content", printable(expected), printable(xmlDeclContent)); PackageTests.addNote("* optional property "+PROPERTY_XMLDECL_CONTENT+" is supported\n"); } // XML decl without required verion pp.setInput( new StringReader( "" ) ); pp.require( XmlPullParser.START_DOCUMENT, null, null); // check that proerties are reset assertNull(pp.getProperty(PROPERTY_XMLDECL_VERSION)); assertNull(pp.getProperty(PROPERTY_XMLDECL_STANDALONE)); assertNull(pp.getProperty(PROPERTY_XMLDECL_CONTENT)); try { pp.next(); fail("expected exception for invalid XML declaration without version"); } catch(XmlPullParserException ex){} pp.setInput( new StringReader( "\n" )); pp.require( XmlPullParser.START_DOCUMENT, null, null); try { pp.next(); fail("expected exception for invalid XML declaration with standalone at wrong position"); } catch(XmlPullParserException ex){} pp.setInput( new StringReader( "" +"" )); pp.require( XmlPullParser.START_DOCUMENT, null, null); // make sure that XMLDecl is not reported pp.nextToken(); pp.require( XmlPullParser.COMMENT, null, null); pp.nextToken(); pp.require( XmlPullParser.START_TAG, null, "foo"); pp.next(); pp.require( XmlPullParser.END_TAG, null, "foo"); pp.next(); pp.require( XmlPullParser.END_DOCUMENT, null, null); } public void testComments() throws Exception { XmlPullParser pp = factory.newPullParser(); pp.setInput( new StringReader( "" ) ); pp.require( XmlPullParser.START_DOCUMENT, null, null); pp.next(); pp.require( XmlPullParser.START_TAG, null, "foo"); try { pp.next(); fail("expected eception for invalid comment ending with --->"); } catch(XmlPullParserException ex){} testContentMerging(pp, "", null); testContentMerging(pp, "\n\n", "\n\n"); testContentMerging(pp, "\n", "\n"); testContentMerging(pp, "alek\n", "alek\n"); testContentMerging(pp, "al\nek\n", "al\nek\n"); } public void testContentMerging(final XmlPullParser pp, final String xml, final String expected) throws Exception { pp.setInput( new StringReader( xml ) ); pp.next(); pp.require( XmlPullParser.START_TAG, null, "foo"); if(expected != null) { pp.next(); pp.require( XmlPullParser.TEXT, null, null); assertEquals(printable(expected), printable(pp.getText())); assertEquals(expected, pp.getText()); } pp.next(); pp.require( XmlPullParser.END_TAG, null, "foo"); } public void testComments2() throws Exception { testComments2(" \r\n\n ", " \n\n "); testComments2(" \r\n\r\n ", " \n\n "); testComments2(" \r\n\r\n", " \n\n"); testComments2(" \r\n\r\n\r\n", " \n\n\n"); testComments2("\r\n\n\n ", "\n\n\n "); testComments2("\r\n ", "\n\n "); testComments2("\n\r", "\n\n"); testComments2("\r\n","\n"); testComments2("\r\n ? ","\n ? "); testComments2("\n \n\n "); testComments2("\n\n\n "); testComments2(" \n\n "); testComments2("\n\n "); testComments2("\n\n"); testComments2("\n"); testComments2("- -"); testComments2("/b>"); testComments2("?? ?/b>"); testComments2("?? ?/b ?>"); } public void testComments2(String value) throws Exception { testComments2(value, value); } public void testComments2(String value, String expected) throws Exception { XmlPullParser pp = factory.newPullParser(); final String XML = "\n\n"; testContentMerging(pp, XML, "\n\n"); pp.setInput( new StringReader( XML ) ); pp.require( XmlPullParser.START_DOCUMENT, null, null); pp.next(); pp.require( XmlPullParser.START_TAG, null, "foo"); pp.nextToken(); pp.require( XmlPullParser.TEXT, null, null); assertEquals("\n", pp.getText()); pp.nextToken(); pp.require( XmlPullParser.COMMENT, null, null); //System.err.println(getClass()+" expected="+printable(expected)+" text="+printable(pp.getText())); assertEquals(printable(expected), printable(pp.getText())); assertEquals(expected, pp.getText()); pp.nextToken(); pp.require( XmlPullParser.TEXT, null, null); assertEquals("\n", pp.getText()); pp.nextToken(); pp.require( XmlPullParser.END_TAG, null, "foo"); } public void testPI() throws Exception { XmlPullParser pp = factory.newPullParser(); //System.out.println(getClass()+"-pp="+pp); pp.setInput( new StringReader( "" ) ); pp.require( XmlPullParser.START_DOCUMENT, null, null); pp.next(); pp.require( XmlPullParser.START_TAG, null, "foo"); pp.next(); pp.require( XmlPullParser.END_TAG, null, "foo"); pp.setInput( new StringReader( "" ) ); pp.require( XmlPullParser.START_DOCUMENT, null, null); pp.next(); pp.require( XmlPullParser.START_TAG, null, "foo"); try { pp.next(); fail("expected exception for invalid PI starting with xml"); } catch(XmlPullParserException ex){} pp.setInput( new StringReader( "" ) ); pp.require( XmlPullParser.START_DOCUMENT, null, null); pp.next(); pp.require( XmlPullParser.START_TAG, null, "foo"); pp.nextToken(); pp.require( XmlPullParser.PROCESSING_INSTRUCTION, null, null); assertEquals("PI", "pi test", pp.getText()); pp.next(); pp.require( XmlPullParser.END_TAG, null, "foo"); testContentMerging(pp, "", null); testContentMerging(pp, "\n\n", "\n\n"); testContentMerging(pp, "\n", "\n"); try { testContentMerging(pp, "\n", "\n"); fail("expected parser to fail as there is space in PI between \r\n\n ", "\n\n "); testPi2("\r\n\r\n ", "\n\n "); testPi2("\r\n\r\n", "\n\n"); testPi2("\r\n\r\n\r\n", "\n\n\n"); testPi2("\r\n\n\n ", "\n\n\n "); testPi2("\r\n ", "\n\n "); testPi2("\n\r", "\n\n"); testPi2("\r\n","\n"); testPi2("\n \n\n "); testPi2("\n\n\n "); testPi2(" \n\n "); testPi2("\n\n "); testPi2("\n\n"); testPi2("\n"); testPi2("- -"); testPi2("/b>"); testPi2("cx-"); testPi2("|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; //import junit.framework.Test; //import junit.framework.TestCase; import junit.framework.TestSuite; //import java.io.ByteArrayInputStream; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserException; /** * Test FEATURE_PROCESS_DOCDECL (when supported) * * @author Aleksander Slominski */ public class TestProcessDocdecl extends UtilTestCase { private XmlPullParserFactory factory; public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestProcessDocdecl.class)); } public TestProcessDocdecl(String name) { super(name); } protected void setUp() throws XmlPullParserException { factory = factoryNewInstance(); //assertEquals(false, factory.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); //assertEquals(false, factory.getFeature(XmlPullParser.FEATURE_VALIDATION)); assertEquals(false, factory.isNamespaceAware()); assertEquals(false, factory.isValidating()); //System.out.println("factory="+factory); } private XmlPullParser newParser(boolean useNamespaces, boolean useValidation) throws XmlPullParserException { XmlPullParser xpp = factory.newPullParser(); xpp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, useNamespaces); assertEquals(useNamespaces, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); try { xpp.setFeature(XmlPullParser.FEATURE_PROCESS_DOCDECL, true); } catch(XmlPullParserException ex) { return null; } assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_DOCDECL)); try { xpp.setFeature(XmlPullParser.FEATURE_VALIDATION, useValidation); } catch(XmlPullParserException ex) { return null; } assertEquals(useValidation, xpp.getFeature(XmlPullParser.FEATURE_VALIDATION)); return xpp; } protected void tearDown() { } public void testSimpleEntity() throws Exception { testSimpleEntity(false, false); testSimpleEntity(true, false); testSimpleEntity(false, true); testSimpleEntity(true, true); } public void testAttributeNormalization() throws Exception { //TODO check that Xerces NON-validating normalization of NMTOKEN attributes //http://www.w3.org/TR/REC-xml#AVNormalize } public void testSimpleEntity(boolean useNamespaces, boolean useValidation) throws Exception { XmlPullParser xpp = newParser(useNamespaces, useValidation); if(xpp == null) return; //http://www.w3.org/TR/REC-xml#intern-replacement final String XML_SIMPLE_ENT_PROLOG = "\n"+ "\n"+ //"\n"+ "\n"+ // "\n"+ // "\n"+ // "\n"+ "\n"+ "\n"+ "]>\n"; final String XML_SIMPLE_ENT = XML_SIMPLE_ENT_PROLOG+ "Publication: &book; \n"; // final String PUB_ENTITY_INTERNAL_REPLACEMENT = // "La Peste: Albert Camus,\n"+ // " 1947 ditions Gallimard. &rights;"; final String PUB_ENTITY_INTERNAL_REPLACEMENT = "La Peste: Albert Camus,\n"+ "&pub;. &rights;"; final String PUB_ENTITY_REPLACEMENT = "La Peste: Albert Camus,\n"+ " 1947 ditions Gallimard. All rights reserved"; //next xpp.setInput(new StringReader( XML_SIMPLE_ENT )); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "test", null, false/*empty*/, 0); xpp.next(); String expectedContent = "Publication: "+PUB_ENTITY_REPLACEMENT+" "; checkParserStateNs(xpp, 1, XmlPullParser.TEXT, null, 0, null, null, expectedContent, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "test", null, false, -1); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); //nextToken } public void testEntityWithMarkup() throws Exception { testEntityWithMarkup(false, false); testEntityWithMarkup(true, false); testEntityWithMarkup(true, true); testEntityWithMarkup(false, true); } public void testEntityWithMarkup(boolean useNamespaces, boolean useValidation) throws Exception { XmlPullParser xpp = newParser(useNamespaces, useValidation); if(xpp == null) return; //http://www.w3.org/TR/REC-xml#sec-entexpand // derived from final String XML_REPLACE_ENT = "\n"+ "\n"+ "\n"+ "An ampersand (&#38;) may be escaped\n"+ "numerically (&#38;#38;) or with a general entity\n"+ "(&amp;).

      \" >\n"+ "]>\n"+ "&example; "; final String EXAMPLE_ENTITY_INTERNAL_REPLACEMENT = "

      An ampersand (&) may be escaped\n"+ "numerically (&#38;) or with a general entity\n"+ "(&amp;).

      \n"; final String EXAMPLE_ENTITY_TEXT_EVENT = "An ampersand (&) may be escaped\n"+ "numerically (&) or with a general entity\n"+ "(&)."; //next xpp.setInput(new StringReader( XML_REPLACE_ENT )); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "test", null, false/*empty*/, 0); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.START_TAG, null, 0, "", "p", null, false/*empty*/, 0); xpp.next(); String expectedContent = EXAMPLE_ENTITY_TEXT_EVENT; checkParserStateNs(xpp, 2, XmlPullParser.TEXT, null, 0, null, null, expectedContent, false, -1); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.END_TAG, null, 0, "", "p", null, false/*empty*/, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.TEXT, null, 0, null, null, " ", false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "test", null, false, -1); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); } public void testTricky() throws Exception { testTricky(false, false); testTricky(true, false); testTricky(true, true); testTricky(false, true); } public void testTricky(boolean useNamespaces, boolean useValidation) throws Exception { XmlPullParser xpp = newParser(useNamespaces, useValidation); if(xpp == null) return; // derived from final String XML_TRICKY = "\n"+ "\n"+ "\n"+ "' >\n"+ "%xx;\n"+ "]>\n"+ "This sample shows a &tricky; method.\n"; final String EXPECTED_XML_TRICKY = "This sample shows a error-prone method."; //next xpp.setInput(new StringReader( XML_TRICKY )); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "test", null, false/*empty*/, 0); xpp.next(); String expectedContent = EXPECTED_XML_TRICKY; checkParserStateNs(xpp, 1, XmlPullParser.TEXT, null, 0, null, null, expectedContent, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "test", null, false, -1); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); //TODO nextToken() } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestSerialize.java100644 0 0 24554 10525225064 24162 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; import junit.framework.TestSuite; import java.io.ByteArrayOutputStream; import java.io.StringWriter; import java.io.ByteArrayInputStream; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlSerializer; /** * Simple test to verify serializer (with no namespaces) * * @author Aleksander Slominski */ public class TestSerialize extends UtilTestCase { private XmlPullParserFactory factory; private XmlPullParser xpp; public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestSerialize.class)); } public TestSerialize(String name) { super(name); } protected void setUp() throws XmlPullParserException { factory = factoryNewInstance(); xpp = factory.newPullParser(); assertEquals(false, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); } protected void tearDown() { } public void testSimpleWriter() throws Exception { XmlSerializer ser = factory.newSerializer(); PackageTests.addNote("* default serializer "+ser.getClass()+"\n"); //assert there is error if trying to write //assert there is error if trying to write try { ser.startTag(null, "foo"); fail("exception was expected of serializer if no input was set on parser"); } catch(Exception ex) {} ser.setOutput(null); //assert there is error if trying to write try { ser.startTag(null, "foo"); fail("exception was expected of serializer if no input was set on parser"); } catch(Exception ex) {} StringWriter sw = new StringWriter(); ser.setOutput(sw); try { ser.setOutput(null, null); fail("exception was expected of setOutput() if output stream is null"); } catch(IllegalArgumentException ex) {} //check get property ser.setOutput(sw); //assertEquals(null, ser.getOutputEncoding()); ser.startDocument("ISO-8859-1", Boolean.TRUE); ser.startTag(null, "foo"); ser.endTag(null, "foo"); ser.endDocument(); // now validate that can be deserialzied //xpp.setInput(new StringReader("")); String serialized = sw.toString(); xpp.setInput(new StringReader(serialized)); assertEquals(null, xpp.getInputEncoding()); checkParserState(xpp, 0, XmlPullParser.START_DOCUMENT, null, null, false, -1); xpp.next(); checkParserState(xpp, 1, XmlPullParser.START_TAG, "foo", null, xpp.isEmptyElementTag() /*empty*/, 0); xpp.next(); checkParserState(xpp, 1, XmlPullParser.END_TAG, "foo", null, false, -1); xpp.next(); checkParserState(xpp, 0, XmlPullParser.END_DOCUMENT, null, null, false, -1); } public void testSimpleStream() throws Exception { XmlSerializer ser = factory.newSerializer(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ser.setOutput(baos, "UTF-8"); ser.startDocument("UTF-8", null); ser.startTag("", "foo"); ser.text("test"); ser.endTag("", "foo"); ser.endDocument(); //check taking input form input stream //byte[] binput = "test".getBytes("UTF8"); byte[] binput = baos.toByteArray(); xpp.setInput(new ByteArrayInputStream( binput ), "UTF-8" ); assertEquals("UTF-8", xpp.getInputEncoding()); //xpp.setInput(new StringReader( "" ) ); checkParserState(xpp, 0, XmlPullParser.START_DOCUMENT, null, null, false, -1); xpp.next(); checkParserState(xpp, 1, XmlPullParser.START_TAG, "foo", null, false /*empty*/, 0); xpp.next(); checkParserState(xpp, 1, XmlPullParser.TEXT, null, "test", false, -1); assertEquals(false, xpp.isWhitespace()); xpp.next(); checkParserState(xpp, 1, XmlPullParser.END_TAG, "foo", null, false, -1); xpp.next(); checkParserState(xpp, 0, XmlPullParser.END_DOCUMENT, null, null, false, -1); } public void testSimpleSerWithAttribute() throws Exception { XmlSerializer ser = factory.newSerializer(); // one step further - it has an attribute and content ... StringWriter sw = new StringWriter(); assertEquals(0, ser.getDepth()); ser.setOutput(sw); assertEquals(0, ser.getDepth()); ser.startDocument(null, null); assertEquals(0, ser.getDepth()); assertEquals(null, ser.getNamespace()); assertEquals(null, ser.getName()); ser.startTag(null, "foo"); assertEquals(1, ser.getDepth()); assertEquals(null, ser.getNamespace()); assertEquals("foo", ser.getName()); ser.attribute(null, "attrName", "attrVal"); assertEquals(1, ser.getDepth()); assertEquals(null, ser.getNamespace()); assertEquals("foo", ser.getName()); ser.text("bar"); assertEquals(1, ser.getDepth()); assertEquals(null, ser.getNamespace()); assertEquals("foo", ser.getName()); ser.startTag("", "p:t"); assertEquals(2, ser.getDepth()); assertEquals("", ser.getNamespace()); assertEquals("p:t", ser.getName()); ser.text("\n\t "); ser.endTag("", "p:t"); assertEquals(1, ser.getDepth()); assertEquals(null, ser.getNamespace()); assertEquals("foo", ser.getName()); ser.endTag(null, "foo"); assertEquals(0, ser.getDepth()); assertEquals(null, ser.getNamespace()); assertEquals(null, ser.getName()); ser.endDocument(); assertEquals(0, ser.getDepth()); assertEquals(null, ser.getNamespace()); assertEquals(null, ser.getName()); //xpp.setInput(new StringReader("bar\r\n\t ")); String serialized = sw.toString(); xpp.setInput(new StringReader(serialized)); checkParserState(xpp, 0, XmlPullParser.START_DOCUMENT, null, null, false, -1); xpp.next(); checkParserState(xpp, 1, XmlPullParser.START_TAG, "foo", null, false, 1); checkAttrib(xpp, 0, "attrName", "attrVal"); xpp.next(); checkParserState(xpp, 1, XmlPullParser.TEXT, null, "bar", false, -1); assertEquals(false, xpp.isWhitespace()); xpp.next(); checkParserState(xpp, 2, XmlPullParser.START_TAG, "p:t", null, false, 0); xpp.next(); checkParserState(xpp, 2, XmlPullParser.TEXT, null, "\n\t ", false, -1); assertTrue(xpp.isWhitespace()); xpp.next(); checkParserState(xpp, 2, XmlPullParser.END_TAG, "p:t", null, false, -1); xpp.next(); checkParserState(xpp, 1, XmlPullParser.END_TAG, "foo", null, false, -1); xpp.next(); checkParserState(xpp, 0, XmlPullParser.END_DOCUMENT, null, null, false, -1); } public void testEscaping() throws Exception { XmlSerializer ser = factory.newSerializer(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ser.setOutput(baos, "UTF-8"); ser.startDocument("UTF-8", null); ser.startTag("", "foo"); String s = "test\u0008\t\r\n"; try { ser.attribute(null, "att", s); fail("expected to fail for control character (<32)"); } catch(IllegalArgumentException e) { } catch(IllegalStateException e){ } ser = factory.newSerializer(); baos = new ByteArrayOutputStream(); ser.setOutput(baos, "UTF-8"); ser.startDocument("UTF-8", null); ser.startTag("", "foo"); try { ser.text(s); } catch(IllegalArgumentException e) { } catch(IllegalStateException e){ } ser = factory.newSerializer(); baos = new ByteArrayOutputStream(); ser.setOutput(baos, "UTF-8"); ser.startDocument("UTF-8", null); ser.startTag("", "foo"); s = "test\u0009\t\r\n"; String expectedS = "test\u0009\t\n"; ser.attribute(null, "att", s); ser.text(s); ser.endTag("", "foo"); ser.endDocument(); //check taking input form input stream //byte[] binput = "test".getBytes("UTF8"); byte[] binput = baos.toByteArray(); //System.out.println(getClass()+" binput="+printable(new String(binput))); xpp.setInput(new ByteArrayInputStream( binput ), "UTF-8" ); assertEquals("UTF-8", xpp.getInputEncoding()); //xpp.setInput(new StringReader( "" ) ); checkParserState(xpp, 0, XmlPullParser.START_DOCUMENT, null, null, false, -1); xpp.next(); checkParserState(xpp, 1, XmlPullParser.START_TAG, "foo", null, false /*empty*/, 1); assertEquals(printable(s), printable(xpp.getAttributeValue(null, "att"))); xpp.next(); checkParserState(xpp, 1, XmlPullParser.TEXT, null, expectedS, false, -1); assertEquals(false, xpp.isWhitespace()); xpp.next(); checkParserState(xpp, 1, XmlPullParser.END_TAG, "foo", null, false, -1); xpp.next(); checkParserState(xpp, 0, XmlPullParser.END_DOCUMENT, null, null, false, -1); baos = new ByteArrayOutputStream(); ser.setOutput(baos, "UTF-8"); ser.startDocument("UTF-8", null); ser.startTag("", "foo"); s = "test\u0000\t\r\n"; try { ser.attribute(null, "att", s); fail("expected to fail as zero chartacter is illegal both in XML 1.0 and 1.1"); } catch(Exception e) {} try { ser.text(s); fail("expected to fail as zero chartacter is illegal both in XML 1.0 and 1.1"); } catch(Exception e) {} } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestSerializeWithNs.java100644 0 0 137414 10525225064 25337 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; import junit.framework.TestSuite; import java.io.ByteArrayOutputStream; import java.io.StringWriter; import java.io.ByteArrayInputStream; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlSerializer; /** * Simple test to verify serializer (with namespaces) * * @author Aleksander Slominski */ public class TestSerializeWithNs extends UtilTestCase { private XmlPullParserFactory factory; private XmlPullParser xpp; public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestSerializeWithNs.class)); } public TestSerializeWithNs(String name) { super(name); } protected void setUp() throws XmlPullParserException { factory = factoryNewInstance(); factory.setNamespaceAware(true); // now validate that can be deserialzied xpp = factory.newPullParser(); assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); } protected void tearDown() { } private void checkSimpleWriterResult(String textContent) throws Exception { checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "foo", null, xpp.isEmptyElementTag() /*empty*/, 0); if(textContent != null) { xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.TEXT, null, 0, null, null, textContent, false, -1); } xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "foo", null, false, -1); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); } public void testSimpleWriter() throws Exception { XmlSerializer ser = factory.newSerializer(); //assert there is error if trying to write //assert there is error if trying to write try { ser.startTag("", "foo"); fail("exception was expected of serializer if no input was set"); } catch(Exception ex) {} ser.setOutput(null); //assert there is error if trying to write try { ser.startTag("", "foo"); fail("exception was expected of serializer if no input was set"); } catch(Exception ex) {} StringWriter sw = new StringWriter(); ser.setOutput(sw); try { ser.setOutput(null, null); fail("exception was expected of setOutput() if output stream is null"); } catch(IllegalArgumentException ex) {} //check get property ser.setOutput(sw); //assertEquals(null, ser.getOutputEncoding()); ser.startDocument("ISO-8859-1", Boolean.TRUE); ser.startTag("", "foo"); //TODO: check that startTag(null, ...) is allowed ser.endTag("", "foo"); ser.endDocument(); //xpp.setInput(new StringReader("")); String serialized = sw.toString(); xpp.setInput(new StringReader(serialized)); assertEquals(null, xpp.getInputEncoding()); checkSimpleWriterResult(null); } public void testSimpleOutputStream() throws Exception { XmlSerializer ser = factory.newSerializer(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ser.setOutput(baos, "UTF-8"); ser.startDocument("UTF-8", null); ser.startTag("", "foo"); final String text = "\"test<&>&"; ser.text(text); ser.endTag("", "foo"); ser.endDocument(); //check taking input form input stream //byte[] binput = "test".getBytes("UTF8"); byte[] binput = baos.toByteArray(); xpp.setInput(new ByteArrayInputStream( binput ), "UTF-8" ); assertEquals("UTF-8", xpp.getInputEncoding()); //xpp.setInput(new StringReader( "" ) ); checkSimpleWriterResult(text); } public void testNamespaceGeneration() throws Exception { XmlSerializer ser = factory.newSerializer(); //System.out.println(getClass()+" ser="+ser); StringWriter sw = new StringWriter(); ser.setOutput(sw); //assertEquals(null, ser.getOutputEncoding()); ser.startDocument("ISO-8859-1", Boolean.TRUE); ser.setPrefix("boo", "http://example.com/boo"); ser.startTag("", "foo"); ser.attribute("http://example.com/boo", "attr", "val"); String booPrefix = ser.getPrefix("http://example.com/boo", false); assertEquals("boo", booPrefix); //check that new prefix may be generated after startTag and used as attribbute value String newPrefix = ser.getPrefix("http://example.com/bar", true); ser.attribute("http://example.com/bar", "attr", "val"); ser.startTag("http://example.com/bar", "foo"); ser.endTag("http://example.com/bar", "foo"); String checkPrefix = ser.getPrefix("http://example.com/bar", false); assertEquals(newPrefix, checkPrefix); ser.endTag("", "foo"); checkPrefix = ser.getPrefix("http://example.com/bar", false); assertEquals(null, checkPrefix); ser.endDocument(); //xpp.setInput(new StringReader("")); String serialized = sw.toString(); //System.out.println(getClass()+" serialized="+serialized); //xpp.setInput(new StringReader(serialized)); } public void testMisc() throws Exception { XmlSerializer ser = factory.newSerializer(); StringWriter sw = new StringWriter(); ser.setOutput(sw); assertEquals(0, ser.getDepth()); assertEquals(null, ser.getNamespace()); assertEquals(null, ser.getName()); // all comments etc ser.startDocument(null, Boolean.TRUE); assertEquals(0, ser.getDepth()); assertEquals(null, ser.getNamespace()); assertEquals(null, ser.getName()); final String docdecl = " foo [\n"+ "\n"+ "\n" +"]"; ser.docdecl(docdecl); ser.processingInstruction("pi test"); final String iws = "\n\t"; ser.ignorableWhitespace(iws); assertEquals(0, ser.getDepth()); assertEquals(null, ser.getNamespace()); assertEquals(null, ser.getName()); ser.startTag(null, "foo"); assertEquals(1, ser.getDepth()); assertEquals(null, ser.getNamespace()); assertEquals("foo", ser.getName()); //check escaping & < > " ' final String attrVal = "attrVal&<>\"''&"; //final String attrVal = "attrVal&;"; ser.attribute(null, "attrName", attrVal); assertEquals(1, ser.getDepth()); assertEquals(null, ser.getNamespace()); assertEquals("foo", ser.getName()); ser.entityRef("amp"); final String cdsect = "hello\"test"; ser.cdsect(cdsect); ser.setPrefix("ns1", "usri2"); assertEquals(1, ser.getDepth()); assertEquals(null, ser.getNamespace()); assertEquals("foo", ser.getName()); ser.startTag("uri1", "bar"); assertEquals(2, ser.getDepth()); assertEquals("uri1", ser.getNamespace()); assertEquals("bar", ser.getName()); final String text = "test\n\ntest"; char[] buf = text.toCharArray(); ser.text(buf, 0, buf.length); final String comment = "comment B- "; ser.comment(comment); assertEquals(2, ser.getDepth()); assertEquals("uri1", ser.getNamespace()); assertEquals("bar", ser.getName()); assertEquals(2, ser.getDepth()); assertEquals("uri1", ser.getNamespace()); assertEquals("bar", ser.getName()); ser.endDocument(); // should close unclosed foo and bar start tag assertEquals(0, ser.getDepth()); assertEquals(null, ser.getNamespace()); assertEquals(null, ser.getName()); // -- now check that we get back what we serialized ... String serialized = sw.toString(); //System.out.println(getClass()+" serialized="+serialized); xpp.setInput(new StringReader(serialized)); xpp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.nextToken(); checkParserStateNs(xpp, 0, XmlPullParser.DOCDECL, null, 0, null, null, false, -1); String gotDocdecl = xpp.getText(); if(gotDocdecl != null) { assertEquals(printable(docdecl), printable(gotDocdecl)); } xpp.nextToken(); checkParserStateNs(xpp, 0, XmlPullParser.PROCESSING_INSTRUCTION, null, 0, null, null, "pi test", false, -1); xpp.nextToken(); if(xpp.getEventType() == XmlPullParser.IGNORABLE_WHITESPACE) { String expectedIws = gatherTokenText(xpp, XmlPullParser.IGNORABLE_WHITESPACE, true); assertEquals(printable(iws), printable(expectedIws)); } checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "foo", null, false, 1); checkAttribNs(xpp, 0, null, "", "attrName", attrVal); xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.ENTITY_REF, null, 0, null, "amp", "&", false, -1); xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.CDSECT, null, 0, null, null, cdsect, false, -1); assertEquals(false, xpp.isWhitespace()); xpp.nextToken(); checkParserStateNs(xpp, 2, XmlPullParser.START_TAG, 2, "uri1", "bar", false, 0); String gotText = nextTokenGathered(xpp, XmlPullParser.TEXT, false); //System.out.println(getClass()+" text="+printable(text)+" got="+printable(gotText)); assertEquals(printable(text), printable(gotText)); //xpp.nextToken(); checkParserStateNs(xpp, 2, XmlPullParser.COMMENT, null, 2, null, null, comment, false, -1); xpp.nextToken(); checkParserStateNs(xpp, 2, XmlPullParser.END_TAG, 2, "uri1", "bar", false, -1); xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, 0, "", "foo", false, -1); } private static final String ENV = "http://www.w3.org/2002/06/soap-envelope"; private static final String ALERTCONTROL = "http://example.org/alertcontrol"; private static final String ALERT = "http://example.org/alert"; private static final String EXPIRES = "2001-06-22T14:00:00-05:00"; private static final String MSG = "Pick up Mary at school at 2pm"; private static final String ROLE = "http://www.w3.org/2002/06/soap-envelope/role/ultimateReceiver"; // based on example from SOAP 1.2 spec http://www.w3.org/TR/soap12-part1/ private static final String SOAP12 = ""+ ""+ ""+ "1"+ ""+EXPIRES+""+ ""+ ""+ ""+ ""+ ""+MSG+""+ ""+ ""+ ""; private String generateSoapEnvelope(String envPrefix, String alertcontrolPrefix, String alertPrefix) throws Exception { return generateSoapEnvelope(envPrefix, alertcontrolPrefix, alertPrefix, null, null, null); } private final String PROPERTY_SERIALIZER_INDENTATION = "http://xmlpull.org/v1/doc/properties.html#serializer-indentation"; private final String PROPERTY_SERIALIZER_LINE_SEPARATOR = "http://xmlpull.org/v1/doc/properties.html#serializer-line-separator"; private final String FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE = "http://xmlpull.org/v1/doc/features.html#serializer-attvalue-use-apostrophe"; private boolean serializerIndentationSupported; private boolean serializerLineSeparatorSupported; private boolean serializerUseApostropheSupported; /** * Test optional support pretty printing */ public void testUseApostrophe() throws Exception { XmlSerializer ser = factory.newSerializer(); try { ser.setFeature(FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE, true); } catch(Exception ex) { // ignore test if optional property not supported return; } PackageTests.addNote("* optional feature "+FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE+" is supported\n"); boolean useApost = ser.getFeature(FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE); assertEquals(true, useApost); checkAttributeQuot(true, ser); ser.setFeature(FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE, false); useApost = ser.getFeature(FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE); assertEquals(false, useApost); checkAttributeQuot(false, ser); useApost = ser.getFeature(FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE); assertEquals(false, useApost); ser.setFeature(FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE, true); useApost = ser.getFeature(FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE); assertEquals(true, useApost); checkAttributeQuot(true, ser); checkAttributeQuotMix(ser); } /** * Check that attribute was quoted correctly */ private void checkAttributeQuot(boolean useApostrophe, XmlSerializer ser) throws Exception { StringWriter sw = new StringWriter(); ser.setOutput(sw); ser.startTag("", "test"); ser.attribute(null, "att", "value"); ser.endTag("", "test"); ser.endDocument(); String s = sw.toString(); if(useApostrophe) { assertTrue("use apostrophe for attribute value", s.indexOf("'value'") !=-1); } else { assertTrue("use quotation for attribute value", s.indexOf("\"value\"") !=-1); } // some validaiton of serialized XML XmlPullParser pp = factory.newPullParser(); pp.setInput(new StringReader(s)); pp.nextTag(); pp.require(XmlPullParser.START_TAG, null, "test"); assertEquals("value", pp.getAttributeValue(XmlPullParser.NO_NAMESPACE, "att")); pp.nextTag(); pp.require(XmlPullParser.END_TAG, null, "test"); } /** * Check that attribute quotations can be changed _during_ serialization */ private void checkAttributeQuotMix(XmlSerializer ser) throws Exception { StringWriter sw = new StringWriter(); ser.setOutput(sw); ser.startTag("", "test"); ser.attribute(null, "att", "value"); ser.setFeature(FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE, true); ser.attribute(null, "attA", "valueA"); ser.setFeature(FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE, false); ser.attribute(null, "attQ", "valueQ"); ser.endTag("", "test"); ser.endDocument(); String s = sw.toString(); assertTrue("use apostrophe for attribute value", s.indexOf("'valueA'") !=-1); assertTrue("use apostrophe for attribute value", s.indexOf("\"valueQ\"") !=-1); // some validaiton of serialized XML XmlPullParser pp = factory.newPullParser(); pp.setInput(new StringReader(s)); pp.nextTag(); pp.require(XmlPullParser.START_TAG, null, "test"); assertEquals("value", pp.getAttributeValue(XmlPullParser.NO_NAMESPACE, "att")); assertEquals("valueA", pp.getAttributeValue(XmlPullParser.NO_NAMESPACE, "attA")); assertEquals("valueQ", pp.getAttributeValue(XmlPullParser.NO_NAMESPACE, "attQ")); pp.nextTag(); pp.require(XmlPullParser.END_TAG, null, "test"); } public void testIndentation() throws Exception { XmlSerializer ser = factory.newSerializer(); try { ser.setProperty(PROPERTY_SERIALIZER_INDENTATION, " "); } catch(Exception ex) { // ignore test if optional property not supported return; } PackageTests.addNote("* optional property "+PROPERTY_SERIALIZER_INDENTATION+" is supported\n"); StringWriter sw = new StringWriter(); ser.setOutput(sw); ser.startTag("", "S1"); ser.startTag("", "S2"); ser.text("T"); ser.endTag("", "S2"); ser.startTag("", "M2"); ser.startTag("", "M3"); ser.endTag("", "M3"); ser.endTag("", "M2"); ser.endTag("", "S1"); ser.endDocument(); String xml = sw.toString(); //System.out.println(getClass()+" xml="+xml); checkFormatting(" ", 0, "\n", "= 0); // check that indent string is used at level for (int i = 0; i < level; i++) { for (int j = indent.length() - 1; j >= 0 ; j--) { --pos; if(pos < 0) { fail("not enough indent for "+printable(s)+" in "+printable(xml)); } char indentCh = indent.charAt(j); char ch = xml.charAt(pos); assertEquals( "expected indentation character '"+printable(indent)+"'" +" pos="+pos+" s='"+printable(s) +"' xml="+printable(xml), printable(indentCh), printable(ch)); } } // check that indent is of exact size and line ending is as expected if(pos > 0) { --pos; char ch = xml.charAt(pos); if(lineSeparator != null) { for (int i = lineSeparator.length() - 1; i >=0 ; i--) { char lineSepCh = lineSeparator.charAt(i); assertEquals( "expected end of line at pos="+pos+" s='"+printable(s) +"' xml="+printable(xml), printable(lineSepCh), printable(ch)); --pos; ch = xml.charAt(pos); } } else { char indentCh = indent.charAt(indent.length() - 1); assertTrue( "expected character that is different from '"+printable(indent)+"'" +" used for indentation " +"pos="+pos+" s="+printable(s)+" xml="+printable(xml), indentCh != ch); } } } public void testLineSeparator() throws Exception { XmlSerializer ser = factory.newSerializer(); try { ser.setProperty(PROPERTY_SERIALIZER_LINE_SEPARATOR, "\n"); } catch(Exception ex) { // ignore test if optional property not supported return; } PackageTests.addNote("* optional property "+PROPERTY_SERIALIZER_LINE_SEPARATOR+" is supported\n"); } /** generate SOAP 1.2 envelope try to use indentation and check automtic namespace prefix declaration and auto-generation of prefixes */ private String generateSoapEnvelope(String envPrefix, String alertcontrolPrefix, String alertPrefix, Boolean attvalueUseApostrophe, String indentation, String lineSeparator ) throws Exception { XmlSerializer ser = factory.newSerializer(); StringWriter sw = new StringWriter(); ser.setOutput(sw); if(attvalueUseApostrophe !=null) { try { ser.setFeature(FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE, attvalueUseApostrophe.booleanValue()); serializerUseApostropheSupported = true; } catch(Exception ex) { // ignore if optional feature not supported } } if(indentation !=null) { try { ser.setProperty(PROPERTY_SERIALIZER_INDENTATION, indentation); serializerIndentationSupported = true; } catch(Exception ex) { // ignore if optional property not supported } } if(lineSeparator !=null) { try { ser.setProperty(PROPERTY_SERIALIZER_LINE_SEPARATOR, lineSeparator); serializerLineSeparatorSupported = true; } catch(Exception ex) { // ignore if optional property not supported } } // all comments etc ser.startDocument(null, Boolean.TRUE); if(envPrefix != null) ser.setPrefix(envPrefix, ENV); ser.startTag(ENV, "Envelope"); ser.startTag(ENV, "Header"); if(alertcontrolPrefix != null) ser.setPrefix(alertcontrolPrefix, ALERTCONTROL); ser.startTag(ALERTCONTROL, "alertcontrol"); ser.attribute(ENV, "mustUnderstand", "true"); ser.attribute(ENV, "role", ROLE); ser.startTag(ALERTCONTROL, "priority"); ser.text("1"); ser.endTag(ALERTCONTROL, "priority"); ser.startTag(ALERTCONTROL, "expires"); ser.text(EXPIRES); ser.endTag(ALERTCONTROL, "expires"); ser.endTag(ALERTCONTROL, "alertcontrol"); ser.endTag(ENV, "Header"); ser.startTag(ENV, "Body"); if(alertPrefix != null) ser.setPrefix(alertPrefix, ALERT); ser.startTag(ALERT, "alert"); ser.startTag(ALERT, "msg"); ser.text(MSG); ser.endTag(ALERT, "msg"); ser.endTag(ALERT, "alert"); ser.endTag(ENV, "Body"); ser.endTag(ENV, "Envelope"); ser.endDocument(); String s = sw.toString(); return s; } public void testSetPrefix(String prefix) throws Exception { XmlSerializer ser = factory.newSerializer(); StringWriter sw = new StringWriter(); ser.setOutput(sw); final String NS = "http://example.com/test"; ser.setPrefix(prefix, NS); ser.startTag(NS, "foo"); ser.endDocument(); String serialized = sw.toString(); //System.out.println(getClass()+" sw="+sw); xpp.setInput(new StringReader(serialized)); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); String expectedPrefix = (prefix != null && prefix.length() == 0) ? null : prefix; checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, expectedPrefix, 1, NS, "foo", null, xpp.isEmptyElementTag() /*empty*/, 0); } public void testSetPrefix() throws Exception { testSetPrefix("ns"); testSetPrefix(""); testSetPrefix(null); } /** * Testing for case described in http://www.extreme.indiana.edu/bugzilla/show_bug.cgi?id=241 */ public void testAttrPrefix(String prefix, boolean extraPrefix) throws Exception { XmlSerializer ser = factory.newSerializer(); //System.err.println(getClass()+" ser="+ser.getClass()); StringWriter sw = new StringWriter(); ser.setOutput(sw); final String NS = "http://example.com/test"; ser.setPrefix(prefix, NS); if(extraPrefix) ser.setPrefix("p1", NS); ser.startTag(NS, "foo"); ser.attribute(NS, "attr", "aar"); ser.endDocument(); String serialized = sw.toString(); xpp.setInput(new StringReader(serialized)); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); String expectedPrefix = (prefix != null && prefix.length() == 0) ? null : prefix; if(extraPrefix) expectedPrefix = "p1"; int nsCount = 1; if(extraPrefix) ++nsCount; if(expectedPrefix == null) ++nsCount; //System.err.println(getClass()+" nsCount="+nsCount+" extraPrefix="+extraPrefix+" expectedPrefix="+expectedPrefix+" sw="+sw); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, expectedPrefix, nsCount, NS, "foo", null, xpp.isEmptyElementTag() /*empty*/, 1); checkAttribNs(xpp, 0, NS, "attr", "aar"); } public void testAttrPrefix() throws Exception { testAttrPrefix("ns", false); testAttrPrefix("", false); testAttrPrefix(null, false); testAttrPrefix("ns", true); testAttrPrefix("", true); testAttrPrefix(null, true); } /** setPrefix check that prefix is not duplicated ... */ public void testSetPrefixAdv() throws Exception { //TODO check redeclaring defult namespace checkTestSetPrefixSoap(SOAP12); checkTestSetPrefixSoap(generateSoapEnvelope("env", "n", "m")); checkTestSetPrefixSoap(generateSoapEnvelope(null, null, "m")); checkTestSetPrefixSoap(generateSoapEnvelope("env", null, "m")); checkTestSetPrefixSoap(generateSoapEnvelope("env", "", "")); String generated = generateSoapEnvelope("", "n", "m"); //System.err.println(getClass()+" generated="+generated); // 1 is for one extra namespace must be added to declare xmlns namespace // for attrbute mustUnderstan in SOAP-ENV namespace checkTestSetPrefixSoap(generated, 1,false); checkTestSetPrefixSoap(generateSoapEnvelope("", null, "m"),1,false); //check optional pretty printing checkTestSetPrefixSoap(generateSoapEnvelope("env", "n", "m", Boolean.FALSE, null, null)); checkTestSetPrefixSoap(generateSoapEnvelope("env", "n", "m", Boolean.TRUE, null, null)); checkTestSetPrefixSoap(generateSoapEnvelope("env", "n", "m", null, " ", null), true); checkTestSetPrefixSoap(generateSoapEnvelope("env", "n", "m", null, "\t", null), true); checkTestSetPrefixSoap(generateSoapEnvelope("env", "n", "m", null, " ", null), true); String s = generateSoapEnvelope("env", "n", "m", Boolean.TRUE, " ", "\n"); //System.out.println(getClass()+" envelope="+generateSoapEnvelope("", "n", "m")); checkTestSetPrefixSoap(s, true); } /** check that ti is possible to select which prefix should be used for namespace * For more details check http://www.extreme.indiana.edu/bugzilla/show_bug.cgi?id=169 */ public void testSetPrefixPreferences() throws Exception { testSetPrefixPreferences("", null); testSetPrefixPreferences("saml", "saml"); // check case when prefix in Infoset is invalid -- prefix preoprty is optional after all // http://www.w3.org/TR/xml-infoset/#infoitem.element testSetPrefixPreferences("sample", "saml"); testSetPrefixPreferences("", null); testSetPrefixPreferences("saml", "saml"); } private void testSetPrefixPreferences(String preferredPrefix, String expectedPrefix) throws Exception { XmlSerializer ser = factory.newSerializer(); StringWriter sw = new StringWriter(); ser.setOutput(sw); // // Book-Signing Event // // // // // // check namespaces generation with explicit prefixes // byte[] binput = (""+ // ""+ // ""+ // ""+ // "").getBytes("US-ASCII"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ser.setOutput(baos, "UTF8"); ser.startDocument(null, null); ser.setPrefix("", "namesp"); ser.setPrefix("ns1", "namesp1"); ser.setPrefix("ns2", "namesp2"); ser.startTag("namesp", "foo"); ser.setPrefix("ns1", "x1"); ser.setPrefix("ns3", "namesp3"); ser.setPrefix("", "namesp1"); ser.startTag("x1", "bar"); ser.startTag("namesp2", "gugu"); ser.attribute("", "a1", "v1"); ser.attribute("namesp2", "a2", "v2" ); ser.attribute("http://www.w3.org/XML/1998/namespace", "lang", "en"); ser.attribute("x1", "a3", "v3"); ser.endTag("namesp2", "gugu"); ser.setPrefix("ns1", "y1"); ser.startTag("namesp1", "baz"); ser.endTag("namesp1", "baz"); ser.endTag("x1", "bar"); ser.endTag("namesp", "foo"); ser.endDocument(); byte[] binput = baos.toByteArray(); //System.out.println(getClass().getName()+"serialized="+new String(binput, "US-ASCII")); xpp.setInput(new ByteArrayInputStream( binput ), "US-ASCII" ); assertEquals("US-ASCII", xpp.getInputEncoding()); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 3, "namesp", "foo", null, false, 0); assertEquals(0, xpp.getNamespaceCount(0)); assertEquals(3, xpp.getNamespaceCount(1)); checkNamespace(xpp, 0, null, "namesp", true); checkNamespace(xpp, 1, "ns1", "namesp1", true); checkNamespace(xpp, 2, "ns2", "namesp2", true); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.START_TAG, "ns1", 6, "x1", "bar", null, false, 0); assertEquals(0, xpp.getNamespaceCount(0)); assertEquals(3, xpp.getNamespaceCount(1)); assertEquals(6, xpp.getNamespaceCount(2)); checkNamespace(xpp, 3, "ns1", "x1", true); checkNamespace(xpp, 4, "ns3", "namesp3", true); checkNamespace(xpp, 5, null, "namesp1", true); xpp.next(); checkParserStateNs(xpp, 3, XmlPullParser.START_TAG, "ns2", 6, "namesp2", "gugu", null, true, 4); assertEquals(6, xpp.getNamespaceCount(2)); assertEquals(6, xpp.getNamespaceCount(3)); assertEquals("x1", xpp.getNamespace("ns1")); assertEquals("namesp2", xpp.getNamespace("ns2")); assertEquals("namesp3", xpp.getNamespace("ns3")); checkAttribNs(xpp, 0, null, "", "a1", "v1"); checkAttribNs(xpp, 1, "ns2", "namesp2", "a2", "v2"); checkAttribNs(xpp, 2, "xml", "http://www.w3.org/XML/1998/namespace", "lang", "en"); checkAttribNs(xpp, 3, "ns1", "x1", "a3", "v3"); xpp.next(); checkParserStateNs(xpp, 3, XmlPullParser.END_TAG, "ns2", 6, "namesp2", "gugu", null, false, -1); xpp.next(); checkParserStateNs(xpp, 3, XmlPullParser.START_TAG, null, 7, "namesp1", "baz", null, xpp.isEmptyElementTag(), 0); assertEquals(0, xpp.getNamespaceCount(0)); assertEquals(3, xpp.getNamespaceCount(1)); assertEquals(6, xpp.getNamespaceCount(2)); assertEquals(7, xpp.getNamespaceCount(3)); checkNamespace(xpp, 6, "ns1", "y1", true); assertEquals("y1", xpp.getNamespace("ns1")); assertEquals("namesp2", xpp.getNamespace("ns2")); assertEquals("namesp3", xpp.getNamespace("ns3")); xpp.next(); checkParserStateNs(xpp, 3, XmlPullParser.END_TAG, null, 7, "namesp1", "baz", null, false, -1); assertEquals("y1", xpp.getNamespace("ns1")); assertEquals("namesp2", xpp.getNamespace("ns2")); assertEquals("namesp3", xpp.getNamespace("ns3")); // check that declared namespaces can be accessed for current end tag assertEquals(3, xpp.getDepth()); assertEquals(6, xpp.getNamespaceCount(2)); assertEquals(7, xpp.getNamespaceCount(3)); // chekc that namespace is accessible by direct addresssing assertEquals(null, xpp.getNamespacePrefix(0)); assertEquals("namesp", xpp.getNamespaceUri(0)); assertEquals("ns1", xpp.getNamespacePrefix(1)); assertEquals("namesp1", xpp.getNamespaceUri(1)); assertEquals("ns1", xpp.getNamespacePrefix(3)); assertEquals("x1", xpp.getNamespaceUri(3)); assertEquals("ns1", xpp.getNamespacePrefix(6)); assertEquals("y1", xpp.getNamespaceUri(6)); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.END_TAG, "ns1", 6, "x1", "bar", null, false, -1); // check that namespace is undelcared assertEquals("x1", xpp.getNamespace("ns1")); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 3, "namesp", "foo", null, false, -1); assertEquals("namesp1", xpp.getNamespace("ns1")); assertEquals("namesp2", xpp.getNamespace("ns2")); assertEquals(null, xpp.getNamespace("ns3")); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); assertEquals(null, xpp.getNamespace("ns1")); assertEquals(null, xpp.getNamespace("ns2")); assertEquals(null, xpp.getNamespace("ns3")); } private void assertXmlEquals(String expectedXml, String actualXml) throws Exception { XmlPullParser expect = factory.newPullParser(); expect.setInput(new StringReader(expectedXml)); XmlPullParser actual = factory.newPullParser(); actual.setInput(new StringReader(actualXml)); while(true) { expect.next(); actual.next(); assertXml("inconsistent event type", expect, actual, XmlPullParser.TYPES[ expect.getEventType() ], XmlPullParser.TYPES[ actual.getEventType() ] ); if(expect.getEventType() == XmlPullParser.END_DOCUMENT) { break; } if(expect.getEventType() == XmlPullParser.START_TAG || expect.getEventType() == XmlPullParser.END_TAG ) { assertXml("tag names", expect, actual, expect.getName(), actual.getName()); assertXml("tag namespaces", expect, actual, expect.getNamespace(), actual.getNamespace()); if(expect.getEventType() == XmlPullParser.START_TAG) { // check consisteny of attributes -- allow them to be in any order int expectAttrCount = expect.getAttributeCount(); assertXml("attributes count", expect, actual, ""+expectAttrCount, ""+actual.getAttributeCount()); for (int i = 0; i < expectAttrCount; i++) { String expectAttrNamespace = expect.getAttributeNamespace(i); String expectAttrName = expect.getAttributeName(i); String expectAttrType = expect.getAttributeType(i); String expectAttrValue = expect.getAttributeValue(i); boolean expectAttrDefault = expect.isAttributeDefault(i); // find this attribute actual position int actualPos = -1; for (int j = 0; j < expectAttrCount; j++) { if(expectAttrNamespace.equals(actual.getAttributeNamespace(j)) && expectAttrName.equals(actual.getAttributeName(j))) { actualPos = j; break; } } String expectN = expectAttrNamespace+":"+expectAttrName; if(actualPos == -1) { System.err.println("expected:\n"+expectedXml +"\nactual:\n"+actualXml); fail("could not find expected attribute "+expectN +" actual parser "+actual.getPositionDescription()); } //and compare ... assertXml("attribute "+expectN+" namespace", expect, actual, expectAttrNamespace, actual.getAttributeNamespace(actualPos) ); assertXml("attribute "+expectN+" name", expect, actual, expectAttrName, actual.getAttributeName(actualPos) ); assertXml("attribute "+expectN+" type", expect, actual, expectAttrType, actual.getAttributeType(actualPos) ); assertXml("attribute "+expectN+" value", expect, actual, expectAttrValue, actual.getAttributeValue(actualPos) ); assertXml("attribute "+expectN+" default", expect, actual, ""+expectAttrDefault, ""+actual.isAttributeDefault(actualPos) ); } } } else if(expect.getEventType() == XmlPullParser.TEXT) { assertXml("text content", expect, actual, expect.getText(), actual.getText()); } else { fail("unexpected event type "+expect.getEventType()+" "+expect.getPositionDescription()); } //System.err.print("."); } //System.err.println("\nOK"); } private static void assertXml(String formatted, XmlPullParser pExpected, XmlPullParser pActual, String expected, String actual ) { if((expected != null && !expected.equals(actual)) || (expected == null && actual != null)) { fail(formatted +" expected:<"+expected+"> but was:<"+actual+">" +" (expecte parser position:"+pExpected.getPositionDescription() +" and actual parser positon:"+pActual.getPositionDescription() ); } } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestSetInput.java100644 0 0 17324 10525225064 24003 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; import junit.framework.TestSuite; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.IOException; import java.io.Reader; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserException; /** * Tests to determine that setInput works as expected for different encodings. * * @author Aleksander Slominski */ public class TestSetInput extends UtilTestCase { private XmlPullParserFactory factory; public TestSetInput(String name) { super(name); } protected void setUp() throws XmlPullParserException { factory = factoryNewInstance(); factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); assertEquals(true, factory.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); } protected void tearDown() { } public void testSetReader() throws Exception { XmlPullParser xpp = factory.newPullParser(); assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); xpp.setInput(null); assertEquals(XmlPullParser.START_DOCUMENT, xpp.getEventType()); try { xpp.next(); fail("exception was expected of next() if no input was set on parser"); } catch(XmlPullParserException ex) {} // make input suspectible to read ... ReaderWrapper reader = new ReaderWrapper( new StringReader("")); assertEquals("no read() called in just contructed reader", false, reader.calledRead()); xpp.setInput(reader); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); assertEquals("read() not called before next()", false, reader.calledRead()); xpp.next(); assertEquals("read() must be called after next()", true, reader.calledRead()); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "foo", null, true/*empty*/, 0); } public void testSetInput() throws Exception { XmlPullParser xpp = factory.newPullParser(); assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); // another test byte[] binput = ("").getBytes("UTF-8"); InputStreamWrapper isw = new InputStreamWrapper( new ByteArrayInputStream( binput )); assertEquals("no read() called in just contructed reader", false, isw.calledRead()); xpp.setInput(isw, "UTF-8"); assertEquals("UTF-8", xpp.getInputEncoding()); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); assertEquals("read() not called before next()", false, isw.calledRead()); xpp.nextToken(); assertEquals("read() must be called after next()", true, isw.calledRead()); //needs to resolve: // java.lang.InternalError: Converter malfunction (UTF-16) -- please submit a bug report via http://java.sun.com/cgi-bin/bugreport.cgi // // // add BOM // //byte[] binput1 = new byte[]{((byte)'\u00FE'), ((byte)'\u00FF')}; // //byte[] binput1 = new byte[]{((byte)'\u00FF'), ((byte)'\u00FE')}; // byte[] binput1 = new byte[0]; // byte[] binput2 = // ("").getBytes("UTF16"); // binput = new byte[ binput1.length + binput2.length ] ; // System.arraycopy(binput1, 0, binput, 0, binput1.length); // System.arraycopy(binput2, 0, binput, binput1.length, binput2.length); // isw = new InputStreamWrapper( // new ByteArrayInputStream( binput )); // assertEquals("no read() called in just contructed reader", false, isw.calledRead()); // // //xpp.setInput(isw, "UTF-16" ); //TODO why Xerces2 causes java Unicode decoder to fail ???? // xpp.setInput(isw, "UTF16" ); // //assertEquals("UTF-16", xpp.getInputEncoding()); // checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); // assertEquals("read() not called before next()", false, isw.calledRead()); // // xpp.nextToken(); // assertEquals("read() must be called after next()", true, isw.calledRead()); // // check input detecting -- for mutlibyte sequences ... final String FEATURE_DETECT_ENCODING = "http://xmlpull.org/v1/doc/features.html#detect-encoding"; if(xpp.getFeature(FEATURE_DETECT_ENCODING)) { PackageTests.addNote("* optional feature "+FEATURE_DETECT_ENCODING+" is supported\n"); isw = new InputStreamWrapper( new ByteArrayInputStream( binput )); assertEquals("no read() called in just contructed reader", false, isw.calledRead()); xpp.setInput(isw, null ); assertEquals(null, xpp.getInputEncoding()); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); //assertEquals("read() not called before next()", false, isw.calledRead()); xpp.nextToken(); assertEquals("read() must be called after next()", true, isw.calledRead()); assertEquals("UTF16", xpp.getInputEncoding()); } // check input detecting -- default binput = ("").getBytes("ISO-8859-1"); isw = new InputStreamWrapper( new ByteArrayInputStream( binput )); assertEquals("no read() called in just contructed reader", false, isw.calledRead()); xpp.setInput(isw, null ); assertEquals(null, xpp.getInputEncoding()); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); //assertEquals("read() not called before next()", false, isw.calledRead()); xpp.next(); assertEquals("read() must be called after next()", true, isw.calledRead()); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "foo", null, true/*empty*/, 0); if(xpp.getFeature(FEATURE_DETECT_ENCODING)) { assertEquals("ISO-8859-1", xpp.getInputEncoding()); } } // ------ allow to detect if input was read private static class InputStreamWrapper extends InputStream { InputStream is; boolean calledRead; public boolean calledRead() { return calledRead; } public InputStreamWrapper(InputStream inputStream) { is = inputStream; } public int read() throws IOException { calledRead = true; return is.read(); } } private static class ReaderWrapper extends Reader { Reader r; boolean calledRead; public boolean calledRead() { return calledRead; } public ReaderWrapper(Reader reader) { r = reader; } public int read(char[]ch, int off, int len) throws IOException { calledRead = true; return r.read(ch, off, len); } public void close() throws IOException { r.close(); } } public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestSetInput.class)); } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestSimple.java100644 0 0 13543 10525225064 23460 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; //import junit.framework.Test; import junit.framework.TestSuite; import java.io.ByteArrayInputStream; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserException; /** * Simple test ot verify pull parser factory * * @author Aleksander Slominski */ public class TestSimple extends UtilTestCase { private XmlPullParserFactory factory; public TestSimple(String name) { super(name); } protected void setUp() throws XmlPullParserException { factory = factoryNewInstance(); //assertEquals(false, factory.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); //assertEquals(false, factory.getFeature(XmlPullParser.FEATURE_VALIDATION)); assertEquals(false, factory.isNamespaceAware()); assertEquals(false, factory.isValidating()); } protected void tearDown() { } public void testSimple() throws Exception { XmlPullParser xpp = factory.newPullParser(); assertEquals(false, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); // this SHOULD always be OK assertEquals("START_DOCUMENT", XmlPullParser.TYPES[XmlPullParser.START_DOCUMENT]); assertEquals("END_DOCUMENT", XmlPullParser.TYPES[XmlPullParser.END_DOCUMENT]); assertEquals("START_TAG", XmlPullParser.TYPES[XmlPullParser.START_TAG]); assertEquals("END_TAG", XmlPullParser.TYPES[XmlPullParser.END_TAG]); assertEquals("TEXT", XmlPullParser.TYPES[XmlPullParser.TEXT]); assertEquals("CDSECT", XmlPullParser.TYPES[XmlPullParser.CDSECT]); assertEquals("ENTITY_REF", XmlPullParser.TYPES[XmlPullParser.ENTITY_REF]); assertEquals("IGNORABLE_WHITESPACE", XmlPullParser.TYPES[XmlPullParser.IGNORABLE_WHITESPACE]); assertEquals("PROCESSING_INSTRUCTION", XmlPullParser.TYPES[XmlPullParser.PROCESSING_INSTRUCTION]); assertEquals("COMMENT", XmlPullParser.TYPES[XmlPullParser.COMMENT]); assertEquals("DOCDECL", XmlPullParser.TYPES[XmlPullParser.DOCDECL]); // check setInput semantics assertEquals(XmlPullParser.START_DOCUMENT, xpp.getEventType()); try { xpp.next(); fail("exception was expected of next() if no input was set on parser"); } catch(XmlPullParserException ex) {} xpp.setInput(null); assertEquals(XmlPullParser.START_DOCUMENT, xpp.getEventType()); try { xpp.next(); fail("exception was expected of next() if no input was set on parser"); } catch(XmlPullParserException ex) {} try { xpp.setInput(null, null); fail("exception was expected of setInput() if input stream is null"); } catch(IllegalArgumentException ex) {} xpp.setInput(null); assertTrue("line number must be -1 or >= 1 not "+xpp.getLineNumber(), xpp.getLineNumber() == -1 || xpp.getLineNumber() >= 1); assertTrue("column number must be -1 or >= 0 not "+xpp.getColumnNumber(), xpp.getColumnNumber() == -1 || xpp.getColumnNumber() >= 0); // check the simplest possible XML document - just one root element xpp.setInput(new StringReader("")); assertEquals(null, xpp.getInputEncoding()); checkParserState(xpp, 0, XmlPullParser.START_DOCUMENT, null, null, false, -1); xpp.next(); checkParserState(xpp, 1, XmlPullParser.START_TAG, "foo", null, false /*empty*/, 0); xpp.next(); checkParserState(xpp, 1, XmlPullParser.END_TAG, "foo", null, false, -1); xpp.next(); checkParserState(xpp, 0, XmlPullParser.END_DOCUMENT, null, null, false, -1); //check taking input form input stream byte[] binput = "".getBytes("UTF-8"); //Xerces2 doe snot like UTF8 ... xpp.setInput(new ByteArrayInputStream( binput ), "UTF-8" ); assertEquals("UTF-8", xpp.getInputEncoding()); //xpp.setInput(new StringReader( "" ) ); checkParserState(xpp, 0, XmlPullParser.START_DOCUMENT, null, null, false, -1); xpp.next(); checkParserState(xpp, 1, XmlPullParser.START_TAG, "foo", null, true /*empty*/, 0); xpp.next(); checkParserState(xpp, 1, XmlPullParser.END_TAG, "foo", null, false, -1); xpp.next(); checkParserState(xpp, 0, XmlPullParser.END_DOCUMENT, null, null, false, -1); // one step further - it has an attribute and content ... xpp.setInput(new StringReader("bar\r\n\t ")); checkParserState(xpp, 0, XmlPullParser.START_DOCUMENT, null, null, false, -1); xpp.next(); checkParserState(xpp, 1, XmlPullParser.START_TAG, "foo", null, false, 1); checkAttrib(xpp, 0, "attrName", "attrVal"); xpp.next(); checkParserState(xpp, 1, XmlPullParser.TEXT, null, "bar", false, -1); assertEquals(false, xpp.isWhitespace()); xpp.next(); checkParserState(xpp, 2, XmlPullParser.START_TAG, "p:t", null, false, 0); xpp.next(); checkParserState(xpp, 2, XmlPullParser.TEXT, null, "\n\t ", false, -1); assertTrue(xpp.isWhitespace()); xpp.next(); checkParserState(xpp, 2, XmlPullParser.END_TAG, "p:t", null, false, -1); xpp.next(); checkParserState(xpp, 1, XmlPullParser.END_TAG, "foo", null, false, -1); xpp.next(); checkParserState(xpp, 0, XmlPullParser.END_DOCUMENT, null, null, false, -1); } public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestSimple.class)); } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestSimpleProcessDocdecl.java100644 0 0 7452 10525225064 26257 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; import junit.framework.TestSuite; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserException; /** * Test FEATURE_PROCESS_DOCDECL (when supported) * * @author Aleksander Slominski */ public class TestSimpleProcessDocdecl extends UtilTestCase { private XmlPullParserFactory factory; public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestSimpleProcessDocdecl.class)); } public TestSimpleProcessDocdecl(String name) { super(name); } protected void setUp() throws XmlPullParserException { factory = factoryNewInstance(); assertEquals(false, factory.isNamespaceAware()); assertEquals(false, factory.isValidating()); //System.out.println("factory="+factory); } public void testProcessDocdecl() throws Exception { XmlPullParser xpp = factory.newPullParser(); try { xpp.setFeature(XmlPullParser.FEATURE_PROCESS_DOCDECL, true); } catch(XmlPullParserException ex) { return; } PackageTests.addNote("* feature "+XmlPullParser.FEATURE_PROCESS_DOCDECL+" is supported\n"); // setting validation MUST enables also PROCESS_DOCDECL assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_DOCDECL)); // default is to have non-validating parser assertEquals(false, xpp.getFeature(XmlPullParser.FEATURE_VALIDATION)); //http://www.w3.org/TR/REC-xml#NT-extSubsetDecl // minimum validation final String XML_MIN_PROLOG = "\n"+ "\n"+ "]>\n"; final String XML_MIN_VALID = XML_MIN_PROLOG+ "Hello, &name;!\n"; xpp.setInput(new StringReader( XML_MIN_VALID )); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); assertNull(xpp.getProperty(PROPERTY_XMLDECL_VERSION)); assertNull(xpp.getProperty(PROPERTY_XMLDECL_STANDALONE)); assertNull(xpp.getProperty(PROPERTY_XMLDECL_CONTENT)); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "greeting", null, false/*empty*/, 0); //XMLDecl support is required when PROCESS DOCDECL enabled assertEquals("1.0", xpp.getProperty(PROPERTY_XMLDECL_VERSION)); assertEquals(Boolean.TRUE, xpp.getProperty(PROPERTY_XMLDECL_STANDALONE)); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.TEXT, null, 0, null, null, "Hello, world!", false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "greeting", null, false, -1); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); //AND WRONG final String XML_MIN_INVALID = XML_MIN_PROLOG+ "Hello, &world;!\n"; xpp.setInput(new StringReader( XML_MIN_INVALID )); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "greet", null, false/*empty*/, 0); try { xpp.next(); fail("exception was expected of next() for undeclared entity"); } catch(XmlPullParserException ex) {} } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestSimpleToken.java100644 0 0 15160 10525225064 24456 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; import junit.framework.TestSuite; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserException; /** * Simple test for minimal XML tokenizing * * @author Aleksander Slominski */ public class TestSimpleToken extends UtilTestCase { private XmlPullParserFactory factory; public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestSimpleToken.class)); } public TestSimpleToken(String name) { super(name); } protected void setUp() throws XmlPullParserException { factory = factoryNewInstance(); factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); assertEquals(true, factory.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); //System.out.println(getClass()+"-factory="+factory); } protected void tearDown() { } public void testVerySimpleToken() throws Exception { XmlPullParser xpp = factory.newPullParser(); assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); xpp.setInput(new StringReader("")); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "foo", null, false, 0); xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.COMMENT, null, 0, null, null, "comment", false, -1); xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.PROCESSING_INSTRUCTION, null, 0, null, null, "target pi", false, -1); xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "foo", null, false, -1); xpp.nextToken(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); } public void testSimpleToken() throws Exception { XmlPullParser xpp = factory.newPullParser(); assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); // check setInput semantics assertEquals(XmlPullParser.START_DOCUMENT, xpp.getEventType()); try { xpp.nextToken(); fail("exception was expected of nextToken() if no input was set on parser"); } catch(XmlPullParserException ex) {} xpp.setInput(null); assertEquals(XmlPullParser.START_DOCUMENT, xpp.getEventType()); try { xpp.nextToken(); fail("exception was expected of next() if no input was set on parser"); } catch(XmlPullParserException ex) {} xpp.setInput(null); //reset parser // attempt to set roundtrip try { xpp.setFeature(FEATURE_XML_ROUNDTRIP, true); } catch(Exception ex) { } // did we succeeded? boolean roundtripSupported = xpp.getFeature(FEATURE_XML_ROUNDTRIP); // check the simplest possible XML document - just one root element for(int i = 1; i <= 2; ++i) { xpp.setInput(new StringReader(i == 1 ? "" : "")); boolean empty = (i == 1); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "foo", null, empty, 0); if(roundtripSupported) { if(empty) { // System.out.println("tag='"+xpp.getText()+"'"); // String foo =""; // String foo2 = xpp.getText(); // System.out.println(foo.equals(foo2)); assertEquals("empty tag roundtrip", printable(""), printable(xpp.getText())); } else { assertEquals("start tag roundtrip", printable(""), printable(xpp.getText())); } } xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "foo", null, false, -1); if(roundtripSupported) { if(empty) { assertEquals("empty tag roundtrip", printable(""), printable(xpp.getText())); } else { assertEquals("end tag roundtrip", printable(""), printable(xpp.getText())); } } xpp.nextToken(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); } } public void testNormalization() throws Exception { XmlPullParser xpp = factory.newPullParser(); assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); testNormalization(xpp); try{ xpp.setFeature(FEATURE_XML_ROUNDTRIP, false); } catch(Exception ex) {} testNormalization(xpp); try{ xpp.setFeature(FEATURE_XML_ROUNDTRIP, true); } catch(Exception ex) {} testNormalization(xpp); } public void testNormalization(XmlPullParser xpp) throws Exception { xpp.setInput(new StringReader("\n \r\n \n\r")); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "foo", null, false/*empty*/, 0); boolean roundtrip = xpp.getFeature(FEATURE_XML_ROUNDTRIP) == false; String text = nextTokenGathered(xpp, XmlPullParser.TEXT, true); if(roundtrip) { assertEquals(printable("\n \n \n\n"), printable(text)); assertEquals("\n \n \n\n", text); } else { assertEquals(printable("\n \r\n \n\r"), printable(text)); assertEquals("\n \r\n \n\r", text); } checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "foo", null, false, -1); xpp.nextToken(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestSimpleValidation.java100644 0 0 6776 10525225064 25465 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; import junit.framework.TestSuite; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserException; /** * Test FEATURE_VALIDATION (when supported) * * @author Aleksander Slominski */ public class TestSimpleValidation extends UtilTestCase { private XmlPullParserFactory factory; public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestSimpleValidation.class)); } public TestSimpleValidation(String name) { super(name); } protected void setUp() throws XmlPullParserException { factory = factoryNewInstance(); assertEquals(false, factory.isNamespaceAware()); assertEquals(false, factory.isValidating()); //System.out.println("factory="+factory); } public void testValidation() throws Exception { XmlPullParser xpp = factory.newPullParser(); try { xpp.setFeature(XmlPullParser.FEATURE_VALIDATION, true); } catch(XmlPullParserException ex) { return; } PackageTests.addNote("* feature "+XmlPullParser.FEATURE_VALIDATION+" is supported\n"); // setting validation MUST enables also PROCESS_DOCDECL assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_DOCDECL)); //http://www.w3.org/TR/REC-xml#NT-extSubsetDecl // minimum validation final String XML_MIN_PROLOG = "\n"+ "\n"+ "]>\n"; final String XML_MIN_VALID = XML_MIN_PROLOG+ "Hello, world!\n"; xpp.setInput(new StringReader( XML_MIN_VALID )); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); assertNull(xpp.getProperty(PROPERTY_XMLDECL_VERSION)); assertNull(xpp.getProperty(PROPERTY_XMLDECL_STANDALONE)); assertNull(xpp.getProperty(PROPERTY_XMLDECL_CONTENT)); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "greeting", null, false/*empty*/, 0); //XMLDecl support is required when PROCESS DOCDECL enabled assertEquals("1.0", xpp.getProperty(PROPERTY_XMLDECL_VERSION)); assertEquals(null, xpp.getProperty(PROPERTY_XMLDECL_STANDALONE)); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.TEXT, null, 0, null, null, "Hello, world!", false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "greeting", null, false, -1); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); //AND WRONG final String XML_MIN_INVALID = XML_MIN_PROLOG+ "Hello, world!\n"; xpp.setInput(new StringReader( XML_MIN_INVALID )); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); try { xpp.next(); fail("exception was expected of next() for invalid document element root"); } catch(XmlPullParserException ex) {} } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestSimpleWithNs.java100644 0 0 20227 10525225064 24612 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; import junit.framework.TestSuite; import java.io.ByteArrayInputStream; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserException; /** * Simple test for minimal XML parsing with namespaces * * @author Aleksander Slominski */ public class TestSimpleWithNs extends UtilTestCase { private XmlPullParserFactory factory; public TestSimpleWithNs(String name) { super(name); } protected void setUp() throws XmlPullParserException { factory = factoryNewInstance(); factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); assertEquals(true, factory.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); } protected void tearDown() { } public void testSimpleWithNs() throws Exception { XmlPullParser xpp = factory.newPullParser(); assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); // check setInput semantics assertEquals(XmlPullParser.START_DOCUMENT, xpp.getEventType()); try { xpp.next(); fail("exception was expected of next() if no input was set on parser"); } catch(XmlPullParserException ex) {} xpp.setInput(null); assertEquals(XmlPullParser.START_DOCUMENT, xpp.getEventType()); try { xpp.next(); fail("exception was expected of next() if no input was set on parser"); } catch(XmlPullParserException ex) {} // check the simplest possible XML document - just one root element xpp.setInput(new StringReader("")); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "foo", null, false/*empty*/, 0); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "foo", null, false, -1); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); xpp.setInput(new StringReader("")); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "foo", null, true/*empty*/, 0); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "foo", null, false, -1); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); // one step further - it has content ... xpp.setInput(new StringReader("bar")); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "foo", null, false, 1); checkAttribNs(xpp, 0, null, "", "attrName", "attrVal"); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.TEXT, null, 0, null, null, "bar", false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 0, "", "foo", null, false, -1); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); byte[] binput = (""+ ""+ ""+ ""+ "").getBytes("US-ASCII"); xpp.setInput(new ByteArrayInputStream( binput ), "US-ASCII" ); assertEquals("US-ASCII", xpp.getInputEncoding()); checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 3, "n", "foo", null, false, 0); assertEquals(0, xpp.getNamespaceCount(0)); assertEquals(3, xpp.getNamespaceCount(1)); checkNamespace(xpp, 0, null, "n", true); checkNamespace(xpp, 1, "ns1", "n1", true); checkNamespace(xpp, 2, "ns2", "n2", true); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.START_TAG, "ns1", 6, "x1", "bar", null, false, 0); assertEquals(0, xpp.getNamespaceCount(0)); assertEquals(3, xpp.getNamespaceCount(1)); assertEquals(6, xpp.getNamespaceCount(2)); checkNamespace(xpp, 3, "ns1", "x1", true); checkNamespace(xpp, 4, "ns3", "n3", true); checkNamespace(xpp, 5, null, "n1", true); xpp.next(); checkParserStateNs(xpp, 3, XmlPullParser.START_TAG, "ns2", 6, "n2", "gugu", null, true, 4); assertEquals(6, xpp.getNamespaceCount(2)); assertEquals(6, xpp.getNamespaceCount(3)); assertEquals("x1", xpp.getNamespace("ns1")); assertEquals("n2", xpp.getNamespace("ns2")); assertEquals("n3", xpp.getNamespace("ns3")); checkAttribNs(xpp, 0, null, "", "a1", "v1"); checkAttribNs(xpp, 1, "ns2", "n2", "a2", "v2"); checkAttribNs(xpp, 2, "xml", "http://www.w3.org/XML/1998/namespace", "lang", "en"); checkAttribNs(xpp, 3, "ns1", "x1", "a3", "v3"); xpp.next(); checkParserStateNs(xpp, 3, XmlPullParser.END_TAG, "ns2", 6, "n2", "gugu", null, false, -1); xpp.next(); checkParserStateNs(xpp, 3, XmlPullParser.START_TAG, null, 7, "n1", "baz", null, false, 0); assertEquals(0, xpp.getNamespaceCount(0)); assertEquals(3, xpp.getNamespaceCount(1)); assertEquals(6, xpp.getNamespaceCount(2)); assertEquals(7, xpp.getNamespaceCount(3)); checkNamespace(xpp, 6, "ns1", "y1", true); assertEquals("y1", xpp.getNamespace("ns1")); assertEquals("n2", xpp.getNamespace("ns2")); assertEquals("n3", xpp.getNamespace("ns3")); xpp.next(); checkParserStateNs(xpp, 3, XmlPullParser.END_TAG, null, 7, "n1", "baz", null, false, -1); assertEquals("y1", xpp.getNamespace("ns1")); assertEquals("n2", xpp.getNamespace("ns2")); assertEquals("n3", xpp.getNamespace("ns3")); // check that declared namespaces can be accessed for current end tag assertEquals(3, xpp.getDepth()); assertEquals(6, xpp.getNamespaceCount(2)); assertEquals(7, xpp.getNamespaceCount(3)); // chekc that namespace is accessible by direct addresssing assertEquals(null, xpp.getNamespacePrefix(0)); assertEquals("n", xpp.getNamespaceUri(0)); assertEquals("ns1", xpp.getNamespacePrefix(1)); assertEquals("n1", xpp.getNamespaceUri(1)); assertEquals("ns1", xpp.getNamespacePrefix(3)); assertEquals("x1", xpp.getNamespaceUri(3)); assertEquals("ns1", xpp.getNamespacePrefix(6)); assertEquals("y1", xpp.getNamespaceUri(6)); xpp.next(); checkParserStateNs(xpp, 2, XmlPullParser.END_TAG, "ns1", 6, "x1", "bar", null, false, -1); // check that namespace is undelcared assertEquals("x1", xpp.getNamespace("ns1")); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.END_TAG, null, 3, "n", "foo", null, false, -1); assertEquals("n1", xpp.getNamespace("ns1")); assertEquals("n2", xpp.getNamespace("ns2")); assertEquals(null, xpp.getNamespace("ns3")); xpp.next(); checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); assertEquals(null, xpp.getNamespace("ns1")); assertEquals(null, xpp.getNamespace("ns2")); assertEquals(null, xpp.getNamespace("ns3")); } public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestSimpleWithNs.class)); } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestToken.java100644 0 0 44551 10525225064 23312 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; import junit.framework.TestSuite; import java.io.StringReader; import java.io.StringWriter; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserException; /** * Conformance test to verify nextToken() behavior. * * @author Aleksander Slominski */ public class TestToken extends UtilTestCase { private XmlPullParserFactory factory; public TestToken(String name) { super(name); } protected void setUp() throws XmlPullParserException { factory = factoryNewInstance(); factory.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); assertEquals(true, factory.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); assertEquals(false, factory.getFeature(XmlPullParser.FEATURE_VALIDATION)); } protected void tearDown() { factory = null; } public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestToken.class)); } private static final String FOO_XML = ""+ " "+ "]>"+ "bar"+ "&test;&test;< "+ "&>'" <"+ ""; private static final String MISC_XML = //"\n \r\n \n\r"+ //""+ //" \r\n "+ "\n \r\n \n\r"+ " \r\n"+ FOO_XML+ " \r\n"; public void testTokenEventEquivalency() throws Exception { XmlPullParser xpp = factory.newPullParser(); assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); xpp.setInput(new StringReader(MISC_XML)); boolean processDocdecl = xpp.getFeature(XmlPullParser.FEATURE_PROCESS_DOCDECL); // make sure entity "test" can be resolved even when parser is not parsing DOCDECL if(!processDocdecl) { xpp.defineEntityReplacementText("test", "This is test! Do NOT Panic!"); } checkParserStateNs(xpp, 0, XmlPullParser.START_DOCUMENT, null, 0, null, null, null, false, -1); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "foo", null, false, 1); checkAttribNs(xpp, 0, null, "", "attrName", "attrVal"); xpp.next(); checkParserStateNs(xpp, 1, XmlPullParser.TEXT, null, 0, null, null, "barThis is test! Do NOT Panic!This is test! Do NOT Panic!< &>'\" < vo"+ " ]"; String gotDocdecl = xpp.getText(); if(roundtripSupported && gotDocdecl == null) { fail("when roundtrip is enabled DOCDECL content must be reported"); } if(gotDocdecl != null) { assertEquals("DOCDECL content", expectedDocdecl, gotDocdecl); } try { xpp.isWhitespace(); fail("whitespace function must fail for DOCDECL"); } catch(XmlPullParserException ex) { } // now parse elements xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.START_TAG, null, 0, "", "foo", null, false, 1); if(roundtripSupported) { assertEquals("start tag roundtrip", "", xpp.getText()); } checkAttribNs(xpp, 0, null, "", "attrName", "attrVal"); try { xpp.isWhitespace(); fail("whitespace function must fail for START_DOCUMENT"); } catch(XmlPullParserException ex) { } { String text = nextTokenGathered(xpp, XmlPullParser.TEXT, false); assertEquals(printable("bar"), printable(text)); } //xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.COMMENT, null, 0, null, null, false, -1); try { xpp.isWhitespace(); fail("whitespace function must fail for COMMENT"); } catch(XmlPullParserException ex) { } { String text = xpp.getText(); if(roundtripSupported) { assertEquals(printable("comment\r\ntest"), printable(text)); } else { assertEquals(printable("comment\ntest"), printable(text)); } } boolean processDocdecl = xpp.getFeature(XmlPullParser.FEATURE_PROCESS_DOCDECL); // uresolved entity must be reurned as null by nextToken() xpp.nextToken(); if(!processDocdecl) { checkParserStateNs(xpp, 1, XmlPullParser.ENTITY_REF, null, 0, null, "test", null, false, -1); } else { checkParserStateNs(xpp, 1, XmlPullParser.ENTITY_REF, null, 0, null, "test", "This is test! Do NOT Panic!", false, -1); } // now we check if we can resolve entity if(!processDocdecl) { xpp.defineEntityReplacementText("test", "This is test! Do NOT Panic!"); } xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.ENTITY_REF, null, 0, null, "test", "This is test! Do NOT Panic!", false, -1); try { xpp.isWhitespace(); fail("whitespace function must fail for ENTITY_RED"); } catch(XmlPullParserException ex) { } // check standard entities and char refs xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.ENTITY_REF, null, 0, null, "lt", "<", false, -1); try { xpp.isWhitespace(); fail("whitespace function must fail for ENTITY_REF"); } catch(XmlPullParserException ex) { } xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.ENTITY_REF, null, 0, null, "#32", " ", false, -1); try { xpp.isWhitespace(); fail("whitespace function must fail for ENTITY_REF"); } catch(XmlPullParserException ex) { } xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.ENTITY_REF, null, 0, null, "amp", "&", false, -1); xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.ENTITY_REF, null, 0, null, "gt", ">", false, -1); xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.ENTITY_REF, null, 0, null, "apos", "'", false, -1); xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.ENTITY_REF, null, 0, null, "quot", "\"", false, -1); xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.ENTITY_REF, null, 0, null, "#x20", " ", false, -1); xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.ENTITY_REF, null, 0, null, "#x3C", "<", false, -1); xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.PROCESSING_INSTRUCTION, null, 0, null, null, false, -1); try { xpp.isWhitespace(); fail("whitespace function must fail for START_DOCUMENT"); } catch(XmlPullParserException ex) { } { String text = xpp.getText(); if(roundtripSupported) { assertEquals(printable("pi ds\r\nda"), printable(text)); } else { assertEquals(printable("pi ds\nda"), printable(text)); } } xpp.nextToken(); checkParserStateNs(xpp, 1, XmlPullParser.CDSECT, null, 0, null, null, " vo", xpp.getText()); } try { xpp.isWhitespace(); fail("whitespace function must fail for END_TAG"); } catch(XmlPullParserException ex) { } xpp.nextToken(); if(checkPrologAndEpilog) { //if(unnormalizedSupported) { if(xpp.getEventType() == XmlPullParser.IGNORABLE_WHITESPACE) { // xpp.nextToken(); // checkParserStateNs(xpp, 0, xpp.IGNORABLE_WHITESPACE, null, 0, null, null, // " \r\n", false, -1); // assertTrue(xpp.isWhitespace()); //String text = nextTokenGathered(xpp, xpp.IGNORABLE_WHITESPACE, true); String text = gatherTokenText(xpp, XmlPullParser.IGNORABLE_WHITESPACE, true); if(roundtripSupported) { assertEquals(printable(" \r\n"), printable(text)); } else { assertEquals(printable(" \n"), printable(text)); } } } checkParserStateNs(xpp, 0, XmlPullParser.END_DOCUMENT, null, 0, null, null, null, false, -1); try { xpp.isWhitespace(); fail("whitespace function must fail for END_DOCUMENT"); } catch(XmlPullParserException ex) { } } // one step further - it has content ... public void testXmlRoundtrip() throws Exception { XmlPullParser xpp = factory.newPullParser(); assertEquals(true, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); // reset parser xpp.setInput(null); // attempt to set roundtrip try { xpp.setFeature(FEATURE_XML_ROUNDTRIP, true); } catch(Exception ex) { } // did we succeeded? boolean roundtripSupported = xpp.getFeature(FEATURE_XML_ROUNDTRIP); if(!roundtripSupported) { return; } PackageTests.addNote("* optional feature "+FEATURE_XML_ROUNDTRIP+" is supported\n"); StringWriter sw = new StringWriter(); String s; //StringWriter st = new StringWriter(); xpp.setInput(new StringReader(MISC_XML)); int[] holderForStartAndLength = new int[2]; char[] buf; while(xpp.nextToken() != XmlPullParser.END_DOCUMENT) { switch(xpp.getEventType()) { case XmlPullParser.START_TAG: buf = xpp.getTextCharacters(holderForStartAndLength); s = new String(buf, holderForStartAndLength[0], holderForStartAndLength[1]); assertEquals("roundtrip START_TAG", xpp.getText(), s); sw.write(s); break; case XmlPullParser.END_TAG: buf = xpp.getTextCharacters(holderForStartAndLength); s = new String(buf, holderForStartAndLength[0], holderForStartAndLength[1]); assertEquals("roundtrip END_TAG", xpp.getText(), s); sw.write(s); break; case XmlPullParser.TEXT: buf = xpp.getTextCharacters(holderForStartAndLength); s = new String(buf, holderForStartAndLength[0], holderForStartAndLength[1]); assertEquals("roundtrip TEXT", xpp.getText(), s); sw.write(s); break; case XmlPullParser.IGNORABLE_WHITESPACE: buf = xpp.getTextCharacters(holderForStartAndLength); s = new String(buf, holderForStartAndLength[0], holderForStartAndLength[1]); assertEquals("roundtrip IGNORABLE_WHITESPACE", xpp.getText(), s); sw.write(s); break; case XmlPullParser.CDSECT: sw.write(""); break; case XmlPullParser.PROCESSING_INSTRUCTION: sw.write(""); break; case XmlPullParser.COMMENT: sw.write(""); break; case XmlPullParser.ENTITY_REF: sw.write("&"); buf = xpp.getTextCharacters(holderForStartAndLength); s = new String(buf, holderForStartAndLength[0], holderForStartAndLength[1]); assertEquals("roundtrip ENTITY_REF", xpp.getName(), s); sw.write(s); sw.write(";"); break; case XmlPullParser.DOCDECL: sw.write(""); break; default: throw new RuntimeException("unknown token type"); } } sw.close(); String RESULT_XML_BUF = sw.toString(); assertEquals("rountrip XML", printable(MISC_XML), printable(RESULT_XML_BUF)); } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestXmlCdsect.java100644 0 0 2130 10525225064 24063 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; import java.io.IOException; import junit.framework.TestSuite; import org.xmlpull.v1.XmlPullParserException; public class TestXmlCdsect extends XmlTestCase { public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestXmlCdsect.class)); } public TestXmlCdsect(String name) { super(name); } public void testCdsect() throws IOException, XmlPullParserException { testXml("cdsect.xml"); } public void testCdsectEol() throws IOException, XmlPullParserException { testXml("cdsect_eol.xml"); } public void testCdsectMixed() throws IOException, XmlPullParserException { testXml("cdsect_mixed.xml"); } public void testCdsectMore() throws IOException, XmlPullParserException { testXml("cdsect_more.xml"); } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestXmlSimple.java100644 0 0 1450 10525225064 24113 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; import java.io.*; import junit.framework.TestSuite; import org.xmlpull.v1.*; public class TestXmlSimple extends XmlTestCase { public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestXmlSimple.class)); } public TestXmlSimple(String name) { super(name); } public void testSimple() throws IOException, XmlPullParserException { testXml("simple.xml"); } public void testSimple2() throws IOException, XmlPullParserException { testXml("simple2.xml"); } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/TestXmlTypical.java100644 0 0 1260 10525225064 24266 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; import java.io.*; import junit.framework.TestSuite; import org.xmlpull.v1.XmlPullParserException; public class TestXmlTypical extends XmlTestCase { public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(TestXmlTypical.class)); } public TestXmlTypical(String name) { super(name); } public void testTypical() throws IOException, XmlPullParserException { testXml("typical.xml"); } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/UtilTestCase.java100644 0 0 31465 10525225064 23743 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) package org.xmlpull.v1.tests; import java.io.IOException; import junit.framework.TestCase; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserException; /** * Some common utilities to help with XMLPULL tests. * * @author Aleksander Slominski */ public class UtilTestCase extends TestCase { protected static final String FEATURE_XML_ROUNDTRIP= "http://xmlpull.org/v1/doc/features.html#xml-roundtrip"; protected final static String PROPERTY_XMLDECL_VERSION = "http://xmlpull.org/v1/doc/properties.html#xmldecl-version"; protected final static String PROPERTY_XMLDECL_STANDALONE = "http://xmlpull.org/v1/doc/properties.html#xmldecl-standalone"; protected final static String PROPERTY_XMLDECL_CONTENT = "http://xmlpull.org/v1/doc/properties.html#xmldecl-content"; protected final static String TEST_XML = "\n"+ "bar\r\n"+ " \n\r \n"+ " This is in a new namespace"+ "\t\n"+ ""+ "\n"+ "\n"+ "\n"; //private static XmlPullParserFactory factory; private static boolean printedFactoryName; public UtilTestCase(String name) { super(name); } public static XmlPullParserFactory factoryNewInstance() throws XmlPullParserException { String property = System.getProperty(XmlPullParserFactory.PROPERTY_NAME); //property = "org.xmlpull.mxp1.MXParserFactory"; //"org.xmlpull.v1.xni2xmlpull1.X2ParserFactory", //property = "org.xmlpull.mxp1.MXParser,org.xmlpull.mxp1_serializer.MXSerializer"; XmlPullParserFactory factory = XmlPullParserFactory.newInstance( property, null //Thread.currentThread().getContextClassLoader().getClass(), //NOT ON JDK 1.1 ); //System.out.println("factory="+factory+" property="+property); if(PackageTests.runnigAllTests() == false && printedFactoryName == false) { System.out.println("factory="+factory+" property="+property); printedFactoryName = true; } return factory; } /** * * Mpve to next token and gather getText() for successive tokens of the same type. * Parser will be positioned on next token of different type. */ public String nextTokenGathered(XmlPullParser xpp, int type, boolean expectedWhitespaces) throws XmlPullParserException, IOException { xpp.nextToken(); return gatherTokenText(xpp, type, expectedWhitespaces); } /** * Gathers getText() for successive tokens of the same type. * Parser will be positioned on next token of different type. */ public String gatherTokenText(XmlPullParser xpp, int type, boolean expectedWhitespaces) throws XmlPullParserException, IOException { StringBuffer buf = new StringBuffer(); assertEquals(XmlPullParser.TYPES[ type ], XmlPullParser.TYPES[ xpp.getEventType() ]); do { buf.append(xpp.getText()); if(expectedWhitespaces) { assertTrue(xpp.isWhitespace()); } } while(xpp.nextToken() == type); return buf.toString(); } public void checkParserState( XmlPullParser xpp, int depth, int type, String name, String text, boolean isEmpty, int attribCount ) throws XmlPullParserException, IOException { assertTrue("line number must be -1 or >= 1 not "+xpp.getLineNumber(), xpp.getLineNumber() == -1 || xpp.getLineNumber() >= 1); assertTrue("column number must be -1 or >= 0 not "+xpp.getColumnNumber(), xpp.getColumnNumber() == -1 || xpp.getColumnNumber() >= 0); assertEquals("PROCESS_NAMESPACES", false, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES)); assertEquals("TYPES[getType()]", XmlPullParser.TYPES[type], XmlPullParser.TYPES[xpp.getEventType()]); assertEquals("getType()", type, xpp.getEventType()); assertEquals("getDepth()", depth, xpp.getDepth()); assertEquals("getPrefix()", null, xpp.getPrefix()); assertEquals("getNamespacesCount(getDepth())", 0, xpp.getNamespaceCount(depth)); if(xpp.getEventType() == XmlPullParser.START_TAG || xpp.getEventType() == XmlPullParser.END_TAG) { assertEquals("getNamespace()", "", xpp.getNamespace()); } else { assertEquals("getNamespace()", null, xpp.getNamespace()); } assertEquals("getName()", name, xpp.getName()); if(xpp.getEventType() != XmlPullParser.START_TAG && xpp.getEventType() != XmlPullParser.END_TAG) { assertEquals("getText()", printable(text), printable(xpp.getText())); int [] holderForStartAndLength = new int[2]; char[] buf = xpp.getTextCharacters(holderForStartAndLength); if(buf != null) { String s = new String(buf, holderForStartAndLength[0], holderForStartAndLength[1]); assertEquals("getText(holder)", printable(text), printable(s)); } else { assertEquals("getTextCharacters()", null, text); } } if(type == XmlPullParser.START_TAG) { assertEquals("isEmptyElementTag()", isEmpty, xpp.isEmptyElementTag()); } else { try { xpp.isEmptyElementTag(); fail("isEmptyElementTag() must throw exception if parser not on START_TAG"); } catch(XmlPullParserException ex) { } } assertEquals("getAttributeCount()", attribCount, xpp.getAttributeCount()); } public void checkParserStateNs( XmlPullParser xpp, int depth, int type, int nsCount, String namespace, String name, boolean isEmpty, int attribCount ) throws XmlPullParserException, IOException { assertTrue("line number must be -1 or >= 1 not "+xpp.getLineNumber(), xpp.getLineNumber() == -1 || xpp.getLineNumber() >= 1); assertTrue("column number must be -1 or >= 0 not "+xpp.getColumnNumber(), xpp.getColumnNumber() == -1 || xpp.getColumnNumber() >= 0); // this methid can be used with enabled and not enabled namespaces //assertEquals("PROCESS_NAMESPACES", true, xpp.getFeature(xpp.FEATURE_PROCESS_NAMESPACES)); assertEquals("TYPES[getEventType()]", XmlPullParser.TYPES[type], XmlPullParser.TYPES[xpp.getEventType()]); assertEquals("getEventType()", type, xpp.getEventType()); assertEquals("getName()", name, xpp.getName()); assertEquals("getDepth()", depth, xpp.getDepth()); assertEquals("getNamespacesCount(getDepth())", nsCount, xpp.getNamespaceCount(depth)); assertEquals("getNamespace()", namespace, xpp.getNamespace()); if(type == XmlPullParser.START_TAG) { assertEquals("isEmptyElementTag()", isEmpty, xpp.isEmptyElementTag()); } else { try { xpp.isEmptyElementTag(); fail("isEmptyElementTag() must throw exception if parser not on START_TAG"); } catch(XmlPullParserException ex) { } } assertEquals("getAttributeCount()", attribCount, xpp.getAttributeCount()); } public void checkParserStateNs( XmlPullParser xpp, int depth, int type, String prefix, int nsCount, String namespace, String name, boolean isEmpty, int attribCount ) throws XmlPullParserException, IOException { checkParserStateNs(xpp, depth, type, nsCount, namespace, name, isEmpty, attribCount); assertEquals("getPrefix()", prefix, xpp.getPrefix()); } public void checkParserStateNs( XmlPullParser xpp, int depth, int type, String prefix, int nsCount, String namespace, String name, String text, boolean isEmpty, int attribCount ) throws XmlPullParserException, IOException { checkParserStateNs(xpp, depth, type, prefix, nsCount, namespace, name, isEmpty, attribCount); if(xpp.getEventType() != XmlPullParser.START_TAG && xpp.getEventType() != XmlPullParser.END_TAG) { assertEquals("getText()", printable(text), printable(xpp.getText())); int [] holderForStartAndLength = new int[2]; char[] buf = xpp.getTextCharacters(holderForStartAndLength); if(buf != null) { String s = new String(buf, holderForStartAndLength[0], holderForStartAndLength[1]); // ENTITY_REF is a special case when getText != (getTextCharacters == getName) if(xpp.getEventType() != XmlPullParser.ENTITY_REF) { assertEquals("getText(holder)", printable(text), printable(s)); } else { assertEquals("getText(holder) ENTITY_REF", printable(name), printable(s)); } } else { assertEquals("getTextCharacters()", null, text); } } } public void checkAttrib( XmlPullParser xpp, int pos, String name, String value ) throws XmlPullParserException, IOException { assertEquals("must be on START_TAG", XmlPullParser.START_TAG, xpp.getEventType()); assertEquals("getAttributePrefix()",null, xpp.getAttributePrefix(pos)); assertEquals("getAttributeNamespace()","", xpp.getAttributeNamespace(pos)); assertEquals("getAttributeName()",name, xpp.getAttributeName(pos)); assertEquals("getAttributeValue()",value, xpp.getAttributeValue(pos)); assertEquals("getAttributeValue(name)",value, xpp.getAttributeValue(null, name)); assertEquals("getAttributeType()","CDATA", xpp.getAttributeType(pos)); assertEquals("isAttributeDefault()",false, xpp.isAttributeDefault(pos)); } public void checkAttribNs( XmlPullParser xpp, int pos, String namespace, String name, String value ) throws XmlPullParserException, IOException { assertEquals("must be on START_TAG", XmlPullParser.START_TAG, xpp.getEventType()); assertEquals("getAttributeNamespace()",namespace, xpp.getAttributeNamespace(pos)); assertEquals("getAttributeName()",name, xpp.getAttributeName(pos)); assertEquals("getAttributeValue()",printable(value), printable(xpp.getAttributeValue(pos))); assertEquals("getAttributeValue(ns,name)", printable(value), printable(xpp.getAttributeValue(namespace, name))); assertEquals("getAttributeType()","CDATA", xpp.getAttributeType(pos)); assertEquals("isAttributeDefault()",false, xpp.isAttributeDefault(pos)); } public void checkAttribNs( XmlPullParser xpp, int pos, String prefix, String namespace, String name, String value ) throws XmlPullParserException, IOException { checkAttribNs(xpp, pos, namespace, name, value); assertEquals("getAttributePrefix()",prefix, xpp.getAttributePrefix(pos)); } public void checkNamespace( XmlPullParser xpp, int pos, String prefix, String uri, boolean checkMapping ) throws XmlPullParserException, IOException { assertEquals("getNamespacePrefix(pos)",prefix, xpp.getNamespacePrefix(pos)); assertEquals("getNamespaceUri(pos)",uri, xpp.getNamespaceUri(pos)); if(checkMapping) { assertEquals("getNamespace(prefix)", uri, xpp.getNamespace (prefix)); } } protected String printable(char ch) { if(ch == '\n') { return "\\n"; } else if(ch == '\r') { return "\\r"; } else if(ch == '\t') { return "\\t"; } if(ch > 127 || ch < 32) { StringBuffer buf = new StringBuffer("\\u"); String hex = Integer.toHexString((int)ch); for (int i = 0; i < 4-hex.length(); i++) { buf.append('0'); } buf.append(hex); return buf.toString(); } return ""+ch; } protected String printable(String s) { if(s == null) return null; StringBuffer buf = new StringBuffer(); for(int i = 0; i < s.length(); ++i) { buf.append(printable(s.charAt(i))); } s = buf.toString(); return s; } } xpp3-1.1.4c/src/java/tests/org/xmlpull/v1/tests/XmlTestCase.java100644 0 0 22603 10525225064 23560 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license see accompanying LICENSE_TESTS.txt file (available also at http://www.xmlpull.org) /* SYNTAX: (// marks unimplemented) inlined xml? // name of file? name of feature* // * // * // * // * // |*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package org.xmlpull.v1.util; import java.io.IOException; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlSerializer; /** * Handy functions that combines XmlPull API into higher level functionality. * * @author Aleksander Slominski * @author Naresh Bhatia */ public class XmlPullUtil { public static final String XSI_NS = "http://www.w3.org/2001/XMLSchema-instance"; private XmlPullUtil() {} /** * Return value of attribute with given name and no namespace. */ public static String getAttributeValue(XmlPullParser pp, String name) { return pp.getAttributeValue(XmlPullParser.NO_NAMESPACE, name); } /** * Return PITarget from Processing Instruction (PI) as defined in * XML 1.0 Section 2.6 Processing Instructions * [16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>' */ public static String getPITarget(XmlPullParser pp) throws IllegalStateException { int eventType; try { eventType = pp.getEventType(); } catch(XmlPullParserException ex) { // should never happen ... throw new IllegalStateException( "could not determine parser state: "+ex+pp.getPositionDescription()); } if( eventType != XmlPullParser.PROCESSING_INSTRUCTION ) { throw new IllegalStateException( "parser must be on processing instruction and not " +XmlPullParser.TYPES[ eventType ]+pp.getPositionDescription()); } final String PI = pp.getText(); for (int i = 0; i < PI.length(); i++) { if( isS(PI.charAt(i)) ) { // assert i > 0 return PI.substring(0,i); } } return PI; } /** * Return everything past PITarget and S from Processing Instruction (PI) as defined in * XML 1.0 Section 2.6 Processing Instructions * [16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>' * *

      NOTE: if there is no PI data it returns empty string. */ public static String getPIData(XmlPullParser pp) throws IllegalStateException { int eventType; try { eventType = pp.getEventType(); } catch(XmlPullParserException ex) { // should never happen ... throw new IllegalStateException( "could not determine parser state: "+ex+pp.getPositionDescription()); } if( eventType != XmlPullParser.PROCESSING_INSTRUCTION ) { throw new IllegalStateException( "parser must be on processing instruction and not " +XmlPullParser.TYPES[ eventType ]+pp.getPositionDescription()); } final String PI = pp.getText(); int pos = -1; for (int i = 0; i < PI.length(); i++) { if( isS(PI.charAt(i)) ) { pos = i; } else if(pos > 0) { return PI.substring(i); } } return ""; } /** * Return true if chacters is S as defined in XML 1.0 * S ::= (#x20 | #x9 | #xD | #xA)+ */ private static boolean isS(char ch) { return (ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t'); } /** * Skip sub tree that is currently porser positioned on. *
      NOTE: parser must be on START_TAG and when funtion returns * parser will be positioned on corresponding END_TAG */ public static void skipSubTree(XmlPullParser pp) throws XmlPullParserException, IOException { pp.require(XmlPullParser.START_TAG, null, null); int level = 1; while(level > 0) { int eventType = pp.next(); if(eventType == XmlPullParser.END_TAG) { --level; } else if(eventType == XmlPullParser.START_TAG) { ++level; } } } /** * call parser nextTag() and check that it is START_TAG, throw exception if not. */ public static void nextStartTag(XmlPullParser pp) throws XmlPullParserException, IOException { if(pp.nextTag() != XmlPullParser.START_TAG) { throw new XmlPullParserException( "expected START_TAG and not "+pp.getPositionDescription()); } } /** * combine nextTag(); pp.require(XmlPullParser.START_TAG, null, name); */ public static void nextStartTag(XmlPullParser pp, String name) throws XmlPullParserException, IOException { pp.nextTag(); pp.require(XmlPullParser.START_TAG, null, name); } /** * combine nextTag(); pp.require(XmlPullParser.START_TAG, namespace, name); */ public static void nextStartTag(XmlPullParser pp, String namespace, String name) throws XmlPullParserException, IOException { pp.nextTag(); pp.require(XmlPullParser.START_TAG, namespace, name); } /** * combine nextTag(); pp.require(XmlPullParser.END_TAG, namespace, name); */ public static void nextEndTag(XmlPullParser pp, String namespace, String name) throws XmlPullParserException, IOException { pp.nextTag(); pp.require(XmlPullParser.END_TAG, namespace, name); } /** * Read text content of element ith given namespace and name * (use null namespace do indicate that nemspace should not be checked) */ public static String nextText(XmlPullParser pp, String namespace, String name) throws IOException, XmlPullParserException { if(name == null) { throw new XmlPullParserException("name for element can not be null"); } pp.require(XmlPullParser.START_TAG, namespace, name); return pp.nextText(); } /** * Read attribute value and return it or throw exception if * current element does not have such attribute. */ public static String getRequiredAttributeValue(XmlPullParser pp, String namespace, String name) throws IOException, XmlPullParserException { String value = pp.getAttributeValue(namespace, name); if (value == null) { throw new XmlPullParserException("required attribute "+name+" is not present"); } else { return value; } } /** * Call parser nextTag() and check that it is END_TAG, throw exception if not. */ public static void nextEndTag(XmlPullParser pp) throws XmlPullParserException, IOException { if(pp.nextTag() != XmlPullParser.END_TAG) { throw new XmlPullParserException( "expected END_TAG and not"+pp.getPositionDescription()); } } /** * Tests if the current event is of the given type and if the namespace and name match. * null will match any namespace and any name. If the test passes a true is returned * otherwise a false is returned. */ public static boolean matches(XmlPullParser pp, int type, String namespace, String name) throws XmlPullParserException { boolean matches = type == pp.getEventType() && (namespace == null || namespace.equals (pp.getNamespace())) && (name == null || name.equals (pp.getName ())); return matches; } /** * Writes a simple element such as johndoe. The namespace * and elementText are allowed to be null. If elementText is null, an xsi:nil="true" * will be added as an attribute. */ public static void writeSimpleElement(XmlSerializer serializer, String namespace, String elementName, String elementText) throws IOException, XmlPullParserException { if (elementName == null) { throw new XmlPullParserException("name for element can not be null"); } serializer.startTag(namespace, elementName); if (elementText == null) { serializer.attribute(XSI_NS, "nil", "true"); } else { serializer.text(elementText); } serializer.endTag(namespace, elementName); } } xpp3-1.1.4c/src/java/wrapper/org/xmlpull/v1/wrapper/XmlPullParserWrapper.java100644 0 0 16601 10525225063 26333 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package org.xmlpull.v1.wrapper; import java.io.IOException; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; /** * Extensions to XmlPullParser interface * * @author Aleksander Slominski * @author Naresh Bhatia */ public interface XmlPullParserWrapper extends XmlPullParser { public static final String XSI_NS = "http://www.w3.org/2001/XMLSchema-instance"; public static final String XSD_NS = "http://www.w3.org/2001/XMLSchema"; /** * Return value of attribute with given name and no namespace. */ public String getAttributeValue(String name); /** * Return PITarget from Processing Instruction (PI) as defined in * XML 1.0 Section 2.6 Processing Instructions * [16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>' */ public String getPITarget() throws IllegalStateException; /** * Return everything past PITarget and S from Processing Instruction (PI) as defined in * XML 1.0 Section 2.6 Processing Instructions * [16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>' * *

      NOTE: if there is no PI data it returns empty string. */ public String getPIData() throws IllegalStateException; /** * Read attribute value and return it or throw exception if * current element does not have such attribute. */ public String getRequiredAttributeValue(String name) throws IOException, XmlPullParserException; /** * Read attribute value and return it or throw exception if * current element does not have such attribute. */ public String getRequiredAttributeValue(String namespace, String name) throws IOException, XmlPullParserException; /** * Read the text of a required element and return it or throw exception if * required element is not found. Useful for getting the text of simple * elements such as johndoe. Assumes that parser is * just before the start tag and leaves the parser at the end tag. If the * text is nil (e.g. ), then a null will be returned. */ public String getRequiredElementText(String namespace, String name) throws IOException, XmlPullParserException; /** * Is the current tag nil? Checks for xsi:nil="true". */ public boolean isNil() throws IOException, XmlPullParserException; /** * Tests if the current event is of the given type and if the namespace and name match. * null will match any namespace and any name. If the test passes a true is returned * otherwise a false is returned. */ public boolean matches(int type, String namespace, String name) throws XmlPullParserException; /** * call parser nextTag() and check that it is START_TAG, throw exception if not. */ public void nextStartTag() throws XmlPullParserException, IOException; /** * combine nextTag(); pp.require(XmlPullParser.START_TAG, null, name); */ public void nextStartTag(String name) throws XmlPullParserException, IOException; /** * combine nextTag(); pp.require(XmlPullParser.START_TAG, namespace, name); */ public void nextStartTag(String namespace, String name) throws XmlPullParserException, IOException; /** * Call parser nextTag() and check that it is END_TAG, throw exception if not. */ public void nextEndTag() throws XmlPullParserException, IOException; /** * combine nextTag(); pp.require(XmlPullParser.END_TAG, null, name); */ public void nextEndTag(String name) throws XmlPullParserException, IOException; /** * combine nextTag(); pp.require(XmlPullParser.END_TAG, namespace, name); */ public void nextEndTag(String namespace, String name) throws XmlPullParserException, IOException; /** * Read text content of element ith given namespace and name * (use null namespace do indicate that nemspace should not be checked) */ public String nextText(String namespace, String name) throws IOException, XmlPullParserException; /** * Skip sub tree that is currently porser positioned on. *
      NOTE: parser must be on START_TAG and when funtion returns * parser will be positioned on matching END_TAG * * This is typically optimized internally by parser but the logic should follow this: * * pp.require(XmlPullParser.START_TAG, null, null); * int level = 1; * while(level > 0) { * int eventType = pp.next(); * if(eventType == XmlPullParser.END_TAG) { * --level; * } else if(eventType == XmlPullParser.START_TAG) { * ++level; * } * } * */ public void skipSubTree() throws XmlPullParserException, IOException; // set of methods to read XSD types // /** // * Read string content of elment and try to convert it to double. // * Take special care of INF, Infinity and NaN. // * After this method executed the parser is positioned on END_TAG. // */ // public double readDouble() throws XmlPullParserException, IOException; // // /** // * Read string content of elment and convert it to float. // * Take special care of INF, Infinity and NaN. // * After this method executed the parser is positioned on END_TAG. // */ // public float readFloat() throws XmlPullParserException, IOException; // // /** // * Read string content of elment and try to convert it to int. // * Take special care of INF, Infinity and NaN. // * After this method executed the parser is positioned on END_TAG. // */ // public int readInt() throws XmlPullParserException, IOException; // // /** // * Check for xsi:nil and if it has value 'true' returns null // * as described in // * XML Schemas // * Part 1 // * otherwise it calls nextText(). // * After this method executed the parser is positioned on END_TAG. // */ // public String readString() throws XmlPullParserException, IOException; // // /** // * Check that parser is on START_TAG with given namespace and name // * and then call readDouble(). // */ // public double readDoubleElement(String namespace, String name) // throws XmlPullParserException, IOException; // // /** // * Check that parser is on START_TAG with given namespace and name // * and then call readFloat(). // */ // public float readFloatElement(String namespace, String name) // throws XmlPullParserException, IOException; // // /** // * Check that parser is on START_TAG with given namespace and name // * and then call readInt(). // */ // public int readIntElement(String namespace, String name) // throws XmlPullParserException, IOException; // // /** // * Check that parser is on START_TAG with given namespace and name // * and then call readString(). // */ // public String readStringElemet(String namespace, String name) // throws XmlPullParserException, IOException; // } xpp3-1.1.4c/src/java/wrapper/org/xmlpull/v1/wrapper/XmlPullWrapperFactory.java100644 0 0 7146 10525225063 26472 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package org.xmlpull.v1.wrapper; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlSerializer; import org.xmlpull.v1.wrapper.classic.StaticXmlPullParserWrapper; import org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper; /** * Handy functions that combines XmlPull API into higher level functionality. *

      NOTE: returned wrapper object is not multi-thread safe * * @author Aleksander Slominski */ public class XmlPullWrapperFactory { private final static boolean DEBUG = false; //protected ClassLoader classLoader; protected XmlPullParserFactory f; //protected boolean useDynamic; public static XmlPullWrapperFactory newInstance() throws XmlPullParserException { //TODO: make into real pluggable factory service (later ...)? return new XmlPullWrapperFactory(null); } public static XmlPullWrapperFactory newInstance(XmlPullParserFactory factory) throws XmlPullParserException { return new XmlPullWrapperFactory(factory); } public static XmlPullWrapperFactory newInstance (String classNames, Class context) throws XmlPullParserException { XmlPullParserFactory factory = XmlPullParserFactory.newInstance(classNames, context); return new XmlPullWrapperFactory(factory); } // ------------ IMPLEMENTATION protected XmlPullWrapperFactory(XmlPullParserFactory factory) throws XmlPullParserException { if(factory != null) { this.f = factory; } else { this.f = XmlPullParserFactory.newInstance(); } } public XmlPullParserFactory getFactory() throws XmlPullParserException { return f; } public void setFeature(String name, boolean state) throws XmlPullParserException { f.setFeature(name, state); } public boolean getFeature (String name) { return f.getFeature(name); } public void setNamespaceAware(boolean awareness) { f.setNamespaceAware(awareness); } public boolean isNamespaceAware() { return f.isNamespaceAware(); } public void setValidating(boolean validating) { f.setValidating(validating); } public boolean isValidating() { return f.isValidating(); } //public void setUseDynamic(boolean enable) { useDynamic = enable; }; //public boolean getUseDynamic() { return useDynamic; }; public XmlPullParserWrapper newPullParserWrapper() throws XmlPullParserException { XmlPullParser pp = f.newPullParser(); // if(useDynamic) { // return (XmlPullParserWrapper) DynamicXmlPullParserWrapper.newProxy(pp, classLoader); // } else { return new StaticXmlPullParserWrapper(pp); } public XmlPullParserWrapper newPullParserWrapper(XmlPullParser pp) throws XmlPullParserException { return new StaticXmlPullParserWrapper(pp); } public XmlSerializerWrapper newSerializerWrapper() throws XmlPullParserException { XmlSerializer xs = f.newSerializer(); return new StaticXmlSerializerWrapper(xs, this); } public XmlSerializerWrapper newSerializerWrapper(XmlSerializer xs) throws XmlPullParserException { return new StaticXmlSerializerWrapper(xs, this); } } xpp3-1.1.4c/src/java/wrapper/org/xmlpull/v1/wrapper/XmlSerializerWrapper.java100644 0 0 11201 10525225063 26342 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package org.xmlpull.v1.wrapper; import java.io.IOException; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlSerializer; /** * Extensions to XmlSerialzier interface * * @author Aleksander Slominski * @author Naresh Bhatia */ public interface XmlSerializerWrapper extends XmlSerializer { public static final String NO_NAMESPACE = XmlPullParserWrapper.NO_NAMESPACE; public static final String XSI_NS = XmlPullParserWrapper.XSI_NS; public static final String XSD_NS = XmlPullParserWrapper.XSD_NS; /** * Get namespace that is used as default when no namespace parameter is used for * startTag(), endTag() and element() */ public String getCurrentNamespaceForElements(); /** * Set namespace to use in startTag(), endTag() and element() * when methods called are those without namespace parameter. */ public String setCurrentNamespaceForElements(String value); /** * Write an attribute without namespace. * Calls to attribute() MUST follow a call to * startTag() immediately. If there is no prefix defined for the * given namespace, a prefix will be defined automatically. * NOTE: current element namespace is not used attribute and attributre has no namespace. */ public XmlSerializerWrapper attribute (String name, String value) throws IOException, IllegalArgumentException, IllegalStateException; /** Write start tag in current namespace with name given as argument. */ public XmlSerializerWrapper startTag(String name) throws IOException, IllegalArgumentException, IllegalStateException; /** Write end tag in current namespace with name given as argument. */ public XmlSerializerWrapper endTag(String name) throws IOException, IllegalArgumentException, IllegalStateException; /** * Writes a simple element such as <username>johndoe</username>. The namespace * and elementText are allowed to be null. If elementText is null, an xsi:nil="true" * will be added as an attribute. */ public XmlSerializerWrapper element(String namespace, String elementName, String elementText) throws IOException, XmlPullParserException; /** Write simple text element in current namespace */ public XmlSerializerWrapper element(String elementName, String elementText) throws IOException, XmlPullParserException; /** Write XML fragment using currently set namespace prefixes */ public void fragment(String xmlFragment) throws IOException, IllegalArgumentException, IllegalStateException, XmlPullParserException; /** Serializer current event form pull parser */ public void event(XmlPullParser pp) throws IOException, IllegalArgumentException, IllegalStateException, XmlPullParserException; public String escapeText(String text) throws IllegalArgumentException; public String escapeAttributeValue(String text) throws IllegalArgumentException; // set of methods to make easy to write XSD types // /** // * Write as text value of argument (just calls text!). // */ // public void writeDouble(double d) // throws XmlPullParserException, IOException, IllegalArgumentException; // public void writeFloat(float f) // throws XmlPullParserException, IOException, IllegalArgumentException; // public void writeInt(int i) // throws XmlPullParserException, IOException, IllegalArgumentException; // public void writeString(String s) // throws XmlPullParserException, IOException, IllegalArgumentException; // // /** // * Write as element with namesoace and name and value inside // * (looks like <ns:name>value</ns:name> where ns is prefix // * for namespace autoatically declared if needed). // */ // public void writeDoubleElement(String namespace, String name, double d) // throws XmlPullParserException, IOException, IllegalArgumentException; // public void writeFloatElement(String namespace, String name, float f) // throws XmlPullParserException, IOException, IllegalArgumentException; // public void writeIntElement(String namespace, String name, int i) // throws XmlPullParserException, IOException, IllegalArgumentException; // public void writeStringElement(String namespace, String name, String s) // throws XmlPullParserException, IOException, IllegalArgumentException; } xpp3-1.1.4c/src/java/wrapper/org/xmlpull/v1/wrapper/classic/StaticXmlPullParserWrapper.java100644 0 0 23340 10525225063 31122 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package org.xmlpull.v1.wrapper.classic; import java.io.IOException; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.wrapper.XmlPullParserWrapper; import org.xmlpull.v1.util.XmlPullUtil; /** * This class seemlesly extends exisiting parser implementation by adding new methods * (provided by XmlPullUtil) and delegating exisiting methods to parser implementation. * * @author Aleksander Slominski * @author Naresh Bhatia */ public class StaticXmlPullParserWrapper extends XmlPullParserDelegate implements XmlPullParserWrapper { public StaticXmlPullParserWrapper(XmlPullParser pp) { super(pp); } public String getAttributeValue(String name) { return XmlPullUtil.getAttributeValue(pp, name); } public String getRequiredAttributeValue(String name) throws IOException, XmlPullParserException { return XmlPullUtil.getRequiredAttributeValue(pp, null, name); } public String getRequiredAttributeValue(String namespace, String name) throws IOException, XmlPullParserException { return XmlPullUtil.getRequiredAttributeValue(pp, namespace, name); } /** * Read the text of a required element and return it or throw exception if * required element is not found. Useful for getting the text of simple * elements such as johndoe. Assumes that parser is * just before the start tag and leaves the parser at the end tag. If the * text is nil (e.g. ), then a null will be returned. */ public String getRequiredElementText(String namespace, String name) throws IOException, XmlPullParserException { if (name == null) { throw new XmlPullParserException("name for element can not be null"); } String text = null; nextStartTag(namespace, name); if (isNil()) { nextEndTag(namespace, name); } else { text = pp.nextText(); } pp.require(XmlPullParser.END_TAG, namespace, name); return text; } public boolean isNil() throws IOException, XmlPullParserException { boolean result = false; String value = pp.getAttributeValue(XSI_NS, "nil"); if ("true".equals(value)) { result = true; } return result; } public String getPITarget() throws IllegalStateException { return XmlPullUtil.getPITarget(pp); } public String getPIData() throws IllegalStateException { return XmlPullUtil.getPIData(pp); } public boolean matches(int type, String namespace, String name) throws XmlPullParserException { return XmlPullUtil.matches(pp, type, namespace, name); } public void nextStartTag() throws XmlPullParserException, IOException { if(pp.nextTag() != XmlPullParser.START_TAG) { throw new XmlPullParserException( "expected START_TAG and not "+pp.getPositionDescription()); } } public void nextStartTag(String name) throws XmlPullParserException, IOException { pp.nextTag(); pp.require(XmlPullParser.START_TAG, null, name); } public void nextStartTag(String namespace, String name) throws XmlPullParserException, IOException { pp.nextTag(); pp.require(XmlPullParser.START_TAG, namespace, name); } public void nextEndTag() throws XmlPullParserException, IOException { XmlPullUtil.nextEndTag(pp); } public void nextEndTag(String name) throws XmlPullParserException, IOException { XmlPullUtil.nextEndTag(pp, null, name); } public void nextEndTag(String namespace, String name) throws XmlPullParserException, IOException { XmlPullUtil.nextEndTag(pp, namespace, name); } public String nextText(String namespace, String name) throws IOException, XmlPullParserException { return XmlPullUtil.nextText(pp, namespace, name); } public void skipSubTree() throws XmlPullParserException, IOException { XmlPullUtil.skipSubTree(pp); } public double readDouble() throws XmlPullParserException, IOException { String value = pp.nextText(); double d; try { d = Double.parseDouble(value); } catch(NumberFormatException ex) { if(value.equals("INF") || value.toLowerCase().equals("infinity")) { d = Double.POSITIVE_INFINITY; } else if (value.equals("-INF") || value.toLowerCase().equals("-infinity")) { d = Double.NEGATIVE_INFINITY; } else if (value.equals("NaN")) { d = Double.NaN; } else { throw new XmlPullParserException("can't parse double value '"+value+"'", this, ex); } } return d; } public float readFloat() throws XmlPullParserException, IOException { String value = pp.nextText(); float f; try { f = Float.parseFloat(value); } catch(NumberFormatException ex) { if(value.equals("INF") || value.toLowerCase().equals("infinity")) { f = Float.POSITIVE_INFINITY; } else if (value.equals("-INF") || value.toLowerCase().equals("-infinity")) { f = Float.NEGATIVE_INFINITY; } else if (value.equals("NaN")) { f = Float.NaN; } else { throw new XmlPullParserException("can't parse float value '"+value+"'", this, ex); } } return f; } // method copied from JiBX see http://sourceforge.net/projects/jibx/ for details private int parseDigits(String text, int offset, int length) throws XmlPullParserException { // check if overflow a potential problem int value = 0; if (length > 9) { // use library parse code for potential overflow try { value = Integer.parseInt(text.substring(offset, offset+length)); } catch (NumberFormatException ex) { throw new XmlPullParserException(ex.getMessage()); } } else { // parse with no overflow worries int limit = offset + length; while (offset < limit) { char chr = text.charAt(offset++); if (chr >= '0' && chr <= '9') { value = value * 10 + (chr - '0'); } else { throw new XmlPullParserException("non-digit in number value",this, null); } } } return value; } // method copied from JiBX see http://sourceforge.net/projects/jibx/ for details private int parseInt(String text) throws XmlPullParserException { // make sure there's text to be processed int offset = 0; int limit = text.length(); if (limit == 0) { throw new XmlPullParserException("empty number value", this, null); } // check leading sign present in text boolean negate = false; char chr = text.charAt(0); if (chr == '-') { if (limit > 9) { // special case to make sure maximum negative value handled try { return Integer.parseInt(text); } catch (NumberFormatException ex) { throw new XmlPullParserException(ex.getMessage(), this, null); } } else { negate = true; offset++; } } else if (chr == '+') { offset++; } if (offset >= limit) { throw new XmlPullParserException("Invalid number format", this, null); } // handle actual value conversion int value = parseDigits(text, offset, limit-offset); if (negate) { return -value; } else { return value; } } public int readInt() throws XmlPullParserException, IOException { try { //int i = Integer.parseInt(pp.nextText()); int i = parseInt(pp.nextText()); return i; } catch(NumberFormatException ex) { throw new XmlPullParserException("can't parse int value", this, ex); } } public String readString() throws XmlPullParserException, IOException { String xsiNil = pp.getAttributeValue(XSD_NS, "nil"); if("true".equals(xsiNil)) { nextEndTag(); return null; } return pp.nextText(); } public double readDoubleElement(String namespace, String name) throws XmlPullParserException, IOException { pp.require(XmlPullParser.START_TAG, namespace, name); return readDouble(); } public float readFloatElement(String namespace, String name) throws XmlPullParserException, IOException { pp.require(XmlPullParser.START_TAG, namespace, name); return readFloat(); } public int readIntElement(String namespace, String name) throws XmlPullParserException, IOException { pp.require(XmlPullParser.START_TAG, namespace, name); return readInt(); } public String readStringElemet(String namespace, String name) throws XmlPullParserException, IOException { pp.require(XmlPullParser.START_TAG, namespace, name); return readString(); } } xpp3-1.1.4c/src/java/wrapper/org/xmlpull/v1/wrapper/classic/StaticXmlSerializerWrapper.java100644 0 0 34221 10525225063 31142 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package org.xmlpull.v1.wrapper.classic; import java.io.IOException; import java.io.StringReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlSerializer; import org.xmlpull.v1.wrapper.XmlPullParserWrapper; import org.xmlpull.v1.wrapper.XmlPullWrapperFactory; import org.xmlpull.v1.wrapper.XmlSerializerWrapper; /** * This class seemlesly extends exisiting serialzier implementation by adding new methods * (provided by XmlPullUtil) and delegating exisiting methods to parser implementation. * * @author Aleksander Slominski * @author Naresh Bhatia */ public class StaticXmlSerializerWrapper extends XmlSerializerDelegate implements XmlSerializerWrapper { private final static String PROPERTY_XMLDECL_STANDALONE = "http://xmlpull.org/v1/doc/features.html#xmldecl-standalone"; private static final boolean TRACE_SIZING = false; protected String currentNs; protected XmlPullWrapperFactory wf; protected XmlPullParserWrapper fragmentParser; public StaticXmlSerializerWrapper(XmlSerializer xs, XmlPullWrapperFactory wf) { super(xs); this.wf = wf; } public String getCurrentNamespaceForElements() { return currentNs; } public String setCurrentNamespaceForElements(String value) { String old = currentNs; currentNs = value; return old; } public XmlSerializerWrapper attribute (String name, String value) throws IOException, IllegalArgumentException, IllegalStateException { xs.attribute(null, name, value); return this; } public XmlSerializerWrapper startTag (String name) throws IOException, IllegalArgumentException, IllegalStateException { xs.startTag(currentNs, name); return this; } public XmlSerializerWrapper endTag(String name) throws IOException, IllegalArgumentException, IllegalStateException { endTag(currentNs, name); return this; } /** Write simple text element in current namespace */ public XmlSerializerWrapper element(String elementName, String elementText) throws IOException, XmlPullParserException { return element(currentNs, elementName, elementText); } public XmlSerializerWrapper element(String namespace, String elementName, String elementText) throws IOException, XmlPullParserException { if (elementName == null) { throw new XmlPullParserException("name for element can not be null"); } xs.startTag(namespace, elementName); if (elementText == null) { xs.attribute(XSI_NS, "nil", "true"); } else { xs.text(elementText); } xs.endTag(namespace, elementName); return this; } //namespace stack //protected int elNamespaceCount[] = new int[ 2 ]; //protected int currentDepth = -1; protected int namespaceEnd = 0; protected String namespacePrefix[] = new String[ 8 ]; protected String namespaceUri[] = new String[ namespacePrefix.length ]; protected int namespaceDepth[] = new int[ namespacePrefix.length ]; private void ensureNamespacesCapacity() { int newSize = namespaceEnd > 7 ? 2 * namespaceEnd : 8; if(TRACE_SIZING) { System.err.println( getClass().getName()+" namespaceSize "+namespacePrefix.length+" ==> "+newSize); } String[] newNamespacePrefix = new String[newSize]; String[] newNamespaceUri = new String[newSize]; int[] newNamespaceDepth = new int[newSize]; if(namespacePrefix != null) { System.arraycopy(namespacePrefix, 0, newNamespacePrefix, 0, namespaceEnd); System.arraycopy(namespaceUri, 0, newNamespaceUri, 0, namespaceEnd); System.arraycopy(namespaceDepth, 0, newNamespaceDepth, 0, namespaceEnd); } namespacePrefix = newNamespacePrefix; namespaceUri = newNamespaceUri; namespaceDepth = newNamespaceDepth; } // public XmlSerializer endTag(String namespace, String name) throws IOException // { // xs.endTag(currentNs, name); // namespaceEnd = elNamespaceCount[ getDepth() ]; // return this; // } public void setPrefix(String prefix, String namespace) throws IOException, IllegalArgumentException, IllegalStateException { xs.setPrefix(prefix, namespace); int depth = getDepth(); for(int pos = namespaceEnd - 1; pos >= 0; --pos) { if(namespaceDepth[ pos ] <= depth) { break; } --namespaceEnd; } if(namespaceEnd >= namespacePrefix.length) { ensureNamespacesCapacity(); } namespacePrefix[ namespaceEnd ] = prefix; namespaceUri[ namespaceEnd ] = namespace; ++namespaceEnd; } public void fragment(String xmlFragment) throws IOException, IllegalArgumentException, IllegalStateException, XmlPullParserException { StringBuffer buf = new StringBuffer(xmlFragment.length() + namespaceEnd * 30); buf.append("= 0; --pos) { String prefix = namespacePrefix[ pos ]; for(int i = namespaceEnd - 1; i > pos; --i) { if(prefix.equals( namespacePrefix[i] )) { continue LOOP; } } buf.append(" xmlns"); if(prefix.length() > 0) { buf.append(':').append(prefix); } buf.append("='"); buf.append(escapeAttributeValue(namespaceUri[ pos ])); buf.append("'"); } buf.append(">"); buf.append(xmlFragment); buf.append(""); if(fragmentParser == null) { fragmentParser = wf.newPullParserWrapper(); } String s = buf.toString(); //System.err.println(getClass().getName()+" fragment XML="+s); fragmentParser.setInput(new StringReader( s ) ); fragmentParser.nextTag(); fragmentParser.require(XmlPullParser.START_TAG, null, "fragment"); while(true) { fragmentParser.nextToken(); if(fragmentParser.getDepth() == 1 && fragmentParser.getEventType() == XmlPullParser.END_TAG) { break; } event(fragmentParser); } fragmentParser.require(XmlPullParser.END_TAG, null, "fragment"); } public void event(XmlPullParser pp) throws XmlPullParserException, IOException { int eventType = pp.getEventType(); switch (eventType) { case XmlPullParser.START_DOCUMENT: //use Boolean.TRUE to make it standalone Boolean standalone = (Boolean) pp.getProperty(PROPERTY_XMLDECL_STANDALONE); startDocument(pp.getInputEncoding(), standalone); break; case XmlPullParser.END_DOCUMENT: endDocument(); break; case XmlPullParser.START_TAG: writeStartTag(pp); break; case XmlPullParser.END_TAG: endTag(pp.getNamespace (), pp.getName ()); break; case XmlPullParser.IGNORABLE_WHITESPACE: //comment it to remove ignorable whtespaces from XML infoset String s = pp.getText (); ignorableWhitespace(s); break; case XmlPullParser.TEXT: if(pp.getDepth() > 0) { text(pp.getText ()); } else { ignorableWhitespace(pp.getText ()); } break; case XmlPullParser.ENTITY_REF: entityRef (pp.getName ()); break; case XmlPullParser.CDSECT: cdsect( pp.getText () ); break; case XmlPullParser.PROCESSING_INSTRUCTION: processingInstruction( pp.getText ()); break; case XmlPullParser.COMMENT: comment (pp.getText ()); break; case XmlPullParser.DOCDECL: docdecl (pp.getText ()); break; } } private void writeStartTag(XmlPullParser pp) throws XmlPullParserException, IOException { if (!pp.getFeature (XmlPullParser.FEATURE_REPORT_NAMESPACE_ATTRIBUTES)) { int nsStart = pp.getNamespaceCount(pp.getDepth()-1); int nsEnd = pp.getNamespaceCount(pp.getDepth()); for (int i = nsStart; i < nsEnd; i++) { String prefix = pp.getNamespacePrefix(i); String ns = pp.getNamespaceUri(i); setPrefix(prefix, ns); } } startTag(pp.getNamespace(), pp.getName()); for (int i = 0; i < pp.getAttributeCount(); i++) { attribute (pp.getAttributeNamespace (i), pp.getAttributeName (i), pp.getAttributeValue (i)); } //ser.closeStartTag(); } public String escapeAttributeValue(String value) //protected void writeAttributeValue(String value, Writer out) throws IOException { int posLt = value.indexOf('<'); int posAmp = value.indexOf('&'); int posQuot = value.indexOf('"'); int posApos = value.indexOf('\''); if(posLt == -1 && posAmp == -1 && posQuot == -1 && posApos == -1) { return value; } StringBuffer buf = new StringBuffer(value.length() + 10); // painful loop ... for(int pos = 0, len = value.length(); pos < len; ++pos) { char ch = value.charAt(pos); switch(ch) { case '<': buf.append("<"); break; case '&': buf.append("&"); break; case '\'': buf.append("'"); break; case '"': buf.append("""); break; default: buf.append(ch); } } return buf.toString(); } //protected void writeElementContent(String text, Writer out) throws IOException public String escapeText(String text) { //<, & esccaped] //out.write(text); int posLt = text.indexOf('<'); int posAmp = text.indexOf('&'); if(posLt == -1 && posAmp == -1) { // this is shortcut return text; } StringBuffer buf = new StringBuffer(text.length() + 10); // painful loop ... int pos = 0; while(true) { if(posLt == -1 && posAmp == -1) { // this is shortcut buf.append(text.substring(pos)); break; } else if(posLt == -1 || (posLt != -1 && posAmp != -1 && posAmp < posLt)) { if(pos < posAmp) buf.append(text.substring(pos, posAmp)); buf.append("&"); pos = posAmp + 1; posAmp = text.indexOf('&', pos); } else if(posAmp == -1 || (posLt != -1 && posAmp != -1 && posLt < posAmp)) { if(pos < posLt) buf.append(text.substring(pos, posLt)); buf.append("<"); pos = posLt + 1; posLt = text.indexOf('<', pos); } else { throw new IllegalStateException("wrong state posLt="+posLt +" posAmp="+posAmp+" for "+text); } } return buf.toString(); } public void writeDouble(double d) throws XmlPullParserException, IOException, IllegalArgumentException { if(d == Double.POSITIVE_INFINITY) { xs.text("INF"); } else if(d == Double.NEGATIVE_INFINITY) { xs.text("-INF"); } else { xs.text(Double.toString(d)); } } public void writeFloat(float f) throws XmlPullParserException, IOException, IllegalArgumentException { if(f == Float.POSITIVE_INFINITY) { xs.text("INF"); } else if(f == Float.NEGATIVE_INFINITY) { xs.text("-INF"); } else { xs.text(Float.toString(f)); } } public void writeInt(int i) throws XmlPullParserException, IOException, IllegalArgumentException { xs.text(Integer.toString(i)); } public void writeString(String s) throws XmlPullParserException, IOException, IllegalArgumentException { if( s == null ) { throw new IllegalArgumentException("null string can not be written"); } xs.text(s); } public void writeDoubleElement(String namespace, String name, double d) throws XmlPullParserException, IOException, IllegalArgumentException { xs.startTag(namespace, name); writeDouble(d); xs.endTag(namespace, name); } public void writeFloatElement(String namespace, String name, float f) throws XmlPullParserException, IOException, IllegalArgumentException { xs.startTag(namespace, name); writeFloat(f); xs.endTag(namespace, name); } public void writeIntElement(String namespace, String name, int i) throws XmlPullParserException, IOException, IllegalArgumentException { xs.startTag(namespace, name); writeInt(i); xs.endTag(namespace, name); } public void writeStringElement(String namespace, String name, String s) throws XmlPullParserException, IOException, IllegalArgumentException { xs.startTag(namespace, name); if(s == null) { xs.attribute(XSD_NS, "nil", "true"); } else { writeString(s); } xs.endTag(namespace, name); } } xpp3-1.1.4c/src/java/wrapper/org/xmlpull/v1/wrapper/classic/XmlPullParserDelegate.java100644 0 0 11554 10525225063 30050 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package org.xmlpull.v1.wrapper.classic; import java.io.IOException; import java.io.InputStream; import java.io.Reader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; /** * This is simple class that implements parser interface by delegating * all calls to actual wrapped class implementation that is passed in constructor. * Purpose of this class is to work as a base class when extending parser interface * by wrapping exsiting parser implementation and allowing to add new methods. * * @author Aleksander Slominski */ public class XmlPullParserDelegate implements XmlPullParser { protected XmlPullParser pp; public XmlPullParserDelegate(XmlPullParser pp) { this.pp = pp; } public String getText() { return pp.getText(); } public void setFeature(String name, boolean state) throws XmlPullParserException { pp.setFeature(name, state); } public char[] getTextCharacters(int[] holderForStartAndLength) { return pp.getTextCharacters(holderForStartAndLength); } public int getColumnNumber() { return pp.getColumnNumber(); } public int getNamespaceCount(int depth) throws XmlPullParserException { return pp.getNamespaceCount(depth); } public String getNamespacePrefix(int pos) throws XmlPullParserException { return pp.getNamespacePrefix(pos); } public String getAttributeName(int index) { return pp.getAttributeName(index); } public String getName() { return pp.getName(); } public boolean getFeature(String name) { return pp.getFeature(name); } public String getInputEncoding() { return pp.getInputEncoding(); } public String getAttributeValue(int index) { return pp.getAttributeValue(index); } public String getNamespace(String prefix) { return pp.getNamespace(prefix); } public void setInput(Reader in) throws XmlPullParserException { pp.setInput(in); } public int getLineNumber() { return pp.getLineNumber(); } public Object getProperty(String name) { return pp.getProperty(name); } public boolean isEmptyElementTag() throws XmlPullParserException { return pp.isEmptyElementTag(); } public boolean isAttributeDefault(int index) { return pp.isAttributeDefault(index); } public String getNamespaceUri(int pos) throws XmlPullParserException { return pp.getNamespaceUri(pos); } public int next() throws XmlPullParserException, IOException { return pp.next(); } public int nextToken() throws XmlPullParserException, IOException { return pp.nextToken(); } public void defineEntityReplacementText(String entityName, String replacementText) throws XmlPullParserException { pp.defineEntityReplacementText(entityName, replacementText); } public int getAttributeCount() { return pp.getAttributeCount(); } public boolean isWhitespace() throws XmlPullParserException { return pp.isWhitespace(); } public String getPrefix() { return pp.getPrefix(); } public void require(int type, String namespace, String name) throws XmlPullParserException, IOException { pp.require(type, namespace, name); } public String nextText() throws XmlPullParserException, IOException { return pp.nextText(); } public String getAttributeType(int index) { return pp.getAttributeType(index); } public int getDepth() { return pp.getDepth(); } public int nextTag() throws XmlPullParserException, IOException { return pp.nextTag(); } public int getEventType() throws XmlPullParserException { return pp.getEventType(); } public String getAttributePrefix(int index) { return pp.getAttributePrefix(index); } public void setInput(InputStream inputStream, String inputEncoding) throws XmlPullParserException { pp.setInput(inputStream, inputEncoding); } public String getAttributeValue(String namespace, String name) { return pp.getAttributeValue(namespace, name); } public void setProperty(String name, Object value) throws XmlPullParserException { pp.setProperty(name, value); } public String getPositionDescription() { return pp.getPositionDescription(); } public String getNamespace() { return pp.getNamespace(); } public String getAttributeNamespace(int index) { return pp.getAttributeNamespace(index); } } xpp3-1.1.4c/src/java/wrapper/org/xmlpull/v1/wrapper/classic/XmlSerializerDelegate.java100644 0 0 10700 10525225063 30060 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/) package org.xmlpull.v1.wrapper.classic; import org.xmlpull.v1.XmlSerializer; import java.io.IOException; import java.io.OutputStream; import java.io.Writer; /** * This is simple class that implements serializer interface by delegating * all calls to actual serialzier implementation passed in constructor. * Purpose of this class is to work as base class to allow extending interface * by wrapping exsiting parser implementation and allowing ot add new methods. * * @author Aleksander Slominski */ public class XmlSerializerDelegate implements XmlSerializer { protected XmlSerializer xs; public XmlSerializerDelegate(XmlSerializer serializer) { this.xs = serializer; } public String getName() { return xs.getName(); } public void setPrefix(String prefix, String namespace) throws IOException, IllegalArgumentException, IllegalStateException { xs.setPrefix(prefix, namespace); } public void setOutput(OutputStream os, String encoding) throws IOException, IllegalArgumentException, IllegalStateException { xs.setOutput(os, encoding); } public void endDocument() throws IOException, IllegalArgumentException, IllegalStateException { xs.endDocument(); } public void comment(String text) throws IOException, IllegalArgumentException, IllegalStateException { xs.comment(text); } public int getDepth() { return xs.getDepth(); } public void setProperty(String name, Object value) throws IllegalArgumentException, IllegalStateException { xs.setProperty(name, value); } public void cdsect(String text) throws IOException, IllegalArgumentException, IllegalStateException { xs.cdsect(text); } public void setFeature(String name, boolean state) throws IllegalArgumentException, IllegalStateException { xs.setFeature(name, state); } public void entityRef(String text) throws IOException, IllegalArgumentException, IllegalStateException { xs.entityRef(text); } public void processingInstruction(String text) throws IOException, IllegalArgumentException, IllegalStateException { xs.processingInstruction(text); } public void setOutput(Writer writer) throws IOException, IllegalArgumentException, IllegalStateException { xs.setOutput(writer); } public void docdecl(String text) throws IOException, IllegalArgumentException, IllegalStateException { xs.docdecl(text); } public void flush() throws IOException { xs.flush(); } public Object getProperty(String name) { return xs.getProperty(name); } public XmlSerializer startTag(String namespace, String name) throws IOException, IllegalArgumentException, IllegalStateException { return xs.startTag(namespace, name); } public void ignorableWhitespace(String text) throws IOException, IllegalArgumentException, IllegalStateException { xs.ignorableWhitespace(text); } public XmlSerializer text(String text) throws IOException, IllegalArgumentException, IllegalStateException { return xs.text(text); } public boolean getFeature(String name) { return xs.getFeature(name); } public XmlSerializer attribute(String namespace, String name, String value) throws IOException, IllegalArgumentException, IllegalStateException { return xs.attribute(namespace, name, value); } public void startDocument(String encoding, Boolean standalone) throws IOException, IllegalArgumentException, IllegalStateException { xs.startDocument(encoding, standalone); } public String getPrefix(String namespace, boolean generatePrefix) throws IllegalArgumentException { return xs.getPrefix(namespace, generatePrefix); } public String getNamespace() { return xs.getNamespace(); } public XmlSerializer endTag(String namespace, String name) throws IOException, IllegalArgumentException, IllegalStateException { return xs.endTag(namespace, name); } public XmlSerializer text(char[] buf, int start, int len) throws IOException, IllegalArgumentException, IllegalStateException { return xs.text(buf, start, len); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/Xb1XPath.java100644 0 0 7642 10525225063 24342 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ /* * Copyright (c) 2002-2004 Extreme! Lab, Indiana University. All rights reserved. * * This software is open source. See the bottom of this file for the licence. * * $Id: Xb1XPath.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ */ package org.xmlpull.v1.builder.xpath; import org.xmlpull.v1.builder.xpath.jaxen.BaseXPath; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.impl.DocumentNavigator; /** * An XPath implementation for the XB1 model * for more details on XB1 see * XB1 * * @author Aleksander Slominski * * @version $Revision: 1.1 $ */ public class Xb1XPath extends BaseXPath { /** * Compile XPath expression into an executable form suitable to use with XB1. * * @param xpathExpr The XPath expression. * * @throws JaxenException if there is a syntax error while * parsing the expression. */ public Xb1XPath(String xpathExpr) throws JaxenException { super( xpathExpr, DocumentNavigator.getInstance() ); } } /* * Indiana University Extreme! Lab Software License, Version 1.2 * * Copyright (c) 2002-2004 The Trustees of Indiana University. * 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) All redistributions of source code must retain the above * copyright notice, the list of authors in the original source * code, this list of conditions and the disclaimer listed in this * license; * * 2) All redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the disclaimer * listed in this license in the documentation and/or other * materials provided with the distribution; * * 3) Any documentation included with all redistributions must include * the following acknowledgement: * * "This product includes software developed by the Indiana * University Extreme! Lab. For further information please visit * http://www.extreme.indiana.edu/" * * Alternatively, this acknowledgment may appear in the software * itself, and wherever such third-party acknowledgments normally * appear. * * 4) The name "Indiana University" or "Indiana University * Extreme! Lab" shall not be used to endorse or promote * products derived from this software without prior written * permission from Indiana University. For written permission, * please contact http://www.extreme.indiana.edu/. * * 5) Products derived from this software may not use "Indiana * University" name nor may "Indiana University" appear in their name, * without prior written permission of the Indiana University. * * Indiana University provides no reassurances that the source code * provided does not infringe the patent or any other intellectual * property rights of any other entity. Indiana University disclaims any * liability to any recipient for claims brought by any other entity * based on infringement of intellectual property rights or otherwise. * * LICENSEE UNDERSTANDS THAT SOFTWARE IS PROVIDED "AS IS" FOR WHICH * NO WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. INDIANA * UNIVERSITY GIVES NO WARRANTIES AND MAKES NO REPRESENTATION THAT * SOFTWARE IS FREE OF INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR * OTHER PROPRIETARY RIGHTS. INDIANA UNIVERSITY MAKES NO WARRANTIES THAT * SOFTWARE IS FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP * DOORS", "WORMS", OR OTHER HARMFUL CODE. LICENSEE ASSUMES THE ENTIRE * RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR ASSOCIATED MATERIALS, * AND TO THE PERFORMANCE AND VALIDITY OF INFORMATION GENERATED USING * SOFTWARE. */ xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/impl/DocumentNavigator.java100644 0 0 30541 10525225063 27347 0ustaraslomewww 0 0 package org.xmlpull.v1.builder.xpath.impl; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import org.xmlpull.v1.builder.XmlAttribute; import org.xmlpull.v1.builder.XmlCharacters; import org.xmlpull.v1.builder.XmlComment; import org.xmlpull.v1.builder.XmlContainer; import org.xmlpull.v1.builder.XmlDocument; import org.xmlpull.v1.builder.XmlElement; import org.xmlpull.v1.builder.XmlInfosetBuilder; import org.xmlpull.v1.builder.XmlNamespace; import org.xmlpull.v1.builder.XmlProcessingInstruction; import org.xmlpull.v1.builder.xpath.Xb1XPath; import org.xmlpull.v1.builder.xpath.jaxen.DefaultNavigator; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.XPath; import org.xmlpull.v1.builder.xpath.jaxen.util.SingleObjectIterator; import org.xmlpull.v1.builder.xpath.saxpath.SAXPathException; /** * Interface for navigating around the XB1 object model * to use with Jaxen XPATH implementation. * * @author Alek */ public class DocumentNavigator extends DefaultNavigator { private static DocumentNavigator instance = new DocumentNavigator(); public static DocumentNavigator getInstance() { return instance; } public boolean isElement(Object obj) { return obj instanceof XmlElement; } public boolean isComment(Object obj) { return obj instanceof XmlComment; } public boolean isText(Object obj) { return ( obj instanceof String || obj instanceof XmlCharacters ); } public boolean isAttribute(Object obj) { return obj instanceof XmlAttribute; } public boolean isProcessingInstruction(Object obj) { return obj instanceof XmlProcessingInstruction; } public boolean isDocument(Object obj) { return obj instanceof XmlDocument; } public boolean isNamespace(Object obj) { return obj instanceof XmlNamespace || obj instanceof XPathNamespace; } public String getElementName(Object obj) { XmlElement elem = (XmlElement) obj; return elem.getName(); } public String getElementNamespaceUri(Object obj) { XmlElement elem = (XmlElement) obj; String uri = elem.getNamespaceName(); if ( uri != null && uri.length() == 0 ) return null; else return uri; } public String getAttributeName(Object obj) { XmlAttribute attr = (XmlAttribute) obj; return attr.getName(); } public String getAttributeNamespaceUri(Object obj) { XmlAttribute attr = (XmlAttribute) obj; String uri = attr.getNamespaceName(); if ( uri != null && uri.length() == 0 ) return null; else return uri; } public Iterator getChildAxisIterator(Object contextNode) { if ( contextNode instanceof XmlElement ) { return ((XmlElement)contextNode).children(); } else if ( contextNode instanceof XmlDocument ) { return ((XmlDocument)contextNode).children().iterator(); } return null; } public Iterator getNamespaceAxisIterator(Object contextNode) { if ( ! ( contextNode instanceof XmlElement ) ) { return null; } XmlElement elem = (XmlElement) contextNode; Map nsMap = new HashMap(); XmlElement current = elem; while ( current != null ) { XmlNamespace ns = current.getNamespace(); //if ( ns != Namespace.NO_NAMESPACE ) { if ( ns != null && ns.getPrefix() != null ) { if ( !nsMap.containsKey(ns.getPrefix()) ) nsMap.put( ns.getPrefix(), new XPathNamespace(elem, ns) ); } Iterator declaredNamespaces = current.namespaces(); while ( declaredNamespaces.hasNext() ) { ns = (XmlNamespace)declaredNamespaces.next(); if ( !nsMap.containsKey(ns.getPrefix()) ) nsMap.put( ns.getPrefix(), new XPathNamespace(elem, ns) ); } if(current.getParent() instanceof XmlElement) { current = (XmlElement) current.getParent(); } else { current = null; } } //TODO: should we really add it or is it already added by XPP3? //nsMap.put( "xml", new XPathNamespace(elem, Namespace.XML_NAMESPACE) ); return nsMap.values().iterator(); } public Iterator getParentAxisIterator(Object contextNode) { Object parent = null; if ( contextNode instanceof XmlDocument ) { parent = contextNode; } else if ( contextNode instanceof XmlElement ) { parent = ((XmlElement)contextNode).getParent(); // if ( parent == null ) // { // if ( ((XmlElement)contextNode).isRootElement() ) // { // parent = ((Element)contextNode).getDocument(); // } // } } else if ( contextNode instanceof XmlAttribute ) { parent = ((XmlAttribute)contextNode).getOwner(); } else if ( contextNode instanceof XPathNamespace ) { parent = ((XPathNamespace)contextNode).getElement(); } else if ( contextNode instanceof XmlProcessingInstruction ) { parent = ((XmlProcessingInstruction)contextNode).getParent(); } else if ( contextNode instanceof XmlComment ) { parent = ((XmlComment)contextNode).getParent(); } else if ( contextNode instanceof XmlCharacters ) { parent = ((XmlCharacters)contextNode).getParent(); } else if ( contextNode instanceof String ) { throw new IllegalStateException("XB1 XML tree shoul dnot contain Strings directly"); } if ( parent != null ) { return new SingleObjectIterator( parent ); } return null; } public Iterator getAttributeAxisIterator(Object contextNode) { if ( ! ( contextNode instanceof XmlElement ) ) { return null; } XmlElement elem = (XmlElement) contextNode; return elem.attributes(); } public XPath parseXPath (String xpath) throws SAXPathException { return new Xb1XPath(xpath); } private static XmlDocument getDocument(XmlElement el) { //TODO recursively work until parent document XmlElement root = el; while(root.getParent() instanceof XmlElement) { root = (XmlElement) root.getParent(); } return (XmlDocument) root.getParent(); } public Object getDocumentNode(Object contextNode) { if ( contextNode instanceof XmlDocument ) { return contextNode; } XmlElement elem = (XmlElement) contextNode; return getDocument(elem); } public String getElementQName(Object obj) { XmlElement elem = (XmlElement) obj; String prefix = null; if(elem.getNamespace() != null) { //TODO REVISIT: needs to declare prefix if namesapce name != null ... or not? prefix = elem.getNamespace().getPrefix(); } if ( prefix == null || "".equals( prefix ) ) { return elem.getName(); } return prefix + ":" + elem.getName(); } public String getAttributeQName(Object obj) { XmlAttribute attr = (XmlAttribute) obj; //String prefix = attr.getNamespacePrefix(); String prefix = null; if(attr.getNamespace() != null) { //TODO REVISIT: needs to declare prefix if namesapce name != null ... or not? prefix = attr.getNamespace().getPrefix(); } if ( prefix == null || "".equals( prefix ) ) { return attr.getName(); } return prefix + ":" + attr.getName(); } public String getNamespaceStringValue(Object obj) { if (obj instanceof XmlNamespace) { XmlNamespace ns = (XmlNamespace) obj; return ns.getNamespaceName(); } else { XPathNamespace ns = (XPathNamespace) obj; return ns.getNamespace().getNamespaceName(); } } public String getNamespacePrefix(Object obj) { if (obj instanceof XmlNamespace) { XmlNamespace ns = (XmlNamespace) obj; return ns.getPrefix(); } else { XPathNamespace ns = (XPathNamespace) obj; return ns.getNamespace().getPrefix(); } } public String getTextStringValue(Object obj) { if ( obj instanceof XmlCharacters ) { return ((XmlCharacters)obj).getText(); } if ( obj instanceof String ) { return ((String)obj); } return ""; } public String getAttributeStringValue(Object obj) { XmlAttribute attr = (XmlAttribute) obj; return attr.getValue(); } public String getElementStringValue(Object obj) { XmlElement elem = (XmlElement) obj; StringBuffer buf = new StringBuffer(); Iterator contentIter = elem.children(); Object each = null; while ( contentIter.hasNext() ) { each = contentIter.next(); if ( each instanceof String ) { buf.append( ((String)each) ); } else if ( each instanceof XmlCharacters ) { buf.append( ((XmlCharacters)each).getText() ); } else if ( each instanceof XmlElement ) { buf.append( getElementStringValue( each ) ); } } return buf.toString(); } public String getProcessingInstructionTarget(Object obj) { XmlProcessingInstruction pi = (XmlProcessingInstruction) obj; return pi.getTarget(); } public String getProcessingInstructionData(Object obj) { XmlProcessingInstruction pi = (XmlProcessingInstruction) obj; return pi.getContent(); } public String getCommentStringValue(Object obj) { XmlComment cmt = (XmlComment) obj; return cmt.getContent(); } public String translateNamespacePrefixToUri(String prefix, Object context) { XmlElement element = null; if ( context instanceof XmlElement ) { element = (XmlElement) context; } else if ( context instanceof XmlCharacters ) { element = (XmlElement) ((XmlCharacters)context).getParent(); } else if ( context instanceof XmlAttribute ) { element = ((XmlAttribute)context).getOwner(); } else if ( context instanceof XPathNamespace ) { element = ((XPathNamespace)context).getElement(); } else if ( context instanceof XmlComment ) { XmlContainer container = ((XmlComment)context).getParent(); if(container instanceof XmlElement) { element = (XmlElement) container; } } else if ( context instanceof XmlProcessingInstruction ) { XmlContainer container = ((XmlProcessingInstruction)context).getParent(); if(container instanceof XmlElement) { element = (XmlElement) container; } } else if ( context instanceof String ) { //TODO REVISIT to do automatic wrapping .... //element = ((String)context).getParent(); throw new IllegalArgumentException("could not determine parent string in "+context); } if ( element != null ) { XmlNamespace namespace = element.lookupNamespaceByPrefix( prefix ); if ( namespace != null ) { return namespace.getNamespaceName(); } } return null; } public Object getDocument(String url) throws FunctionCallException { try { XmlInfosetBuilder builder = XmlInfosetBuilder.newInstance(); return builder.parseLocation( url ); } catch (Exception e) { throw new FunctionCallException( e.getMessage() ); } } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/impl/XPathNamespace.java100644 0 0 2035 10525225063 26534 0ustaraslomewww 0 0 package org.xmlpull.v1.builder.xpath.impl; import org.xmlpull.v1.builder.XmlElement; import org.xmlpull.v1.builder.XmlNamespace; /** * Wrap namespace with parent so we can find parent as required by JAXEN .... * * @author */ public class XPathNamespace { private XmlElement element; private XmlNamespace namespace; public XPathNamespace( XmlNamespace namespace ) { this.namespace = namespace; } public XPathNamespace( XmlElement element, XmlNamespace namespace ) { this.element = element; this.namespace = namespace; } public XmlElement getElement() { return element; } // public void setElement( XmlElement element ) // { // this.element = element; // } public XmlNamespace getNamespace() { return namespace; } public String toString() { return ( "[xmlns:" + namespace.getPrefix() + "=\"" + namespace.getNamespaceName() + "\", element=" + element.getName() + "]" ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/BaseXPath.java100644 0 0 61211 10525225063 25677 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/BaseXPath.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:00 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: BaseXPath.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; import org.xmlpull.v1.builder.xpath.jaxen.expr.Expr; import org.xmlpull.v1.builder.xpath.jaxen.expr.XPathExpr; import org.xmlpull.v1.builder.xpath.jaxen.function.BooleanFunction; import org.xmlpull.v1.builder.xpath.jaxen.function.StringFunction; import org.xmlpull.v1.builder.xpath.jaxen.function.NumberFunction; import org.xmlpull.v1.builder.xpath.saxpath.XPathReader; import org.xmlpull.v1.builder.xpath.saxpath.SAXPathException; import org.xmlpull.v1.builder.xpath.saxpath.helpers.XPathReaderFactory; import java.io.Serializable; import java.util.ArrayList; import java.util.List; /** Base functionality for all concrete, implementation-specific XPaths. * *

      * This class provides generic functionality for further-defined * implementation-specific XPaths. *

      * *

      * If you want to adapt the Jaxen engine so that it can traverse your own * object model then this is a good base class to derive from. * Typically you only really need to provide your own * {@link org.jaxen.Navigator} implementation. *

      * * @see org.jaxen.dom4j.Dom4jXPath XPath for dom4j * @see org.jaxen.jdom.JDOMXPath XPath for JDOM * @see org.jaxen.dom.DOMXPath XPath for W3C DOM * @see org.jaxen.exml.ElectricXPath XPath for Electric XML * * @author bob mcwhirter * @author James Strachan */ public class BaseXPath implements XPath, Serializable { /** the parsed form of the xpath expression */ private XPathExpr xpath; /** the support information and function, namespace and variable contexts */ private ContextSupport support; /** the implementation-specific Navigator for retrieving XML nodes **/ private Navigator navigator; /** Construct given an XPath expression string. * * @param xpathExpr The XPath expression. * * @throws JaxenException if there is a syntax error while * parsing the expression. */ protected BaseXPath(String xpathExpr) throws JaxenException { try { XPathReader reader = XPathReaderFactory.createReader(); JaxenHandler handler = new JaxenHandler(); reader.setXPathHandler( handler ); reader.parse( xpathExpr ); this.xpath = handler.getXPathExpr(); } catch (org.xmlpull.v1.builder.xpath.saxpath.XPathSyntaxException e) { throw new org.xmlpull.v1.builder.xpath.jaxen.XPathSyntaxException( e.getXPath(), e.getPosition(), e.getMessage() ); } catch (SAXPathException e) { throw new JaxenException( e ); } } /** Construct given an XPath expression string. * * @param xpathExpr The XPath expression. * * @param navigator the XML navigator to use * * @throws JaxenException if there is a syntax error while * parsing the expression. */ public BaseXPath(String xpathExpr, Navigator navigator) throws JaxenException { this( xpathExpr ); this.navigator = navigator; } /** Evaluate this XPath against a given context. * *

      * The context of evaluation my be a document, * an element, or a set of elements. *

      * *

      * If the expression evaluates to a single primitive * (String, Number or Boolean) type, it is returned * directly. Otherwise, the returned value is a * List (a node-set, in the terms of the * specification) of values. *

      * *

      * When using this method, one must be careful to * test the class of the returned objects, and of * each of the composite members if a List * is returned. If the returned members are XML entities, * they will be the actual Document, * Element or Attribute objects * as defined by the concrete XML object-model implementation, * directly from the context document. This does not * return copies of anything, but merely returns * references to entities within the source document. *

      * * @param node The node, nodeset or Context object for evaluation. This value can be null. * * @return The result of evaluating the XPath expression * against the supplied context. */ public Object evaluate(Object node) throws JaxenException { List answer = selectNodes(node); if ( answer != null && answer.size() == 1 ) { Object first = answer.get(0); if ( first instanceof String || first instanceof Number || first instanceof Boolean ) { return first; } } return answer; } /** Select all nodes that are selectable by this XPath * expression. If multiple nodes match, multiple nodes * will be returned. * *

      * NOTE: In most cases, nodes will be returned * in document-order, as defined by the XML Canonicalization * specification. The exception occurs when using XPath * expressions involving the union operator * (denoted with the pipe '|' character). *

      * * @param node The node, nodeset or Context object for evaluation. This value can be null. * * @return The node-set of all items selected * by this XPath expression. * * @see #selectSingleNode */ public List selectNodes(Object node) throws JaxenException { Context context = getContext( node ); return selectNodesForContext( context ); } /** Select only the first node that is selectable by this XPath * expression. If multiple nodes match, only one node will be * returned. * * NOTE: In most cases, the selected node will be the first * selectable node in document-order, as defined by the XML Canonicalization * specification. The exception occurs when using XPath * expressions involving the union operator * (denoted with the pipe '|' character). *

      * * @param node The node, nodeset or Context object for evaluation. This value can be null. * * @return The node-set of all items selected * by this XPath expression. * * @see #selectNodes */ public Object selectSingleNode(Object node) throws JaxenException { List results = selectNodes( node ); if ( results.isEmpty() ) { return null; } return results.get( 0 ); } public String valueOf(Object node) throws JaxenException { return stringValueOf( node ); } public String stringValueOf(Object node) throws JaxenException { Context context = getContext( node ); Object result = selectSingleNodeForContext( context ); if ( result == null ) { return ""; } return StringFunction.evaluate( result, context.getNavigator() ); } /** Retrieve a boolean-value interpretation of this XPath * expression when evaluated against a given context. * *

      * The boolean-value of the expression is determined per * the boolean(..) core function as defined * in the XPath specification. This means that an expression * that selects zero nodes will return false, * while an expression that selects one-or-more nodes will * return true. *

      * * @param node The node, nodeset or Context object for evaluation. This value can be null. * * @return The boolean-value interpretation of this expression. */ public boolean booleanValueOf(Object node) throws JaxenException { Context context = getContext( node ); List result = selectNodesForContext( context ); if ( result == null ) return false; return BooleanFunction.evaluate( result, context.getNavigator() ).booleanValue(); } /** Retrieve a number-value interpretation of this XPath * expression when evaluated against a given context. * *

      * The number-value of the expression is determined per * the number(..) core function as defined * in the XPath specification. This means that if this * expression selects multiple nodes, the number-value * of the first node is returned. *

      * * @param node The node, nodeset or Context object for evaluation. This value can be null. * * @return The number-value interpretation of this expression. */ public Number numberValueOf(Object node) throws JaxenException { Context context = getContext( node ); Object result = selectSingleNodeForContext( context ); if ( result == null ) { return null; } return NumberFunction.evaluate( result, context.getNavigator() ); } // Helpers /** Add a namespace prefix-to-URI mapping for this XPath * expression. * *

      * Namespace prefix-to-URI mappings in an XPath are independant * of those used within any document. Only the mapping explicitly * added to this XPath will be available for resolving the * XPath expression. *

      * *

      * This is a convenience method for adding mappings to the * default {@link NamespaceContext} in place for this XPath. * If you have installed a specific custom NamespaceContext, * then this method will throw a JaxenException. *

      * * @param prefix The namespace prefix. * @param uri The namespace URI. * * @throws JaxenException If a NamespaceContext * used by this XPath has been explicitly installed. */ public void addNamespace(String prefix, String uri) throws JaxenException { NamespaceContext nsContext = getNamespaceContext(); if ( nsContext instanceof SimpleNamespaceContext ) { ((SimpleNamespaceContext)nsContext).addNamespace( prefix, uri ); return; } throw new JaxenException("Operation not permitted while using a custom namespace context."); } // ------------------------------------------------------------ // ------------------------------------------------------------ // Properties // ------------------------------------------------------------ // ------------------------------------------------------------ /** Set a NamespaceContext for use with this * XPath expression. * *

      * A NamespaceContext is responsible for translating * namespace prefixes within the expression into namespace URIs. *

      * * @param namespaceContext The NamespaceContext to * install for this expression. * * @see NamespaceContext * @see NamespaceContext#translateNamespacePrefixToUri */ public void setNamespaceContext(NamespaceContext namespaceContext) { getContextSupport().setNamespaceContext(namespaceContext); } /** Set a FunctionContext for use with this XPath * expression. * *

      * A FunctionContext is responsible for resolving * all function calls used within the expression. *

      * * @param functionContext The FunctionContext to * install for this expression. * * @see FunctionContext * @see FunctionContext#getFunction */ public void setFunctionContext(FunctionContext functionContext) { getContextSupport().setFunctionContext(functionContext); } /** Set a VariableContext for use with this XPath * expression. * *

      * A VariableContext is responsible for resolving * all variables referenced within the expression. *

      * * @param variableContext The VariableContext to * install for this expression. * * @see VariableContext * @see VariableContext#getVariableValue */ public void setVariableContext(VariableContext variableContext) { getContextSupport().setVariableContext(variableContext); } /** Retrieve the NamespaceContext used by this XPath * expression. * *

      * A FunctionContext is responsible for resolving * all function calls used within the expression. *

      * *

      * If this XPath expression has not previously had a NamespaceContext * installed, a new default NamespaceContext will be created, * installed and returned. *

      * * @return The NamespaceContext used by this expression. * * @see NamespaceContext */ public NamespaceContext getNamespaceContext() { NamespaceContext answer = getContextSupport().getNamespaceContext(); if ( answer == null ) { answer = createNamespaceContext(); getContextSupport().setNamespaceContext( answer ); } return answer; } /** Retrieve the FunctionContext used by this XPath * expression. * *

      * A FunctionContext is responsible for resolving * all function calls used within the expression. *

      * *

      * If this XPath expression has not previously had a FunctionContext * installed, a new default FunctionContext will be created, * installed and returned. *

      * * @return The FunctionContext used by this expression. * * @see FunctionContext */ public FunctionContext getFunctionContext() { FunctionContext answer = getContextSupport().getFunctionContext(); if ( answer == null ) { answer = createFunctionContext(); getContextSupport().setFunctionContext( answer ); } return answer; } /** Retrieve the VariableContext used by this XPath * expression. * *

      * A VariableContext is responsible for resolving * all variables referenced within the expression. *

      * *

      * If this XPath expression has not previously had a VariableContext * installed, a new default VariableContext will be created, * installed and returned. *

      * * @return The VariableContext used by this expression. * * @see VariableContext */ public VariableContext getVariableContext() { VariableContext answer = getContextSupport().getVariableContext(); if ( answer == null ) { answer = createVariableContext(); getContextSupport().setVariableContext( answer ); } return answer; } /** Retrieve the root expression of the internal * compiled form of this XPath expression. * *

      * Internally, Jaxen maintains a form of Abstract Syntax * Tree (AST) to represent the structure of the XPath expression. * This is normally not required during normal consumer-grade * usage of Jaxen. This method is provided for hard-core users * who wish to manipulate or inspect a tree-based version of * the expression. *

      * * @return The root of the AST of this expression. */ public Expr getRootExpr() { return xpath.getRootExpr(); } /** Return the normalized string of this XPath expression. * *

      * During parsing, the XPath expression is normalized, * removing abbreviations and other convenience notation. * This method returns the fully normalized representation * of the original expression. *

      * * @return The normalized XPath expression string. */ public String toString() { return this.xpath.getText(); } /** Returns the string version of this xpath. * * @return The normalized XPath expression string. * * @see #toString */ public String debug() { return this.xpath.toString(); } // ------------------------------------------------------------ // ------------------------------------------------------------ // Implementation methods // ------------------------------------------------------------ // ------------------------------------------------------------ /** Create a {@link Context} wrapper for the provided * implementation-specific object. * * @param node The implementation-specific object * to be used as the context. * * @return A Context wrapper around the object. */ protected Context getContext(Object node) { if ( node instanceof Context ) { return (Context) node; } Context fullContext = new Context( getContextSupport() ); if ( node instanceof List ) { fullContext.setNodeSet( (List) node ); } else { List list = new ArrayList( 1 ); list.add( node ); fullContext.setNodeSet( list ); } return fullContext; } /** Retrieve the {@link ContextSupport} aggregation of * NamespaceContext, FunctionContext, * VariableContext, and {@link Navigator}. * * @return Aggregate ContextSupport for this * XPath expression. */ protected ContextSupport getContextSupport() { if ( support == null ) { support = new ContextSupport( createNamespaceContext(), createFunctionContext(), createVariableContext(), getNavigator() ); } return support; } /** Retrieve the XML object-model-specific {@link Navigator} * for us in evaluating this XPath expression. * * @return The implementation-specific Navigator. */ public Navigator getNavigator() { return navigator; } // ------------------------------------------------------------ // ------------------------------------------------------------ // Factory methods for default contexts // ------------------------------------------------------------ // ------------------------------------------------------------ /** Create a default FunctionContext. * * @return The default FunctionContext. */ protected FunctionContext createFunctionContext() { return XPathFunctionContext.getInstance(); } /** Create a default NamespaceContext. * * @return A default NamespaceContext instance. */ protected NamespaceContext createNamespaceContext() { return new SimpleNamespaceContext(); } /** Create a default VariableContext. * * @return A default VariableContext instance. */ protected VariableContext createVariableContext() { return new SimpleVariableContext(); } /** Select all nodes that are selectable by this XPath * expression on the given Context object. * If multiple nodes match, multiple nodes * will be returned. * *

      * NOTE: In most cases, nodes will be returned * in document-order, as defined by the XML Canonicalization * specification. The exception occurs when using XPath * expressions involving the union operator * (denoted with the pipe '|' character). *

      * * @param context is the Context which gets evaluated. * * @return The node-set of all items selected * by this XPath expression. * */ protected List selectNodesForContext(Context context) throws JaxenException { return this.xpath.asList( context ); } /** Select only the first node that is selectable by this XPath * expression. If multiple nodes match, only one node will be * returned. * * NOTE: In most cases, the selected node will be the first * selectable node in document-order, as defined by the XML Canonicalization * specification. The exception occurs when using XPath * expressions involving the union operator * (denoted with the pipe '|' character). *

      * * @param context is the Context which gets evaluated. * * @return The node-set of all items selected * by this XPath expression. * * @see #selectNodesForContext */ protected Object selectSingleNodeForContext(Context context) throws JaxenException { List results = selectNodesForContext( context ); if ( results.isEmpty() ) { return null; } return results.get( 0 ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/Context.java100644 0 0 14262 10525225063 25510 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/Context.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:34 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: Context.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; import java.io.Serializable; import java.util.List; import java.util.ArrayList; /** Wrapper around implementation-specific objects used * as the context of an expression evaluation. * *

      * NOTE: This class is not typically used directly, * but is exposed for writers of implementation-specific * XPath packages. *

      * *

      * The Context bundles utilities together * for evaluation of the expression. It wraps the provided * objects for ease-of-passage through the expression AST. *

      * * @see ContextSupport * @see BaseXPath * @see org.jaxen.dom4j.Dom4jXPath XPath for dom4j * @see org.jaxen.jdom.JDOMXPath XPath for JDOM * @see org.jaxen.dom.DOMXPath XPath for W3C DOM * @see org.jaxen.exml.ElectricXPath XPath for Electric XML * * @author bob mcwhirter */ public class Context implements Serializable { private ContextSupport contextSupport; private List nodeSet; private int size; private int position; public Context(ContextSupport contextSupport) { this.contextSupport = contextSupport; this.nodeSet = new ArrayList(0); } public List getNodeSet() { return this.nodeSet; } public void setNodeSet(List nodeSet) { this.nodeSet = nodeSet; } public ContextSupport getContextSupport() { return this.contextSupport; } public void setContextSupport(ContextSupport contextSupport) { this.contextSupport = contextSupport; } public Navigator getNavigator() { return getContextSupport().getNavigator(); } public String translateNamespacePrefixToUri(String prefix) { return getContextSupport().translateNamespacePrefixToUri( prefix ); } public Object getVariableValue( String namespaceURI, String prefix, String localName ) throws UnresolvableException { return getContextSupport().getVariableValue( namespaceURI, prefix, localName ); } public Function getFunction( String namespaceURI, String prefix, String localName ) throws UnresolvableException { return getContextSupport().getFunction( namespaceURI, prefix, localName ); } public void setSize(int size) { this.size = size; } public void setPosition(int position) { this.position = position; } public int getSize() { return this.size; } public int getPosition() { return this.position; } public Context duplicate() { Context dupe = new Context( getContextSupport() ); List thisNodeSet = getNodeSet(); if ( thisNodeSet != null ) { List dupeNodeSet = new ArrayList( thisNodeSet.size() ); dupeNodeSet.addAll( thisNodeSet ); dupe.setNodeSet( dupeNodeSet ); } return dupe; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/ContextSupport.java100644 0 0 15016 10525225063 27103 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/ContextSupport.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:34 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: ContextSupport.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; import java.io.Serializable; /** Supporting context information for resolving * namespace prefixess, functions, and variables. * *

      * NOTE: This class is not typically used directly, * but is exposed for writers of implementation-specific * XPath packages. *

      * * @see org.jaxen.dom4j.Dom4jXPath XPath for dom4j * @see org.jaxen.jdom.JDOMXPath XPath for JDOM * @see org.jaxen.dom.DOMXPath XPath for W3C DOM * @see org.jaxen.exml.ElectricXPath XPath for Electric XML * * @author bob mcwhirter (bob@werken.com) */ public class ContextSupport implements Serializable { private transient FunctionContext functionContext; private NamespaceContext namespaceContext; private VariableContext variableContext; private Navigator navigator; /** Construct an empty ContextSupport. */ public ContextSupport() { // intentionally left blank } /** Construct. * * @param namespaceContext The NamespaceContext. * @param functionContext The FunctionContext. * @param variableContext The VariableContext. */ public ContextSupport(NamespaceContext namespaceContext, FunctionContext functionContext, VariableContext variableContext, Navigator navigator) { setNamespaceContext( namespaceContext ); setFunctionContext( functionContext ); setVariableContext( variableContext ); this.navigator = navigator; } public void setNamespaceContext(NamespaceContext namespaceContext) { this.namespaceContext = namespaceContext; } public void setFunctionContext(FunctionContext functionContext) { this.functionContext = functionContext; } public void setVariableContext(VariableContext variableContext) { this.variableContext = variableContext; } public NamespaceContext getNamespaceContext() { return this.namespaceContext; } public FunctionContext getFunctionContext() { return this.functionContext; } public VariableContext getVariableContext() { return this.variableContext; } public Navigator getNavigator() { return this.navigator; } public String translateNamespacePrefixToUri(String prefix) { NamespaceContext context = getNamespaceContext(); if ( context != null ) { return context.translateNamespacePrefixToUri( prefix ); } return null; } public Object getVariableValue( String namespaceURI, String prefix, String localName ) throws UnresolvableException { VariableContext context = getVariableContext(); if ( context != null ) { return context.getVariableValue( namespaceURI, prefix, localName ); } else { throw new UnresolvableException( "No variable context installed" ); } } public Function getFunction( String namespaceURI, String prefix, String localName ) throws UnresolvableException { FunctionContext context = getFunctionContext(); if ( context != null ) { return context.getFunction( namespaceURI, prefix, localName ); } else { throw new UnresolvableException( "No function context installed" ); } } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/DefaultNavigator.java100644 0 0 22567 10525225063 27332 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/DefaultNavigator.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:34 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultNavigator.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; import org.xmlpull.v1.builder.xpath.jaxen.pattern.Pattern; import org.xmlpull.v1.builder.xpath.jaxen.util.SelfAxisIterator; import org.xmlpull.v1.builder.xpath.jaxen.util.DescendantOrSelfAxisIterator; import org.xmlpull.v1.builder.xpath.jaxen.util.AncestorOrSelfAxisIterator; import org.xmlpull.v1.builder.xpath.jaxen.util.AncestorAxisIterator; import org.xmlpull.v1.builder.xpath.jaxen.util.DescendantAxisIterator; import org.xmlpull.v1.builder.xpath.jaxen.util.PrecedingAxisIterator; import org.xmlpull.v1.builder.xpath.jaxen.util.FollowingAxisIterator; import org.xmlpull.v1.builder.xpath.jaxen.util.PrecedingSiblingAxisIterator; import org.xmlpull.v1.builder.xpath.jaxen.util.FollowingSiblingAxisIterator; import java.util.Iterator; /** Default implementation of {@link Navigator}. * *

      * This implementation is an abstract class, since * some required operations cannot be implemented without * additional knowledge of the object model. *

      * *

      * When possible, default method implementations build * upon each other, to reduce the number of methods required * to be implemented for each object model. All methods, * of course, may be overridden, to provide more-efficient * implementations. *

      * * @author bob mcwhirter (bob@werken.com) * @author Erwin Bolwidt (ejb@klomp.org) */ public abstract class DefaultNavigator implements Navigator { /** Throws UnsupportedAxisException */ public Iterator getChildAxisIterator(Object contextNode) throws UnsupportedAxisException { throw new UnsupportedAxisException("child"); } public Iterator getDescendantAxisIterator(Object contextNode) throws UnsupportedAxisException { return new DescendantAxisIterator( contextNode, this ); } /** Throws UnsupportedAxisException */ public Iterator getParentAxisIterator(Object contextNode) throws UnsupportedAxisException { throw new UnsupportedAxisException("parent"); } public Iterator getAncestorAxisIterator(Object contextNode) throws UnsupportedAxisException { return new AncestorAxisIterator( contextNode, this ); } /** Throws UnsupportedAxisException */ public Iterator getFollowingSiblingAxisIterator(Object contextNode) throws UnsupportedAxisException { return new FollowingSiblingAxisIterator( contextNode, this ); } /** Throws UnsupportedAxisException */ public Iterator getPrecedingSiblingAxisIterator(Object contextNode) throws UnsupportedAxisException { return new PrecedingSiblingAxisIterator( contextNode, this ); } /** Throws UnsupportedAxisException */ public Iterator getFollowingAxisIterator(Object contextNode) throws UnsupportedAxisException { return new FollowingAxisIterator( contextNode, this ); // throw new UnsupportedAxisException("following"); } /** Throws UnsupportedAxisException */ public Iterator getPrecedingAxisIterator(Object contextNode) throws UnsupportedAxisException { return new PrecedingAxisIterator( contextNode, this ); // throw new UnsupportedAxisException("preceding"); } /** Throws UnsupportedAxisException */ public Iterator getAttributeAxisIterator(Object contextNode) throws UnsupportedAxisException { throw new UnsupportedAxisException("attribute"); } /** Throws UnsupportedAxisException */ public Iterator getNamespaceAxisIterator(Object contextNode) throws UnsupportedAxisException { throw new UnsupportedAxisException("namespace"); } public Iterator getSelfAxisIterator(Object contextNode) throws UnsupportedAxisException { return new SelfAxisIterator( contextNode ); } public Iterator getDescendantOrSelfAxisIterator(Object contextNode) throws UnsupportedAxisException { return new DescendantOrSelfAxisIterator( contextNode, this ); } public Iterator getAncestorOrSelfAxisIterator(Object contextNode) throws UnsupportedAxisException { return new AncestorOrSelfAxisIterator( contextNode, this ); } public Object getDocumentNode(Object contextNode) { return null; } public String translateNamespacePrefixToUri(String prefix, Object element) { return null; } public String getProcessingInstructionTarget(Object obj) { return null; } public String getProcessingInstructionData(Object obj) { return null; } public short getNodeType(Object node) { if ( isElement(node) ) { return Pattern.ELEMENT_NODE; } else if ( isAttribute(node) ) { return Pattern.ATTRIBUTE_NODE; } else if ( isText(node) ) { return Pattern.TEXT_NODE; } else if ( isComment(node) ) { return Pattern.COMMENT_NODE; } else if ( isDocument(node) ) { return Pattern.DOCUMENT_NODE; } else if ( isProcessingInstruction(node) ) { return Pattern.DOCUMENT_NODE; } else { return Pattern.UNKNOWN_NODE; } } public Object getParentNode(Object contextNode) throws UnsupportedAxisException { Iterator iter = getParentAxisIterator( contextNode ); if ( iter != null && iter.hasNext() ) { return iter.next(); } return null; } public Object getDocument(String url) throws FunctionCallException { return null; } /** * Default implementation that can not find elements. Override in subclass * if subclass does know about attribute types. * * @param contextNode a node from the document in which to look for the * id * @param elementId id to look for * * @return null */ public Object getElementById(Object object, String elementId) { return null; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/Function.java100644 0 0 7424 10525225063 25633 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/Function.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:34 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: Function.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; import java.util.List; /** Interface for the extensible function framework. * *

      * NOTE: This class is not typically used directly, * but is exposed for writers of extended XPath packages. *

      * *

      * Implementations of Function are functors * which are used to evaluate a function-call within an * XPath expression. *

      * * @see FunctionContext * * @author bob mcwhirter */ public interface Function { /** Call this function. * * @param context The context at the point in the * expression when the function is called. * @param args List of arguments provided during * the call of the function. */ Object call(Context context, List args) throws FunctionCallException; } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/FunctionCallException.java100644 0 0 12012 10525225063 30313 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/FunctionCallException.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:34 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: FunctionCallException.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; import java.io.PrintStream; import java.io.PrintWriter; /** FunctionCallException is thrown if an exception * occurs during the evaluation of a function. * This exception may include a root exception, such as if the * real exception was failure to load an XML document via the * document() function call. * * @author bob mcwhirter (bob @ werken.com) * @author James Strachan */ public class FunctionCallException extends JaxenException { private Throwable nestedException; public FunctionCallException(String message) { super( message ); } public FunctionCallException(Throwable nestedException) { super( nestedException.getMessage() ); this.nestedException = nestedException; } public FunctionCallException(String message, Exception nestedException) { super( message ); this.nestedException = nestedException; } public void printStackTrace( PrintStream s ) { super.printStackTrace(); if ( nestedException != null ) { s.println( "Root cause:" ); nestedException.printStackTrace( s ); } } public void printStackTrace( PrintWriter w ) { super.printStackTrace(); if ( nestedException != null ) { w.println( "Root cause:" ); nestedException.printStackTrace( w ); } } public void printStackTrace() { super.printStackTrace(); if ( nestedException != null ) { System.out.println( "Root cause:" ); nestedException.printStackTrace(); } } public Throwable fillInStackTrace() { if ( nestedException == null ) { return super.fillInStackTrace(); } else { return nestedException.fillInStackTrace(); } } // Properties //------------------------------------------------------------------------- public Throwable getNestedException() { return nestedException; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/FunctionContext.java100644 0 0 11414 10525225063 27212 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/FunctionContext.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:34 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: FunctionContext.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; /** Implemented by classes that know how to resolve xpath function names and * namespaces to implementations of these functions. * *

      * By using a custom FunctionContext, new or different * functions may be installed and available to XPath expression writers. *

      * * @see XPathFunctionContext * * @author bob mcwhirter */ public interface FunctionContext { /** An implementation should return a Function implementation object * based on the namespace uri and local name of the function-call * expression. * *

      * It must not use the prefix parameter to select an implementation, * because a prefix could be bound to any namespace; the prefix parameter * could be used in debugging output or other generated information. * The prefix may otherwise be completely ignored. *

      * * @param namespaceURI the namespace uri to which the prefix parameter * is bound in the xpath expression. If the function * call expression had no prefix, the namespace uri * is null. * @param prefix the prefix that was used in the function call * expression. * @param localName the local name of the function-call expression; * if there is no prefix, then this is the whole * name of the function. * * @return a Function implementation object. * @throws UnresolvableException when the function cannot be resolved. */ Function getFunction( String namespaceURI, String prefix, String localName ) throws UnresolvableException; } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/JaxenException.java100644 0 0 7642 10525225063 26774 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/JaxenException.java,v 1.2 2004/10/01 08:33:20 aslom Exp $ * $Revision: 1.2 $ * $Date: 2004/10/01 08:33:20 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: JaxenException.java,v 1.2 2004/10/01 08:33:20 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; import org.xmlpull.v1.builder.xpath.saxpath.SAXPathException; /** Generic Jaxen exception. * *

      * This is the root of all Jaxen exceptions. * It may wrap other exceptions. See {@link #getRootCause}. * * @author bob mcwhirter */ public class JaxenException extends SAXPathException { /** Root cause, if any. */ //private Throwable rootCause; /** Construct with a message. * * @param message The error message. */ public JaxenException(String message) { super( message ); } /** Construct with a root cause. * * @param rootCause Root cause of the error. */ public JaxenException(Throwable rootCause) { super( "wrapped exception" ); this.detail = rootCause; } /** Retrieve the root cause, if any. * * @return Root cause of the error. */ public Throwable getRootCause() { return this.detail; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/JaxenHandler.java100644 0 0 47311 10525225063 26430 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/JaxenHandler.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:00 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: JaxenHandler.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; import org.xmlpull.v1.builder.xpath.jaxen.expr.XPathFactory; import org.xmlpull.v1.builder.xpath.jaxen.expr.DefaultXPathFactory; import org.xmlpull.v1.builder.xpath.jaxen.expr.XPathExpr; import org.xmlpull.v1.builder.xpath.jaxen.expr.LocationPath; import org.xmlpull.v1.builder.xpath.jaxen.expr.FilterExpr; import org.xmlpull.v1.builder.xpath.jaxen.expr.Expr; import org.xmlpull.v1.builder.xpath.jaxen.expr.Step; import org.xmlpull.v1.builder.xpath.jaxen.expr.Predicate; import org.xmlpull.v1.builder.xpath.jaxen.expr.Predicated; import org.xmlpull.v1.builder.xpath.jaxen.expr.FunctionCallExpr; import org.xmlpull.v1.builder.xpath.saxpath.XPathHandler; import org.xmlpull.v1.builder.xpath.saxpath.Operator; import java.util.LinkedList; import java.util.Iterator; /** SAXPath XPathHandler implementation capable * of building Jaxen expression trees which can walk various * different object models. * * @author bob mcwhirter (bob@werken.com) */ public class JaxenHandler implements XPathHandler { private XPathFactory xpathFactory; private XPathExpr xpath; protected boolean simplified; protected LinkedList stack; /** Construct. */ public JaxenHandler() { this.stack = new LinkedList(); this.xpathFactory = new DefaultXPathFactory(); } /** Set the Jaxen XPathFactory to use * during the parse to construct the XPath expression tree. * * @param xpathFactory The factory to use during the parse. */ public void setXPathFactory(XPathFactory xpathFactory) { this.xpathFactory = xpathFactory; } /** Retrieve the Jaxen XPathFactory used * during the parse to construct the XPath expression tree. * * @return The XPathFactory used during the parse. */ public XPathFactory getXPathFactory() { return this.xpathFactory; } /** Retrieve the simplified Jaxen XPath expression tree. * *

      * This method is only valid once XPathReader.parse(...) * successfully returned. *

      * * @return The XPath expression tree. */ public XPathExpr getXPathExpr() { return getXPathExpr( true ); } /** Retrieve the Jaxen XPath expression tree, optionally * simplified. * *

      * This method is only valid once XPathReader.parse(...) * successfully returned. *

      * * @return The XPath expression tree. */ public XPathExpr getXPathExpr(boolean shouldSimplify) { if ( shouldSimplify && ! this.simplified ) { //System.err.println("simplifyin...."); this.xpath.simplify(); this.simplified = true; } return this.xpath; } public void startXPath() throws JaxenException { //System.err.println("startXPath()"); this.simplified = false; pushFrame(); } public void endXPath() throws JaxenException { //System.err.println("endXPath()"); this.xpath = getXPathFactory().createXPath( (Expr) pop() ); popFrame(); } public void startPathExpr() throws JaxenException { //System.err.println("startPathExpr()"); pushFrame(); } public void endPathExpr() throws JaxenException { //System.err.println("endPathExpr()"); // PathExpr ::= LocationPath // | FilterExpr // | FilterExpr / RelativeLocationPath // | FilterExpr // RelativeLocationPath // // If the current stack-frame has two items, it's a // FilterExpr and a LocationPath (of some flavor). // // If the current stack-frame has one item, it's simply // a FilterExpr, and more than like boils down to a // primary expr of some flavor. But that's for another // method... FilterExpr filterExpr; LocationPath locationPath; Object popped; //System.err.println("stackSize() == " + stackSize() ); if ( stackSize() == 2 ) { locationPath = (LocationPath) pop(); filterExpr = (FilterExpr) pop(); } else { popped = pop(); if ( popped instanceof LocationPath ) { locationPath = (LocationPath) popped; filterExpr = null; } else { locationPath = null; filterExpr = (FilterExpr) popped; } } popFrame(); push( getXPathFactory().createPathExpr( filterExpr, locationPath ) ); } public void startAbsoluteLocationPath() throws JaxenException { //System.err.println("startAbsoluteLocationPath()"); pushFrame(); push( getXPathFactory().createAbsoluteLocationPath() ); } public void endAbsoluteLocationPath() throws JaxenException { //System.err.println("endAbsoluteLocationPath()"); endLocationPath(); } public void startRelativeLocationPath() throws JaxenException { //System.err.println("startRelativeLocationPath()"); pushFrame(); push( getXPathFactory().createRelativeLocationPath() ); } public void endRelativeLocationPath() throws JaxenException { //System.err.println("endRelativeLocationPath()"); endLocationPath(); } protected void endLocationPath() throws JaxenException { LocationPath path = (LocationPath) peekFrame().removeFirst(); addSteps( path, popFrame().iterator() ); push( path ); } protected void addSteps(LocationPath locationPath, Iterator stepIter) { while ( stepIter.hasNext() ) { locationPath.addStep( (Step) stepIter.next() ); } } public void startNameStep(int axis, String prefix, String localName) throws JaxenException { //System.err.println("startNameStep(" + axis + ", " + prefix + ", " + localName + ")"); pushFrame(); push( getXPathFactory().createNameStep( axis, prefix, localName ) ); } public void endNameStep() throws JaxenException { //System.err.println("endNameStep()"); endStep(); } public void startTextNodeStep(int axis) throws JaxenException { //System.err.println("startTextNodeStep()"); pushFrame(); push( getXPathFactory().createTextNodeStep( axis ) ); } public void endTextNodeStep() throws JaxenException { //System.err.println("endTextNodeStep()"); endStep(); } public void startCommentNodeStep(int axis) throws JaxenException { //System.err.println("startCommentNodeStep()"); pushFrame(); push( getXPathFactory().createCommentNodeStep( axis ) ); } public void endCommentNodeStep() throws JaxenException { //System.err.println("endCommentNodeStep()"); endStep(); } public void startAllNodeStep(int axis) throws JaxenException { //System.err.println("startAllNodeStep()"); pushFrame(); push( getXPathFactory().createAllNodeStep( axis ) ); } public void endAllNodeStep() throws JaxenException { //System.err.println("endAllNodeStep()"); endStep(); } public void startProcessingInstructionNodeStep(int axis, String name) throws JaxenException { //System.err.println("startProcessingInstructionStep()"); pushFrame(); push( getXPathFactory().createProcessingInstructionNodeStep( axis, name ) ); } public void endProcessingInstructionNodeStep() throws JaxenException { //System.err.println("endProcessingInstructionStep()"); endStep(); } protected void endStep() { Step step = (Step) peekFrame().removeFirst(); addPredicates( step, popFrame().iterator() ); push( step ); } public void startPredicate() throws JaxenException { //System.err.println("startPredicate()"); pushFrame(); } public void endPredicate() throws JaxenException { //System.err.println("endPredicate()"); Predicate predicate = getXPathFactory().createPredicate( (Expr) pop() ); popFrame(); push( predicate ); } public void startFilterExpr() throws JaxenException { //System.err.println("startFilterExpr()"); pushFrame(); } public void endFilterExpr() throws JaxenException { //System.err.println("endFilterExpr()"); Expr expr = (Expr) peekFrame().removeFirst(); FilterExpr filter = getXPathFactory().createFilterExpr( expr ); Iterator predIter = popFrame().iterator(); addPredicates( filter, predIter ); push( filter ); } protected void addPredicates(Predicated obj, Iterator predIter) { while ( predIter.hasNext() ) { obj.addPredicate( (Predicate) predIter.next() ); } } protected void returnExpr() { Expr expr = (Expr) pop(); popFrame(); push( expr ); } public void startOrExpr() throws JaxenException { //System.err.println("startOrExpr()"); } public void endOrExpr(boolean create) throws JaxenException { //System.err.println("endOrExpr()"); if ( create ) { //System.err.println("makeOrExpr"); Expr rhs = (Expr) pop(); Expr lhs = (Expr) pop(); push( getXPathFactory().createOrExpr( lhs, rhs ) ); } } public void startAndExpr() throws JaxenException { //System.err.println("startAndExpr()"); } public void endAndExpr(boolean create) throws JaxenException { //System.err.println("endAndExpr()"); if ( create ) { //System.err.println("makeAndExpr"); Expr rhs = (Expr) pop(); Expr lhs = (Expr) pop(); push( getXPathFactory().createAndExpr( lhs, rhs ) ); } } public void startEqualityExpr() throws JaxenException { //System.err.println("startEqualityExpr()"); } public void endEqualityExpr(int operator) throws JaxenException { //System.err.println("endEqualityExpr(" + operator + ")"); if ( operator != Operator.NO_OP ) { //System.err.println("makeEqualityExpr"); Expr rhs = (Expr) pop(); Expr lhs = (Expr) pop(); push( getXPathFactory().createEqualityExpr( lhs, rhs, operator ) ); } } public void startRelationalExpr() throws JaxenException { //System.err.println("startRelationalExpr()"); } public void endRelationalExpr(int operator) throws JaxenException { //System.err.println("endRelationalExpr(" + operator + ")"); if ( operator != Operator.NO_OP ) { //System.err.println("makeRelationalExpr"); Expr rhs = (Expr) pop(); Expr lhs = (Expr) pop(); push( getXPathFactory().createRelationalExpr( lhs, rhs, operator ) ); } } public void startAdditiveExpr() throws JaxenException { //System.err.println("startAdditiveExpr()"); } public void endAdditiveExpr(int operator) throws JaxenException { //System.err.println("endAdditiveExpr(" + operator + ")"); if ( operator != Operator.NO_OP ) { //System.err.println("makeAdditiveExpr"); Expr rhs = (Expr) pop(); Expr lhs = (Expr) pop(); push( getXPathFactory().createAdditiveExpr( lhs, rhs, operator ) ); } } public void startMultiplicativeExpr() throws JaxenException { //System.err.println("startMultiplicativeExpr()"); } public void endMultiplicativeExpr(int operator) throws JaxenException { //System.err.println("endMultiplicativeExpr(" + operator + ")"); if ( operator != Operator.NO_OP ) { //System.err.println("makeMulitiplicativeExpr"); Expr rhs = (Expr) pop(); Expr lhs = (Expr) pop(); push( getXPathFactory().createMultiplicativeExpr( lhs, rhs, operator ) ); } } public void startUnaryExpr() throws JaxenException { //System.err.println("startUnaryExpr()"); } public void endUnaryExpr(int operator) throws JaxenException { //System.err.println("endUnaryExpr(" + operator + ")"); if ( operator != Operator.NO_OP ) { push( getXPathFactory().createUnaryExpr( (Expr) pop(), operator ) ); } } public void startUnionExpr() throws JaxenException { //System.err.println("startUnionExpr()"); } public void endUnionExpr(boolean create) throws JaxenException { //System.err.println("endUnionExpr()"); if ( create ) { //System.err.println("makeUnionExpr"); Expr rhs = (Expr) pop(); Expr lhs = (Expr) pop(); push( getXPathFactory().createUnionExpr( lhs, rhs ) ); } } public void number(int number) throws JaxenException { //System.err.println("number(" + number + ")"); push( getXPathFactory().createNumberExpr( number ) ); } public void number(double number) throws JaxenException { //System.err.println("number(" + number + ")"); push( getXPathFactory().createNumberExpr( number ) ); } public void literal(String literal) throws JaxenException { push( getXPathFactory().createLiteralExpr( literal ) ); } public void variableReference(String prefix, String variableName) throws JaxenException { push( getXPathFactory().createVariableReferenceExpr( prefix, variableName ) ); } public void startFunction(String prefix, String functionName) throws JaxenException { pushFrame(); push( getXPathFactory().createFunctionCallExpr( prefix, functionName ) ); } public void endFunction() throws JaxenException { FunctionCallExpr function = (FunctionCallExpr) peekFrame().removeFirst(); addParameters( function, popFrame().iterator() ); push( function ); } protected void addParameters(FunctionCallExpr function, Iterator paramIter) { while ( paramIter.hasNext() ) { function.addParameter( (Expr) paramIter.next() ); } } protected int stackSize() { return peekFrame().size(); } protected void push(Object obj) { peekFrame().addLast( obj ); //System.err.println("push(" + this.stack.size() + "/" + peekFrame().size() + ") == " + obj ); } protected Object pop() { //System.err.println("pop(" + this.stack.size() + "/" + peekFrame().size() + ")"); return peekFrame().removeLast(); } protected boolean canPop() { return ( peekFrame().size() > 0 ); } protected void pushFrame() { this.stack.addLast( new LinkedList() ); //System.err.println("pushFrame(" + this.stack.size() + ")"); } protected LinkedList popFrame() { //System.err.println("popFrame(" + this.stack.size() + ")"); return (LinkedList) this.stack.removeLast(); } protected LinkedList peekFrame() { return (LinkedList) this.stack.getLast(); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/NamespaceContext.java100644 0 0 10310 10525225063 27313 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/NamespaceContext.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:34 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: NamespaceContext.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; /** Resolves namespace prefixes to namespace URIs. * *

      * The prefixes used within an XPath expression are * independant of those used within any target document. * When evaluating an XPath against a document, only * the resolved namespace URIs are compared, not their * prefixes. *

      * *

      * A NamespaceContext is responsible for * translating prefixes as they appear in XPath expressions * into URIs for comparison. A document's prefixes are * resolved internal to the document based upon its own * namespace nodes. *

      * * @see BaseXPath * @see Navigator#getElementNamespaceUri * @see Navigator#getAttributeNamespaceUri * * @author bob mcwhirter */ public interface NamespaceContext { /** Translate the provided namespace prefix into * the matching bound namespace URI. * *

      * In XPath, there is no such thing as a 'default namespace'. * The empty prefix always resolves to the empty * namespace URI. *

      * * @param prefix The namespace prefix to resolve. * * @return The namespace URI matching the prefix. */ String translateNamespacePrefixToUri(String prefix); } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/Navigator.java100644 0 0 45512 10525225063 26020 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/Navigator.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:34 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: Navigator.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; import java.io.Serializable; import java.util.Iterator; import org.xmlpull.v1.builder.xpath.saxpath.SAXPathException; /** Interface for navigating around an arbitrary object * model, using xpath semantics. * *

      * There is a method to obtain a java.util.Iterator, * for each axis specified by XPath. If the target object model * does not support the semantics of a particular axis, an * {@link UnsupportedAxisException} is to be thrown. *

      * * @author bob mcwhirter (bob@werken.com) * @author James Strachan */ public interface Navigator extends Serializable { // ------------------------------------------------------------ // ------------------------------------------------------------ // Axis Iterators // ------------------------------------------------------------ // ------------------------------------------------------------ /** Retrieve an Iterator matching the child * xpath axis. * * @param contextNode The origin context node. * * @return An Iterator capable of traversing the axis. * * @throws UnsupportedAxisException is the semantics of this axis are * not supported by this object model. */ Iterator getChildAxisIterator(Object contextNode) throws UnsupportedAxisException; /** Retrieve an Iterator matching the descendant * xpath axis. * * @param contextNode The origin context node. * * @return An Iterator capable of traversing the axis. * * @throws UnsupportedAxisException is the semantics of this axis are * not supported by this object model. */ Iterator getDescendantAxisIterator(Object contextNode) throws UnsupportedAxisException; /** Retrieve an Iterator matching the parent xpath axis. * * @param contextNode The origin context node. * * @return An Iterator capable of traversing the axis. * * @throws UnsupportedAxisException is the semantics of this axis are * not supported by this object model. */ Iterator getParentAxisIterator(Object contextNode) throws UnsupportedAxisException; /** Retrieve an Iterator matching the ancestor * xpath axis. * * @param contextNode The origin context node. * * @return An Iterator capable of traversing the axis. * * @throws UnsupportedAxisException is the semantics of this axis are * not supported by this object model. */ Iterator getAncestorAxisIterator(Object contextNode) throws UnsupportedAxisException; /** Retrieve an Iterator matching the * following-sibling xpath axis. * * @param contextNode The origin context node. * * @return An Iterator capable of traversing the axis. * * @throws UnsupportedAxisException is the semantics of this axis are * not supported by this object model. */ Iterator getFollowingSiblingAxisIterator(Object contextNode) throws UnsupportedAxisException; /** Retrieve an Iterator matching the * preceding-sibling xpath axis. * * @param contextNode The origin context node. * * @return An Iterator capable of traversing the axis. * * @throws UnsupportedAxisException is the semantics of this axis are * not supported by this object model. */ Iterator getPrecedingSiblingAxisIterator(Object contextNode) throws UnsupportedAxisException; /** Retrieve an Iterator matching the following * xpath axis. * * @param contextNode The origin context node. * * @return An Iterator capable of traversing the axis. * * @throws UnsupportedAxisException is the semantics of this axis are * not supported by this object model. */ Iterator getFollowingAxisIterator(Object contextNode) throws UnsupportedAxisException; /** Retrieve an Iterator matching the preceding xpath axis. * * @param contextNode The origin context node. * * @return An Iterator capable of traversing the axis. * * @throws UnsupportedAxisException is the semantics of this axis are * not supported by this object model. */ Iterator getPrecedingAxisIterator(Object contextNode) throws UnsupportedAxisException; /** Retrieve an Iterator matching the attribute * xpath axis. * * @param contextNode The origin context node. * * @return An Iterator capable of traversing the axis. * * @throws UnsupportedAxisException is the semantics of this axis are * not supported by this object model. */ Iterator getAttributeAxisIterator(Object contextNode) throws UnsupportedAxisException; /** Retrieve an Iterator matching the namespace * xpath axis. * * @param contextNode The origin context node. * * @return An Iterator capable of traversing the axis. * * @throws UnsupportedAxisException is the semantics of this axis are * not supported by this object model. */ Iterator getNamespaceAxisIterator(Object contextNode) throws UnsupportedAxisException; /** Retrieve an Iterator matching the self xpath * axis. * * @param contextNode The origin context node. * * @return An Iterator capable of traversing the axis. * * @throws UnsupportedAxisException is the semantics of this axis are * not supported by this object model. */ Iterator getSelfAxisIterator(Object contextNode) throws UnsupportedAxisException; /** Retrieve an Iterator matching the * descendant-or-self xpath axis. * * @param contextNode The origin context node. * * @return An Iterator capable of traversing the axis. * * @throws UnsupportedAxisException is the semantics of this axis are * not supported by this object model. */ Iterator getDescendantOrSelfAxisIterator(Object contextNode) throws UnsupportedAxisException; /** Retrieve an Iterator matching the * ancestor-or-self xpath axis. * * @param contextNode The origin context node. * * @return An Iterator capable of traversing the axis. * * @throws UnsupportedAxisException is the semantics of this axis are * not supported by this object model. */ Iterator getAncestorOrSelfAxisIterator(Object contextNode) throws UnsupportedAxisException; // ------------------------------------------------------------ // ------------------------------------------------------------ // Extractors // ------------------------------------------------------------ // ------------------------------------------------------------ /** Loads a document from the given URI * * @param uri is the URI of the document to load * * @throws FunctionCallException if the document could not be loaded */ Object getDocument(String uri) throws FunctionCallException; /** Returns the document node that contains the given context node. * * @param object The context node. * * @return The document of the context node. * * @see #isDocument(Object) */ Object getDocumentNode(Object contextNode); /** Returns the parent of the given context node. * *

      * The parent of any node must either be a document * node or an element node. *

      * * @param object The context node. * * @return The parent of the context node. * * @see #isDocument * @see #isElement */ Object getParentNode(Object contextNode) throws UnsupportedAxisException; /** Retrieve the namespace URI of the given element node. * * @param element The context element node. * * @return The namespace URI of the element node. */ String getElementNamespaceUri(Object element); /** Retrieve the name of the given element node. * * @param element The context element node. * * @return The name of the element node. */ String getElementName(Object element); /** Retrieve the QName of the given element node. * * @param element The context element node. * * @return The QName of the element node. */ String getElementQName(Object element); /** Retrieve the namespace URI of the given attribute node. * * @param element The context attribute node. * * @return The namespace URI of the attribute node. */ String getAttributeNamespaceUri(Object attr); /** Retrieve the name of the given attribute node. * * @param element The context attribute node. * * @return The name of the attribute node. */ String getAttributeName(Object attr); /** Retrieve the QName of the given attribute node. * * @param element The context attribute node. * * @return The QName of the attribute node. */ String getAttributeQName(Object attr); /** Retrieve the target of a processing-instruction. * * @param pi The context processing-instruction node. * * @return The target of the processing-instruction node. */ String getProcessingInstructionTarget(Object pi); /** Retrieve the data of a processing-instruction. * * @param pi The context processing-instruction node. * * @return The data of the processing-instruction node. */ String getProcessingInstructionData(Object pi); // ------------------------------------------------------------ // ------------------------------------------------------------ // isXXX testers // ------------------------------------------------------------ // ------------------------------------------------------------ /** Returns whether the given object is a document node. A document node * is the node that is selected by the xpath expression /. * * @param object The object to test. * * @return true if the object is a document node, * else false */ boolean isDocument(Object object); /** Returns whether the given object is an element node. * * @param object The object to test. * * @return true if the object is an element node, * else false */ boolean isElement(Object object); /** Returns whether the given object is an attribute node. * * @param object The object to test. * * @return true if the object is an attribute node, * else false */ boolean isAttribute(Object object); /** Returns whether the given object is a namespace node. * * @param object The object to test. * * @return true if the object is a namespace node, * else false */ boolean isNamespace(Object object); /** Returns whether the given object is a comment node. * * @param object The object to test. * * @return true if the object is a comment node, * else false */ boolean isComment(Object object); /** Returns whether the given object is a text node. * * @param object The object to test. * * @return true if the object is a text node, * else false */ boolean isText(Object object); /** Returns whether the given object is a processing-instruction node. * * @param object The object to test. * * @return true if the object is a processing-instruction node, * else false */ boolean isProcessingInstruction(Object object); // ------------------------------------------------------------ // ------------------------------------------------------------ // String-Value extractors // ------------------------------------------------------------ // ------------------------------------------------------------ /** Retrieve the string-value of a comment node. * * @param comment The comment node. * * @return The string-value of the node. */ String getCommentStringValue(Object comment); /** Retrieve the string-value of an element node. * * @param element The comment node. * * @return The string-value of the node. */ String getElementStringValue(Object element); /** Retrieve the string-value of an attribute node. * * @param attr The attribute node. * * @return The string-value of the node. */ String getAttributeStringValue(Object attr); /** Retrieve the string-value of a namespace node. * * @param attr The namespace node. * * @return The string-value of the node. */ String getNamespaceStringValue(Object ns); /** Retrieve the string-value of a text node. * * @param attr The text node. * * @return The string-value of the node. */ String getTextStringValue(Object txt); // ------------------------------------------------------------ // ------------------------------------------------------------ // General utilities // ------------------------------------------------------------ // ------------------------------------------------------------ /** Retrieve the namespace prefix of a namespace node. * * @param ns The namespace node. * * @return The prefix associated with the node. */ String getNamespacePrefix(Object ns); /** Translate a namespace prefix to a namespace URI, possibly * considering a particular element node. * *

      * Strictly speaking, prefix-to-URI translation should occur * irrespective of any element in the document. This method * is provided to allow a non-conforming ease-of-use enhancement. *

      * * @param prefix The prefix to translate. * @param element The element to consider during translation. * * @return The namespace URI associated with the prefix. * * @see NamespaceContext */ String translateNamespacePrefixToUri(String prefix, Object element); /** Returns a parsed form of the given xpath string, which will be suitable * for queries on documents that use the same navigator as this one. * * @param xpath The xpath expression. * * @return A new XPath expression object. * * @see XPath */ XPath parseXPath(String xpath) throws SAXPathException; /** * Returns the element whose ID is given by elementId. * If no such element exists, returns null. * Attributes with the name "ID" are not of type ID unless so defined. * Implementations that do not know whether attributes are of type ID or * not are expected to return null. * * @param contextNode a node from the document in which to look for the * id * @param elementId id to look for * * @return element whose ID is given by elementId, or null if no such * element exists in the document or if the implementation * does not know about attribute types */ Object getElementById(Object contextNode, String elementId); /** Returns a number that identifies the type of node that the given * object represents in this navigator. * * @see org.jaxen.pattern.Pattern */ short getNodeType(Object node); } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/QualifiedName.java100644 0 0 10706 10525225063 26567 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/QualifiedName.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:34 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: QualifiedName.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; /** A local name (that matches the XML NCName production) and a namespace uri * with which the local name is qualified. * * @author Erwin Bolwidt ( ejb @ klomp.org ) */ class QualifiedName { private String namespaceURI; private String localName; /** Constructs a QualifiedName object. * * @param namespaceURI namespace URI that qualifies the name, or * null for default namespace. * @param localName local name that is qualified by the namespace uri. * must not be null. */ QualifiedName( String namespaceURI, String localName ) { this.namespaceURI = namespaceURI; this.localName = localName; } public String getNamespaceURI() { return namespaceURI; } public String getLocalName() { return localName; } public int hashCode() { return ( localName.hashCode() ^ ( namespaceURI == null ? 0 : namespaceURI.hashCode() ) ); } public boolean equals( Object o ) { if ( !(o instanceof QualifiedName) ) return false; QualifiedName other = (QualifiedName)o; if ( namespaceURI == null ) return ( other.namespaceURI == null && other.localName.equals(localName) ); else return ( namespaceURI.equals(other.namespaceURI) && other.localName.equals(localName) ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/SimpleFunctionContext.java100644 0 0 13013 10525225063 30361 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/SimpleFunctionContext.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:00 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: SimpleFunctionContext.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; import java.util.HashMap; /** Simple default implementation of FunctionContext. * *

      * This is a simple table-based key-lookup implementation * for FunctionContext which can be programmatically * extended by registering additional functions. *

      * * @see XPathFunctionContext * * @author bob mcwhirter */ public class SimpleFunctionContext implements FunctionContext { /** Table of functions. */ private HashMap functions; /** Construct. * *

      * Construct with an empty function lookup table. *

      */ public SimpleFunctionContext() { this.functions = new HashMap(); } /** Register a new function. * *

      * By registering a new function, any XPath expression * that utilizes this FunctionContext may * refer-to and use the new function. *

      * *

      * Functions may exist either in an namespace or not. * Namespace prefix-to-URI resolution is the responsibility * of a {@link NamespaceContext}. Within this FunctionContext * functions are only referenced using the URI, not * the prefix. *

      * *

      * The namespace URI of a function may be null * to indicate that it exists without a namespace. *

      * * @param namespaceURI The namespace URI of the function to * be registered with this context. * @param localName The non-prefixed local portion of the * function to be registered with this context. * @param function A {@link Function} implementation object * to be used when evaluating the function. */ public void registerFunction(String namespaceURI, String localName, Function function ) { this.functions.put( new QualifiedName(namespaceURI, localName), function ); } public Function getFunction(String namespaceURI, String prefix, String localName ) throws UnresolvableException { Object key = new QualifiedName( namespaceURI, localName ); if ( this.functions.containsKey(key) ) return (Function) this.functions.get( key ); else throw new UnresolvableException( "Function " + prefix + ":" + localName ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/SimpleNamespaceContext.java100644 0 0 11574 10525225063 30502 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/SimpleNamespaceContext.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:34 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: SimpleNamespaceContext.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; import java.io.Serializable; import java.util.Iterator; import java.util.Map; import java.util.HashMap; /** * Provides mappings from namespace prefix to namespace URI to the xpath * engine. */ public class SimpleNamespaceContext implements NamespaceContext, Serializable { private Map namespaces; public SimpleNamespaceContext() { this.namespaces = new HashMap(); } public SimpleNamespaceContext(Map namespaces) { this.namespaces = namespaces; } /** * Adds all the namespace declarations that are in scope on the given * element. In the case of an XSLT stylesheet, this would be the element * that has the xpath expression in one of its attributes; i.e. * <xsl:if test="condition/xpath/expression">. * * @param nav the navigator for use in conjunction with * element * @param element the element to copy the namespaces from */ public void addElementNamespaces( Navigator nav, Object element ) throws UnsupportedAxisException { Iterator namespaceAxis = nav.getNamespaceAxisIterator( element ); while ( namespaceAxis.hasNext() ) { Object namespace = namespaceAxis.next(); String prefix = nav.getNamespacePrefix( namespace ); String uri = nav.getNamespaceStringValue( namespace ); if ( translateNamespacePrefixToUri(prefix) == null ) { addNamespace( prefix, uri ); } } } public void addNamespace(String prefix, String namespaceUri) { this.namespaces.put( prefix, namespaceUri ); } public String translateNamespacePrefixToUri(String prefix) { if ( this.namespaces.containsKey( prefix ) ) { return (String) this.namespaces.get( prefix ); } return null; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/SimpleVariableContext.java100644 0 0 13466 10525225063 30335 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/SimpleVariableContext.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:34 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: SimpleVariableContext.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; import java.io.Serializable; import java.util.Map; import java.util.HashMap; /** Simple default implementation for VariableContext. * *

      * This is a simple table-based key-lookup implementation * for VariableContext which can be programmatically * extended by setting additional variables. *

      * * @author bob mcwhirter */ public class SimpleVariableContext implements VariableContext, Serializable { /** Table of variable bindings. */ private Map variables; /** Construct. * *

      * Construct with an empty variable lookup table. *

      */ public SimpleVariableContext() { variables = new HashMap(); } /** Set the value associated with a variable. * *

      * This method sets a variable that is * associated with any particular namespace. * These variables appear such as $prefix:foo * in an XPath expression. Prefix to URI resolution * is the responsibility of a NamespaceContext. * Variables within a VariableContext are * refered to purely based upon their namespace URI, * if any. *

      * * @param namespaceURI The namespace URI of the variable. * @param localName The local name of the variable * @param value The value to be bound to the variable. */ public void setVariableValue( String namespaceURI, String localName, Object value ) { this.variables.put( new QualifiedName(namespaceURI, localName), value ); } /** Set the value associated with a variable. * *

      * This method sets a variable that is not * associated with any particular namespace. * These variables appear such as $foo * in an XPath expression. *

      * * @param localName The local name of the variable * @param value The value to be bound to the variable. */ public void setVariableValue( String localName, Object value ) { this.variables.put( new QualifiedName(null, localName), value ); } public Object getVariableValue( String namespaceURI, String prefix, String localName ) throws UnresolvableException { Object key = new QualifiedName( namespaceURI, localName ); if ( this.variables.containsKey(key) ) { return this.variables.get( key ); } else { throw new UnresolvableException( "Variable {" + namespaceURI + "}" + prefix + ":" + localName ); } } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/UnresolvableException.java100644 0 0 6465 10525225063 30372 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/UnresolvableException.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:34 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: UnresolvableException.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; /** Used when a function-call or variable-reference, or any other lookup * based on namespace and local name, couldn't be resolved. * * @author Erwin Bolwidt (ejb @ klomp.org) */ public class UnresolvableException extends JaxenException { public UnresolvableException(String message) { super( message ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/UnsupportedAxisException.java100644 0 0 6562 10525225063 31104 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/UnsupportedAxisException.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:34 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: UnsupportedAxisException.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; /** Indicates attempt to evaluate an XPath axis that * is unsupported by the current object-model. * * @author bob mcwhirter */ public class UnsupportedAxisException extends JaxenException { /** Construct. * * @param msg The error message. */ public UnsupportedAxisException(String msg) { super( msg ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/VariableContext.java100644 0 0 12607 10525225063 27157 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/VariableContext.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:34 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: VariableContext.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; /** Resolves variable bindings within an XPath expression. * *

      * Variables within an XPath expression are denoted using * notation such as $varName or $nsPrefix:varName, and may * refer to primitive types (Boolean, Number or String), * node-sets or individual XML nodes. *

      * *

      * When a variable is bound to a node-set, the * actual Java object returned should be a java.util.List * containing XML nodes from the object-model (dom4j, JDOM, DOM, EXML) * being used with the XPath. *

      * *

      * A variable may validly be assigned the null value, * but an unbound variable (one that this context does not know about) * should cause an {@link UnresolvableException} to be thrown. *

      * * @see SimpleVariableContext * @see NamespaceContext * * @author bob mcwhirter * @author James Strachan */ public interface VariableContext { /** An implementation should return the value of an xpath variable * based on the namespace uri and local name of the variable-reference * expression. * *

      * It must not use the prefix parameter to select a variable, * because a prefix could be bound to any namespace; the prefix parameter * could be used in debugging output or other generated information. * The prefix may otherwise be ignored. *

      * * @param namespaceURI the namespace uri to which the prefix parameter * is bound in the xpath expression. If the variable * reference expression had no prefix, the namespace * uri is null. * @param prefix the prefix that was used in the variable reference * expression. * @param localName the local name of the variable-reference * expression; if there is no prefix, then this is * the whole name of the variable. * * @return the variable's value (which can be null) * @throws UnresolvableException when the variable cannot be resolved. */ public Object getVariableValue( String namespaceURI, String prefix, String localName ) throws UnresolvableException; } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/XPath.java100644 0 0 35265 10525225063 25116 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/XPath.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:00 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: XPath.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; import java.util.List; /** * Defines the interface to an object which represents an XPath 1.0 expression which * can be evaluated against a variety of different XML object models. * *

      * Most of the evaluation methods take a context object. This is typically a * node or node set object (which is typically a List of node objects) or * a Jaxen Context object. * A null context is allowed, meaning that * there is no XML nodes on which to evaluate. *

      * * @see org.jaxen.dom4j.Dom4jXPath XPath for dom4j * @see org.jaxen.jdom.JDOMXPath XPath for JDOM * @see org.jaxen.dom.DOMXPath XPath for W3C DOM * @see org.jaxen.exml.ElectricXPath XPath for Electric XML * * @author bob mcwhirter * @author James Strachan */ public interface XPath { /** Evaluate this XPath against a given context. * *

      * The context of evaluation my be a document, * an element, or a set of elements. *

      * *

      * If the expression evaluates to a single primitive * (String, Number or Boolean) type, it is returned * directly. Otherwise, the returned value is a * List (a node-set, in the terms of the * specification) of values. *

      * *

      * When using this method, one must be careful to * test the class of the returned objects, and of * each of the composite members if a List * is returned. If the returned members are XML entities, * they will be the actual Document, * Element or Attribute objects * as defined by the concrete XML object-model implementation, * directly from the context document. This does not * return copies of anything, but merely returns * references to entities within the source document. *

      * * @param The node, nodeset or Context object for evaluation. This value can be null * * @return The result of evaluating the XPath expression * against the supplied context. */ public Object evaluate(Object context) throws JaxenException; /** Select all nodes that are selectable by this XPath * expression. If multiple nodes match, multiple nodes * will be returned. * *

      * NOTE: In most cases, nodes will be returned * in document-order, as defined by the XML Canonicalization * specification. The exception occurs when using XPath * expressions involving the union operator * (denoted with the pipe '|' character). *

      * * @param The node, nodeset or Context object for evaluation. This value can be null * * @return The node-set of all items selected * by this XPath expression. * * @see #selectSingleNode */ public List selectNodes(Object context) throws JaxenException; /** Select only the first node that is selectable by this XPath * expression. If multiple nodes match, only one node will be * returned. * * NOTE: In most cases, the selected node will be the first * selectable node in document-order, as defined by the XML Canonicalization * specification. The exception occurs when using XPath * expressions involving the union operator * (denoted with the pipe '|' character). *

      * * @param The node, nodeset or Context object for evaluation. This value can be null * * @return The node-set of all items selected * by this XPath expression. * * @see #selectNodes */ public Object selectSingleNode(Object context) throws JaxenException; /** Retrieve a string-value interpretation of this XPath * expression when evaluated against a given context. * *

      * The string-value of the expression is determined per * the string(..) core function as defined * in the XPath specification. This means that an expression * that selects more than one nodes will return the string value * of the first node in the node set.. *

      * * @param The node, nodeset or Context object for evaluation. This value can be null * * @return The string-value interpretation of this expression. * * @deprecated As of Jaxen 1.0 RC1 please use * {@link #stringValueOf(Object) instead} */ public String valueOf(Object context) throws JaxenException; /** Retrieve a string-value interpretation of this XPath * expression when evaluated against a given context. * *

      * The string-value of the expression is determined per * the string(..) core function as defined * in the XPath specification. This means that an expression * that selects more than one nodes will return the string value * of the first node in the node set.. *

      * * @param The node, nodeset or Context object for evaluation. This value can be null * * @return The string-value interpretation of this expression. */ public String stringValueOf(Object context) throws JaxenException; /** Retrieve a boolean-value interpretation of this XPath * expression when evaluated against a given context. * *

      * The boolean-value of the expression is determined per * the boolean(..) core function as defined * in the XPath specification. This means that an expression * that selects zero nodes will return false, * while an expression that selects one-or-more nodes will * return true. *

      * * @param The node, nodeset or Context object for evaluation. This value can be null * * @return The boolean-value interpretation of this expression. */ public boolean booleanValueOf(Object context) throws JaxenException; /** Retrieve a number-value interpretation of this XPath * expression when evaluated against a given context. * *

      * The number-value of the expression is determined per * the number(..) core function as defined * in the XPath specification. This means that if this * expression selects multiple nodes, the number-value * of the first node is returned. *

      * * @param The node, nodeset or Context object for evaluation. This value can be null * * @return The number-value interpretation of this expression. */ public Number numberValueOf(Object context) throws JaxenException; // Helpers /** Add a namespace prefix-to-URI mapping for this XPath * expression. * *

      * Namespace prefix-to-URI mappings in an XPath are independant * of those used within any document. Only the mapping explicitly * added to this XPath will be available for resolving the * XPath expression. *

      * *

      * This is a convenience method for adding mappings to the * default {@link NamespaceContext} in place for this XPath. * If you have installed a specific custom NamespaceContext, * then this method will throw a JaxenException. *

      * * @param prefix The namespace prefix. * @param uri The namespace URI. * * @throws JaxenException If a NamespaceContext * used by this XPath has been explicitly installed. */ public void addNamespace(String prefix, String uri) throws JaxenException; // ------------------------------------------------------------ // ------------------------------------------------------------ // Properties // ------------------------------------------------------------ // ------------------------------------------------------------ /** Set a NamespaceContext for use with this * XPath expression. * *

      * A NamespaceContext is responsible for translating * namespace prefixes within the expression into namespace URIs. *

      * * @param namespaceContext The NamespaceContext to * install for this expression. * * @see NamespaceContext * @see NamespaceContext#translateNamespacePrefixToUri */ public void setNamespaceContext(NamespaceContext namespaceContext); /** Set a FunctionContext for use with this XPath * expression. * *

      * A FunctionContext is responsible for resolving * all function calls used within the expression. *

      * * @param functionContext The FunctionContext to * install for this expression. * * @see FunctionContext * @see FunctionContext#getFunction */ public void setFunctionContext(FunctionContext functionContext); /** Set a VariableContext for use with this XPath * expression. * *

      * A VariableContext is responsible for resolving * all variables referenced within the expression. *

      * * @param variableContext The VariableContext to * install for this expression. * * @see VariableContext * @see VariableContext#getVariableValue */ public void setVariableContext(VariableContext variableContext); /** Retrieve the NamespaceContext used by this XPath * expression. * *

      * A FunctionContext is responsible for resolving * all function calls used within the expression. *

      * *

      * If this XPath expression has not previously had a NamespaceContext * installed, a new default NamespaceContext will be created, * installed and returned. *

      * * @return The NamespaceContext used by this expression. * * @see NamespaceContext */ public NamespaceContext getNamespaceContext(); /** Retrieve the FunctionContext used by this XPath * expression. * *

      * A FunctionContext is responsible for resolving * all function calls used within the expression. *

      * *

      * If this XPath expression has not previously had a FunctionContext * installed, a new default FunctionContext will be created, * installed and returned. *

      * * @return The FunctionContext used by this expression. * * @see FunctionContext */ public FunctionContext getFunctionContext(); /** Retrieve the VariableContext used by this XPath * expression. * *

      * A VariableContext is responsible for resolving * all variables referenced within the expression. *

      * *

      * If this XPath expression has not previously had a VariableContext * installed, a new default VariableContext will be created, * installed and returned. *

      * * @return The VariableContext used by this expression. * * @see VariableContext */ public VariableContext getVariableContext(); /** Retrieve the XML object-model-specific {@link Navigator} * for us in evaluating this XPath expression. * * @return The implementation-specific Navigator. */ public Navigator getNavigator(); } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/XPathFunctionContext.java100644 0 0 22426 10525225063 30164 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/XPathFunctionContext.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:00 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: XPathFunctionContext.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; import org.xmlpull.v1.builder.xpath.jaxen.function.*; import org.xmlpull.v1.builder.xpath.jaxen.function.ext.*; /** A FunctionContext implementing the core XPath * function library, with extensions. * *

      * The core XPath function library is provided through this * implementation of FunctionContext. Additionally, * extension functions have been provided, as enumerated below. *

      * *

      * This class implements a Singleton pattern (see {@link #getInstance}), * as it is perfectly re-entrant and thread-safe. If using the * singleton, it is inadvisable to call {@link #registerFunction} * as that will extend the global function context, affecting other * users of the singleton. But that's your call, really, now isn't * it? That may be what you really want to do. *

      * *

      * Extension functions: * *

        *
      • matrix-concat(..)
      • *
      • evaluate(..)
      • *
      * * @see FunctionContext * * @author bob mcwhirter */ public class XPathFunctionContext extends SimpleFunctionContext { /** Singleton implementation. */ private static class Singleton { /** Singleton instance. */ private static XPathFunctionContext instance = new XPathFunctionContext(); } /** Retrieve the singleton instance. * * @return The singleton instance. */ public static FunctionContext getInstance() { return Singleton.instance; } /** Construct. * *

      * Construct with all core XPath functions registered. *

      */ public XPathFunctionContext() { registerFunction( null, // namespace URI "boolean", new BooleanFunction() ); registerFunction( null, // namespace URI "ceiling", new CeilingFunction() ); registerFunction( null, // namespace URI "concat", new ConcatFunction() ); registerFunction( null, // namespace URI "contains", new ContainsFunction() ); registerFunction( null, // namespace URI "count", new CountFunction() ); registerFunction( null, // namespace URI "document", new DocumentFunction() ); registerFunction( null, // namespace URI "false", new FalseFunction() ); registerFunction( null, // namespace URI "floor", new FloorFunction() ); registerFunction( null, // namespace URI "id", new IdFunction() ); registerFunction( null, // namespace URI "last", new LastFunction() ); registerFunction( null, // namespace URI "local-name", new LocalNameFunction() ); registerFunction( null, // namespace URI "name", new NameFunction() ); registerFunction( null, // namespace URI "namespace-uri", new NamespaceUriFunction() ); registerFunction( null, // namespace URI "normalize-space", new NormalizeSpaceFunction() ); registerFunction( null, // namespace URI "not", new NotFunction() ); registerFunction( null, // namespace URI "number", new NumberFunction() ); registerFunction( null, // namespace URI "position", new PositionFunction() ); registerFunction( null, // namespace URI "round", new RoundFunction() ); registerFunction( null, // namespace URI "starts-with", new StartsWithFunction() ); registerFunction( null, // namespace URI "string", new StringFunction() ); registerFunction( null, // namespace URI "string-length", new StringLengthFunction() ); registerFunction( null, // namespace URI "substring-after", new SubstringAfterFunction() ); registerFunction( null, // namespace URI "substring-before", new SubstringBeforeFunction() ); registerFunction( null, // namespace URI "substring", new SubstringFunction() ); registerFunction( null, // namespace URI "sum", new SumFunction() ); registerFunction( null, // namespace URI "true", new TrueFunction() ); registerFunction( null, // namespace URI "translate", new TranslateFunction() ); // register extension functions // extension functions should go into a namespace, but which one? // for now, keep them in default namespace to not to break any code registerFunction( null, // namespace URI "matrix-concat", new MatrixConcatFunction() ); registerFunction( null, // namespace URI "evaluate", new EvaluateFunction() ); registerFunction( null, // namespace URI "lower-case", new LowerFunction() ); registerFunction( null, // namespace URI "upper-case", new UpperFunction() ); registerFunction( null, // namespace URI "ends-with", new EndsWithFunction() ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/XPathSyntaxException.java100644 0 0 12642 10525225063 30176 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/XPathSyntaxException.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:34 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: XPathSyntaxException.java,v 1.1 2004/06/16 15:55:34 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen; /** Indicates an error during parsing of an XPath * expression. * * @see XPath * * @author bob mcwhirter * @author James Strachan */ public class XPathSyntaxException extends JaxenException { /** The textual xpath expression. */ private String xpath; /** The position of the error. */ private int position; /** Construct. * * @param xpath The erroneous xpath. * @param position The position of the error. * @param message The error message. */ public XPathSyntaxException(String xpath, int position, String message) { super( message ); this.xpath = xpath; this.position = position; } /** Retrieve the position of the error. * * @return The position of the error. */ public int getPosition() { return this.position; } /** Retrieve the expression containing the error. * * @return The erroneous expression. */ public String getXPath() { return this.xpath; } /** Retrieve a string useful for denoting where * the error occured. * *

      * This is a string composed of whitespace and * a marker at the position (see {@link #getPosition}) * of the error. This is useful for creating * friendly multi-line error displays. *

      * * @return The error position marker. */ public String getPositionMarker() { StringBuffer buf = new StringBuffer(); int pos = getPosition(); for ( int i = 0 ; i < pos ; ++i ) { buf.append(" "); } buf.append("^"); return buf.toString(); } /** Retrieve the friendly multi-line error message. * *

      * This returns a multi-line string that contains * the original erroneous xpath expression with a * marker underneath indicating exactly where the * error occurred. *

      * * @return The multi-line error message. */ public String getMultilineMessage() { StringBuffer buf = new StringBuffer(); buf.append( getMessage() ); buf.append( "\n" ); buf.append( getXPath() ); buf.append( "\n" ); buf.append( getPositionMarker() ); return buf.toString(); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/BinaryExpr.java100644 0 0 6056 10525225063 27107 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/BinaryExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: BinaryExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; public interface BinaryExpr extends Expr { Expr getLHS(); Expr getRHS(); } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultAbsoluteLocationPath.java100644 0 0 10700 10525225063 32424 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultAbsoluteLocationPath.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultAbsoluteLocationPath.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import java.util.List; import java.util.ArrayList; import java.util.Collections; public class DefaultAbsoluteLocationPath extends DefaultLocationPath { public DefaultAbsoluteLocationPath() { } public String toString() { return "[(DefaultAbsoluteLocationPath): " + super.toString() + "]"; } public boolean isAbsolute() { return true; } public String getText() { return "/" + super.getText(); } public Object evaluate(Context context) throws JaxenException { ContextSupport support = context.getContextSupport(); Navigator nav = support.getNavigator(); Context absContext = new Context( support ); List contextNodes = context.getNodeSet(); if ( contextNodes.isEmpty() ) { return Collections.EMPTY_LIST; } Object firstNode = contextNodes.get( 0 ); Object docNode = nav.getDocumentNode( firstNode ); if ( docNode == null ) { return Collections.EMPTY_LIST; } List list = new ArrayList(1); list.add( docNode ); absContext.setNodeSet( list ); return super.evaluate( absContext ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultAdditiveExpr.java100644 0 0 6456 10525225063 30725 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultAdditiveExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultAdditiveExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; abstract class DefaultAdditiveExpr extends DefaultArithExpr { public DefaultAdditiveExpr(Expr lhs, Expr rhs) { super( lhs, rhs ); } public String toString() { return "[(DefaultAdditiveExpr): " + getLHS() + ", " + getRHS() + "]"; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultAllNodeStep.java100644 0 0 7111 10525225063 30474 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultAllNodeStep.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultAllNodeStep.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.expr.iter.IterableAxis; public class DefaultAllNodeStep extends DefaultStep { public DefaultAllNodeStep(IterableAxis axis) { super( axis ); } public String toString() { return "[(DefaultAllNodeStep): " + getAxisName() + "]"; } public String getText() { return getAxisName() + "::node()" + super.getText(); } public boolean matches(Object node, ContextSupport contextSupport) { return true; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultAndExpr.java100644 0 0 10103 10525225063 27676 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultAndExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultAndExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.function.BooleanFunction; class DefaultAndExpr extends DefaultLogicalExpr { public DefaultAndExpr(Expr lhs, Expr rhs) { super( lhs, rhs ); } public String getOperator() { return "and"; } public String toString() { return "[(DefaultAndExpr): " + getLHS() + ", " + getRHS() + "]"; } public Object evaluate(Context context) throws JaxenException { Navigator nav = context.getNavigator(); Boolean lhsValue = BooleanFunction.evaluate( getLHS().evaluate( context ), nav ); if ( lhsValue == Boolean.FALSE ) { return Boolean.FALSE; } Boolean rhsValue = BooleanFunction.evaluate( getRHS().evaluate( context ), nav ); if ( rhsValue == Boolean.FALSE ) { return Boolean.FALSE; } return Boolean.TRUE; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultArithExpr.java100644 0 0 7077 10525225063 30243 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultArithExpr.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:00 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultArithExpr.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; abstract class DefaultArithExpr extends DefaultBinaryExpr { public DefaultArithExpr(Expr lhs, Expr rhs) { super( lhs, rhs ); } public String toString() { return "[(DefaultArithExpr): " + getLHS() + ", " + getRHS() + "]"; } public void assertInteger( Number number ) throws JaxenException { if( number.doubleValue() != number.intValue() ) { throw new JaxenException( number + " is not an integer" ); } } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultBinaryExpr.java100644 0 0 7765 10525225063 30424 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultBinaryExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultBinaryExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; abstract class DefaultBinaryExpr extends DefaultExpr implements BinaryExpr { private Expr lhs; private Expr rhs; public DefaultBinaryExpr(Expr lhs, Expr rhs) { this.lhs = lhs; this.rhs = rhs; } public Expr getLHS() { return this.lhs; } public Expr getRHS() { return this.rhs; } public void setLHS(Expr lhs) { this.lhs = lhs; } public void setRHS(Expr rhs) { this.rhs = rhs; } public abstract String getOperator(); public String getText() { Expr lhs = getLHS(); Expr rhs = getRHS(); return "(" + getLHS().getText() + " " + getOperator() + " " + getRHS().getText() + ")"; } public String toString() { return "[(" + getClass().getName() + "): " + getLHS() + ", " + getRHS() + "]"; } public Expr simplify() { setLHS( getLHS().simplify() ); setRHS( getRHS().simplify() ); return this; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultCommentNodeStep.java100644 0 0 7310 10525225063 31367 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultCommentNodeStep.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultCommentNodeStep.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.expr.iter.IterableAxis; public class DefaultCommentNodeStep extends DefaultStep { public DefaultCommentNodeStep(IterableAxis axis) { super( axis ); } public String toString() { return "[(DefaultCommentNodeStep): " + getAxis() + "]"; } public String getText() { return getAxisName() + "::comment()"; } public boolean matches(Object node, ContextSupport contextSupport) { Navigator nav = contextSupport.getNavigator(); return nav.isComment( node ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultDivExpr.java100644 0 0 7613 10525225063 27712 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultDivExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultDivExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.jaxen.function.NumberFunction; class DefaultDivExpr extends DefaultMultiplicativeExpr { public DefaultDivExpr(Expr lhs, Expr rhs) { super( lhs, rhs ); } public String getOperator() { return "div"; } public Object evaluate(Context context) throws JaxenException { Number lhsValue = NumberFunction.evaluate( getLHS().evaluate( context ), context.getNavigator() ); Number rhsValue = NumberFunction.evaluate( getRHS().evaluate( context ), context.getNavigator() ); double result = lhsValue.doubleValue() / rhsValue.doubleValue(); return new Double( result ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultEqualityExpr.java100644 0 0 14317 10525225063 31004 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultEqualityExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultEqualityExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import java.util.List; import java.util.Iterator; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.jaxen.function.StringFunction; import org.xmlpull.v1.builder.xpath.jaxen.function.BooleanFunction; import org.xmlpull.v1.builder.xpath.jaxen.function.NumberFunction; abstract class DefaultEqualityExpr extends DefaultTruthExpr { public DefaultEqualityExpr( Expr lhs, Expr rhs ) { super( lhs, rhs ); } public String toString() { return "[(DefaultEqualityExpr): " + getLHS() + ", " + getRHS() + "]"; } public Object evaluate( Context context ) throws JaxenException { Object lhsValue = getLHS().evaluate( context ); Object rhsValue = getRHS().evaluate( context ); if( lhsValue == null || rhsValue == null ) { return Boolean.FALSE; } Navigator nav = context.getNavigator(); if( bothAreSets( lhsValue, rhsValue ) ) { return evaluateSetSet( (List) lhsValue, (List) rhsValue, nav ); } else if ( eitherIsSet( lhsValue, rhsValue ) ) { if ( isSet( lhsValue ) ) { return evaluateSetSet( (List) lhsValue, convertToList( rhsValue ), nav ); } else { return evaluateSetSet( convertToList( lhsValue ), (List) rhsValue, nav ); } } else { return evaluateObjectObject( lhsValue, rhsValue, nav ) ? Boolean.TRUE : Boolean.FALSE; } } private Boolean evaluateSetSet( List lhsSet, List rhsSet, Navigator nav ) { if( setIsEmpty( lhsSet ) || setIsEmpty( rhsSet ) ) { return Boolean.FALSE; } for( Iterator lhsIterator = lhsSet.iterator(); lhsIterator.hasNext(); ) { Object lhs = lhsIterator.next(); for( Iterator rhsIterator = rhsSet.iterator(); rhsIterator.hasNext(); ) { Object rhs = rhsIterator.next(); if( evaluateObjectObject( lhs, rhs, nav ) ) { return Boolean.TRUE; } } } return Boolean.FALSE; } private boolean evaluateObjectObject( Object lhs, Object rhs, Navigator nav ) { if( eitherIsBoolean( lhs, rhs ) ) { return evaluateObjectObject( BooleanFunction.evaluate( lhs, nav ), BooleanFunction.evaluate( rhs, nav ) ); } else if( eitherIsNumber( lhs, rhs ) ) { return evaluateObjectObject( NumberFunction.evaluate( lhs, nav ), NumberFunction.evaluate( rhs, nav ) ); } else { return evaluateObjectObject( StringFunction.evaluate( lhs, nav ), StringFunction.evaluate( rhs, nav ) ); } } protected abstract boolean evaluateObjectObject( Object lhs, Object rhs ); } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultEqualsExpr.java100644 0 0 7227 10525225063 30423 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultEqualsExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultEqualsExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.function.NumberFunction; class DefaultEqualsExpr extends DefaultEqualityExpr { public DefaultEqualsExpr( Expr lhs, Expr rhs ) { super( lhs, rhs ); } public String getOperator() { return "="; } public String toString() { return "[(DefaultEqualsExpr): " + getLHS() + ", " + getRHS() + "]"; } protected boolean evaluateObjectObject( Object lhs, Object rhs ) { if( eitherIsNumber( lhs, rhs ) ) { if( NumberFunction.isNaN( (Double) lhs ) || NumberFunction.isNaN( (Double) rhs ) ) { return false; } } return lhs.equals( rhs ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultExpr.java100644 0 0 7411 10525225063 27243 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultExpr.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:00 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultExpr.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.util.SingleObjectIterator; import java.util.List; import java.util.ArrayList; import java.util.Iterator; public abstract class DefaultExpr implements Expr { public Expr simplify() { return this; } static public Iterator convertToIterator(Object obj) { if ( obj instanceof Iterator ) { return (Iterator) obj; } if ( obj instanceof List ) { return ((List)obj).iterator(); } return new SingleObjectIterator( obj ); } static public List convertToList(Object obj) { if ( obj instanceof List ) { return (List) obj; } List list = new ArrayList( 1 ); list.add( obj ); return list; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultFilterExpr.java100644 0 0 13277 10525225063 30440 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultFilterExpr.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:00 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultFilterExpr.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import java.util.ArrayList; import java.util.List; public class DefaultFilterExpr extends DefaultExpr implements FilterExpr, Predicated { private Expr expr; private PredicateSet predicates; public DefaultFilterExpr() { this.predicates = new PredicateSet(); } public DefaultFilterExpr(Expr expr) { this.expr = expr; this.predicates = new PredicateSet(); } public void addPredicate(Predicate predicate) { this.predicates.addPredicate( predicate ); } public List getPredicates() { return this.predicates.getPredicates(); } public PredicateSet getPredicateSet() { return this.predicates; } public Expr getExpr() { return this.expr; } public String toString() { return "[(DefaultFilterExpr): expr: " + expr + " predicates: " + predicates + " ]"; } public String getText() { String text = ""; if ( this.expr != null ) { text = this.expr.getText(); } text += predicates.getText(); return text; } public Expr simplify() { this.predicates.simplify(); if ( this.expr != null ) { this.expr = this.expr.simplify(); } if ( this.predicates.getPredicates().size() == 0 ) { return getExpr(); } return this; } /** Returns true if the current filter matches at least one of the context nodes */ public boolean asBoolean(Context context) throws JaxenException { Object results = null; if ( expr != null ) { results = expr.evaluate( context ); } else { ArrayList list = new ArrayList(1); list.addAll( context.getNodeSet() ); results = list; } if ( results instanceof Boolean ) { Boolean b = (Boolean) results; return b.booleanValue(); } if ( results instanceof List ) { return getPredicateSet().evaluateAsBoolean( (List) results, context.getContextSupport() ); } return false; } public Object evaluate(Context context) throws JaxenException { Object results = getExpr().evaluate( context ); if ( results instanceof List ) { List newresults = getPredicateSet().evaluatePredicates( (List) results, context.getContextSupport() ); results = newresults; } return results; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultFunctionCallExpr.java100644 0 0 14567 10525225063 31577 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultFunctionCallExpr.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:00 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultFunctionCallExpr.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import java.util.List; import java.util.ArrayList; import java.util.Iterator; class DefaultFunctionCallExpr extends DefaultExpr implements FunctionCallExpr { private String prefix; private String functionName; private List parameters; public DefaultFunctionCallExpr(String prefix, String functionName) { this.prefix = prefix; this.functionName = functionName; this.parameters = new ArrayList(); } public void addParameter(Expr parameter) { this.parameters.add( parameter ); } public List getParameters() { return this.parameters; } public String getPrefix() { return this.prefix; } public String getFunctionName() { return this.functionName; } public String getText() { StringBuffer buf = new StringBuffer(); String prefix = getPrefix(); if ( prefix != null && ! prefix.equals("") ) { buf.append( prefix ); buf.append( ":" ); } buf.append( getFunctionName() ); buf.append( "(" ); Iterator paramIter = getParameters().iterator(); Expr eachParam = null; while ( paramIter.hasNext() ) { eachParam = (Expr) paramIter.next(); buf.append( eachParam.getText() ); if ( paramIter.hasNext() ) { buf.append( ", " ); } } buf.append( ")" ); return buf.toString(); } public Expr simplify() { List paramExprs = getParameters(); int paramSize = paramExprs.size(); Expr eachParam = null; List newParams = new ArrayList( paramSize ); for ( int i = 0 ; i < paramSize ; ++i ) { eachParam = (Expr) paramExprs.get( i ); newParams.add( eachParam.simplify() ); } this.parameters = newParams; return this; } public String toString() { String prefix = getPrefix(); if ( prefix == null ) { return "[(DefaultFunctionCallExpr): " + getFunctionName() + "(" + getParameters() + ") ]"; } return "[(DefaultFunctionCallExpr): " + getPrefix() + ":" + getFunctionName() + "(" + getParameters() + ") ]"; } public Object evaluate(Context context) throws JaxenException { String namespaceURI = context.translateNamespacePrefixToUri( getPrefix() ); Function func = context.getFunction( namespaceURI, getPrefix(), getFunctionName() ); List paramExprs = getParameters(); int paramSize = paramExprs.size(); List paramValues = new ArrayList( paramSize ); Expr eachParam = null; Object eachValue = null; for ( int i = 0 ; i < paramSize ; ++i ) { eachParam = (Expr) paramExprs.get( i ); eachValue = eachParam.evaluate( context ); paramValues.add( eachValue ); } return func.call( context, paramValues ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultGreaterThanEqualExpr.java100644 0 0 6533 10525225063 32364 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultGreaterThanEqualExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultGreaterThanEqualExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; class DefaultGreaterThanEqualExpr extends DefaultRelationalExpr { public DefaultGreaterThanEqualExpr( Expr lhs, Expr rhs ) { super( lhs, rhs ); } public String getOperator() { return ">="; } protected boolean evaluateDoubleDouble( Double lhs, Double rhs ) { return lhs.compareTo( rhs ) >= 0; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultGreaterThanExpr.java100644 0 0 6505 10525225063 31373 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultGreaterThanExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultGreaterThanExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; class DefaultGreaterThanExpr extends DefaultRelationalExpr { public DefaultGreaterThanExpr( Expr lhs, Expr rhs ) { super( lhs, rhs ); } public String getOperator() { return ">"; } protected boolean evaluateDoubleDouble( Double lhs, Double rhs ) { return lhs.compareTo( rhs ) > 0; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultLessThanEqualExpr.java100644 0 0 6517 10525225063 31703 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultLessThanEqualExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultLessThanEqualExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; class DefaultLessThanEqualExpr extends DefaultRelationalExpr { public DefaultLessThanEqualExpr( Expr lhs, Expr rhs ) { super( lhs, rhs ); } public String getOperator() { return "<="; } protected boolean evaluateDoubleDouble( Double lhs, Double rhs ) { return lhs.compareTo( rhs ) <= 0; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultLessThanExpr.java100644 0 0 6465 10525225063 30715 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultLessThanExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultLessThanExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; class DefaultLessThanExpr extends DefaultRelationalExpr { public DefaultLessThanExpr( Expr lhs, Expr rhs ) { super( lhs, rhs ); } public String getOperator() { return "<"; } protected boolean evaluateDoubleDouble( Double lhs, Double rhs ) { return lhs.compareTo( rhs ) < 0; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultLiteralExpr.java100644 0 0 7072 10525225063 30563 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultLiteralExpr.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:00 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultLiteralExpr.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; class DefaultLiteralExpr extends DefaultExpr implements LiteralExpr { private String literal; public DefaultLiteralExpr(String literal) { this.literal = literal; } public String getLiteral() { return this.literal; } public String toString() { return "[(DefaultLiteralExpr): " + getLiteral() + "]"; } public String getText() { return "\"" + getLiteral() + "\""; } public Object evaluate(Context context) { return getLiteral(); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultLocationPath.java100644 0 0 16061 10525225063 30733 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultLocationPath.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:00 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultLocationPath.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.jaxen.util.IdentityHashMap; import java.util.List; import java.util.ArrayList; import java.util.LinkedList; import java.util.Iterator; import java.util.Map; abstract class DefaultLocationPath extends DefaultExpr implements LocationPath { private List steps; private final static Object PRESENT = new Object(); public DefaultLocationPath() { this.steps = new LinkedList(); } public void addStep(Step step) { getSteps().add( step ); } public List getSteps() { return this.steps; } public Expr simplify() { Iterator stepIter = getSteps().iterator(); Step eachStep = null; while ( stepIter.hasNext() ) { eachStep = (Step) stepIter.next(); eachStep.simplify(); } return this; } public String getText() { StringBuffer buf = new StringBuffer(); Iterator stepIter = getSteps().iterator(); while ( stepIter.hasNext() ) { buf.append( ((Step)stepIter.next()).getText() ); if ( stepIter.hasNext() ) { buf.append( "/" ); } } return buf.toString(); } public String toString() { StringBuffer buf = new StringBuffer(); Iterator stepIter = getSteps().iterator(); while( stepIter.hasNext() ) { buf.append( stepIter.next().toString() ); if ( stepIter.hasNext() ) { buf.append("/"); } } return buf.toString(); } public boolean isAbsolute() { return false; } public Object evaluate(Context context) throws JaxenException { List contextNodeSet = new ArrayList(); Map unique = new IdentityHashMap(); contextNodeSet.addAll( context.getNodeSet() ); Object eachContextNode = null; Iterator stepIter = getSteps().iterator(); Step eachStep = null; List newNodeSet = new ArrayList(); int contextSize = 0; OUTTER: while ( stepIter.hasNext() ) { eachStep = (Step) stepIter.next(); contextSize = contextNodeSet.size(); INNER: for ( int i = 0 ; i < contextSize ; ++i ) { eachContextNode = contextNodeSet.get( i ); Iterator axisNodeIter = eachStep.axisIterator( eachContextNode, context.getContextSupport() ); if ( axisNodeIter == null ) { continue INNER; } Object eachAxisNode = null; List interimSet=new ArrayList(); while ( axisNodeIter.hasNext() ) { eachAxisNode = axisNodeIter.next(); // System.err.println( "----> " + eachAxisNode + " // " + eachStep.matches( eachAxisNode, context.getContextSupport() ) ); if ( eachStep.matches( eachAxisNode, context.getContextSupport() ) ) { if ( ! unique.containsKey( eachAxisNode ) ) { unique.put( eachAxisNode, PRESENT ); interimSet.add( eachAxisNode ); } } } List filtered = eachStep.getPredicateSet().evaluatePredicates(interimSet,context.getContextSupport() ); newNodeSet.addAll(filtered); } contextNodeSet.clear(); contextNodeSet.addAll( newNodeSet ); newNodeSet.clear(); unique.clear(); } return contextNodeSet; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultLogicalExpr.java100644 0 0 6261 10525225063 30540 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultLogicalExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultLogicalExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; abstract class DefaultLogicalExpr extends DefaultTruthExpr { public DefaultLogicalExpr(Expr lhs, Expr rhs) { super( lhs, rhs ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultMinusExpr.java100644 0 0 7620 10525225063 30261 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultMinusExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultMinusExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.jaxen.function.NumberFunction; class DefaultMinusExpr extends DefaultAdditiveExpr { public DefaultMinusExpr(Expr lhs, Expr rhs) { super( lhs, rhs ); } public String getOperator() { return "-"; } public Object evaluate(Context context) throws JaxenException { Number lhsValue = NumberFunction.evaluate( getLHS().evaluate( context ), context.getNavigator() ); Number rhsValue = NumberFunction.evaluate( getRHS().evaluate( context ), context.getNavigator() ); double result = lhsValue.doubleValue() - rhsValue.doubleValue(); return new Double( result ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultModExpr.java100644 0 0 7731 10525225063 27710 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultModExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultModExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.jaxen.function.NumberFunction; class DefaultModExpr extends DefaultMultiplicativeExpr { public DefaultModExpr(Expr lhs, Expr rhs) { super( lhs, rhs ); } public String getOperator() { return "mod"; } public Object evaluate(Context context) throws JaxenException { Number lhsValue = NumberFunction.evaluate( getLHS().evaluate( context ), context.getNavigator() ); Number rhsValue = NumberFunction.evaluate( getRHS().evaluate( context ), context.getNavigator() ); assertInteger( lhsValue ); assertInteger( rhsValue ); int result = lhsValue.intValue() % rhsValue.intValue(); return new Double( result ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultMultiplicativeExpr.java100644 0 0 6522 10525225063 32161 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultMultiplicativeExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultMultiplicativeExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; abstract class DefaultMultiplicativeExpr extends DefaultArithExpr { public DefaultMultiplicativeExpr(Expr lhs, Expr rhs) { super( lhs, rhs ); } public String toString() { return "[(DefaultMultiplicativeExpr): " + getLHS() + ", " + getRHS() + "]"; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultMultiplyExpr.java100644 0 0 7640 10525225063 31007 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultMultiplyExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultMultiplyExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.jaxen.function.NumberFunction; class DefaultMultiplyExpr extends DefaultMultiplicativeExpr { public DefaultMultiplyExpr(Expr lhs, Expr rhs) { super( lhs, rhs ); } public String getOperator() { return "*"; } public Object evaluate(Context context) throws JaxenException { Number lhsValue = NumberFunction.evaluate( getLHS().evaluate( context ), context.getNavigator() ); Number rhsValue = NumberFunction.evaluate( getRHS().evaluate( context ), context.getNavigator() ); double result = lhsValue.doubleValue() * rhsValue.doubleValue(); return new Double( result ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultNameStep.java100644 0 0 17770 10525225063 30072 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultNameStep.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultNameStep.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.expr.iter.IterableAxis; /** Expression object that represents any flavor * of name-test steps within an XPath. * *

      * This includes simple steps, such as "foo", * non-default-axis steps, such as "following-sibling::foo" * or "@foo", and namespace-aware steps, such * as "foo:bar". *

      * * @author bob mcwhirter (bob@werken.com) */ public class DefaultNameStep extends DefaultStep { /** Our prefix, bound through the current Context. * The empty-string ("") if no prefix was specified. * Decidedly NOT-NULL, due to SAXPath constraints. */ private String prefix; /** Our local-name.*/ private String localName; /** Quick flag denoting if the localname was '*' */ private boolean matchesAnyName; public DefaultNameStep(IterableAxis axis, String prefix, String localName) { super( axis ); this.prefix = prefix; this.localName = localName; this.matchesAnyName = "*".equals( localName ); } public String getPrefix() { return this.prefix; } public String getLocalName() { return this.localName; } public boolean isMatchesAnyName() { return matchesAnyName; } public String getText() { if ( ( getPrefix() != null ) && ( ! getPrefix().equals("") ) ) { return getAxisName() + "::" + getPrefix() + ":" + getLocalName() + super.getText(); } return getAxisName() + "::" + getLocalName() + super.getText(); } public String toString() { return "[(DefaultNameStep): " + getPrefix() + ":" + getLocalName() + "[" + super.toString() + "]]"; } public boolean matches(Object node, ContextSupport contextSupport) { //System.err.println( "DefaultNameStep.matches(" + node + ")" ); Navigator nav = contextSupport.getNavigator(); String myPrefix = getPrefix(); String myUri = null; boolean hasPrefix = ( myPrefix != null ) && (! ( "".equals( myPrefix ) ) ); String nodeUri = null; String nodeName = null; if ( nav.isElement( node ) ) { nodeUri = nav.getElementNamespaceUri( node ); nodeName = nav.getElementName( node ); } else if ( nav.isAttribute( node ) ) { nodeUri = nav.getAttributeNamespaceUri( node ); nodeName = nav.getAttributeName( node ); } else if ( nav.isDocument( node ) ) { return ( ! hasPrefix ) && matchesAnyName; } else if ( nav.isNamespace( node ) ) { nodeUri = null; nodeName = nav.getNamespacePrefix( node ); } else { // * will only match elements on most axis return false; } // System.out.println( "Matching nodeURI: " + nodeUri + " name: " + nodeName ); if ( hasPrefix ) { myUri = contextSupport.translateNamespacePrefixToUri( myPrefix ); } else if ( matchesAnyName ) { return true; } // If we have a prefix that does not map to no namespace, // but the node doesn't have *any* namespace-uri, then we fast-fail. if ( ( myUri != null && !"".equals( myUri ) ) && ( nodeUri == null || "".equals( nodeUri ) ) ) { return false; } // If we don't have a prefix, but the node does // have any namespace-uri, then we fast-fail. if ( ! hasPrefix && ( nodeUri != null && ! "".equals( nodeUri ) ) ) { return false; } // To fail-fast, we check the equality of // local-names first. Shorter strings compare // quicker. if ( getLocalName().equals( nodeName ) || matchesAnyName ) { if ( ! hasPrefix ) { return true; } return matchesNamespaceURIs( myUri, nodeUri ); } return false; } /** @return true if the two namespace URIs are equal * Note that we may wish to consider null being equal to "" */ protected boolean matchesNamespaceURIs( String u1, String u2 ) { //System.out.println( "Comparing URI: " + u1 + " against URI: " + u2 ); if ( u1 == u2 ) { return true; } if ( u1 == null ) { u1 = ""; } if ( u2 == null ) { u2 = ""; } return u1.equals( u2 ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultNotEqualsExpr.java100644 0 0 7246 10525225063 31105 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultNotEqualsExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultNotEqualsExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.function.NumberFunction; class DefaultNotEqualsExpr extends DefaultEqualityExpr { public DefaultNotEqualsExpr( Expr lhs, Expr rhs ) { super( lhs, rhs ); } public String getOperator() { return "!="; } public String toString() { return "[(DefaultNotEqualsExpr): " + getLHS() + ", " + getRHS() + "]"; } protected boolean evaluateObjectObject( Object lhs, Object rhs ) { if( eitherIsNumber( lhs, rhs ) ) { if( NumberFunction.isNaN( (Double) lhs ) || NumberFunction.isNaN( (Double) rhs ) ) { return true; } } return !lhs.equals( rhs ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultNumberExpr.java100644 0 0 7050 10525225063 30413 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultNumberExpr.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:00 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultNumberExpr.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; class DefaultNumberExpr extends DefaultExpr implements NumberExpr { private Number number; public DefaultNumberExpr(Number number) { this.number = number; } public Number getNumber() { return this.number; } public String toString() { return "[(DefaultNumberExpr): " + getNumber() + "]"; } public String getText() { return getNumber().toString(); } public Object evaluate(Context context) { return getNumber(); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultOrExpr.java100644 0 0 10073 10525225063 27562 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultOrExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultOrExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.function.BooleanFunction; class DefaultOrExpr extends DefaultLogicalExpr { public DefaultOrExpr(Expr lhs, Expr rhs) { super( lhs, rhs ); } public String getOperator() { return "or"; } public String toString() { return "[(DefaultOrExpr): " + getLHS() + ", " + getRHS() + "]"; } public Object evaluate(Context context) throws JaxenException { Navigator nav = context.getNavigator(); Boolean lhsValue = BooleanFunction.evaluate( getLHS().evaluate( context ), nav ); if ( lhsValue == Boolean.TRUE ) { return Boolean.TRUE; } Boolean rhsValue = BooleanFunction.evaluate( getRHS().evaluate( context ), nav ); if ( rhsValue == Boolean.TRUE ) { return Boolean.TRUE; } return Boolean.FALSE; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultPathExpr.java100644 0 0 11760 10525225063 30102 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultPathExpr.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:00 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultPathExpr.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; class DefaultPathExpr extends DefaultExpr implements PathExpr { private Expr filterExpr; private LocationPath locationPath; public DefaultPathExpr(Expr filterExpr, LocationPath locationPath) { this.filterExpr = filterExpr; this.locationPath = locationPath; } public Expr getFilterExpr() { return this.filterExpr; } public void setFilterExpr(Expr filterExpr) { this.filterExpr = filterExpr; } public LocationPath getLocationPath() { return this.locationPath; } public String toString() { if ( getLocationPath() != null ) { return "[(DefaultPathExpr): " + getFilterExpr() + ", " + getLocationPath() + "]"; } return "[(DefaultPathExpr): " + getFilterExpr() + "]"; } public String getText() { StringBuffer buf = new StringBuffer(); if ( getFilterExpr() != null ) { buf.append( getFilterExpr().getText() ); } if ( getLocationPath() != null ) { buf.append( getLocationPath().getText() ); } return buf.toString(); } public Expr simplify() { if ( getFilterExpr() != null ) { setFilterExpr( getFilterExpr().simplify() ); } if ( getLocationPath() != null ) { getLocationPath().simplify(); } if ( getLocationPath() == null ) { return getFilterExpr(); } if ( getFilterExpr() == null ) { return getLocationPath(); } return this; } public Object evaluate(Context context) throws JaxenException { Object results = getFilterExpr().evaluate( context ); context.setNodeSet( convertToList( results ) ); return getLocationPath().evaluate( context ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultPlusExpr.java100644 0 0 7620 10525225063 30111 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultPlusExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultPlusExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.jaxen.function.NumberFunction; class DefaultPlusExpr extends DefaultAdditiveExpr { public DefaultPlusExpr(Expr lhs, Expr rhs) { super( lhs, rhs ); } public String getOperator() { return "+"; } public Object evaluate(Context context) throws JaxenException { Number lhsValue = NumberFunction.evaluate( getLHS().evaluate( context ), context.getNavigator() ); Number rhsValue = NumberFunction.evaluate( getRHS().evaluate( context ), context.getNavigator() ); double result = lhsValue.doubleValue() + rhsValue.doubleValue(); return new Double( result ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultPredicate.java100644 0 0 7377 10525225063 30240 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultPredicate.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:00 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultPredicate.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; class DefaultPredicate implements Predicate { private Expr expr; public DefaultPredicate(Expr expr) { setExpr( expr ); } public Expr getExpr() { return this.expr; } public void setExpr(Expr expr) { this.expr = expr; } public String getText() { return "[" + getExpr().getText() + "]"; } public String toString() { return "[(DefaultPredicate): " + getExpr() + "]"; } public void simplify() { setExpr( getExpr().simplify() ); } public Object evaluate(Context context) throws JaxenException { return getExpr().evaluate( context ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultPredicated.java100644 0 0 10546 10525225063 30414 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultPredicated.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultPredicated.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import java.util.List; import java.util.ArrayList; import java.util.Iterator; class DefaultPredicated { private List predicates; protected DefaultPredicated() { this.predicates = new ArrayList(); } public List getPredicates() { return this.predicates; } public void addPredicate(Predicate predicate) { getPredicates().add( predicate ); } public String getText() { StringBuffer buf = new StringBuffer(); Iterator predIter = getPredicates().iterator(); while ( predIter.hasNext() ) { buf.append( ((Predicate)predIter.next()).getText() ); } return buf.toString(); } public String toString() { StringBuffer buf = new StringBuffer(); Iterator predIter = getPredicates().iterator(); while( predIter.hasNext() ) { buf.append( predIter.next().toString() ); if ( predIter.hasNext() ) { buf.append(", "); } } return buf.toString(); } public void simplifyAllPredicates() { Iterator predIter = getPredicates().iterator(); Predicate eachPred = null; while ( predIter.hasNext() ) { eachPred = (Predicate) predIter.next(); eachPred.simplify(); } } } ././@LongLink100644 0 0 155 10525225067 10260 Lustar 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultProcessingInstructionNodeStep.javaxpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultProcessingInstructionNodeS100644 0 0 10117 10525225063 32731 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultProcessingInstructionNodeStep.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultProcessingInstructionNodeStep.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.expr.iter.IterableAxis; public class DefaultProcessingInstructionNodeStep extends DefaultStep { private String name; public DefaultProcessingInstructionNodeStep(IterableAxis axis, String name) { super( axis ); this.name = name; } public String getName() { return this.name; } public boolean matches(Object node, ContextSupport support) { Navigator nav = support.getNavigator(); boolean isPi = nav.isProcessingInstruction( node ); if ( isPi ) { String name = getName(); if ( name == null || "".equals( name ) ) { return true; } else { return name.equals( nav.getProcessingInstructionTarget( node ) ); } } return false; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultRelationalExpr.java100644 0 0 13005 10525225063 31272 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultRelationalExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultRelationalExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import java.util.List; import java.util.Iterator; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.jaxen.function.NumberFunction; abstract class DefaultRelationalExpr extends DefaultTruthExpr { public DefaultRelationalExpr( Expr lhs, Expr rhs ) { super( lhs, rhs ); } public String toString() { return "[(DefaultRelationalExpr): " + getLHS() + ", " + getRHS() + "]"; } public Object evaluate( Context context ) throws JaxenException { Object lhsValue = getLHS().evaluate( context ); Object rhsValue = getRHS().evaluate( context ); Navigator nav = context.getNavigator(); if( bothAreSets( lhsValue, rhsValue ) ) { return evaluateSetSet( (List) lhsValue, (List) rhsValue, nav ); } if( eitherIsSet( lhsValue, rhsValue ) ) { if( isSet( lhsValue ) ) { return evaluateSetSet( (List) lhsValue, convertToList( rhsValue ), nav ); } else { return evaluateSetSet( convertToList( lhsValue ), (List) rhsValue, nav ); } } return evaluateObjectObject( lhsValue, rhsValue, nav ) ? Boolean.TRUE : Boolean.FALSE; } private Object evaluateSetSet( List lhsSet, List rhsSet, Navigator nav ) { if( setIsEmpty( lhsSet ) || setIsEmpty( rhsSet ) ) // return false if either is null or empty { return Boolean.FALSE; } for( Iterator lhsIterator = lhsSet.iterator(); lhsIterator.hasNext(); ) { Object lhs = lhsIterator.next(); for( Iterator rhsIterator = rhsSet.iterator(); rhsIterator.hasNext(); ) { Object rhs = rhsIterator.next(); if( evaluateObjectObject( lhs, rhs, nav ) ) { return Boolean.TRUE; } } } return Boolean.FALSE; } private boolean evaluateObjectObject( Object lhs, Object rhs, Navigator nav ) { if( lhs == null || rhs == null ) { return false; } Double lhsNum = NumberFunction.evaluate( lhs, nav ); Double rhsNum = NumberFunction.evaluate( rhs, nav ); if( NumberFunction.isNaN( lhsNum ) || NumberFunction.isNaN( rhsNum ) ) { return false; } return evaluateDoubleDouble( lhsNum, rhsNum ); } protected abstract boolean evaluateDoubleDouble( Double lhs, Double rhs ); } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultRelativeLocationPath.java100644 0 0 6362 10525225063 32412 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultRelativeLocationPath.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultRelativeLocationPath.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; public class DefaultRelativeLocationPath extends DefaultLocationPath { public DefaultRelativeLocationPath() { } public String toString() { return "[(DefaultRelativeLocationPath): " + super.toString() + "]"; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultStep.java100644 0 0 11045 10525225063 27256 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultStep.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:00 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultStep.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; import org.xmlpull.v1.builder.xpath.jaxen.expr.iter.IterableAxis; import org.xmlpull.v1.builder.xpath.saxpath.Axis; import java.util.List; import java.util.Iterator; public abstract class DefaultStep implements Step { private IterableAxis axis; private PredicateSet predicates; public DefaultStep(IterableAxis axis) { this.axis = axis; this.predicates = new PredicateSet(); } public void addPredicate(Predicate predicate) { this.predicates.addPredicate( predicate ); } public List getPredicates() { return this.predicates.getPredicates(); } public PredicateSet getPredicateSet() { return this.predicates; } public int getAxis() { return this.axis.value(); } public IterableAxis getIterableAxis() { return this.axis; } public String getAxisName() { return Axis.lookup( getAxis() ); } public String getText() { return this.predicates.getText(); } public String toString() { return getIterableAxis() + " " + super.toString(); } public void simplify() { this.predicates.simplify(); } public Iterator axisIterator(Object contextNode, ContextSupport support) throws UnsupportedAxisException { return getIterableAxis().iterator( contextNode, support ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultTextNodeStep.java100644 0 0 7120 10525225063 30710 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultTextNodeStep.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultTextNodeStep.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.expr.iter.IterableAxis; public class DefaultTextNodeStep extends DefaultStep { public DefaultTextNodeStep(IterableAxis axis) { super( axis ); } public boolean matches(Object node, ContextSupport support) { Navigator nav = support.getNavigator(); return nav.isText( node ); } public String getText() { return getAxisName() + "::text()" + super.getText(); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultTruthExpr.java100644 0 0 11502 10525225063 30306 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultTruthExpr.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:00 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultTruthExpr.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import java.util.List; abstract class DefaultTruthExpr extends DefaultBinaryExpr { public DefaultTruthExpr(Expr lhs, Expr rhs) { super( lhs, rhs ); } public String toString() { return "[(DefaultTruthExpr): " + getLHS() + ", " + getRHS() + "]"; } protected boolean bothAreSets(Object lhs, Object rhs) { return ( lhs instanceof List && rhs instanceof List ); } protected boolean eitherIsSet(Object lhs, Object rhs) { return ( lhs instanceof List || rhs instanceof List ); } protected boolean isSet(Object obj) { return ( obj instanceof List ); } protected boolean setIsEmpty( List set ) { return (set == null || set.size() == 0); } protected boolean eitherIsBoolean(Object lhs, Object rhs) { return ( lhs instanceof Boolean || rhs instanceof Boolean ); } protected boolean bothAreBoolean(Object lhs, Object rhs) { return ( lhs instanceof Boolean && rhs instanceof Boolean ); } protected boolean eitherIsNumber(Object lhs, Object rhs) { return ( lhs instanceof Number || rhs instanceof Number ); } protected boolean isNumber(Object obj) { return ( obj instanceof Number ); } protected boolean isString(Object obj) { return ( obj instanceof String ); } protected boolean isBoolean(Object obj) { return ( obj instanceof Boolean ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultUnaryExpr.java100644 0 0 7702 10525225063 30265 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultUnaryExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultUnaryExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.jaxen.function.NumberFunction; class DefaultUnaryExpr extends DefaultExpr implements UnaryExpr { private Expr expr; public DefaultUnaryExpr(Expr expr) { this.expr = expr; } public Expr getExpr() { return this.expr; } public String toString() { return "[(DefaultUnaryExpr): " + getExpr() + "]"; } public String getText() { return "-(" + getExpr().getText() + ")"; } public Expr simplify() { expr = expr.simplify(); return this; } public Object evaluate(Context context) throws JaxenException { Number number = NumberFunction.evaluate( getExpr().evaluate( context ), context.getNavigator() ); return new Double( number.doubleValue() * -1 ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultUnionExpr.java100644 0 0 10465 10525225063 30277 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultUnionExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultUnionExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import java.util.List; import java.util.ArrayList; import java.util.Set; import java.util.HashSet; import java.util.Iterator; public class DefaultUnionExpr extends DefaultBinaryExpr implements UnionExpr { public DefaultUnionExpr(Expr lhs, Expr rhs) { super( lhs, rhs ); } public String getOperator() { return "|"; } public String toString() { return "[(DefaultUnionExpr): " + getLHS() + ", " + getRHS() + "]"; } public Object evaluate(Context context) throws JaxenException { List results = new ArrayList(); List lhsResults = convertToList( getLHS().evaluate( context ) ); List rhsResults = convertToList( getRHS().evaluate( context ) ); Set unique = new HashSet(); results.addAll( lhsResults ); unique.addAll( lhsResults ); Iterator rhsIter = rhsResults.iterator(); Object each = null; while ( rhsIter.hasNext() ) { each = rhsIter.next(); if ( ! unique.contains( each ) ) { results.add( each ); unique.add( each ); } } return results; } } ././@LongLink100644 0 0 145 10525225067 10257 Lustar 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultVariableReferenceExpr.javaxpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultVariableReferenceExpr.java100644 0 0 10773 10525225063 32555 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultVariableReferenceExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultVariableReferenceExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.UnresolvableException; class DefaultVariableReferenceExpr extends DefaultExpr implements VariableReferenceExpr { private String prefix; private String variableName; public DefaultVariableReferenceExpr(String prefix, String variableName) { this.prefix = prefix; this.variableName = variableName; } public String getPrefix() { return this.prefix; } public String getVariableName() { return this.variableName; } public String toString() { String prefix = getPrefix(); if ( prefix == null ) { return "[(DefaultVariableReferenceExpr): " + getVariableName() + "]"; } return "[(DefaultVariableReferenceExpr): " + getPrefix() + ":" + getVariableName() + "]"; } public String getText() { String prefix = getPrefix(); if ( prefix == null ) { return "$" + getVariableName(); } return "$" + prefix + ":" + getVariableName(); } public Object evaluate(Context context) throws UnresolvableException { String namespaceURI = context.translateNamespacePrefixToUri( getPrefix() ); return context.getVariableValue( namespaceURI, getPrefix(), getVariableName() ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultXPathExpr.java100644 0 0 7544 10525225063 30217 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultXPathExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultXPathExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import java.util.List; public class DefaultXPathExpr implements XPathExpr { private Expr rootExpr; public DefaultXPathExpr(Expr rootExpr) { this.rootExpr = rootExpr; } public Expr getRootExpr() { return this.rootExpr; } public void setRootExpr(Expr rootExpr) { this.rootExpr = rootExpr; } public String toString() { return "[(DefaultXPath): " + getRootExpr() + "]"; } public String getText() { return getRootExpr().getText(); } public void simplify() { setRootExpr( getRootExpr().simplify() ); } public List asList(Context context) throws JaxenException { return DefaultExpr.convertToList( getRootExpr().evaluate( context ) ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultXPathFactory.java100644 0 0 31142 10525225063 30717 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultXPathFactory.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DefaultXPathFactory.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.jaxen.expr.iter.*; import org.xmlpull.v1.builder.xpath.saxpath.Axis; public class DefaultXPathFactory implements XPathFactory { public XPathExpr createXPath(Expr rootExpr) throws JaxenException { return new DefaultXPathExpr( rootExpr ); } public PathExpr createPathExpr(FilterExpr filterExpr, LocationPath locationPath) throws JaxenException { return new DefaultPathExpr( filterExpr, locationPath ); } public LocationPath createRelativeLocationPath() throws JaxenException { return new DefaultRelativeLocationPath(); } public LocationPath createAbsoluteLocationPath() throws JaxenException { return new DefaultAbsoluteLocationPath(); } public BinaryExpr createOrExpr(Expr lhs, Expr rhs) throws JaxenException { return new DefaultOrExpr( lhs, rhs ); } public BinaryExpr createAndExpr(Expr lhs, Expr rhs) throws JaxenException { return new DefaultAndExpr( lhs, rhs ); } public BinaryExpr createEqualityExpr(Expr lhs, Expr rhs, int equalityOperator) throws JaxenException { switch ( equalityOperator ) { case EQUALS: { return new DefaultEqualsExpr( lhs, rhs ); } case NOT_EQUALS: { return new DefaultNotEqualsExpr( lhs, rhs ); } } throw new JaxenException( "Unhandled operator in createEqualityExpr(): " + equalityOperator ); } public BinaryExpr createRelationalExpr(Expr lhs, Expr rhs, int relationalOperator) throws JaxenException { switch ( relationalOperator ) { case LESS_THAN: { return new DefaultLessThanExpr( lhs, rhs ); } case GREATER_THAN: { return new DefaultGreaterThanExpr( lhs, rhs ); } case LESS_THAN_EQUALS: { return new DefaultLessThanEqualExpr( lhs, rhs ); } case GREATER_THAN_EQUALS: { return new DefaultGreaterThanEqualExpr( lhs, rhs ); } } throw new JaxenException( "Unhandled operator in createRelationalExpr(): " + relationalOperator ); } public BinaryExpr createAdditiveExpr(Expr lhs, Expr rhs, int additiveOperator) throws JaxenException { switch ( additiveOperator ) { case ADD: { return new DefaultPlusExpr( lhs, rhs ); } case SUBTRACT: { return new DefaultMinusExpr( lhs, rhs ); } } throw new JaxenException( "Unhandled operator in createAdditiveExpr(): " + additiveOperator ); } public BinaryExpr createMultiplicativeExpr(Expr lhs, Expr rhs, int multiplicativeOperator) throws JaxenException { switch ( multiplicativeOperator ) { case MULTIPLY: { return new DefaultMultiplyExpr( lhs, rhs ); } case DIV: { return new DefaultDivExpr( lhs, rhs ); } case MOD: { return new DefaultModExpr( lhs, rhs ); } } throw new JaxenException( "Unhandled operator in createMultiplicativeExpr(): " + multiplicativeOperator ); } public Expr createUnaryExpr(Expr expr, int unaryOperator) throws JaxenException { switch ( unaryOperator ) { case NEGATIVE: { return new DefaultUnaryExpr( expr ); } } return expr; } public UnionExpr createUnionExpr(Expr lhs, Expr rhs) throws JaxenException { return new DefaultUnionExpr( lhs, rhs ); } public FilterExpr createFilterExpr(Expr expr) throws JaxenException { return new DefaultFilterExpr( expr ); } public FunctionCallExpr createFunctionCallExpr(String prefix, String functionName) throws JaxenException { return new DefaultFunctionCallExpr( prefix, functionName ); } public NumberExpr createNumberExpr(int number) throws JaxenException { // return new DefaultNumberExpr( new Integer(number) ); return new DefaultNumberExpr( new Double(number) ); } public NumberExpr createNumberExpr(double number) throws JaxenException { return new DefaultNumberExpr( new Double(number) ); } public LiteralExpr createLiteralExpr(String literal) throws JaxenException { return new DefaultLiteralExpr( literal ); } public VariableReferenceExpr createVariableReferenceExpr(String prefix, String variable) throws JaxenException { return new DefaultVariableReferenceExpr( prefix, variable ); } public Step createNameStep(int axis, String prefix, String localName) throws JaxenException { IterableAxis iter = getIterableAxis( axis ); return new DefaultNameStep( iter, prefix, localName ); } public Step createTextNodeStep(int axis) throws JaxenException { IterableAxis iter = getIterableAxis( axis ); return new DefaultTextNodeStep( iter ); } public Step createCommentNodeStep(int axis) throws JaxenException { IterableAxis iter = getIterableAxis( axis ); return new DefaultCommentNodeStep( iter ); } public Step createAllNodeStep(int axis) throws JaxenException { IterableAxis iter = getIterableAxis( axis ); return new DefaultAllNodeStep( iter ); } public Step createProcessingInstructionNodeStep(int axis, String piName) throws JaxenException { IterableAxis iter = getIterableAxis( axis ); return new DefaultProcessingInstructionNodeStep( iter, piName ); } public Predicate createPredicate(Expr predicateExpr) throws JaxenException { return new DefaultPredicate( predicateExpr ); } protected IterableAxis getIterableAxis(int axis) { IterableAxis iter = null; switch ( axis ) { case Axis.CHILD: { iter = new IterableChildAxis( axis ); break; } case Axis.DESCENDANT: { iter = new IterableDescendantAxis( axis ); break; } case Axis.PARENT: { iter = new IterableParentAxis( axis ); break; } case Axis.FOLLOWING_SIBLING: { iter = new IterableFollowingSiblingAxis( axis ); break; } case Axis.PRECEDING_SIBLING: { iter = new IterablePrecedingSiblingAxis( axis ); break; } case Axis.FOLLOWING: { iter = new IterableFollowingAxis( axis ); break; } case Axis.PRECEDING: { iter = new IterablePrecedingAxis( axis ); break; } case Axis.ATTRIBUTE: { iter = new IterableAttributeAxis( axis ); break; } case Axis.NAMESPACE: { iter = new IterableNamespaceAxis( axis ); break; } case Axis.SELF: { iter = new IterableSelfAxis( axis ); break; } case Axis.DESCENDANT_OR_SELF: { iter = new IterableDescendantOrSelfAxis( axis ); break; } case Axis.ANCESTOR_OR_SELF: { iter = new IterableAncestorOrSelfAxis( axis ); break; } case Axis.ANCESTOR: { iter = new IterableAncestorAxis( axis ); break; } } return iter; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/Expr.java100644 0 0 7152 10525225063 25740 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/Expr.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:00 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: Expr.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import java.io.Serializable; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; public interface Expr extends Serializable { String getText(); Expr simplify(); // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- /* List asList(Context context); Iterator asIterator(Context context); String asString(Context context); Boolean asBoolean(Context context); Number asNumber(Context context); */ Object evaluate(Context context) throws JaxenException; } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/FilterExpr.java100644 0 0 6505 10525225063 27107 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/FilterExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: FilterExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; public interface FilterExpr extends Expr, Predicated { /** Evaluates the filter expression on the current context * and returns true if at least one node matches. */ public boolean asBoolean(Context context) throws JaxenException; } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/FunctionCallExpr.java100644 0 0 6101 10525225063 30233 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/FunctionCallExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: FunctionCallExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; public interface FunctionCallExpr extends Expr { void addParameter(Expr parameter); } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/LiteralExpr.java100644 0 0 6014 10525225063 27251 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/LiteralExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: LiteralExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; public interface LiteralExpr extends Expr { } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/LocationPath.java100644 0 0 6226 10525225063 27410 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/LocationPath.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: LocationPath.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import java.util.List; public interface LocationPath extends Expr { void addStep(Step step); List getSteps(); String getText(); public boolean isAbsolute(); } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/NumberExpr.java100644 0 0 6011 10525225063 27102 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/NumberExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: NumberExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; public interface NumberExpr extends Expr { } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/PathExpr.java100644 0 0 6152 10525225063 26554 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/PathExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: PathExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; public interface PathExpr extends Expr { Expr getFilterExpr(); void setFilterExpr(Expr filterExpr); LocationPath getLocationPath(); } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/Predicate.java100644 0 0 6465 10525225063 26730 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/Predicate.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:00 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: Predicate.java,v 1.2 2005/08/11 22:44:00 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import java.io.Serializable; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; public interface Predicate extends Serializable { Expr getExpr(); void setExpr(Expr expr); void simplify(); String getText(); Object evaluate(Context context) throws JaxenException; } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/PredicateSet.java100644 0 0 21466 10525225063 27422 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/PredicateSet.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: PredicateSet.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.jaxen.function.BooleanFunction; import java.io.Serializable; import java.util.List; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; class PredicateSet implements Serializable { private List predicates; public PredicateSet() { this.predicates = Collections.EMPTY_LIST; } public void addPredicate(Predicate predicate) { if ( this.predicates == Collections.EMPTY_LIST ) { this.predicates = new ArrayList(); } this.predicates.add( predicate ); } public List getPredicates() { return this.predicates; } public void simplify() { Iterator predIter = this.predicates.iterator(); Predicate eachPred = null; while ( predIter.hasNext() ) { eachPred = (Predicate) predIter.next(); eachPred.simplify(); } } public String getText() { StringBuffer buf = new StringBuffer(); Iterator predIter = this.predicates.iterator(); Predicate eachPred = null; while ( predIter.hasNext() ) { eachPred = (Predicate) predIter.next(); buf.append( eachPred.getText() ); } return buf.toString(); } // XXXX: Note - this could be *MUCH* more efficient // currently this creates many redundant collections and should halt // evaluation on the first matching item. protected boolean evaluateAsBoolean(List contextNodeSet, ContextSupport support) throws JaxenException { List result = evaluatePredicates( contextNodeSet, support ); return ! result.isEmpty(); } protected List evaluatePredicates(List contextNodeSet, ContextSupport support) throws JaxenException { // Easy way out (necessary) if (predicates.size()==0) return contextNodeSet; List newNodeSet = new ArrayList(); List filterSet = contextNodeSet; List predicates = getPredicates(); Iterator predIter = predicates.iterator(); Predicate eachPred = null; Object contextNode = null; Object predResult = null; Context predContext = new Context( support ); // Filter the 'filterSet' against all predicates. This has been // tuned for performance, so there are two separate loops // In the first run, all nodes matching the first predicate will // be copied from contextNodeSet to newNodeSet // In the second loop, newNodeSet is filtered progressively against // the remaining predicates, eliminating any non-matching nodes if ( predIter.hasNext() ) { eachPred = (Predicate) predIter.next(); int filterSize = filterSet.size(); for ( int i = 0 ; i < filterSize ; ++i ) { contextNode = filterSet.get( i ); List list = new ArrayList( 1 ); list.add( contextNode ); predContext.setNodeSet( list ); predContext.setPosition( i + 1 ); predContext.setSize( filterSize ); predResult = eachPred.evaluate( predContext ); if ( predResult instanceof Number ) { int proximity = ((Number)predResult).intValue(); if ( proximity == ( i + 1 ) ) { newNodeSet.add( contextNode ); } } else { Boolean includes = BooleanFunction.evaluate( predResult, predContext.getNavigator() ); if ( includes.booleanValue() ) { newNodeSet.add( contextNode ); } } } } // This will be true if any filtering takes place from here on boolean nodesFiltered = false; // Second loop: Filter filterSet until no more predicates are left filterSet = newNodeSet; while ( predIter.hasNext() ) { eachPred = (Predicate) predIter.next(); int filterSize = filterSet.size(); for ( int i = 0 ; i < filterSize ; ++i ) { contextNode = filterSet.get(i); // Check if a node has been eliminated already if (contextNode == null) continue; List list = new ArrayList( 1 ); list.add( contextNode ); predContext.setNodeSet( list ); predContext.setPosition( i + 1 ); predContext.setSize( filterSize ); predResult = eachPred.evaluate( predContext ); if ( predResult instanceof Number ) { int proximity = ((Number)predResult).intValue(); if ( proximity != ( i + 1 ) ) { filterSet.set(i,null); nodesFiltered = true; } } else { Boolean includes = BooleanFunction.evaluate( predResult, predContext.getNavigator() ); if ( !includes.booleanValue() ) { filterSet.set(i,null); nodesFiltered = true; } } } } // Go through the filtered set and delete any null nodes (if necessary) if (nodesFiltered) { // System.err.println("FILTERING"); Iterator iter=filterSet.iterator(); while (iter.hasNext()) { Object obj=iter.next(); if (obj==null) iter.remove(); } } return filterSet; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/Predicated.java100644 0 0 6260 10525225063 27065 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/Predicated.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: Predicated.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import java.io.Serializable; import java.util.List; public interface Predicated extends Serializable { void addPredicate(Predicate predicate); List getPredicates(); PredicateSet getPredicateSet(); } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/Step.java100644 0 0 7134 10525225063 25735 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/Step.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: Step.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; import java.util.Iterator; //public interface Step extends Predicated, Expr public interface Step extends Predicated { boolean matches(Object node, ContextSupport contextSupport); String getText(); void simplify(); public int getAxis(); /* Iterator asIterator(Iterator contextIterator, ContextSupport support); */ Iterator axisIterator(Object contextNode, ContextSupport support) throws UnsupportedAxisException; } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/UnaryExpr.java100644 0 0 6031 10525225063 26752 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/UnaryExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: UnaryExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; public interface UnaryExpr extends Expr { Expr getExpr(); } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/UnionExpr.java100644 0 0 6013 10525225063 26744 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/UnionExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: UnionExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; public interface UnionExpr extends BinaryExpr { } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/VariableReferenceExpr.java100644 0 0 6052 10525225063 31223 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/VariableReferenceExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: VariableReferenceExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; public interface VariableReferenceExpr extends Expr { } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/XPathExpr.java100644 0 0 6522 10525225063 26705 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/XPathExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: XPathExpr.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import java.io.Serializable; import java.util.List; public interface XPathExpr extends Serializable { Expr getRootExpr(); void setRootExpr(Expr rootExpr); String getText(); void simplify(); List asList(Context context) throws JaxenException; } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/XPathFactory.java100644 0 0 13223 10525225063 27412 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/XPathFactory.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:36 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: XPathFactory.java,v 1.1 2004/06/16 15:55:36 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.saxpath.Operator; public interface XPathFactory extends Operator { XPathExpr createXPath(Expr rootExpr) throws JaxenException; PathExpr createPathExpr(FilterExpr filterExpr, LocationPath locationPath) throws JaxenException; LocationPath createRelativeLocationPath() throws JaxenException; LocationPath createAbsoluteLocationPath() throws JaxenException; BinaryExpr createOrExpr(Expr lhs, Expr rhs) throws JaxenException; BinaryExpr createAndExpr(Expr lhs, Expr rhs) throws JaxenException; BinaryExpr createEqualityExpr(Expr lhs, Expr rhs, int equalityOperator) throws JaxenException; BinaryExpr createRelationalExpr(Expr lhs, Expr rhs, int relationalOperator) throws JaxenException; BinaryExpr createAdditiveExpr(Expr lhs, Expr rhs, int additiveOperator) throws JaxenException; BinaryExpr createMultiplicativeExpr(Expr lhs, Expr rhs, int multiplicativeOperator) throws JaxenException; Expr createUnaryExpr(Expr expr, int unaryOperator) throws JaxenException; UnionExpr createUnionExpr(Expr lhs, Expr rhs) throws JaxenException; FilterExpr createFilterExpr(Expr expr) throws JaxenException; FunctionCallExpr createFunctionCallExpr(String prefix, String functionName) throws JaxenException; NumberExpr createNumberExpr(int number) throws JaxenException; NumberExpr createNumberExpr(double number) throws JaxenException; LiteralExpr createLiteralExpr(String literal) throws JaxenException; VariableReferenceExpr createVariableReferenceExpr(String prefix, String variableName) throws JaxenException; Step createNameStep(int axis, String prefix, String localName) throws JaxenException; Step createAllNodeStep(int axis) throws JaxenException; Step createCommentNodeStep(int axis) throws JaxenException; Step createTextNodeStep(int axis) throws JaxenException; Step createProcessingInstructionNodeStep(int axis, String name) throws JaxenException; Predicate createPredicate(Expr predicateExpr) throws JaxenException; } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableAncestorAxis.java100644 0 0 6776 10525225063 32053 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableAncestorAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:01 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: IterableAncestorAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr.iter; import java.util.Iterator; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; public class IterableAncestorAxis extends IterableAxis { public IterableAncestorAxis(int value) { super( value ); } public Iterator iterator(Object contextNode, ContextSupport support) throws UnsupportedAxisException { return support.getNavigator().getAncestorAxisIterator( contextNode ); } } ././@LongLink100644 0 0 150 10525225067 10253 Lustar 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableAncestorOrSelfAxis.javaxpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableAncestorOrSelfAxis.j100644 0 0 7034 10525225063 32462 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableAncestorOrSelfAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:01 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: IterableAncestorOrSelfAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr.iter; import java.util.Iterator; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; public class IterableAncestorOrSelfAxis extends IterableAxis { public IterableAncestorOrSelfAxis(int value) { super( value ); } public Iterator iterator(Object contextNode, ContextSupport support) throws UnsupportedAxisException { return support.getNavigator().getAncestorOrSelfAxisIterator( contextNode ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableAttributeAxis.java100644 0 0 7003 10525225063 32220 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableAttributeAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:01 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: IterableAttributeAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr.iter; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; import java.util.Iterator; public class IterableAttributeAxis extends IterableAxis { public IterableAttributeAxis(int value) { super( value ); } public Iterator iterator(Object contextNode, ContextSupport support) throws UnsupportedAxisException { return support.getNavigator().getAttributeAxisIterator( contextNode ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableAxis.java100644 0 0 7043 10525225063 30340 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:01 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: IterableAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr.iter; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; import java.io.Serializable; import java.util.Iterator; public abstract class IterableAxis implements Serializable { private int value; public IterableAxis(int axisValue) { this.value = axisValue; } public int value() { return this.value; } public abstract Iterator iterator(Object contextNode, ContextSupport support) throws UnsupportedAxisException; } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableChildAxis.java100644 0 0 6757 10525225063 31317 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableChildAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:01 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: IterableChildAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr.iter; import java.util.Iterator; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; public class IterableChildAxis extends IterableAxis { public IterableChildAxis(int value) { super( value ); } public Iterator iterator(Object contextNode, ContextSupport support) throws UnsupportedAxisException { return support.getNavigator().getChildAxisIterator( contextNode ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableDescendantAxis.java100644 0 0 7010 10525225063 32323 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableDescendantAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:01 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: IterableDescendantAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr.iter; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; import java.util.Iterator; public class IterableDescendantAxis extends IterableAxis { public IterableDescendantAxis(int value) { super( value ); } public Iterator iterator(Object contextNode, ContextSupport support) throws UnsupportedAxisException { return support.getNavigator().getDescendantAxisIterator( contextNode ); } } ././@LongLink100644 0 0 152 10525225067 10255 Lustar 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableDescendantOrSelfAxis.javaxpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableDescendantOrSelfAxis100644 0 0 7046 10525225063 32527 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableDescendantOrSelfAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:01 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: IterableDescendantOrSelfAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr.iter; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; import java.util.Iterator; public class IterableDescendantOrSelfAxis extends IterableAxis { public IterableDescendantOrSelfAxis(int value) { super( value ); } public Iterator iterator(Object contextNode, ContextSupport support) throws UnsupportedAxisException { return support.getNavigator().getDescendantOrSelfAxisIterator( contextNode ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableFollowingAxis.java100644 0 0 7003 10525225063 32215 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableFollowingAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:01 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: IterableFollowingAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr.iter; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; import java.util.Iterator; public class IterableFollowingAxis extends IterableAxis { public IterableFollowingAxis(int value) { super( value ); } public Iterator iterator(Object contextNode, ContextSupport support) throws UnsupportedAxisException { return support.getNavigator().getFollowingAxisIterator( contextNode ); } } ././@LongLink100644 0 0 152 10525225067 10255 Lustar 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableFollowingSiblingAxis.javaxpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableFollowingSiblingAxis100644 0 0 7046 10525225063 32614 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableFollowingSiblingAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:01 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: IterableFollowingSiblingAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr.iter; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; import java.util.Iterator; public class IterableFollowingSiblingAxis extends IterableAxis { public IterableFollowingSiblingAxis(int value) { super( value ); } public Iterator iterator(Object contextNode, ContextSupport support) throws UnsupportedAxisException { return support.getNavigator().getFollowingSiblingAxisIterator( contextNode ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableNamespaceAxis.java100644 0 0 7003 10525225063 32151 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableNamespaceAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:01 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: IterableNamespaceAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr.iter; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; import java.util.Iterator; public class IterableNamespaceAxis extends IterableAxis { public IterableNamespaceAxis(int value) { super( value ); } public Iterator iterator(Object contextNode, ContextSupport support) throws UnsupportedAxisException { return support.getNavigator().getNamespaceAxisIterator( contextNode ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableParentAxis.java100644 0 0 6764 10525225063 31523 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableParentAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:01 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: IterableParentAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr.iter; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; import java.util.Iterator; public class IterableParentAxis extends IterableAxis { public IterableParentAxis(int value) { super( value ); } public Iterator iterator(Object contextNode, ContextSupport support) throws UnsupportedAxisException { return support.getNavigator().getParentAxisIterator( contextNode ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterablePrecedingAxis.java100644 0 0 7003 10525225063 32155 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterablePrecedingAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:01 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: IterablePrecedingAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr.iter; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; import java.util.Iterator; public class IterablePrecedingAxis extends IterableAxis { public IterablePrecedingAxis(int value) { super( value ); } public Iterator iterator(Object contextNode, ContextSupport support) throws UnsupportedAxisException { return support.getNavigator().getPrecedingAxisIterator( contextNode ); } } ././@LongLink100644 0 0 152 10525225067 10255 Lustar 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterablePrecedingSiblingAxis.javaxpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterablePrecedingSiblingAxis100644 0 0 7046 10525225063 32554 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterablePrecedingSiblingAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:01 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: IterablePrecedingSiblingAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr.iter; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; import java.util.Iterator; public class IterablePrecedingSiblingAxis extends IterableAxis { public IterablePrecedingSiblingAxis(int value) { super( value ); } public Iterator iterator(Object contextNode, ContextSupport support) throws UnsupportedAxisException { return support.getNavigator().getPrecedingSiblingAxisIterator( contextNode ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableSelfAxis.java100644 0 0 6752 10525225063 31160 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableSelfAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:01 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: IterableSelfAxis.java,v 1.2 2005/08/11 22:44:01 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.expr.iter; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; import java.util.Iterator; public class IterableSelfAxis extends IterableAxis { public IterableSelfAxis(int value) { super( value ); } public Iterator iterator(Object contextNode, ContextSupport support) throws UnsupportedAxisException { return support.getNavigator().getSelfAxisIterator( contextNode ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/BooleanFunction.java100644 0 0 13663 10525225063 31002 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/BooleanFunction.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:02 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: BooleanFunction.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.List; /** *

      4.3 boolean boolean(object) * * @author bob mcwhirter (bob @ werken.com) */ public class BooleanFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if ( args.size() == 1 ) { return evaluate( args.get(0), context.getNavigator() ); } throw new FunctionCallException("boolean() requires one argument"); } public static Boolean evaluate(Object obj, Navigator nav) { if ( obj instanceof List ) { List list = (List) obj; // if it's an empty list, then we have a null node-set -> false if (list.size() == 0) { return Boolean.FALSE; } // otherwise, unwrap the list and check the primitive obj = list.get(0); } // now check for primitive types // otherwise a non-empty nodeset is true // if it's a Boolean, let it decide if ( obj instanceof Boolean ) { return (Boolean) obj; } // if it's a Number, != 0 -> true else if ( obj instanceof Number ) { double d = ((Number) obj).doubleValue(); if ( d == 0 || d == Double.NaN ) { return Boolean.FALSE; } return Boolean.TRUE; } // if it's a String, "" -> false else if ( obj instanceof String ) { return ( ((String)obj).length() > 0 ? Boolean.TRUE : Boolean.FALSE ); } else { // assume its a node so that this nodeset is non-empty // and so its true return ( obj != null ) ? Boolean.TRUE : Boolean.FALSE; } /* This is the old way to test nodes - don't think this is correct and its certainly less efficient else { // convert to String if it's a special object type if ( nav.isElement( obj ) ) { obj = nav.getElementStringValue( obj ); } else if ( nav.isAttribute( obj ) ) { obj = nav.getAttributeStringValue( obj ); } else if ( nav.isText( obj ) ) { obj = nav.getTextStringValue( obj ); } else if ( obj instanceof String ) { return ( ((String)obj).length() > 0 ? Boolean.TRUE : Boolean.FALSE ); } return Boolean.FALSE; } */ } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/CeilingFunction.java100644 0 0 10003 10525225063 30756 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/CeilingFunction.java,v 1.1 2004/06/16 15:55:39 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:39 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: CeilingFunction.java,v 1.1 2004/06/16 15:55:39 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.List; /** *

      4.4 number ceiling(number) * * @author bob mcwhirter (bob @ werken.com) */ public class CeilingFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 1) { return evaluate( args.get(0), context.getNavigator() ); } throw new FunctionCallException("ceiling() requires one argument."); } public static Double evaluate(Object obj, Navigator nav) { Number value = NumberFunction.evaluate( obj, nav ); return new Double( Math.ceil( value.doubleValue() ) ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ConcatFunction.java100644 0 0 10314 10525225063 30620 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ConcatFunction.java,v 1.1 2004/06/16 15:55:39 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:39 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: ConcatFunction.java,v 1.1 2004/06/16 15:55:39 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.List; import java.util.Iterator; /** *

      4.2 string concat(string,string,string*) * * @author bob mcwhirter (bob@werken.com) */ public class ConcatFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if ( args.size() >= 2 ) { return evaluate( args, context.getNavigator() ); } throw new FunctionCallException("concat() requires at least two arguments"); } public static String evaluate(List list, Navigator nav) { StringBuffer result = new StringBuffer(); Iterator argIter = list.iterator(); while ( argIter.hasNext() ) { result.append( StringFunction.evaluate( argIter.next(), nav ) ); } return result.toString(); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ContainsFunction.java100644 0 0 10460 10525225063 31171 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ContainsFunction.java,v 1.1 2004/06/16 15:55:39 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:39 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: ContainsFunction.java,v 1.1 2004/06/16 15:55:39 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.List; /** *

      4.2 boolean contains(string,string) * * @author bob mcwhirter (bob @ werken.com) */ public class ContainsFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 2) { return evaluate(args.get(0), args.get(1), context.getNavigator() ); } throw new FunctionCallException("contains() requires two arguments."); } public static Boolean evaluate(Object strArg, Object matchArg, Navigator nav) { String str = StringFunction.evaluate( strArg, nav ); String match = StringFunction.evaluate( matchArg, nav ); return ( ( str.indexOf(match) >= 0) ? Boolean.TRUE : Boolean.FALSE ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/CountFunction.java100644 0 0 7631 10525225063 30471 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/CountFunction.java,v 1.1 2004/06/16 15:55:39 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:39 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: CountFunction.java,v 1.1 2004/06/16 15:55:39 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import java.util.List; /** *

      4.1 number count(node-set) * * @author bob mcwhirter (bob @ werken.com) */ public class CountFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 1) { return evaluate( args.get(0) ); } throw new FunctionCallException( "count() requires one argument." ); } public static Number evaluate(Object obj) { if( obj == null ) { return new Double( 0 ); } if (obj instanceof List) { return new Double( ((List)obj).size() ); } return new Double( 1 ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/DocumentFunction.java100644 0 0 7672 10525225063 31164 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/DocumentFunction.java,v 1.1 2004/06/16 15:55:39 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:39 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DocumentFunction.java,v 1.1 2004/06/16 15:55:39 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import java.util.List; public class DocumentFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 1) { Navigator nav = context.getNavigator(); String url = StringFunction.evaluate( args.get( 0 ), nav ); return evaluate( url, nav ); } throw new FunctionCallException( "false() requires no arguments." ); } public static Object evaluate(String url, Navigator nav) throws FunctionCallException { return nav.getDocument( url ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/FalseFunction.java100644 0 0 7255 10525225063 30435 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/FalseFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: FalseFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import java.util.List; /** *

      4.3 boolean false() * * @author bob mcwhirter (bob @ werken.com) */ public class FalseFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 0) { return evaluate(); } throw new FunctionCallException( "false() requires no arguments." ); } public static Boolean evaluate() { return Boolean.FALSE; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/FloorFunction.java100644 0 0 7772 10525225063 30470 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/FloorFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: FloorFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.List; /** *

      4.4 number floor(number) * * @author bob mcwhirter (bob @ werken.com) */ public class FloorFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 1) { return evaluate( args.get(0), context.getNavigator() ); } throw new FunctionCallException( "floor() requires one argument." ); } public static Double evaluate(Object obj, Navigator nav) { Number value = NumberFunction.evaluate( obj, nav ); return new Double( Math.floor( value.doubleValue() ) ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/IdFunction.java100644 0 0 11463 10525225063 27753 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/IdFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: IdFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; /** *

      4.1 node-set id(object) * * @author Erwin Bolwidt (ejb @ klomp.org) * @author J\u00e9r\u00f4me N\u00e8gre (jerome.negre @ e-xmlmedia.fr) */ public class IdFunction implements Function { public Object call (Context context, List args) throws FunctionCallException { if ( args.size() == 1 ) { return evaluate( context.getNodeSet(), args.get(0), context.getNavigator() ); } throw new FunctionCallException( "id() requires one argument" ); } public static List evaluate (List contextNodes, Object arg, Navigator nav) { List nodes = new ArrayList(); if (contextNodes.size() == 0) return nodes; Object contextNode = contextNodes.get(0); if (arg instanceof List) { Iterator iter = ((List)arg).iterator(); while (iter.hasNext()) { String id = StringFunction.evaluate(iter.next(), nav); nodes.addAll( evaluate( contextNodes, id, nav ) ); } } else { String ids = StringFunction.evaluate(arg, nav); StringTokenizer tok = new StringTokenizer(ids, " \t\n\r"); while (tok.hasMoreTokens()) { String id = tok.nextToken(); Object node = nav.getElementById(contextNode, id); if (node != null) { nodes.add(node); } } } return nodes; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/LastFunction.java100644 0 0 7325 10525225063 30304 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/LastFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: LastFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import java.util.List; /** *

      4.1 number last() * * @author bob mcwhirter (bob @ werken.com) */ public class LastFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 0) { return evaluate( context ); } throw new FunctionCallException( "last() requires no arguments." ); } public static Double evaluate(Context context) { return new Double( context.getSize() ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/LocalNameFunction.java100644 0 0 11506 10525225063 31250 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/LocalNameFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: LocalNameFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import java.util.List; /** *

      4.1 string local-name(node-set?) * * @author bob mcwhirter (bob @ werken.com) */ public class LocalNameFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if ( args.size() == 0 ) { return evaluate( context.getNodeSet(), context.getNavigator() ); } if ( args.size() == 1 ) { return evaluate( args, context.getNavigator() ); } throw new FunctionCallException( "local-name() requires zero or one argument." ); } public static String evaluate(List list, Navigator nav) { if ( ! list.isEmpty() ) { Object first = list.get(0); if (first instanceof List) { return evaluate( (List) first, nav ); } else if ( nav.isElement( first ) ) { return nav.getElementName( first ); } else if ( nav.isAttribute( first ) ) { return nav.getAttributeName( first ); } else if ( nav.isProcessingInstruction( first ) ) { return nav.getProcessingInstructionTarget( first ); } else if ( nav.isNamespace( first ) ) { return nav.getNamespacePrefix( first ); } } return ""; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/NameFunction.java100644 0 0 11456 10525225063 30301 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/NameFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: NameFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.List; /** *

      4.1 string name(node-set?) * * @author bob mcwhirter (bob @ werken.com) */ public class NameFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if ( args.size() == 0 ) { return evaluate( context.getNodeSet(), context.getNavigator() ); } if ( args.size() == 1 ) { return evaluate( args, context.getNavigator() ); } throw new FunctionCallException( "name() requires zero or one argument." ); } public static String evaluate(List list, Navigator nav) { if ( ! list.isEmpty() ) { Object first = list.get(0); if (first instanceof List) { return evaluate( (List) first, nav ); } else if ( nav.isElement( first ) ) { return nav.getElementQName( first ); } else if ( nav.isAttribute( first ) ) { return nav.getAttributeQName( first ); } else if ( nav.isProcessingInstruction( first ) ) { return nav.getProcessingInstructionTarget( first ); } else if ( nav.isNamespace( first ) ) { return nav.getNamespacePrefix( first ); } } return ""; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/NamespaceUriFunction.java100644 0 0 11063 10525225063 31767 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/NamespaceUriFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: NamespaceUriFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.List; /** *

      4.1 string namespace-uri(node-set?) * * @author bob mcwhirter (bob @ werken.com) */ public class NamespaceUriFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 0) { return evaluate( context.getNodeSet(), context.getNavigator() ); } if ( args.size() == 1 ) { return evaluate( args, context.getNavigator() ); } throw new FunctionCallException( "namespace-uri() requires zero or one argument." ); } public static String evaluate(List list, Navigator nav) { if ( ! list.isEmpty() ) { Object first = list.get(0); if ( first instanceof List ) { return evaluate( (List) first, nav ); } else if ( nav.isElement( first ) ) { return nav.getElementNamespaceUri( first ); } else if ( nav.isAttribute( first ) ) { return nav.getAttributeNamespaceUri( first ); } } return ""; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/NormalizeSpaceFunction.java100644 0 0 11061 10525225063 32325 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/NormalizeSpaceFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: NormalizeSpaceFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.List; import java.util.StringTokenizer; /** *

      4.2 string normalize-space(string) * * @author James Strachan (james@metastuff.com) */ public class NormalizeSpaceFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() >= 1) { return evaluate( args.get(0), context.getNavigator() ); } throw new FunctionCallException( "normalize-space() requires one argument" ); } public static String evaluate(Object strArg, Navigator nav) { String str = StringFunction.evaluate( strArg, nav ); if ( str.length() <= 1 ) { return str; } StringBuffer buffer = new StringBuffer(); boolean first = true; StringTokenizer tokenizer = new StringTokenizer(str); while ( tokenizer.hasMoreTokens() ) { if (first) { first = false; } else { buffer.append(" "); } buffer.append(tokenizer.nextToken()); } return buffer.toString(); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/NotFunction.java100644 0 0 7643 10525225063 30144 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/NotFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: NotFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.List; /** *

      4.3 boolean not(boolean) * * @author bob mcwhirter (bob @ werken.com) */ public class NotFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 1) { return evaluate( args.get(0), context.getNavigator() ); } throw new FunctionCallException( "not() requires one argument." ); } public static Boolean evaluate(Object obj, Navigator nav) { return ( ( BooleanFunction.evaluate( obj, nav ).booleanValue() ) ? Boolean.FALSE : Boolean.TRUE ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/NumberFunction.java100644 0 0 12121 10525225063 30637 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/NumberFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: NumberFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.List; import java.util.Iterator; /** *

      4.4 number number(object) * * @author bob mcwhirter (bob @ werken.com) */ public class NumberFunction implements Function { private final static Double NaN = new Double( Double.NaN ); public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 1) { return evaluate( args.get(0), context.getNavigator() ); } throw new FunctionCallException( "number() requires one argument." ); } public static Double evaluate(Object obj, Navigator nav) { if( obj instanceof Double ) { return (Double) obj; } else if (obj instanceof Number) { return new Double( ((Number) obj).doubleValue() ); } else if ( obj instanceof Boolean ) { if ( obj == Boolean.TRUE ) { return new Double( 1 ); } else { return new Double( 0 ); } } else if ( obj instanceof String ) { String str = (String) obj; try { Double doubleValue = new Double( str ); return doubleValue; } catch (NumberFormatException e) { return new Double( Double.NaN ); } } else if ( obj instanceof List || obj instanceof Iterator ) { String strValue = StringFunction.evaluate( obj, nav ); return evaluate( StringFunction.evaluate( obj, nav ), nav ); } else if ( nav.isElement( obj ) || nav.isAttribute( obj ) ) { return evaluate( StringFunction.evaluate( obj, nav ), nav ); } return new Double( Double.NaN ); } public static boolean isNaN( double val ) { return isNaN( new Double( val ) ); } public static boolean isNaN( Double val ) { return val.equals( NaN ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/PositionFunction.java100644 0 0 7342 10525225063 31204 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/PositionFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: PositionFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import java.util.List; /** *

      4.1 number position() * * @author bob mcwhirter (bob @ werken.com) */ public class PositionFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if ( args.size() == 0 ) { return evaluate( context ); } throw new FunctionCallException( "position() requires no arguments." ); } public static Number evaluate(Context context) { return new Double( context.getPosition() ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/RoundFunction.java100644 0 0 10313 10525225063 30477 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/RoundFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: RoundFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.List; /** *

      4.4 number round(number) * * @author bob mcwhirter (bob @ werken.com) */ public class RoundFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 1) { return evaluate( args.get(0), context.getNavigator() ); } throw new FunctionCallException( "round() requires one argument." ); } public static Number evaluate(Object obj, Navigator nav) { Number n = NumberFunction.evaluate( obj, nav ); if ( n instanceof Double ) { Double d = (Double) n; if (d.isNaN() || d.isInfinite()) { return d; } } double value = n.doubleValue(); return new Double( Math.round( value ) ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/StartsWithFunction.java100644 0 0 10470 10525225063 31530 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/StartsWithFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: StartsWithFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.List; /** *

      4.2 boolean starts-with(string,string) * * @author bob mcwhirter (bob @ werken.com) */ public class StartsWithFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 2) { return evaluate( args.get(0), args.get(1), context.getNavigator() ); } throw new FunctionCallException( "starts-with() requires two arugments." ); } public static Boolean evaluate(Object strArg, Object matchArg, Navigator nav) { String str = StringFunction.evaluate( strArg, nav ); String match = StringFunction.evaluate( matchArg, nav ); return ( str.startsWith(match) ? Boolean.TRUE : Boolean.FALSE ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/StringFunction.java100644 0 0 14250 10525225063 30662 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/StringFunction.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:02 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: StringFunction.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.List; /** *

      4.2 string string(object) * * @author bob mcwhirter (bob @ werken.com) */ public class StringFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { int size = args.size(); if ( size == 0 ) { return evaluate( context.getNodeSet(), context.getNavigator() ); } else if ( size == 1 ) { return evaluate( args.get(0), context.getNavigator() ); } throw new FunctionCallException( "string() requires one argument." ); } public static String evaluate(Object obj, Navigator nav) { if ( obj == null ) { return ""; } if ( obj instanceof String) { return (String) obj; } else if ( nav.isElement( obj ) ) { return nav.getElementStringValue( obj ); } else if ( nav.isAttribute( obj ) ) { return nav.getAttributeStringValue( obj ); } else if ( nav.isText( obj ) ) { return nav.getTextStringValue( obj ); } else if ( nav.isProcessingInstruction( obj ) ) { return nav.getProcessingInstructionData( obj ); } else if ( nav.isComment( obj ) ) { return nav.getCommentStringValue( obj ); } else if ( nav.isNamespace( obj ) ) { return nav.getNamespaceStringValue( obj ); } else if (obj instanceof List) { List list = (List) obj; int size = list.size(); if ( size > 0 ) { // the XPath string() function only returns the // string value of the first node in a nodeset return evaluate( list.get(0), nav ); } } else if ( obj instanceof Boolean ) { return obj.toString(); } else if ( obj instanceof Integer ) { return obj.toString(); } else if ( obj instanceof Double ) { Double num = (Double) obj; if ( num.isNaN() ) { return "NaN"; } else if ( num.isInfinite() ) { if ( num.intValue() < 0 ) { return "-Infinity"; } else { return "Infinity"; } } else if( num.floatValue() == num.intValue() ) // strip .0 { return Integer.toString( num.intValue() ); } else { return num.toString(); } } return ""; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/StringLengthFunction.java100644 0 0 10126 10525225063 32022 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/StringLengthFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: StringLengthFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.List; /** *

      4.2 number string-length(string) * * @author bob mcwhirter (bob @ werken.com) */ public class StringLengthFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 0) { return evaluate( context.getNodeSet(), context.getNavigator() ); } else if (args.size() == 1) { return evaluate( args.get(0), context.getNavigator() ); } throw new FunctionCallException( "string-length() requires one argument." ); } public static Number evaluate(Object obj, Navigator nav ) { String str = StringFunction.evaluate( obj, nav ); return new Double(str.length()); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/SubstringAfterFunction.java100644 0 0 10554 10525225063 32361 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/SubstringAfterFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: SubstringAfterFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.List; /** *

      4.2 string substring-after(string,string) * * @author bob mcwhirter (bob @ werken.com) */ public class SubstringAfterFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 2) { return evaluate( args.get(0), args.get(1), context.getNavigator() ); } throw new FunctionCallException( "substring-after() requires two arguments." ); } public static String evaluate(Object strArg, Object matchArg, Navigator nav) { String str = StringFunction.evaluate( strArg, nav ); String match = StringFunction.evaluate( matchArg, nav ); int loc = str.indexOf(match); if ( loc < 0 ) { return ""; } return str.substring(loc+match.length()); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/SubstringBeforeFunction.java100644 0 0 10542 10525225063 32517 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/SubstringBeforeFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: SubstringBeforeFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.List; /** *

      4.2 string substring-before(string,string) * * @author bob mcwhirter (bob @ werken.com) */ public class SubstringBeforeFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 2) { return evaluate( args.get(0), args.get(1), context.getNavigator() ); } throw new FunctionCallException( "substring-before() requires two arguments." ); } public static String evaluate(Object strArg, Object matchArg, Navigator nav) { String str = StringFunction.evaluate( strArg, nav ); String match = StringFunction.evaluate( matchArg, nav ); int loc = str.indexOf(match); if ( loc < 0 ) { return ""; } return str.substring(0, loc); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/SubstringFunction.java100644 0 0 13003 10525225063 31367 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/SubstringFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: SubstringFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.List; /** *

      4.2 string substring(string,number,number?) * * @author bob mcwhirter (bob @ werken.com) */ public class SubstringFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 2) { return evaluate( args.get(0), args.get(1), context.getNavigator() ); } else if (args.size() == 3) { return evaluate( args.get(0), args.get(1), args.get(2), context.getNavigator() ); } throw new FunctionCallException( "substring() requires two or three arguments." ); } public static String evaluate(Object strArg, Object startArg, Navigator nav) { String str = StringFunction.evaluate( strArg, nav ); int start = RoundFunction.evaluate( NumberFunction.evaluate( startArg, nav), nav ).intValue(); start -= 1; return str.substring(start); } public static String evaluate(Object strArg, Object startArg, Object lenArg, Navigator nav) { String str = StringFunction.evaluate( strArg, nav ); int start = RoundFunction.evaluate( NumberFunction.evaluate( startArg, nav ), nav ).intValue(); int len = RoundFunction.evaluate( NumberFunction.evaluate( lenArg, nav ), nav ).intValue(); // Java Strings start at 0 rather than 1 start -= 1; int end = start + len; return str.substring(start, end); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/SumFunction.java100644 0 0 10636 10525225063 30164 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/SumFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: SumFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.List; import java.util.Iterator; /** *

      4.4 number sum(node-set) * * @author bob mcwhirter (bob @ werken.com) */ public class SumFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 1) { return evaluate( args.get(0), context.getNavigator() ); } throw new FunctionCallException( "sum() requires one argument." ); } public static Double evaluate(Object obj, Navigator nav) { double sum = 0; double term = 0; if (obj instanceof List) { Iterator nodeIter = ((List)obj).iterator(); while ( nodeIter.hasNext() ) { term = NumberFunction.evaluate( nodeIter.next(), nav ).doubleValue(); sum += term; } } else { sum += NumberFunction.evaluate( obj, nav ).doubleValue(); } return new Double(sum); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/TranslateFunction.java100644 0 0 13011 10525225063 31343 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/TranslateFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: TranslateFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.function.StringFunction; import java.util.List; import java.util.Map; import java.util.HashMap; /** *

      4.2 string translate(string,string,string) * * The translation is done thru a HashMap. * Performance tip (for anyone who needs to improve the performance of this particular function): * Cache the HashMaps, once they are constructed. * * @author Jan Dvorak ( jan.dvorak @ mathan.cz ) * */ public class TranslateFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 3) { return evaluate( args.get(0), args.get(1), args.get(2), context.getNavigator() ); } throw new FunctionCallException( "translate() requires three arguments." ); } public static String evaluate(Object strArg, Object fromArg, Object toArg, Navigator nav) { String inStr = StringFunction.evaluate( strArg, nav ); String fromStr = StringFunction.evaluate( fromArg, nav ); String toStr = StringFunction.evaluate( toArg, nav ); // Initialize the mapping in a HashMap Map charMap = new HashMap(); int fromLen = fromStr.length(); int toLen = toStr.length(); for ( int i = 0; i < fromLen; ++i ) { String cFrom = fromStr.substring( i, i+1 ).intern(); if ( charMap.containsKey( cFrom ) ) { // We've seen the character before, ignore continue; } if ( i < toLen ) { Character cTo = new Character( toStr.charAt( i ) ); // Will change charMap.put( cFrom, cTo ); } else { // Will delete charMap.put( cFrom, null ); } } // Process the input string thru the map StringBuffer outStr = new StringBuffer( inStr.length() ); int inLen = inStr.length(); for ( int i = 0; i < inLen; ++i ) { String cIn = inStr.substring( i, i+1 ); if ( charMap.containsKey( cIn ) ) { Character cTo = (Character) charMap.get( cIn ); if ( cTo != null ) { outStr.append( cTo.charValue() ); } } else { outStr.append( cIn ); } } return new String( outStr ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/TrueFunction.java100644 0 0 7247 10525225063 30323 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/TrueFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:40 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: TrueFunction.java,v 1.1 2004/06/16 15:55:40 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import java.util.List; /** *

      4.3 boolean true() * * @author bob mcwhirter (bob @ werken.com) */ public class TrueFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 0) { return evaluate(); } throw new FunctionCallException( "true() requires no arguments." ); } public static Boolean evaluate() { return Boolean.TRUE; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ext/EndsWithFunction.java100644 0 0 10553 10525225063 31743 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ext/EndsWithFunction.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:41 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: EndsWithFunction.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function.ext; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.function.StringFunction; import java.util.List; /** *

      boolean ends-with(string,string) * * @author mark wilson (markw @ wilsoncom.de) */ public class EndsWithFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 2) { return evaluate( args.get(0), args.get(1), context.getNavigator() ); } throw new FunctionCallException( "ends-with() requires two arugments." ); } public static Boolean evaluate(Object strArg, Object matchArg, Navigator nav) { String str = StringFunction.evaluate( strArg, nav ); String match = StringFunction.evaluate( matchArg, nav ); return ( str.endsWith(match) ? Boolean.TRUE : Boolean.FALSE ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ext/EvaluateFunction.java100644 0 0 11725 10525225063 31766 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ext/EvaluateFunction.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:02 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: EvaluateFunction.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function.ext; import java.util.Collections; import java.util.List; import org.xmlpull.v1.builder.xpath.jaxen.XPath; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.ContextSupport; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.function.StringFunction; import org.xmlpull.v1.builder.xpath.saxpath.SAXPathException; /** * node-set evaluate(string) * * @author Erwin Bolwidt (ejb @ klomp.org) */ public class EvaluateFunction implements Function { public Object call( Context context, List args ) throws FunctionCallException { if ( args.size() == 1 ) { return evaluate( context, args.get(0)); } throw new FunctionCallException( "id() requires one argument" ); } public static List evaluate (Context context, Object arg) throws FunctionCallException { List contextNodes = context.getNodeSet(); if (contextNodes.size() == 0) return Collections.EMPTY_LIST; Object contextNode = contextNodes.get(0); Navigator nav = context.getNavigator(); String xpathString; if ( arg instanceof String ) xpathString = (String)arg; else xpathString = StringFunction.evaluate(arg, nav); try { XPath xpath = nav.parseXPath(xpathString); ContextSupport support = context.getContextSupport(); xpath.setVariableContext( support.getVariableContext() ); xpath.setFunctionContext( support.getFunctionContext() ); xpath.setNamespaceContext( support.getNamespaceContext() ); return xpath.selectNodes( context.duplicate() ); } catch ( SAXPathException e ) { throw new FunctionCallException(e.toString()); } } } ././@LongLink100644 0 0 146 10525225067 10260 Lustar 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ext/LocaleFunctionSupport.javaxpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ext/LocaleFunctionSupport.jav100644 0 0 15465 10525225063 32660 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ext/LocaleFunctionSupport.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:02 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: LocaleFunctionSupport.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function.ext; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.function.StringFunction; import java.util.List; import java.util.Locale; import java.util.StringTokenizer; /** *

      An abastract base class for Locale-specific extension * functions. This class provides convenience methods that * can be inherited, specifically to find a Locale from * an XPath function argument value. *

      * * @author James Strachan */ public abstract class LocaleFunctionSupport implements Function { /** * Attempts to convert the given function argument value * into a Locale either via casting, * extracting it from a List * or looking up the named Locale using reflection. * * @param value is either a Locale, a List containing a Locale * or a String containing the name of a Locale * as defined by the Locale static members. * * @return the Locale for the value or null if one could * not be deduced */ protected Locale getLocale(Object value, Navigator navigator) { if (value instanceof Locale) { return (Locale) value; } else if(value instanceof List) { List list = (List) value; if ( ! list.isEmpty() ) { return getLocale( list.get(0), navigator ); } } else { String text = StringFunction.evaluate( value, navigator ); if (text != null && text.length() > 0) { return findLocale( text ); } } return null; } /** * Tries to find a Locale instance by name using xml:lang style encodings * like 'en', 'en-US', 'en-US-Brooklyn'. * * @param localeText is the xml:lang encoding of a Locale * @return the Locale for the given text or null if one could not * be found */ protected Locale findLocale(String localeText) { StringTokenizer enu = new StringTokenizer( localeText, "-" ); if (enu.hasMoreTokens()) { String language = enu.nextToken(); if (! enu.hasMoreTokens()) { return findLocaleForLanguage(language); } else { String country = enu.nextToken(); if (! enu.hasMoreTokens()) { return new Locale(language, country); } else { String variant = enu.nextToken(); return new Locale(language, country, variant); } } } return null; } /** * Finds the locale with the given language name with no country * or variant, such as Locale.ENGLISH or Locale.FRENCH * * @param language is the language code to look for * @return the Locale for the given language or null if one could not * be found */ protected Locale findLocaleForLanguage(String language) { Locale[] locales = Locale.getAvailableLocales(); for ( int i = 0, size = locales.length; i < size; i++ ) { Locale locale = locales[i]; if ( language.equals( locale.getLanguage() ) ) { String country = locale.getCountry(); if ( country == null || country.length() == 0 ) { String variant = locale.getVariant(); if ( variant == null || variant.length() == 0 ) { return locale; } } } } return null; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ext/LowerFunction.java100644 0 0 12060 10525225063 31301 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ext/LowerFunction.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:02 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: LowerFunction.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function.ext; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.function.StringFunction; import java.util.List; import java.util.Locale; /** *

      string lower-case(string) * * This function can take a second parameter of the * Locale to use for the String conversion. *

      * *

      * For example * * lower-case( /foo/bar ) * lower-case( /foo/@name, $myLocale ) *

      * * @author mark wilson (markw@wilsoncom.de) * @author James Strachan */ public class LowerFunction extends LocaleFunctionSupport { public Object call(Context context, List args) throws FunctionCallException { Navigator navigator = context.getNavigator(); int size = args.size(); if (size > 0) { Object text = args.get(0); Locale locale = null; if (size > 1) { locale = getLocale( args.get(1), navigator ); } return evaluate( text, locale, navigator ); } throw new FunctionCallException( "lower-case() requires at least one argument." ); } /** * Converts the given string value to lower case using an optional Locale * * @param strArg the value which gets converted to a String * @param locale the Locale to use for the conversion or null if the * default should be used * @param nav the Navigator to use */ public static String evaluate(Object strArg, Locale locale, Navigator nav) { String str = StringFunction.evaluate( strArg, nav ); if (locale != null) { return str.toLowerCase(locale); } else { return str.toLowerCase(); } } } ././@LongLink100644 0 0 145 10525225067 10257 Lustar 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ext/MatrixConcatFunction.javaxpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ext/MatrixConcatFunction.java100644 0 0 15327 10525225063 32616 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ext/MatrixConcatFunction.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:02 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: MatrixConcatFunction.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function.ext; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Function; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.function.StringFunction; import java.util.ArrayList; import java.util.List; import java.util.Iterator; import java.util.Enumeration; /**

      Extension Function boolean matrix-concat(nodeSet,nodeSet,nodeSet*) * * @author James Pereira (JPereira@CT.BBD.CO.ZA) */ public class MatrixConcatFunction implements Function { public Object call(Context context, List args) { if ( args.size() >= 2 ) { return evaluate(args, context.getNavigator()); } return null; } public static Object evaluate(List list, Navigator nav) { ArrayList matrix = new ArrayList(); Iterator argIter = list.iterator(); while (argIter.hasNext()) { ArrayList v = new ArrayList(); Object obj = argIter.next(); if (obj instanceof List) { List args = (List) obj; for ( int i = 0, size = args.size(); i < size; i++ ) { v.add( StringFunction.evaluate( args.get(i), nav ) ); } } else { v.add( StringFunction.evaluate( obj, nav ) ); } matrix.add(v); } ArrayList result = new ArrayList(); Enumeration elemList = new MatrixEnum( matrix ); while (elemList.hasMoreElements()) { Object obj = elemList.nextElement(); if (obj instanceof List) { StringBuffer text = new StringBuffer(127); List args = (List) obj; for (Iterator it = args.iterator(); it.hasNext(); ) { text.append(it.next()); } result.add( text.toString() ); } else { result.add( obj ); } } return result; } public static class MatrixEnum implements Enumeration { private ArrayList m_source; private int m_maxSize = 0; private int m_currIdx = -1; public MatrixEnum (ArrayList _source) { m_source = _source; for ( Iterator iter = m_source.iterator(); iter.hasNext(); ) { ArrayList element = (ArrayList) iter.next(); int size = element.size(); if (size > m_maxSize) { m_maxSize = size; } } } public MatrixEnum (ArrayList _source, int _maxSize) { m_source = _source; m_maxSize = _maxSize; } public boolean hasMoreElements() { if ((m_maxSize != 0) && (++m_currIdx < m_maxSize)) { return true; } else { return false; } } public Object nextElement() { ArrayList result = new ArrayList(); for ( Iterator iter = m_source.iterator(); iter.hasNext(); ) { ArrayList element = (ArrayList) iter.next(); int size = element.size(); if ( m_currIdx < size ) { result.add( element.get( m_currIdx ) ); } else { if ( size > 0 ) { result.add( element.get( size - 1 ) ); } else { // XXXX: what to do now? result.add( "" ); } } } return result; } } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ext/UpperFunction.java100644 0 0 12174 10525225063 31312 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/function/ext/UpperFunction.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:02 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: UpperFunction.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.function.ext; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.FunctionCallException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.function.StringFunction; import java.util.List; import java.util.Locale; /** *

      string upper-case(string) * * This function can take a second parameter of the * Locale to use for the String conversion. *

      * *

      * For example * * upper-case( /foo/bar ) * upper-case( /foo/@name, $myLocale ) *

      * * @author mark wilson (markw@wilsoncom.de) * @author James Strachan */ public class UpperFunction extends LocaleFunctionSupport { public Object call(Context context, List args) throws FunctionCallException { Navigator navigator = context.getNavigator(); int size = args.size(); if (size > 0) { Object text = args.get(0); Locale locale = null; if (size > 1) { locale = getLocale( args.get(1), navigator ); } return evaluate( text, locale, navigator ); } throw new FunctionCallException( "upper-case() requires at least one argument." ); } /** * Converts the given string value to upper case using an optional Locale * * @param strArg the value which gets converted to a String * @param locale the Locale to use for the conversion or null if the * default should be used * @param nav the Navigator to use */ public static String evaluate(Object strArg, Locale locale, Navigator nav) { String str = StringFunction.evaluate( strArg, nav ); if (locale != null) { // System.out.println( "Using Locale: " + locale ); return str.toUpperCase(locale); } else { return str.toUpperCase(); } } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/package.html100644 0 0 101 10525225063 25425 0ustaraslomewww 0 0 Based on Jaxen 1.0_FCS (jaxen-1.0-FCS.zip size 4,034,673 bytes) xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/AnyChildNodeTest.java100644 0 0 7777 10525225063 30677 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/AnyChildNodeTest.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:41 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: AnyChildNodeTest.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.pattern; import org.xmlpull.v1.builder.xpath.jaxen.Context; /**

      AnyChildNodeTest matches any child node.

      * * @author James Strachan * @version $Revision: 1.1 $ */ public class AnyChildNodeTest extends NodeTest { private static AnyChildNodeTest instance = new AnyChildNodeTest(); public static AnyChildNodeTest getInstance() { return instance; } public AnyChildNodeTest() { } /** @return true if the pattern matches the given node */ public boolean matches( Object node, Context context ) { short type = context.getNavigator().getNodeType( node ); return type == ELEMENT_NODE || type == TEXT_NODE || type == COMMENT_NODE || type == PROCESSING_INSTRUCTION_NODE; } public double getPriority() { return -0.5; } public short getMatchType() { return ANY_NODE; } public String getText() { return "*"; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/AnyNodeTest.java100644 0 0 7433 10525225063 27720 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/AnyNodeTest.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:41 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: AnyNodeTest.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.pattern; import org.xmlpull.v1.builder.xpath.jaxen.Context; /**

      AnyNodeTest matches any node.

      * * @author James Strachan * @version $Revision: 1.1 $ */ public class AnyNodeTest extends NodeTest { private static AnyNodeTest instance = new AnyNodeTest(); public static AnyNodeTest getInstance() { return instance; } public AnyNodeTest() { } /** @return true if the pattern matches the given node */ public boolean matches( Object node, Context context ) { return true; } public double getPriority() { return -0.5; } public short getMatchType() { return ANY_NODE; } public String getText() { return "*"; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/LocationPathPattern.java100644 0 0 23610 10525225063 31461 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/LocationPathPattern.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:02 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: LocationPathPattern.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.pattern; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.expr.FilterExpr; /**

      LocationPathPattern matches any node using a * location path such as A/B/C. * The parentPattern and ancestorPattern properties are used to * chain location path patterns together

      * * @author James Strachan * @version $Revision: 1.2 $ */ public class LocationPathPattern extends Pattern { /** The node test to perform on this step of the path */ private NodeTest nodeTest = AnyNodeTest.getInstance(); /** Patterns matching my parent node */ private Pattern parentPattern; /** Patterns matching one of my ancestors */ private Pattern ancestorPattern; /** The filters to match against */ private List filters; /** Whether this lcoation path is absolute or not */ private boolean absolute; public LocationPathPattern() { } public LocationPathPattern(NodeTest nodeTest) { this.nodeTest = nodeTest; } public Pattern simplify() { if ( parentPattern != null ) { parentPattern = parentPattern.simplify(); } if ( ancestorPattern != null ) { ancestorPattern = ancestorPattern.simplify(); } if ( filters == null ) { if ( parentPattern == null && ancestorPattern == null ) { return nodeTest; } if ( parentPattern != null && ancestorPattern == null ) { if ( nodeTest instanceof AnyNodeTest ) { return parentPattern; } } } return this; } /** Adds a filter to this pattern */ public void addFilter(FilterExpr filter) { if ( filters == null ) { filters = new ArrayList(); } filters.add( filter ); } /** Adds a pattern for the parent of the current * context node used in this pattern. */ public void setParentPattern(Pattern parentPattern) { this.parentPattern = parentPattern; } /** Adds a pattern for an ancestor of the current * context node used in this pattern. */ public void setAncestorPattern(Pattern ancestorPattern) { this.ancestorPattern = ancestorPattern; } /** Allows the NodeTest to be set */ public void setNodeTest(NodeTest nodeTest) throws JaxenException { if ( this.nodeTest instanceof AnyNodeTest ) { this.nodeTest = nodeTest; } else { throw new JaxenException( "Attempt to overwrite nodeTest: " + this.nodeTest + " with: " + nodeTest ); } } /** @return true if the pattern matches the given node */ public boolean matches( Object node, Context context ) throws JaxenException { Navigator navigator = context.getNavigator(); /* if ( isAbsolute() ) { node = navigator.getDocumentNode( node ); } */ if (! nodeTest.matches(node, context) ) { return false; } if (parentPattern != null) { Object parent = navigator.getParentNode( node ); if ( parent == null ) { return false; } if ( ! parentPattern.matches( parent, context ) ) { return false; } } if (ancestorPattern != null) { Object ancestor = navigator.getParentNode( node ); while (true) { if ( ancestorPattern.matches( ancestor, context ) ) { break; } if ( ancestor == null ) { return false; } if ( navigator.isDocument( ancestor ) ) { return false; } ancestor = navigator.getParentNode( ancestor ); } } if (filters != null) { List list = new ArrayList( 1 ); list.add( node ); context.setNodeSet( list ); // XXXX: filters aren't positional, so should we clone context? boolean answer = true; for (Iterator iter = filters.iterator(); iter.hasNext(); ) { FilterExpr filter = (FilterExpr) iter.next(); if ( ! filter.asBoolean( context ) ) { answer = false; break; } } // restore context context.setNodeSet( list ); return answer; } return true; } public double getPriority() { if ( filters != null ) { return 0.5; } return nodeTest.getPriority(); } public short getMatchType() { return nodeTest.getMatchType(); } public String getText() { StringBuffer buffer = new StringBuffer(); if ( absolute ) { buffer.append( "/" ); } if (ancestorPattern != null) { String text = ancestorPattern.getText(); if ( text.length() > 0 ) { buffer.append( text ); buffer.append( "//" ); } } if (parentPattern != null) { String text = parentPattern.getText(); if ( text.length() > 0 ) { buffer.append( text ); buffer.append( "/" ); } } buffer.append( nodeTest.getText() ); if ( filters != null ) { buffer.append( "[" ); for (Iterator iter = filters.iterator(); iter.hasNext(); ) { FilterExpr filter = (FilterExpr) iter.next(); buffer.append( filter.getText() ); } buffer.append( "]" ); } return buffer.toString(); } public String toString() { return super.toString() + "[ absolute: " + absolute + " parent: " + parentPattern + " ancestor: " + ancestorPattern + " filters: " + filters + " nodeTest: " + nodeTest + " ]"; } public boolean isAbsolute() { return absolute; } public void setAbsolute(boolean absolute) { this.absolute = absolute; } public boolean hasAnyNodeTest() { return nodeTest instanceof AnyNodeTest; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/NameTest.java100644 0 0 11722 10525225063 27257 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/NameTest.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:41 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: NameTest.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.pattern; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; /**

      NameTest tests for a node name.

      * * @author James Strachan * @version $Revision: 1.1 $ */ public class NameTest extends NodeTest { /** The name to match against */ private String name; /** The type of node to match - either attribute or element */ private short nodeType; public NameTest(String name, short nodeType) { this.name = name; this.nodeType = nodeType; } /** @return true if the pattern matches the given node */ public boolean matches( Object node, Context context ) { Navigator navigator = context.getNavigator(); if ( nodeType == Pattern.ELEMENT_NODE ) { return navigator.isElement( node ) && name.equals( navigator.getElementName( node ) ); } else if ( nodeType == Pattern.ATTRIBUTE_NODE ) { return navigator.isAttribute( node ) && name.equals( navigator.getAttributeName( node ) ); } else { if ( navigator.isElement( node ) ) { return name.equals( navigator.getElementName( node ) ); } else if ( navigator.isAttribute( node ) ) { return name.equals( navigator.getAttributeName( node ) ); } } return false; } public double getPriority() { return 0.0; } public short getMatchType() { return nodeType; } public String getText() { if ( nodeType == Pattern.ATTRIBUTE_NODE ) { return "@" + name; } else { return name; } } public String toString() { return super.toString() + "[ name: " + name + " type: " + nodeType + " ]"; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/NamespaceTest.java100644 0 0 12214 10525225063 30270 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/NamespaceTest.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:41 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: NamespaceTest.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.pattern; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; /**

      NamespaceTest tests for a given namespace URI.

      * * @author James Strachan * @version $Revision: 1.1 $ */ public class NamespaceTest extends NodeTest { /** The prefix to match against */ private String prefix; /** The type of node to match - either attribute or element */ private short nodeType; public NamespaceTest(String prefix, short nodeType) { if ( prefix == null ) { prefix = ""; } this.prefix = prefix; this.nodeType = nodeType; } /** @return true if the pattern matches the given node */ public boolean matches( Object node, Context context ) { Navigator navigator = context.getNavigator(); String uri = getURI( node, context ); if ( nodeType == Pattern.ELEMENT_NODE ) { return navigator.isElement( node ) && uri.equals( navigator.getElementNamespaceUri( node ) ); } else if ( nodeType == Pattern.ATTRIBUTE_NODE ) { return navigator.isAttribute( node ) && uri.equals( navigator.getAttributeNamespaceUri( node ) ); } return false; } public double getPriority() { return -0.25; } public short getMatchType() { return nodeType; } public String getText() { return prefix + ":"; } public String toString() { return super.toString() + "[ prefix: " + prefix + " type: " + nodeType + " ]"; } /** Returns the URI of the current prefix or "" if no URI can be found */ protected String getURI(Object node, Context context) { String uri = context.getNavigator().translateNamespacePrefixToUri( prefix, node ); if ( uri == null ) { uri = context.getContextSupport().translateNamespacePrefixToUri( prefix ); } if ( uri == null ) { uri = ""; } return uri; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/NoNodeTest.java100644 0 0 7426 10525225063 27547 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/NoNodeTest.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:41 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: NoNodeTest.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.pattern; import org.xmlpull.v1.builder.xpath.jaxen.Context; /**

      NoNodeTest matches no nodes.

      * * @author James Strachan * @version $Revision: 1.1 $ */ public class NoNodeTest extends NodeTest { private static NoNodeTest instance = new NoNodeTest(); public static NoNodeTest getInstance() { return instance; } public NoNodeTest() { } /** @return true if the pattern matches the given node */ public boolean matches( Object node, Context context ) { return false; } public double getPriority() { return -0.5; } public short getMatchType() { return NO_NODE; } public String getText() { return ""; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/NodeTest.java100644 0 0 6270 10525225063 27246 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/NodeTest.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:02 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: NodeTest.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.pattern; /**

      NodeTest is a simple test on a node.

      * * @author James Strachan * @version $Revision: 1.2 $ */ public abstract class NodeTest extends Pattern { } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/NodeTypeTest.java100644 0 0 12343 10525225063 30126 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/NodeTypeTest.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:41 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: NodeTypeTest.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.pattern; import org.xmlpull.v1.builder.xpath.jaxen.Context; /**

      NodeTypeTest matches if the node is of a certain type * such as element, attribute, comment, text, processing instruction and so forth.

      * * @author James Strachan * @version $Revision: 1.1 $ */ public class NodeTypeTest extends NodeTest { public static final NodeTypeTest DOCUMENT_TEST = new NodeTypeTest( DOCUMENT_NODE ); public static final NodeTypeTest ELEMENT_TEST = new NodeTypeTest( ELEMENT_NODE ); public static final NodeTypeTest ATTRIBUTE_TEST = new NodeTypeTest( ATTRIBUTE_NODE ); public static final NodeTypeTest COMMENT_TEST = new NodeTypeTest( COMMENT_NODE ); public static final NodeTypeTest TEXT_TEST = new NodeTypeTest( TEXT_NODE ); public static final NodeTypeTest PROCESSING_INSTRUCTION_TEST = new NodeTypeTest( PROCESSING_INSTRUCTION_NODE ); public static final NodeTypeTest NAMESPACE_TEST = new NodeTypeTest( NAMESPACE_NODE ); private short nodeType; public NodeTypeTest(short nodeType) { this.nodeType = nodeType; } /** @return true if the pattern matches the given node */ public boolean matches( Object node, Context context ) { return nodeType == context.getNavigator().getNodeType( node ); } public double getPriority() { return -0.5; } public short getMatchType() { return nodeType; } public String getText() { switch (nodeType) { case ELEMENT_NODE: return "child()"; case ATTRIBUTE_NODE: return "@*"; case NAMESPACE_NODE: return "namespace()"; case DOCUMENT_NODE: return "/"; case COMMENT_NODE: return "comment()"; case TEXT_NODE: return "text()"; case PROCESSING_INSTRUCTION_NODE: return "processing-instruction()"; } return ""; } public String toString() { return super.toString() + "[ type: " + nodeType + " ]"; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/Pattern.java100644 0 0 15255 10525225063 27161 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/Pattern.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:41 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: Pattern.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.pattern; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; /**

      Pattern defines the behaviour for pattern in * the XSLT processing model.

      * * @author James Strachan * @version $Revision: 1.1 $ */ public abstract class Pattern { // These node numbers are compatable with both DOM and dom4j's node types /** Matches Element nodes */ public static final short ELEMENT_NODE = 1; /** Matches elements nodes */ public static final short ATTRIBUTE_NODE = 2; /** Matches elements nodes */ public static final short TEXT_NODE = 3; /** Matches elements nodes */ public static final short CDATA_SECTION_NODE = 4; /** Matches elements nodes */ public static final short ENTITY_REFERENCE_NODE = 5; /** Matches elements nodes */ //public static final short ENTITY_NODE = 6; /** Matches ProcessingInstruction */ public static final short PROCESSING_INSTRUCTION_NODE = 7; /** Matches Comments nodes */ public static final short COMMENT_NODE = 8; /** Matches Document nodes */ public static final short DOCUMENT_NODE = 9; /** Matches DocumentType nodes */ public static final short DOCUMENT_TYPE_NODE = 10; //public static final short DOCUMENT_FRAGMENT_NODE = 11; //public static final short NOTATION_NODE = 12; /** Matchs a Namespace Node - NOTE this differs from DOM */ // XXXX: ???? public static final short NAMESPACE_NODE = 13; /** Does not match any valid node */ public static final short UNKNOWN_NODE = 14; /** The maximum number of node types for sizing purposes */ public static final short MAX_NODE_TYPE = 14; /** Matches any node */ public static final short ANY_NODE = 0; /** Matches no nodes */ public static final short NO_NODE = 14; /** @return true if the pattern matches the given node */ public abstract boolean matches( Object node, Context context ) throws JaxenException; /** Returns the default resolution policy of the pattern according to the * * XSLT conflict resolution spec. * */ public double getPriority() { return 0.5; } /** If this pattern is a union pattern then this * method should return an array of patterns which * describe the union pattern, which should contain more than one pattern. * Otherwise this method should return null. * * @return an array of the patterns which make up this union pattern * or null if this pattern is not a union pattern */ public Pattern[] getUnionPatterns() { return null; } /** @return the type of node the pattern matches * which by default should return ANY_NODE if it can * match any kind of node. */ public short getMatchType() { return ANY_NODE; } /** For patterns which only match an ATTRIBUTE_NODE or an * ELEMENT_NODE then this pattern may return the name of the * element or attribute it matches. This allows a more efficient * rule matching algorithm to be performed, rather than a brute * force approach of evaluating every pattern for a given Node. * * @return the name of the element or attribute this pattern matches * or null if this pattern matches any or more than one name. */ public String getMatchesNodeName() { return null; } public Pattern simplify() { return this; } /** Returns a textual representation of this pattern */ public abstract String getText(); } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/PatternHandler.java100644 0 0 27110 10525225063 30450 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/PatternHandler.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:02 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: PatternHandler.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.pattern; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.jaxen.JaxenHandler; import org.xmlpull.v1.builder.xpath.jaxen.expr.FilterExpr; import org.xmlpull.v1.builder.xpath.jaxen.expr.Expr; import org.xmlpull.v1.builder.xpath.saxpath.Axis; import java.util.LinkedList; /** SAXPath XPathHandler implementation capable * of building Jaxen expression trees which can walk various * different object models. * * @author bob mcwhirter (bob@werken.com) */ public class PatternHandler extends JaxenHandler { private Pattern pattern; public PatternHandler() { } /** Retrieve the simplified Jaxen Pattern expression tree. * *

      * This method is only valid once XPathReader.parse(...) * successfully returned. *

      * * @return The Pattern expression tree. */ public Pattern getPattern() { return getPattern( true ); } /** Retrieve the Jaxen Pattern expression tree, optionally * simplified. * *

      * This method is only valid once XPathReader.parse(...) * successfully returned. *

      * * @return The Pattern expression tree. */ public Pattern getPattern(boolean shouldSimplify) { if ( shouldSimplify && ! this.simplified ) { //System.err.println("simplifyin...."); this.pattern.simplify(); this.simplified = true; } return this.pattern; } public void endXPath() throws JaxenException { this.pattern = (Pattern) pop(); System.out.println( "stack is: " + stack ); popFrame(); } public void endPathExpr() throws JaxenException { //System.err.println("endPathExpr()"); // PathExpr ::= LocationPath // | FilterExpr // | FilterExpr / RelativeLocationPath // | FilterExpr // RelativeLocationPath // // If the current stack-frame has two items, it's a // FilterExpr and a LocationPath (of some flavor). // // If the current stack-frame has one item, it's simply // a FilterExpr, and more than like boils down to a // primary expr of some flavor. But that's for another // method... LinkedList frame = popFrame(); System.out.println( "endPathExpr(): " + frame ); push( frame.removeFirst() ); /* LocationPathPattern locationPath = new LocationPathPattern(); push( locationPath ); while (! frame.isEmpty() ) { Object filter = frame.removeLast(); if ( filter instanceof NodeTest ) { locationPath.setNodeTest( (NodeTest) filter ); } else if ( filter instanceof FilterExpr ) { locationPath.addFilter( (FilterExpr) filter ); } else if ( filter instanceof LocationPathPattern ) { LocationPathPattern parent = (LocationPathPattern) filter; locationPath.setParentPattern( parent ); locationPath = parent; } else if ( filter != null ) { throw new JaxenException( "Unknown filter: " + filter ); } } */ } public void startAbsoluteLocationPath() throws JaxenException { //System.err.println("startAbsoluteLocationPath()"); pushFrame(); push( createAbsoluteLocationPath() ); } public void endAbsoluteLocationPath() throws JaxenException { //System.err.println("endAbsoluteLocationPath()"); endLocationPath(); } public void startRelativeLocationPath() throws JaxenException { //System.err.println("startRelativeLocationPath()"); pushFrame(); push( createRelativeLocationPath() ); } public void endRelativeLocationPath() throws JaxenException { //System.err.println("endRelativeLocationPath()"); endLocationPath(); } protected void endLocationPath() throws JaxenException { // start at the back, its the main pattern then add everything else as LinkedList list = popFrame(); System.out.println( "endLocationPath: " + list ); LocationPathPattern locationPath = (LocationPathPattern) list.removeFirst(); push( locationPath ); boolean doneNodeTest = false; while ( ! list.isEmpty() ) { Object filter = list.removeFirst(); if ( filter instanceof NodeTest ) { if ( doneNodeTest ) { LocationPathPattern parent = new LocationPathPattern( (NodeTest) filter ); locationPath.setParentPattern( parent ); locationPath = parent; doneNodeTest = false; } else { locationPath.setNodeTest( (NodeTest) filter ); } } else if ( filter instanceof FilterExpr ) { locationPath.addFilter( (FilterExpr) filter ); } else if ( filter instanceof LocationPathPattern ) { LocationPathPattern parent = (LocationPathPattern) filter; locationPath.setParentPattern( parent ); locationPath = parent; doneNodeTest = false; } } } public void startNameStep(int axis, String prefix, String localName) throws JaxenException { //System.err.println("startNameStep(" + axis + ", " + prefix + ", " + localName + ")"); pushFrame(); short nodeType = Pattern.ELEMENT_NODE; switch ( axis ) { case Axis.ATTRIBUTE: nodeType = Pattern.ATTRIBUTE_NODE; break; case Axis.NAMESPACE: nodeType = Pattern.NAMESPACE_NODE; break; } if ( prefix != null && prefix.length() > 0 && ! prefix.equals( "*" ) ) { push( new NamespaceTest( prefix, nodeType ) ); } if ( localName != null && localName.length() > 0 && ! localName.equals( "*" ) ) { push( new NameTest( localName, nodeType ) ); } } public void startTextNodeStep(int axis) throws JaxenException { //System.err.println("startTextNodeStep()"); pushFrame(); push( new NodeTypeTest( Pattern.TEXT_NODE ) ); } public void startCommentNodeStep(int axis) throws JaxenException { //System.err.println("startCommentNodeStep()"); pushFrame(); push( new NodeTypeTest( Pattern.COMMENT_NODE ) ); } public void startAllNodeStep(int axis) throws JaxenException { //System.err.println("startAllNodeStep()"); pushFrame(); push( AnyNodeTest.getInstance() ); } public void startProcessingInstructionNodeStep(int axis, String name) throws JaxenException { //System.err.println("startProcessingInstructionStep()"); pushFrame(); // XXXX: should we throw an exception if name is present? push( new NodeTypeTest( Pattern.PROCESSING_INSTRUCTION_NODE ) ); } protected void endStep() { LinkedList list = popFrame(); if ( ! list.isEmpty() ) { push( list.removeFirst() ); if ( ! list.isEmpty() ) { System.out.println( "List should now be empty!" + list ); } } } public void startUnionExpr() throws JaxenException { //System.err.println("startUnionExpr()"); } public void endUnionExpr(boolean create) throws JaxenException { //System.err.println("endUnionExpr()"); if ( create ) { //System.err.println("makeUnionExpr"); Expr rhs = (Expr) pop(); Expr lhs = (Expr) pop(); push( getXPathFactory().createUnionExpr( lhs, rhs ) ); } } protected Pattern createAbsoluteLocationPath() { return new LocationPathPattern( NodeTypeTest.DOCUMENT_TEST ); } protected Pattern createRelativeLocationPath() { return new LocationPathPattern(); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/PatternParser.java100644 0 0 25501 10525225063 30331 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/PatternParser.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:02 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: PatternParser.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.pattern; import java.util.Iterator; import java.util.List; import java.util.ListIterator; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.jaxen.JaxenHandler; import org.xmlpull.v1.builder.xpath.jaxen.expr.*; import org.xmlpull.v1.builder.xpath.saxpath.Axis; import org.xmlpull.v1.builder.xpath.saxpath.SAXPathException; import org.xmlpull.v1.builder.xpath.saxpath.XPathReader; import org.xmlpull.v1.builder.xpath.saxpath.helpers.XPathReaderFactory; /** PatternParser is a helper class for parsing * XSLT patterns * * @author James Strachan */ public class PatternParser { private static final boolean TRACE = false; private static final boolean USE_HANDLER = false; public static Pattern parse(String text) throws JaxenException, SAXPathException { if ( USE_HANDLER ) { XPathReader reader = XPathReaderFactory.createReader(); PatternHandler handler = new PatternHandler(); handler.setXPathFactory( new DefaultXPathFactory() ); reader.setXPathHandler( handler ); reader.parse( text ); return handler.getPattern(); } else { XPathReader reader = XPathReaderFactory.createReader(); JaxenHandler handler = new JaxenHandler(); handler.setXPathFactory( new DefaultXPathFactory() ); reader.setXPathHandler( handler ); reader.parse( text ); Pattern pattern = convertExpr( handler.getXPathExpr().getRootExpr() ); return pattern.simplify(); } } protected static Pattern convertExpr(Expr expr) throws JaxenException { if ( TRACE ) { System.out.println( "Converting: " + expr + " into a pattern." ); } if ( expr instanceof LocationPath ) { return convertExpr( (LocationPath) expr ); } else if ( expr instanceof FilterExpr ) { LocationPathPattern answer = new LocationPathPattern(); answer.addFilter( (FilterExpr) expr ); return answer; } else if ( expr instanceof UnionExpr ) { UnionExpr unionExpr = (UnionExpr) expr; Pattern lhs = convertExpr( unionExpr.getLHS() ); Pattern rhs = convertExpr( unionExpr.getRHS() ); return new UnionPattern( lhs, rhs ); } else { LocationPathPattern answer = new LocationPathPattern(); answer.addFilter( new DefaultFilterExpr( expr ) ); return answer; } } protected static LocationPathPattern convertExpr(LocationPath locationPath) throws JaxenException { LocationPathPattern answer = new LocationPathPattern(); //answer.setAbsolute( locationPath.isAbsolute() ); List steps = locationPath.getSteps(); // go through steps backwards LocationPathPattern path = answer; boolean first = true; for ( ListIterator iter = steps.listIterator( steps.size() ); iter.hasPrevious(); ) { Step step = (Step) iter.previous(); if ( first ) { first = false; path = convertStep( path, step ); } else { if ( navigationStep( step ) ) { LocationPathPattern parent = new LocationPathPattern(); int axis = step.getAxis(); if ( axis == Axis.DESCENDANT || axis == Axis.DESCENDANT_OR_SELF ) { path.setAncestorPattern( parent ); } else { path.setParentPattern( parent ); } path = parent; } path = convertStep( path, step ); } } if ( locationPath.isAbsolute() ) { LocationPathPattern parent = new LocationPathPattern( NodeTypeTest.DOCUMENT_TEST ); path.setParentPattern( parent ); } return answer; } protected static LocationPathPattern convertStep(LocationPathPattern path, Step step) throws JaxenException { if ( step instanceof DefaultAllNodeStep ) { int axis = step.getAxis(); if ( axis == Axis.ATTRIBUTE ) { path.setNodeTest( NodeTypeTest.ATTRIBUTE_TEST ); } else { path.setNodeTest( NodeTypeTest.ELEMENT_TEST ); } } else if ( step instanceof DefaultCommentNodeStep ) { path.setNodeTest( NodeTypeTest.COMMENT_TEST ); } else if ( step instanceof DefaultProcessingInstructionNodeStep ) { path.setNodeTest( NodeTypeTest.PROCESSING_INSTRUCTION_TEST ); } else if ( step instanceof DefaultTextNodeStep ) { path.setNodeTest( TextNodeTest.SINGLETON ); } else if ( step instanceof DefaultCommentNodeStep ) { path.setNodeTest( NodeTypeTest.COMMENT_TEST ); } else if ( step instanceof DefaultNameStep ) { DefaultNameStep nameStep = (DefaultNameStep) step; String localName = nameStep.getLocalName(); String prefix = nameStep.getPrefix(); int axis = nameStep.getAxis(); short nodeType = Pattern.ELEMENT_NODE; if ( axis == Axis.ATTRIBUTE ) { nodeType = Pattern.ATTRIBUTE_NODE; } if ( nameStep.isMatchesAnyName() ) { if ( prefix.length() == 0 || prefix.equals( "*" ) ) { if ( axis == Axis.ATTRIBUTE ) { path.setNodeTest( NodeTypeTest.ATTRIBUTE_TEST ); } else { path.setNodeTest( NodeTypeTest.ELEMENT_TEST ); } } else { path.setNodeTest( new NamespaceTest( prefix, nodeType ) ); } } else { path.setNodeTest( new NameTest( localName, nodeType ) ); // XXXX: should support namespace in the test too } return convertDefaultStep(path, nameStep); } else if ( step instanceof DefaultStep ) { return convertDefaultStep(path, (DefaultStep) step); } else { throw new JaxenException( "Cannot convert: " + step + " to a Pattern" ); } return path; } protected static LocationPathPattern convertDefaultStep(LocationPathPattern path, DefaultStep step) throws JaxenException { List predicates = step.getPredicates(); if ( ! predicates.isEmpty() ) { DefaultFilterExpr filter = new DefaultFilterExpr(); for ( Iterator iter = predicates.iterator(); iter.hasNext(); ) { filter.addPredicate( (Predicate) iter.next() ); } path.addFilter( filter ); } return path; } protected static boolean navigationStep( Step step ) { if ( step instanceof DefaultNameStep ) { return true; } else if ( step.getClass().equals( DefaultStep.class ) ) { DefaultStep defaultStep = (DefaultStep) step; return ! step.getPredicates().isEmpty(); } else { return true; } } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/TextNodeTest.java100644 0 0 7273 10525225063 30117 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/TextNodeTest.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:41 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: TextNodeTest.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.pattern; import org.xmlpull.v1.builder.xpath.jaxen.Context; /**

      TextNodeTest matches any text node.

      * * @author James Strachan * @version $Revision: 1.1 $ */ public class TextNodeTest extends NodeTest { public static final TextNodeTest SINGLETON = new TextNodeTest(); public TextNodeTest() { } /** @return true if the pattern matches the given node */ public boolean matches( Object node, Context context ) { return context.getNavigator().isText( node ); } public double getPriority() { return -0.5; } public String getText() { return "text()"; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/UnionPattern.java100644 0 0 12757 10525225063 30176 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/pattern/UnionPattern.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:41 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: UnionPattern.java,v 1.1 2004/06/16 15:55:41 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.pattern; import org.xmlpull.v1.builder.xpath.jaxen.Context; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; /**

      UnionPattern represents a union pattern.

      * * @author James Strachan * @version $Revision: 1.1 $ */ public class UnionPattern extends Pattern { private Pattern lhs; private Pattern rhs; private short nodeType = ANY_NODE; private String matchesNodeName = null; public UnionPattern() { } public UnionPattern(Pattern lhs, Pattern rhs) { this.lhs = lhs; this.rhs = rhs; init(); } public Pattern getLHS() { return lhs; } public void setLHS(Pattern lhs) { this.lhs = lhs; init(); } public Pattern getRHS() { return rhs; } public void setRHS(Pattern rhs) { this.rhs = rhs; init(); } // Pattern interface //------------------------------------------------------------------------- /** @return true if the pattern matches the given node */ public boolean matches( Object node, Context context ) throws JaxenException { return lhs.matches( node, context ) || rhs.matches( node, context ); } public Pattern[] getUnionPatterns() { return new Pattern[] { lhs, rhs }; } public short getMatchType() { return nodeType; } public String getMatchesNodeName() { return matchesNodeName; } public Pattern simplify() { this.lhs = lhs.simplify(); this.rhs = rhs.simplify(); init(); return this; } public String getText() { return lhs.getText() + " | " + rhs.getText(); } public String toString() { return super.toString() + "[ lhs: " + lhs + " rhs: " + rhs + " ]"; } // Implementation methods //------------------------------------------------------------------------- private void init() { short type1 = lhs.getMatchType(); short type2 = rhs.getMatchType(); this.nodeType = ( type1 == type2 ) ? type1 : ANY_NODE; String name1 = lhs.getMatchesNodeName(); String name2 = rhs.getMatchesNodeName(); this.matchesNodeName = null; if ( name1 != null && name2 != null && name1.equals( name2 ) ) { this.matchesNodeName = name1; } } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/AncestorAxisIterator.java100644 0 0 7277 10525225063 31146 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/AncestorAxisIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:42 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: AncestorAxisIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.util; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; import java.util.Iterator; public class AncestorAxisIterator extends StackedIterator { public AncestorAxisIterator(Object contextNode, Navigator navigator) { super( contextNode, navigator ); } protected AncestorAxisIterator() { } protected Iterator createIterator(Object contextNode) { try { return getNavigator().getParentAxisIterator( contextNode ); } catch (UnsupportedAxisException e) { // okay... } return null; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/AncestorOrSelfAxisIterator.java100644 0 0 7530 10525225063 32251 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/AncestorOrSelfAxisIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:42 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: AncestorOrSelfAxisIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.util; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; import java.util.Iterator; public class AncestorOrSelfAxisIterator extends AncestorAxisIterator { public AncestorOrSelfAxisIterator(Object contextNode, Navigator navigator) { try { pushIterator( navigator.getSelfAxisIterator( contextNode ) ); } catch (UnsupportedAxisException e) { } init( contextNode, navigator ); } protected Iterator createIterator(Object contextNode) { try { return getNavigator().getParentAxisIterator( contextNode ); } catch (UnsupportedAxisException e) { // okay... } return null; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/DescendantAxisIterator.java100644 0 0 7355 10525225063 31435 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/DescendantAxisIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:42 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DescendantAxisIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.util; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; import java.util.Iterator; public class DescendantAxisIterator extends StackedIterator { public DescendantAxisIterator(Object contextNode, Navigator navigator) { super( contextNode, navigator ); } protected DescendantAxisIterator() { } protected Iterator createIterator(Object contextNode) { try { Iterator iter = getNavigator().getChildAxisIterator( contextNode ); return iter; } catch (UnsupportedAxisException e) { // okay... } return null; } } ././@LongLink100644 0 0 145 10525225067 10257 Lustar 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/DescendantOrSelfAxisIterator.javaxpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/DescendantOrSelfAxisIterator.java100644 0 0 7054 10525225063 32544 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/DescendantOrSelfAxisIterator.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:02 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: DescendantOrSelfAxisIterator.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.util; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; public class DescendantOrSelfAxisIterator extends DescendantAxisIterator { public DescendantOrSelfAxisIterator(Object contextNode, Navigator navigator) { try { pushIterator( navigator.getSelfAxisIterator( contextNode ) ); } catch (UnsupportedAxisException e) { } init( contextNode, navigator ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/FollowingAxisIterator.java100644 0 0 13144 10525225063 31336 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/FollowingAxisIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:42 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: FollowingAxisIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ */ /** * @author Erwin Bolwidt */ package org.xmlpull.v1.builder.xpath.jaxen.util; import java.util.Collections; import java.util.Iterator; import java.util.NoSuchElementException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; public class FollowingAxisIterator implements Iterator { private final static Iterator EMPTY_ITERATOR = Collections.EMPTY_LIST.iterator(); private Object contextNode; private Navigator navigator; private Iterator siblings; private Iterator currentSibling; public FollowingAxisIterator(Object contextNode, Navigator navigator) throws UnsupportedAxisException { this.contextNode = contextNode; this.navigator = navigator; this.siblings = navigator.getFollowingSiblingAxisIterator(contextNode); this.currentSibling = EMPTY_ITERATOR; } private boolean goForward() { while ( ! siblings.hasNext() ) { if ( !goUp() ) { return false; } } Object nextSibling = siblings.next(); this.currentSibling = new DescendantOrSelfAxisIterator(nextSibling, navigator); return true; } private boolean goUp() { if ( contextNode == null || navigator.isDocument(contextNode) ) { return false; } try { contextNode = navigator.getParentNode( contextNode ); if ( contextNode != null && !navigator.isDocument(contextNode) ) { siblings = navigator.getFollowingSiblingAxisIterator(contextNode); return true; } else { return false; } } catch (UnsupportedAxisException e) { // Appearantly, the parent/following-siblings axis is not supported // for the parent node, so the iterator can't go up in the // ancestry anymore. return false; } } public boolean hasNext() { while ( ! currentSibling.hasNext() ) { if ( ! goForward() ) { return false; } } return true; } public Object next() throws NoSuchElementException { if ( ! hasNext() ) { throw new NoSuchElementException(); } return currentSibling.next(); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException(); } } ././@LongLink100644 0 0 145 10525225067 10257 Lustar 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/FollowingSiblingAxisIterator.javaxpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/FollowingSiblingAxisIterator.java100644 0 0 12703 10525225063 32646 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/FollowingSiblingAxisIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:42 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: FollowingSiblingAxisIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.util; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; import java.util.Iterator; import java.util.Collections; import java.util.List; import java.util.ArrayList; import java.util.NoSuchElementException; public class FollowingSiblingAxisIterator implements Iterator { private Object contextNode; private Navigator navigator; private Iterator siblingIter; private Object nextObj; public FollowingSiblingAxisIterator(Object contextNode, Navigator navigator) throws UnsupportedAxisException { this.contextNode = contextNode; this.navigator = navigator; init(); stepAhead(); } private void init() throws UnsupportedAxisException { Object parent = this.navigator.getParentNode( this.contextNode ); List siblings = Collections.EMPTY_LIST; boolean foundSelf = false; if ( parent != null ) { Iterator childIter = this.navigator.getChildAxisIterator( parent ); Object eachChild = null; siblings = new ArrayList(); while ( childIter.hasNext() ) { eachChild = childIter.next(); if ( foundSelf ) { siblings.add( eachChild ); } else if ( eachChild == this.contextNode ) { foundSelf = true; } } } this.siblingIter = siblings.iterator(); } public boolean hasNext() { return ( this.nextObj != null ); } public Object next() throws NoSuchElementException { if ( ! hasNext() ) { throw new NoSuchElementException(); } Object obj = this.nextObj; this.nextObj = null; stepAhead(); return obj; } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException(); } private void stepAhead() { if ( this.nextObj != null ) { return; } Object obj = null; while ( siblingIter.hasNext() ) { obj = siblingIter.next(); if ( this.navigator.isElement( obj ) ) { this.nextObj = obj; break; } } } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/IdentityHashMap.java100644 0 0 70103 10525225063 30070 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/IdentityHashMap.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:42 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: IdentityHashMap.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.util; import java.io.*; import java.util.*; public class IdentityHashMap extends AbstractMap implements Map, Cloneable, java.io.Serializable { /** * The hash table data. */ private transient Entry table[]; /** * The total number of mappings in the hash table. */ private transient int count; /** * The table is rehashed when its size exceeds this threshold. (The * value of this field is (int)(capacity * loadFactor).) * * @serial */ private int threshold; /** * The load factor for the hashtable. * * @serial */ private float loadFactor; /** * The number of times this HashMap has been structurally modified * Structural modifications are those that change the number of mappings in * the HashMap or otherwise modify its internal structure (e.g., * rehash). This field is used to make iterators on Collection-views of * the HashMap fail-fast. (See ConcurrentModificationException). */ private transient int modCount = 0; /** * Constructs a new, empty map with the specified initial * capacity and the specified load factor. * * @param initialCapacity the initial capacity of the HashMap. * @param loadFactor the load factor of the HashMap * @throws IllegalArgumentException if the initial capacity is less * than zero, or if the load factor is nonpositive. */ public IdentityHashMap(int initialCapacity, float loadFactor) { if (initialCapacity < 0) throw new IllegalArgumentException("Illegal Initial Capacity: "+ initialCapacity); if (loadFactor <= 0 || Float.isNaN(loadFactor)) throw new IllegalArgumentException("Illegal Load factor: "+ loadFactor); if (initialCapacity==0) initialCapacity = 1; this.loadFactor = loadFactor; table = new Entry[initialCapacity]; threshold = (int)(initialCapacity * loadFactor); } /** * Constructs a new, empty map with the specified initial capacity * and default load factor, which is 0.75. * * @param initialCapacity the initial capacity of the HashMap. * @throws IllegalArgumentException if the initial capacity is less * than zero. */ public IdentityHashMap(int initialCapacity) { this(initialCapacity, 0.75f); } /** * Constructs a new, empty map with a default capacity and load * factor, which is 0.75. */ public IdentityHashMap() { this(11, 0.75f); } /** * Constructs a new map with the same mappings as the given map. The * map is created with a capacity of twice the number of mappings in * the given map or 11 (whichever is greater), and a default load factor, * which is 0.75. * * @param t the map whose mappings are to be placed in this map. */ public IdentityHashMap(Map t) { this(Math.max(2*t.size(), 11), 0.75f); putAll(t); } /** * Returns the number of key-value mappings in this map. * * @return the number of key-value mappings in this map. */ public int size() { return count; } /** * Returns true if this map contains no key-value mappings. * * @return true if this map contains no key-value mappings. */ public boolean isEmpty() { return count == 0; } /** * Returns true if this map maps one or more keys to the * specified value. * * @param value value whose presence in this map is to be tested. * @return true if this map maps one or more keys to the * specified value. */ public boolean containsValue(Object value) { Entry tab[] = table; if (value==null) { for (int i = tab.length ; i-- > 0 ;) for (Entry e = tab[i] ; e != null ; e = e.next) if (e.value==null) return true; } else { for (int i = tab.length ; i-- > 0 ;) for (Entry e = tab[i] ; e != null ; e = e.next) if (value.equals(e.value)) return true; } return false; } /** * Returns true if this map contains a mapping for the specified * key. * * @return true if this map contains a mapping for the specified * key. * @param key key whose presence in this Map is to be tested. */ public boolean containsKey(Object key) { Entry tab[] = table; if (key != null) { //int hash = key.hashCode(); int hash = System.identityHashCode( key ); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index]; e != null; e = e.next) // if (e.hash==hash && key.equals(e.key)) if (e.hash==hash && ( key == e.key ) ) return true; } else { for (Entry e = tab[0]; e != null; e = e.next) if (e.key==null) return true; } return false; } /** * Returns the value to which this map maps the specified key. Returns * null if the map contains no mapping for this key. A return * value of null does not necessarily indicate that the * map contains no mapping for the key; it's also possible that the map * explicitly maps the key to null. The containsKey * operation may be used to distinguish these two cases. * * @return the value to which this map maps the specified key. * @param key key whose associated value is to be returned. */ public Object get(Object key) { Entry tab[] = table; if (key != null) { // int hash = key.hashCode(); int hash = System.identityHashCode( key ); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index]; e != null; e = e.next) // if ((e.hash == hash) && key.equals(e.key)) if ((e.hash == hash) && ( key == e.key ) ) return e.value; } else { for (Entry e = tab[0]; e != null; e = e.next) if (e.key==null) return e.value; } return null; } /** * Rehashes the contents of this map into a new IdentityHashMap instance * with a larger capacity. This method is called automatically when the * number of keys in this map exceeds its capacity and load factor. */ private void rehash() { int oldCapacity = table.length; Entry oldMap[] = table; int newCapacity = oldCapacity * 2 + 1; Entry newMap[] = new Entry[newCapacity]; modCount++; threshold = (int)(newCapacity * loadFactor); table = newMap; for (int i = oldCapacity ; i-- > 0 ;) { for (Entry old = oldMap[i] ; old != null ; ) { Entry e = old; old = old.next; int index = (e.hash & 0x7FFFFFFF) % newCapacity; e.next = newMap[index]; newMap[index] = e; } } } /** * Associates the specified value with the specified key in this map. * If the map previously contained a mapping for this key, the old * value is replaced. * * @param key key with which the specified value is to be associated. * @param value value to be associated with the specified key. * @return previous value associated with specified key, or null * if there was no mapping for key. A null return can * also indicate that the IdentityHashMap previously associated * null with the specified key. */ public Object put(Object key, Object value) { // Makes sure the key is not already in the IdentityHashMap. Entry tab[] = table; int hash = 0; int index = 0; if (key != null) { // hash = key.hashCode(); hash = System.identityHashCode( key ); index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index] ; e != null ; e = e.next) { // if ((e.hash == hash) && key.equals(e.key)) { if ((e.hash == hash) && ( key == e.key ) ) { Object old = e.value; e.value = value; return old; } } } else { for (Entry e = tab[0] ; e != null ; e = e.next) { if (e.key == null) { Object old = e.value; e.value = value; return old; } } } modCount++; if (count >= threshold) { // Rehash the table if the threshold is exceeded rehash(); tab = table; index = (hash & 0x7FFFFFFF) % tab.length; } // Creates the new entry. Entry e = new Entry(hash, key, value, tab[index]); tab[index] = e; count++; return null; } /** * Removes the mapping for this key from this map if present. * * @param key key whose mapping is to be removed from the map. * @return previous value associated with specified key, or null * if there was no mapping for key. A null return can * also indicate that the map previously associated null * with the specified key. */ public Object remove(Object key) { Entry tab[] = table; if (key != null) { // int hash = key.hashCode(); int hash = System.identityHashCode( key ); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index], prev = null; e != null; prev = e, e = e.next) { // if ((e.hash == hash) && key.equals(e.key)) { if ((e.hash == hash) && ( key == e.key ) ) { modCount++; if (prev != null) prev.next = e.next; else tab[index] = e.next; count--; Object oldValue = e.value; e.value = null; return oldValue; } } } else { for (Entry e = tab[0], prev = null; e != null; prev = e, e = e.next) { if (e.key == null) { modCount++; if (prev != null) prev.next = e.next; else tab[0] = e.next; count--; Object oldValue = e.value; e.value = null; return oldValue; } } } return null; } /** * Copies all of the mappings from the specified map to this one. * * These mappings replace any mappings that this map had for any of the * keys currently in the specified Map. * * @param t Mappings to be stored in this map. */ public void putAll(Map t) { Iterator i = t.entrySet().iterator(); while (i.hasNext()) { Map.Entry e = (Map.Entry) i.next(); put(e.getKey(), e.getValue()); } } /** * Removes all mappings from this map. */ public void clear() { Entry tab[] = table; modCount++; for (int index = tab.length; --index >= 0; ) tab[index] = null; count = 0; } /** * Returns a shallow copy of this IdentityHashMap instance: the keys and * values themselves are not cloned. * * @return a shallow copy of this map. */ public Object clone() { try { IdentityHashMap t = (IdentityHashMap)super.clone(); t.table = new Entry[table.length]; for (int i = table.length ; i-- > 0 ; ) { t.table[i] = (table[i] != null) ? (Entry)table[i].clone() : null; } t.keySet = null; t.entrySet = null; t.values = null; t.modCount = 0; return t; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } } // Views private transient Set keySet = null; private transient Set entrySet = null; private transient Collection values = null; /** * Returns a set view of the keys contained in this map. The set is * backed by the map, so changes to the map are reflected in the set, and * vice-versa. The set supports element removal, which removes the * corresponding mapping from this map, via the Iterator.remove, * Set.remove, removeAll, retainAll, and * clear operations. It does not support the add or * addAll operations. * * @return a set view of the keys contained in this map. */ public Set keySet() { if (keySet == null) { keySet = new AbstractSet() { public Iterator iterator() { return getHashIterator(KEYS); } public int size() { return count; } public boolean contains(Object o) { return containsKey(o); } public boolean remove(Object o) { int oldSize = count; IdentityHashMap.this.remove(o); return count != oldSize; } public void clear() { IdentityHashMap.this.clear(); } }; } return keySet; } /** * Returns a collection view of the values contained in this map. The * collection is backed by the map, so changes to the map are reflected in * the collection, and vice-versa. The collection supports element * removal, which removes the corresponding mapping from this map, via the * Iterator.remove, Collection.remove, * removeAll, retainAll, and clear operations. * It does not support the add or addAll operations. * * @return a collection view of the values contained in this map. */ public Collection values() { if (values==null) { values = new AbstractCollection() { public Iterator iterator() { return getHashIterator(VALUES); } public int size() { return count; } public boolean contains(Object o) { return containsValue(o); } public void clear() { IdentityHashMap.this.clear(); } }; } return values; } /** * Returns a collection view of the mappings contained in this map. Each * element in the returned collection is a Map.Entry. The * collection is backed by the map, so changes to the map are reflected in * the collection, and vice-versa. The collection supports element * removal, which removes the corresponding mapping from the map, via the * Iterator.remove, Collection.remove, * removeAll, retainAll, and clear operations. * It does not support the add or addAll operations. * * @return a collection view of the mappings contained in this map. * @see Map.Entry */ public Set entrySet() { if (entrySet==null) { entrySet = new AbstractSet() { public Iterator iterator() { return getHashIterator(ENTRIES); } public boolean contains(Object o) { if (!(o instanceof Map.Entry)) return false; Map.Entry entry = (Map.Entry)o; Object key = entry.getKey(); Entry tab[] = table; // int hash = (key==null ? 0 : key.hashCode()); int hash = (key==null ? 0 : System.identityHashCode( key ) ); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index]; e != null; e = e.next) if (e.hash==hash && e.equals(entry)) return true; return false; } public boolean remove(Object o) { if (!(o instanceof Map.Entry)) return false; Map.Entry entry = (Map.Entry)o; Object key = entry.getKey(); Entry tab[] = table; // int hash = (key==null ? 0 : key.hashCode()); int hash = (key==null ? 0 : System.identityHashCode( key ) ); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index], prev = null; e != null; prev = e, e = e.next) { if (e.hash==hash && e.equals(entry)) { modCount++; if (prev != null) prev.next = e.next; else tab[index] = e.next; count--; e.value = null; return true; } } return false; } public int size() { return count; } public void clear() { IdentityHashMap.this.clear(); } }; } return entrySet; } private Iterator getHashIterator(int type) { if (count == 0) { return emptyHashIterator; } else { return new HashIterator(type); } } /** * IdentityHashMap collision list entry. */ private static class Entry implements Map.Entry { int hash; Object key; Object value; Entry next; Entry(int hash, Object key, Object value, Entry next) { this.hash = hash; this.key = key; this.value = value; this.next = next; } protected Object clone() { return new Entry(hash, key, value, (next==null ? null : (Entry)next.clone())); } // Map.Entry Ops public Object getKey() { return key; } public Object getValue() { return value; } public Object setValue(Object value) { Object oldValue = this.value; this.value = value; return oldValue; } public boolean equals(Object o) { if (!(o instanceof Map.Entry)) return false; Map.Entry e = (Map.Entry)o; return (key==null ? e.getKey()==null : key.equals(e.getKey())) && (value==null ? e.getValue()==null : value.equals(e.getValue())); } public int hashCode() { return hash ^ (value==null ? 0 : value.hashCode()); } public String toString() { return key+"="+value; } } // Types of Iterators private static final int KEYS = 0; private static final int VALUES = 1; private static final int ENTRIES = 2; private static EmptyHashIterator emptyHashIterator = new EmptyHashIterator(); private static class EmptyHashIterator implements Iterator { EmptyHashIterator() { } public boolean hasNext() { return false; } public Object next() { throw new NoSuchElementException(); } public void remove() { throw new IllegalStateException(); } } private class HashIterator implements Iterator { Entry[] table = IdentityHashMap.this.table; int index = table.length; Entry entry = null; Entry lastReturned = null; int type; /** * The modCount value that the iterator believes that the backing * List should have. If this expectation is violated, the iterator * has detected concurrent modification. */ private int expectedModCount = modCount; HashIterator(int type) { this.type = type; } public boolean hasNext() { Entry e = entry; int i = index; Entry t[] = table; /* Use locals for faster loop iteration */ while (e == null && i > 0) e = t[--i]; entry = e; index = i; return e != null; } public Object next() { if (modCount != expectedModCount) throw new ConcurrentModificationException(); Entry et = entry; int i = index; Entry t[] = table; /* Use locals for faster loop iteration */ while (et == null && i > 0) et = t[--i]; entry = et; index = i; if (et != null) { Entry e = lastReturned = entry; entry = e.next; return type == KEYS ? e.key : (type == VALUES ? e.value : e); } throw new NoSuchElementException(); } public void remove() { if (lastReturned == null) throw new IllegalStateException(); if (modCount != expectedModCount) throw new ConcurrentModificationException(); Entry[] tab = IdentityHashMap.this.table; int index = (lastReturned.hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index], prev = null; e != null; prev = e, e = e.next) { if (e == lastReturned) { modCount++; expectedModCount++; if (prev == null) tab[index] = e.next; else prev.next = e.next; count--; lastReturned = null; return; } } throw new ConcurrentModificationException(); } } /** * Save the state of the IdentityHashMap instance to a stream (i.e., * serialize it). * * @serialData The capacity of the IdentityHashMap (the length of the * bucket array) is emitted (int), followed by the * size of the IdentityHashMap (the number of key-value * mappings), followed by the key (Object) and value (Object) * for each key-value mapping represented by the IdentityHashMap * The key-value mappings are emitted in no particular order. */ private void writeObject(java.io.ObjectOutputStream s) throws IOException { // Write out the threshold, loadfactor, and any hidden stuff s.defaultWriteObject(); // Write out number of buckets s.writeInt(table.length); // Write out size (number of Mappings) s.writeInt(count); // Write out keys and values (alternating) for (int index = table.length-1; index >= 0; index--) { Entry entry = table[index]; while (entry != null) { s.writeObject(entry.key); s.writeObject(entry.value); entry = entry.next; } } } private static final long serialVersionUID = 362498820763181265L; /** * Reconstitute the IdentityHashMap instance from a stream (i.e., * deserialize it). */ private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException { // Read in the threshold, loadfactor, and any hidden stuff s.defaultReadObject(); // Read in number of buckets and allocate the bucket array; int numBuckets = s.readInt(); table = new Entry[numBuckets]; // Read in size (number of Mappings) int size = s.readInt(); // Read the keys and values, and put the mappings in the IdentityHashMap for (int i=0; i and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: LinkedIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.util; import java.util.Iterator; import java.util.NoSuchElementException; import java.util.List; import java.util.ArrayList; public class LinkedIterator implements Iterator { private List iterators; private int cur; public LinkedIterator() { this.iterators = new ArrayList(); this.cur = 0; } public void addIterator(Iterator i) { this.iterators.add( i ); } public boolean hasNext() { boolean has = false; if ( this.cur < this.iterators.size() ) { has = ((Iterator)this.iterators.get( this.cur )).hasNext(); if ( ! has && this.cur < this.iterators.size() ) { ++this.cur; has = hasNext(); } } else { has = false; } return has; } public Object next() { if ( ! hasNext() ) { throw new NoSuchElementException(); } return ((Iterator)this.iterators.get( this.cur )).next(); } public void remove() { throw new UnsupportedOperationException(); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/PrecedingAxisIterator.java100644 0 0 15422 10525225063 31277 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/PrecedingAxisIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:42 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: PrecedingAxisIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.util; import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; import java.util.NoSuchElementException; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; /** * @author Erwin Bolwidt */ public class PrecedingAxisIterator implements Iterator { private final class ReverseDescendantOrSelfAxisIterator extends StackedIterator { ReverseDescendantOrSelfAxisIterator(Object contextNode) throws UnsupportedAxisException { pushIterator(PrecedingAxisIterator.this.navigator.getSelfAxisIterator(contextNode)); init(contextNode, PrecedingAxisIterator.this.navigator); } protected Iterator createIterator(Object contextNode) { try { Iterator iter = PrecedingAxisIterator.this.navigator.getChildAxisIterator(contextNode); if (iter == null) { return null; } LinkedList reverse = new LinkedList(); while ( iter.hasNext() ) { reverse.addFirst( iter.next() ); } return reverse.iterator(); } catch (UnsupportedAxisException e) { // okay... } return null; } } private final static Iterator EMPTY_ITERATOR = Collections.EMPTY_LIST.iterator(); private Object contextNode; private Navigator navigator; private Iterator siblings; private Iterator currentSibling; public PrecedingAxisIterator(Object contextNode, Navigator navigator) throws UnsupportedAxisException { this.contextNode = contextNode; this.navigator = navigator; this.siblings = navigator.getPrecedingSiblingAxisIterator(contextNode); this.currentSibling = EMPTY_ITERATOR; } private boolean goBack() { while ( ! siblings.hasNext() ) { if (!goUp()) { return false; } } Object prevSibling = siblings.next(); try { this.currentSibling = new ReverseDescendantOrSelfAxisIterator( prevSibling ); return true; } catch (UnsupportedAxisException e) { return false; } } private boolean goUp() { if ( contextNode == null || navigator.isDocument(contextNode) ) { return false; } try { contextNode = navigator.getParentNode(contextNode); if ( contextNode != null && ! navigator.isDocument(contextNode) ) { siblings = navigator.getPrecedingSiblingAxisIterator(contextNode); return true; } return false; } catch (UnsupportedAxisException e) { // Appearantly, the preceding-siblings axis is not supported // for the parent node, so the iterator can't go up in the // ancestry anymore. return false; } } public boolean hasNext() { while ( ! currentSibling.hasNext() ) { if ( ! goBack() ) { return false; } } return true; } public Object next() throws NoSuchElementException { if ( ! hasNext() ) { throw new NoSuchElementException(); } return currentSibling.next(); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException(); } } ././@LongLink100644 0 0 145 10525225067 10257 Lustar 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/PrecedingSiblingAxisIterator.javaxpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/PrecedingSiblingAxisIterator.java100644 0 0 13055 10525225063 32607 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/PrecedingSiblingAxisIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:42 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: PrecedingSiblingAxisIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.util; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import org.xmlpull.v1.builder.xpath.jaxen.UnsupportedAxisException; import java.util.Iterator; import java.util.Collections; import java.util.List; import java.util.LinkedList; import java.util.NoSuchElementException; public class PrecedingSiblingAxisIterator implements Iterator { private Object contextNode; private Navigator navigator; private Iterator siblingIter; private Object nextObj; public PrecedingSiblingAxisIterator(Object contextNode, Navigator navigator) throws UnsupportedAxisException { this.contextNode = contextNode; this.navigator = navigator; init(); stepAhead(); } private void init() throws UnsupportedAxisException { Object parent = this.navigator.getParentNode( this.contextNode ); List siblings = Collections.EMPTY_LIST; if ( parent != null ) { Iterator childIter = this.navigator.getChildAxisIterator( parent ); Object eachChild = null; siblings = new LinkedList(); while ( childIter.hasNext() ) { eachChild = childIter.next(); if ( eachChild == this.contextNode ) { break; } ((LinkedList)siblings).addFirst( eachChild ); } } this.siblingIter = siblings.iterator(); } public boolean hasNext() { return ( this.nextObj != null ); } public Object next() throws NoSuchElementException { if ( ! hasNext() ) { throw new NoSuchElementException(); } Object obj = this.nextObj; this.nextObj = null; stepAhead(); return obj; } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException(); } private void stepAhead() { if ( this.nextObj != null ) { return; } Object obj = null; while ( siblingIter.hasNext() ) { obj = siblingIter.next(); this.nextObj = obj; break; /* This should iterate through all nodes, not necessarily just elements if ( this.navigator.isElement( obj ) ) { this.nextObj = obj; break; } */ } } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/SelfAxisIterator.java100644 0 0 7266 10525225063 30257 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/SelfAxisIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:42 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: SelfAxisIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.util; import java.util.Iterator; import java.util.NoSuchElementException; public class SelfAxisIterator implements Iterator { private boolean hasNext; private Object node; public SelfAxisIterator(Object node) { this.hasNext = true; this.node = node; } public boolean hasNext() { return this.hasNext; } public Object next() throws NoSuchElementException { if ( hasNext() ) { this.hasNext = false; return this.node; } throw new NoSuchElementException(); } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException(); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/SingleObjectIterator.java100644 0 0 7167 10525225063 31111 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/SingleObjectIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:42 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: SingleObjectIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.util; import java.util.Iterator; import java.util.NoSuchElementException; public class SingleObjectIterator implements Iterator { private Object object; private boolean seen; public SingleObjectIterator(Object object) { this.object = object; this.seen = false; } public boolean hasNext() { return ! this.seen; } public Object next() { if ( hasNext() ) { this.seen = true; return this.object; } throw new NoSuchElementException(); } public void remove() { throw new UnsupportedOperationException(); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/StackedIterator.java100644 0 0 13053 10525225063 30126 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/jaxen/util/StackedIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:42 $ * * ==================================================================== * * 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@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@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 and * James Strachan . For more information on the * Jaxen Project, please see . * * $Id: StackedIterator.java,v 1.1 2004/06/16 15:55:42 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.jaxen.util; import org.xmlpull.v1.builder.xpath.jaxen.Navigator; import java.util.Iterator; import java.util.NoSuchElementException; import java.util.LinkedList; import java.util.Set; import java.util.HashSet; public abstract class StackedIterator implements Iterator { private Object contextNode; private LinkedList iteratorStack; private Navigator navigator; private Set created; public StackedIterator(Object contextNode, Navigator navigator) { this.iteratorStack = new LinkedList(); this.created = new HashSet(); init( contextNode, navigator ); } protected StackedIterator() { this.iteratorStack = new LinkedList(); this.created = new HashSet(); } protected void init(Object contextNode, Navigator navigator) { this.contextNode = contextNode; this.navigator = navigator; pushIterator( internalCreateIterator( contextNode ) ); } private Iterator internalCreateIterator(Object contextNode) { if ( this.created.contains( contextNode ) ) { return null; } this.created.add( contextNode ); return createIterator( contextNode ); } public boolean hasNext() { Iterator curIter = currentIterator(); if ( curIter == null ) { return false; } return curIter.hasNext(); } public Object next() throws NoSuchElementException { if ( ! hasNext() ) { throw new NoSuchElementException(); } Iterator curIter = currentIterator(); Object object = curIter.next(); pushIterator( internalCreateIterator( object ) ); return object; } public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException(); } abstract protected Iterator createIterator(Object contextNode); protected void pushIterator(Iterator iter) { if ( iter != null ) { this.iteratorStack.addLast( iter ); } } private Iterator currentIterator() { while ( iteratorStack.size() > 0 ) { Iterator curIter = (Iterator) iteratorStack.getFirst(); if ( curIter.hasNext() ) { return curIter; } iteratorStack.removeFirst(); } return null; } protected Navigator getNavigator() { return this.navigator; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/Axis.java100644 0 0 15245 10525225063 25335 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/Axis.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ * $Revision: 1.2 $ * $Date: 2005/08/11 22:44:02 $ * * ==================================================================== * * Copyright (C) 2000-2002 werken digital. * 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 "SAXPath" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact license@saxpath.org. * * 4. Products derived from this software may not be called "SAXPath", nor * may "SAXPath" appear in their name, without prior written permission * from the SAXPath Project Management (pm@saxpath.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 * SAXPath Project (http://www.saxpath.org/)." * Alternatively, the acknowledgment may be graphical using the logos * available at http://www.saxpath.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 SAXPath 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 SAXPath Project and was originally * created by bob mcwhirter and * James Strachan . For more information on the * SAXPath Project, please see . * * $Id: Axis.java,v 1.2 2005/08/11 22:44:02 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.saxpath; public class Axis { /** Marker for an invalid axis */ public final static int INVALID_AXIS = 0; /** The child axis */ public final static int CHILD = 1; /** The descendant axis */ public final static int DESCENDANT = 2; /** The parent axis */ public final static int PARENT = 3; /** The ancestor axis */ public final static int ANCESTOR = 4; /** The following-sibling axis */ public final static int FOLLOWING_SIBLING = 5; /** The preceding-sibling axis */ public final static int PRECEDING_SIBLING = 6; /** The following axis */ public final static int FOLLOWING = 7; /** The preceding axis */ public final static int PRECEDING = 8; /** The attribute axis */ public final static int ATTRIBUTE = 9; /** The namespace axis */ public final static int NAMESPACE = 10; /** The self axis */ public final static int SELF = 11; /** The descendant-or-self axis */ public final static int DESCENDANT_OR_SELF = 12; /** The ancestor-or-self axis */ public final static int ANCESTOR_OR_SELF = 13; public static String lookup(int axisNum) { switch ( axisNum ) { case CHILD: return "child"; case DESCENDANT: return "descendant"; case PARENT: return "parent"; case ANCESTOR: return "ancestor"; case FOLLOWING_SIBLING: return "following-sibling"; case PRECEDING_SIBLING: return "preceding-sibling"; case FOLLOWING: return "following"; case PRECEDING: return "preceding"; case ATTRIBUTE: return "attribute"; case NAMESPACE: return "namespace"; case SELF: return "self"; case DESCENDANT_OR_SELF: return "descendant-or-self"; case ANCESTOR_OR_SELF: return "ancestor-or-self"; } return null; } public static int lookup(String axisName) { if ( "child".equals( axisName ) ) { return CHILD; } if ( "descendant".equals( axisName ) ) { return DESCENDANT; } if ( "parent".equals( axisName ) ) { return PARENT; } if ( "ancestor".equals( axisName ) ) { return ANCESTOR; } if ( "following-sibling".equals( axisName ) ) { return FOLLOWING_SIBLING; } if ( "preceding-sibling".equals( axisName ) ) { return PRECEDING_SIBLING; } if ( "following".equals( axisName ) ) { return FOLLOWING; } if ( "preceding".equals( axisName ) ) { return PRECEDING; } if ( "attribute".equals( axisName ) ) { return ATTRIBUTE; } if ( "namespace".equals( axisName ) ) { return NAMESPACE; } if ( "self".equals( axisName ) ) { return SELF; } if ( "descendant-or-self".equals( axisName ) ) { return DESCENDANT_OR_SELF; } if ( "ancestor-or-self".equals( axisName ) ) { return ANCESTOR_OR_SELF; } return INVALID_AXIS; } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/Operator.java100644 0 0 7275 10525225063 26210 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/Operator.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:43 $ * * ==================================================================== * * Copyright (C) 2000-2002 werken digital. * 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 "SAXPath" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact license@saxpath.org. * * 4. Products derived from this software may not be called "SAXPath", nor * may "SAXPath" appear in their name, without prior written permission * from the SAXPath Project Management (pm@saxpath.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 * SAXPath Project (http://www.saxpath.org/)." * Alternatively, the acknowledgment may be graphical using the logos * available at http://www.saxpath.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 SAXPath 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 SAXPath Project and was originally * created by bob mcwhirter and * James Strachan . For more information on the * SAXPath Project, please see . * * $Id: Operator.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.saxpath; public interface Operator { final static int NO_OP = 0; // Equality final static int EQUALS = 1; final static int NOT_EQUALS = 2; // Relational final static int LESS_THAN = 3; final static int LESS_THAN_EQUALS = 4; final static int GREATER_THAN = 5; final static int GREATER_THAN_EQUALS = 6; // Additive final static int ADD = 7; final static int SUBTRACT = 8; // Multiplicative final static int MULTIPLY = 9; final static int MOD = 10; final static int DIV = 11; // Unary final static int NEGATIVE = 12; } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/SAXPathEventSource.java100644 0 0 7134 10525225063 30042 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/SAXPathEventSource.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:43 $ * * ==================================================================== * * Copyright (C) 2000-2002 werken digital. * 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 "SAXPath" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact license@saxpath.org. * * 4. Products derived from this software may not be called "SAXPath", nor * may "SAXPath" appear in their name, without prior written permission * from the SAXPath Project Management (pm@saxpath.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 * SAXPath Project (http://www.saxpath.org/)." * Alternatively, the acknowledgment may be graphical using the logos * available at http://www.saxpath.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 SAXPath 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 SAXPath Project and was originally * created by bob mcwhirter and * James Strachan . For more information on the * SAXPath Project, please see . * * $Id: SAXPathEventSource.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.saxpath; /** Interface for any object capable of generating * SAXPath events to an {@link XPathHandler}. * * @author bob mcwhirter (bob@werken.com) */ public interface SAXPathEventSource { /** Set the {@link XPathHandler} to receive * event callbacks during the parse. * * @param handler The handler to receive callbacks. */ void setXPathHandler(XPathHandler handler); /** Retrieve the current {@link XPathHandler} * which receives the event callbacks. * * @return The currently installed XPathHandler. */ XPathHandler getXPathHandler(); } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/SAXPathException.java100644 0 0 6516 10525225063 27541 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/SAXPathException.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:43 $ * * ==================================================================== * * Copyright (C) 2000-2002 werken digital. * 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 "SAXPath" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact license@saxpath.org. * * 4. Products derived from this software may not be called "SAXPath", nor * may "SAXPath" appear in their name, without prior written permission * from the SAXPath Project Management (pm@saxpath.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 * SAXPath Project (http://www.saxpath.org/)." * Alternatively, the acknowledgment may be graphical using the logos * available at http://www.saxpath.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 SAXPath 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 SAXPath Project and was originally * created by bob mcwhirter and * James Strachan . For more information on the * SAXPath Project, please see . * * $Id: SAXPathException.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.saxpath; import org.xmlpull.v1.builder.XmlBuilderException; /** Base of all SAXPath exceptions. * * @author bob mcwhirter (bob@werken.com) */ public class SAXPathException extends XmlBuilderException { /** Construct with a given message. * * @param msg The error message. */ public SAXPathException(String msg) { super( msg ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/SAXPathParseException.java100644 0 0 6505 10525225063 30532 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/SAXPathParseException.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:43 $ * * ==================================================================== * * Copyright (C) 2000-2002 werken digital. * 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 "SAXPath" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact license@saxpath.org. * * 4. Products derived from this software may not be called "SAXPath", nor * may "SAXPath" appear in their name, without prior written permission * from the SAXPath Project Management (pm@saxpath.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 * SAXPath Project (http://www.saxpath.org/)." * Alternatively, the acknowledgment may be graphical using the logos * available at http://www.saxpath.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 SAXPath 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 SAXPath Project and was originally * created by bob mcwhirter and * James Strachan . For more information on the * SAXPath Project, please see . * * $Id: SAXPathParseException.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.saxpath; /** Base of all parse-related SAXPath exceptions. * * @author bob mcwhirter (bob@werken.com) */ public class SAXPathParseException extends SAXPathException { /** Construct with the given message. * * @param msg The error message. */ public SAXPathParseException(String msg) { super( msg ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/XPathHandler.java100644 0 0 30373 10525225063 26752 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/XPathHandler.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:43 $ * * ==================================================================== * * Copyright (C) 2000-2002 werken digital. * 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 "SAXPath" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact license@saxpath.org. * * 4. Products derived from this software may not be called "SAXPath", nor * may "SAXPath" appear in their name, without prior written permission * from the SAXPath Project Management (pm@saxpath.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 * SAXPath Project (http://www.saxpath.org/)." * Alternatively, the acknowledgment may be graphical using the logos * available at http://www.saxpath.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 SAXPath 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 SAXPath Project and was originally * created by bob mcwhirter and * James Strachan . For more information on the * SAXPath Project, please see . * * $Id: XPathHandler.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.saxpath; /** Interface for event-based XPath parsing. * *

      * A {@link XPathReader} generates callbacks into * an XPathHandler to allow for custom * handling of the parse. *

      * *

      * The callbacks very closely match the productions * listed in the W3C XPath specification. Gratuitous * productions (ie, Expr/startExpr()/endExpr())are not * included in this API. *

      * * @author bob mcwhirter (bob@werken.com) */ public interface XPathHandler { /** Receive notification of the start of an XPath expression parse. */ void startXPath() throws SAXPathException; /** Receive notification of the end of an XPath expression parse. */ void endXPath() throws SAXPathException; /** Receive notification of the start of a path expression. */ void startPathExpr() throws SAXPathException; /** Receive notification of the end of a path expression. */ void endPathExpr() throws SAXPathException; /** Receive notification of the start of an absolute location path expression. */ void startAbsoluteLocationPath() throws SAXPathException; /** Receive notification of the end of an absolute location path expression. */ void endAbsoluteLocationPath() throws SAXPathException; /** Receive notification of the start of a relative location path expression. */ void startRelativeLocationPath() throws SAXPathException; /** Receive notification of the end of a relative location path expression. */ void endRelativeLocationPath() throws SAXPathException; /** Receive notification of the start of a name step. * * @param axis The axis of this step. * @param prefix The namespace prefix for the name to test, * or the empty-string if no prefix is specified. * @param localName The local part of the name to test. */ void startNameStep(int axis, String prefix, String localName) throws SAXPathException; /** Receive notification of the end of a NameStep */ void endNameStep() throws SAXPathException; /** Receive notification of the start of a text() step. * * @param axis The axis of this step. */ void startTextNodeStep(int axis) throws SAXPathException; /** Receive notification of the end of a text() step. */ void endTextNodeStep() throws SAXPathException; /** Receive notification of the start of a comment() step. * * @param axis The axis of this step. */ void startCommentNodeStep(int axis) throws SAXPathException; /** Receive notification of the end of a comment() step. */ void endCommentNodeStep() throws SAXPathException; /** Receive notification of the start of a node() step. * * @param axis The axis of this step. */ void startAllNodeStep(int axis) throws SAXPathException; /** Receive notification of the end of a node() step. */ void endAllNodeStep() throws SAXPathException; /** Receive notification of the start of a processing-instruction(...) step. * * @param axis The axis of this step. * @param name The name of the processing-instruction, of * the empty-string if none is specified. */ void startProcessingInstructionNodeStep(int axis, String name) throws SAXPathException; /** Receive notification of the end of a processing-instruction(...) step. */ void endProcessingInstructionNodeStep() throws SAXPathException; /** Receive notification of the start of a predicate. */ void startPredicate() throws SAXPathException; /** Receive notification of the end of a predicate. */ void endPredicate() throws SAXPathException; /** Receive notification of the start of a filter expression. */ void startFilterExpr() throws SAXPathException; /** Receive notification of the end of a filter expression. */ void endFilterExpr() throws SAXPathException; /** Receive notification of the start of an 'or' expression. */ void startOrExpr() throws SAXPathException; /** Receive notification of the end of an 'or' expression. * * @param create Flag that indicates if this expression * should truly be instantiated, or if it was just * a pass-through, based upon the grammar productions. */ void endOrExpr(boolean create) throws SAXPathException; /** Receive notification of the start of an 'and' expression. */ void startAndExpr() throws SAXPathException; /** Receive notification of the end of an 'and' expression. * * @param create Flag that indicates if this expression * should truly be instantiated, or if it was just * a pass-through, based upon the grammar productions. */ void endAndExpr(boolean create) throws SAXPathException; /** Receive notification of the start of an equality ('=' or '!=') expression. */ void startEqualityExpr() throws SAXPathException; /** Receive notification of the end of an equality ('=' or '!=') expression. * * @param operator The operator specific to this particular * equality expression. If null, this expression * is only a pass-through, and should not actually * be instantiated. */ void endEqualityExpr(int equalityOperator) throws SAXPathException; /** Receive notification of the start of a relational ('<', '>', '<=', or '>=') expression. */ void startRelationalExpr() throws SAXPathException; /** Receive notification of the start of a relational ('<', '>', '<=', or '>=') expression. * * @param operator The operator specific to this particular * relational expression. If null, this expression * is only a pass-through, and should not actually * be instantiated. */ void endRelationalExpr(int relationalOperator) throws SAXPathException; /** Receive notification of the start of an additive ('+' or '-') expression. */ void startAdditiveExpr() throws SAXPathException; /** Receive notification of the end of an additive ('+' or '-') expression. * * @param operator The operator specific to this particular * additive expression. If null, this expression * is only a pass-through, and should not actually * be instantiated. */ void endAdditiveExpr(int additiveOperator) throws SAXPathException; /** Receive notification of the start of a multiplicative ('*', 'div' or 'mod') expression. */ void startMultiplicativeExpr() throws SAXPathException; /** Receive notification of the start of a multiplicative ('*', 'div' or 'mod') expression. * * @param operator The operator specific to this particular * multiplicative expression. If null, this expression * is only a pass-through, and should not actually * be instantiated. */ void endMultiplicativeExpr(int multiplicativeOperator) throws SAXPathException; /** Receive notification of the start of a unary ('+' or '-') expression. */ void startUnaryExpr() throws SAXPathException; /** Receive notification of the end of a unary ('+' or '-') expression. * * @param operator The operator specific to this particular * unary expression. If null, this expression is only * a pass-through, and should not actually be instantiated. * If not {@link Operator#NO_OP}, it'll always be {@link Operator#NEGATIVE}. */ void endUnaryExpr(int unaryOperator) throws SAXPathException; /** Receive notification of the start of a union ('|') expression. */ void startUnionExpr() throws SAXPathException; /** Receive notification of the end of a union ('|') expression. * * @param create Flag that indicates if this expression * should truly be instantiated, or if it was just * a pass-through, based upon the grammar productions. */ void endUnionExpr(boolean create) throws SAXPathException; /** Receive notification of a number expression. * * @param number The number value. */ void number(int number) throws SAXPathException; /** Receive notification of a number expression. * * @param number The number value. */ void number(double number) throws SAXPathException; /** Receive notification of a literal expression. * * @param literal The string literal value. */ void literal(String literal) throws SAXPathException; /** Receive notification of a variable-reference expression. * * @param prefix The ns-uri prefix of the variable. * @param variableName The name of the variable. */ void variableReference(String prefix, String variableName) throws SAXPathException; /** Receive notification of a function call. * * @param prefix The ns-uri prefix of the function. * @param functionName The name of the function. */ void startFunction(String prefix, String functionName) throws SAXPathException; /** Receive notification of the end of a function call. */ void endFunction() throws SAXPathException; } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/XPathReader.java100644 0 0 7023 10525225063 26553 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/XPathReader.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:43 $ * * ==================================================================== * * Copyright (C) 2000-2002 werken digital. * 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 "SAXPath" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact license@saxpath.org. * * 4. Products derived from this software may not be called "SAXPath", nor * may "SAXPath" appear in their name, without prior written permission * from the SAXPath Project Management (pm@saxpath.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 * SAXPath Project (http://www.saxpath.org/)." * Alternatively, the acknowledgment may be graphical using the logos * available at http://www.saxpath.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 SAXPath 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 SAXPath Project and was originally * created by bob mcwhirter and * James Strachan . For more information on the * SAXPath Project, please see . * * $Id: XPathReader.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.saxpath; /** Interface for readers which can parse textual * XPath expressions, and produce callbacks to * {@link XPathHandler} objects. * * @author bob mcwhirter (bob@werken.com) */ public interface XPathReader extends SAXPathEventSource { /** Perform parsing of the textual XPath expression, * and produce event callbacks to an {@link XPathHandler}. * * @param xpath The textual XPath expression to parse. * * @throws SAXPathException In the event an error occurs. */ void parse(String xpath) throws SAXPathException; } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/XPathSyntaxException.java100644 0 0 10410 10525225063 30530 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/XPathSyntaxException.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:43 $ * * ==================================================================== * * Copyright (C) 2000-2002 werken digital. * 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 "SAXPath" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact license@saxpath.org. * * 4. Products derived from this software may not be called "SAXPath", nor * may "SAXPath" appear in their name, without prior written permission * from the SAXPath Project Management (pm@saxpath.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 * SAXPath Project (http://www.saxpath.org/)." * Alternatively, the acknowledgment may be graphical using the logos * available at http://www.saxpath.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 SAXPath 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 SAXPath Project and was originally * created by bob mcwhirter and * James Strachan . For more information on the * SAXPath Project, please see . * * $Id: XPathSyntaxException.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.saxpath; import org.xmlpull.v1.builder.xpath.saxpath.SAXPathException; public class XPathSyntaxException extends SAXPathException { private String xpath; private int position; public XPathSyntaxException(String xpath, int position, String message) { super( message ); this.position = position; this.xpath = xpath; } public int getPosition() { return this.position; } public String getXPath() { return this.xpath; } public String toString() { return "com.werken.saxpath.XPathSyntaxException: " + getPosition() + ": " + getMessage(); } public String getPositionMarker() { StringBuffer buf = new StringBuffer(); int pos = getPosition(); for ( int i = 0 ; i < pos ; ++i ) { buf.append(" "); } buf.append("^"); return buf.toString(); } public String getMultilineMessage() { StringBuffer buf = new StringBuffer(); buf.append( getMessage() ); buf.append( "\n" ); buf.append( getXPath() ); buf.append( "\n" ); buf.append( getPositionMarker() ); return buf.toString(); } } ././@LongLink100644 0 0 154 10525225067 10257 Lustar 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/DefaultXPathHandler.javaxpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/DefaultXPathHandl100644 0 0 13572 10525225063 32533 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/DefaultXPathHandler.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:43 $ * * ==================================================================== * * Copyright (C) 2000-2002 werken digital. * 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 "SAXPath" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact license@saxpath.org. * * 4. Products derived from this software may not be called "SAXPath", nor * may "SAXPath" appear in their name, without prior written permission * from the SAXPath Project Management (pm@saxpath.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 * SAXPath Project (http://www.saxpath.org/)." * Alternatively, the acknowledgment may be graphical using the logos * available at http://www.saxpath.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 SAXPath 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 SAXPath Project and was originally * created by bob mcwhirter and * James Strachan . For more information on the * SAXPath Project, please see . * * $Id: DefaultXPathHandler.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.saxpath.com.werken.saxpath; import org.xmlpull.v1.builder.xpath.saxpath.XPathHandler; class DefaultXPathHandler implements XPathHandler { static class Singleton { static final DefaultXPathHandler instance = new DefaultXPathHandler(); } public static XPathHandler getInstance() { return Singleton.instance; } public void startXPath() { } public void endXPath() { } public void startPathExpr() { } public void endPathExpr() { } public void startAbsoluteLocationPath() { } public void endAbsoluteLocationPath() { } public void startRelativeLocationPath() { } public void endRelativeLocationPath() { } public void startNameStep(int axis, String prefix, String localName) { } public void startTextNodeStep(int axis) { } public void endTextNodeStep() { } public void startCommentNodeStep(int axis) { } public void endCommentNodeStep() { } public void startAllNodeStep(int axis) { } public void endAllNodeStep() { } public void startProcessingInstructionNodeStep(int axis, String name) { } public void endProcessingInstructionNodeStep() { } public void endNameStep() { } public void startPredicate() { } public void endPredicate() { } public void startFilterExpr() { } public void endFilterExpr() { } public void startOrExpr() { } public void endOrExpr(boolean create) { } public void startAndExpr() { } public void endAndExpr(boolean create) { } public void startEqualityExpr() { } public void endEqualityExpr(int operator) { } public void startRelationalExpr() { } public void endRelationalExpr(int operator) { } public void startAdditiveExpr() { } public void endAdditiveExpr(int operator) { } public void startMultiplicativeExpr() { } public void endMultiplicativeExpr(int operator) { } public void startUnaryExpr() { } public void endUnaryExpr(int operator) { } public void startUnionExpr() { } public void endUnionExpr(boolean create) { } public void number(int number) { } public void number(double number) { } public void literal(String literal) { } public void variableReference(String prefix, String variableName) { } public void startFunction(String prefix, String functionName) { } public void endFunction() { } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/Token.java100644 0 0 10371 10525225063 31225 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/Token.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:43 $ * * ==================================================================== * * Copyright (C) 2000-2002 werken digital. * 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 "SAXPath" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact license@saxpath.org. * * 4. Products derived from this software may not be called "SAXPath", nor * may "SAXPath" appear in their name, without prior written permission * from the SAXPath Project Management (pm@saxpath.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 * SAXPath Project (http://www.saxpath.org/)." * Alternatively, the acknowledgment may be graphical using the logos * available at http://www.saxpath.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 SAXPath 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 SAXPath Project and was originally * created by bob mcwhirter and * James Strachan . For more information on the * SAXPath Project, please see . * * $Id: Token.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.saxpath.com.werken.saxpath; class Token { private int tokenType; private String parseText; private int tokenBegin; private int tokenEnd; public Token(int tokenType, String parseText, int tokenBegin, int tokenEnd) { setTokenType( tokenType ); setParseText( parseText ); setTokenBegin( tokenBegin ); setTokenEnd( tokenEnd ); } private void setTokenType(int tokenType) { this.tokenType = tokenType; } public int getTokenType() { return this.tokenType; } private void setParseText(String parseText) { this.parseText = parseText; } public String getTokenText() { return this.parseText.substring( getTokenBegin(), getTokenEnd() ); } private void setTokenBegin(int tokenBegin) { this.tokenBegin = tokenBegin; } int getTokenBegin() { return this.tokenBegin; } private void setTokenEnd(int tokenEnd) { this.tokenEnd = tokenEnd; } int getTokenEnd() { return this.tokenEnd; } public String toString() { return ("[ (" + tokenType + ") (" + getTokenText() + ")"); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/TokenTypes.java100644 0 0 10423 10525225063 32250 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/TokenTypes.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:43 $ * * ==================================================================== * * Copyright (C) 2000-2002 werken digital. * 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 "SAXPath" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact license@saxpath.org. * * 4. Products derived from this software may not be called "SAXPath", nor * may "SAXPath" appear in their name, without prior written permission * from the SAXPath Project Management (pm@saxpath.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 * SAXPath Project (http://www.saxpath.org/)." * Alternatively, the acknowledgment may be graphical using the logos * available at http://www.saxpath.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 SAXPath 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 SAXPath Project and was originally * created by bob mcwhirter and * James Strachan . For more information on the * SAXPath Project, please see . * * $Id: TokenTypes.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.saxpath.com.werken.saxpath; interface TokenTypes { static final int LEFT_PAREN = 1; static final int RIGHT_PAREN = 2; static final int LEFT_BRACKET = 3; static final int RIGHT_BRACKET = 4; static final int PLUS = 5; static final int MINUS = 6; static final int LESS_THAN = 7; static final int LESS_THAN_EQUALS = 8; static final int GREATER_THAN = 9; static final int GREATER_THAN_EQUALS = 10; static final int SLASH = 11; static final int DOUBLE_SLASH = 12; static final int DOT = 13; static final int DOT_DOT = 14; static final int IDENTIFIER = 15; static final int AT = 16; static final int PIPE = 17; static final int COLON = 18; static final int DOUBLE_COLON = 19; static final int STAR = 20; static final int EQUALS = 21; static final int NOT_EQUALS = 22; static final int NOT = 23; static final int DIV = 24; static final int MOD = 25; static final int DOLLAR = 26; static final int LITERAL = 27; static final int AND = 28; static final int OR = 29; static final int INTEGER = 30; static final int DOUBLE = 31; static final int COMMA = 32; //static final int SKIP = 99; //static final int EOF = 100; static final int SKIP = -2; static final int EOF = -1; } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/XPathLexer.java100644 0 0 55350 10525225063 32177 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/XPathLexer.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:43 $ * * ==================================================================== * * Copyright (C) 2000-2002 werken digital. * 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 "SAXPath" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact license@saxpath.org. * * 4. Products derived from this software may not be called "SAXPath", nor * may "SAXPath" appear in their name, without prior written permission * from the SAXPath Project Management (pm@saxpath.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 * SAXPath Project (http://www.saxpath.org/)." * Alternatively, the acknowledgment may be graphical using the logos * available at http://www.saxpath.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 SAXPath 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 SAXPath Project and was originally * created by bob mcwhirter and * James Strachan . For more information on the * SAXPath Project, please see . * * $Id: XPathLexer.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.saxpath.com.werken.saxpath; class XPathLexer { private String xpath; private int currentPosition; private int endPosition; private Token previousToken; public XPathLexer(String xpath) { setXPath( xpath ); } XPathLexer() { } void setXPath(String xpath) { this.xpath = xpath; this.currentPosition = 0; this.endPosition = xpath.length(); } public String getXPath() { return this.xpath; } public Token nextToken() { Token token = null; do { token = null; switch ( LA(1) ) { case '$': { token = dollar(); break; } case '"': case '\'': { token = literal(); break; } case '/': { token = slashes(); break; } case ',': { token = comma(); break; } case '(': { token = leftParen(); break; } case ')': { token = rightParen(); break; } case '[': { token = leftBracket(); break; } case ']': { token = rightBracket(); break; } case '+': { token = plus(); break; } case '-': { token = minus(); break; } case '<': case '>': { token = relationalOperator(); break; } case '=': { token = equals(); break; } case '!': { if ( LA(2) == '=' ) { token = notEquals(); } else { token = not(); } break; } case '|': { token = pipe(); break; } case '@': { token = at(); break; } case ':': { if ( LA(2) == ':' ) { token = doubleColon(); } else { token = colon(); } break; } case '*': { token = star(); break; } case '.': { switch ( LA(2) ) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { token = number(); break; } default: { token = dots(); break; } } break; } case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { token = number(); break; } case ' ': case '\t': case '\n': case '\r': { token = whitespace(); break; } default: { if ( isIdentifierStartChar( LA(1) ) ) { token = identifierOrOperatorName(); } } } if ( token == null ) { token = new Token( TokenTypes.EOF, getXPath(), currentPosition(), endPosition() ); } } while ( token.getTokenType() == TokenTypes.SKIP ); setPreviousToken( token ); return token; } Token identifierOrOperatorName() { Token token = null; Token previousToken = getPreviousToken(); if ( previousToken != null ) { // For some reason, section 3.7, Lexical structure, // doesn't seem to feel like it needs to mention the // SLASH, DOUBLE_SLASH, and COLON tokens for the test // if an NCName is an operator or not. // // Accoring to section 3.7, "/foo" should be considered // as a SLASH following by an OperatorName being 'foo'. // Which is just simply, clearly, wrong, in my mind. // // -bob switch ( previousToken.getTokenType() ) { case TokenTypes.AT: case TokenTypes.DOUBLE_COLON: case TokenTypes.LEFT_PAREN: case TokenTypes.LEFT_BRACKET: case TokenTypes.AND: case TokenTypes.OR: case TokenTypes.MOD: case TokenTypes.DIV: case TokenTypes.COLON: case TokenTypes.SLASH: case TokenTypes.DOUBLE_SLASH: case TokenTypes.PIPE: case TokenTypes.DOLLAR: case TokenTypes.PLUS: case TokenTypes.MINUS: case TokenTypes.STAR: case TokenTypes.COMMA: case TokenTypes.LESS_THAN: case TokenTypes.GREATER_THAN: case TokenTypes.LESS_THAN_EQUALS: case TokenTypes.GREATER_THAN_EQUALS: case TokenTypes.EQUALS: case TokenTypes.NOT_EQUALS: { token = identifier(); break; } default: { token = operatorName(); break; } } } else { token = identifier(); } return token; } Token identifier() { Token token = null; int start = currentPosition(); while ( hasMoreChars() ) { if ( isIdentifierChar( LA(1) ) ) { consume(); } else { break; } } token = new Token( TokenTypes.IDENTIFIER, getXPath(), start, currentPosition() ); return token; } Token operatorName() { Token token = null; switch ( LA(1) ) { case 'a': { token = and(); break; } case 'o': { token = or(); break; } case 'm': { token = mod(); break; } case 'd': { token = div(); break; } } return token; } Token mod() { Token token = null; if ( ( LA(1) == 'm' ) && ( LA(2) == 'o' ) && ( LA(3) == 'd' ) && ( ! isIdentifierChar( LA(4) ) ) ) { token = new Token( TokenTypes.MOD, getXPath(), currentPosition(), currentPosition()+3 ); consume(); consume(); consume(); } return token; } Token div() { Token token = null; if ( ( LA(1) == 'd' ) && ( LA(2) == 'i' ) && ( LA(3) == 'v' ) && ( ! isIdentifierChar( LA(4) ) ) ) { token = new Token( TokenTypes.DIV, getXPath(), currentPosition(), currentPosition()+3 ); consume(); consume(); consume(); } return token; } Token and() { Token token = null; if ( ( LA(1) == 'a' ) && ( LA(2) == 'n' ) && ( LA(3) == 'd' ) && ( ! isIdentifierChar( LA(4) ) ) ) { token = new Token( TokenTypes.AND, getXPath(), currentPosition(), currentPosition()+3 ); consume(); consume(); consume(); } return token; } Token or() { Token token = null; if ( ( LA(1) == 'o' ) && ( LA(2) == 'r' ) && ( ! isIdentifierChar( LA(3) ) ) ) { token = new Token( TokenTypes.OR, getXPath(), currentPosition(), currentPosition()+2 ); consume(); consume(); } return token; } Token number() { int start = currentPosition(); boolean periodAllowed = true; loop: while( true ) { switch ( LA(1) ) { case '.': { if ( periodAllowed ) { periodAllowed = false; consume(); } else { break loop; } break; } case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { consume(); break; } default: { break loop; } } } Token token = null; if ( periodAllowed ) { token = new Token( TokenTypes.INTEGER, getXPath(), start, currentPosition() ); } else { token = new Token( TokenTypes.DOUBLE, getXPath(), start, currentPosition() ); } return token; } Token whitespace() { consume(); loop: while( hasMoreChars() ) { switch ( LA(1) ) { case ' ': case '\t': case '\n': case '\r': { consume(); break; } default: { break loop; } } } return new Token( TokenTypes.SKIP, getXPath(), 0, 0 ); } Token comma() { Token token = new Token( TokenTypes.COMMA, getXPath(), currentPosition(), currentPosition()+1 ); consume(); return token; } Token equals() { Token token = new Token( TokenTypes.EQUALS, getXPath(), currentPosition(), currentPosition()+1 ); consume(); return token; } Token minus() { Token token = new Token( TokenTypes.MINUS, getXPath(), currentPosition(), currentPosition()+1 ); consume(); return token; } Token plus() { Token token = new Token( TokenTypes.PLUS, getXPath(), currentPosition(), currentPosition()+1 ); consume(); return token; } Token dollar() { Token token = new Token( TokenTypes.DOLLAR, getXPath(), currentPosition(), currentPosition()+1 ); consume(); return token; } Token pipe() { Token token = new Token( TokenTypes.PIPE, getXPath(), currentPosition(), currentPosition()+1 ); consume(); return token; } Token at() { Token token = new Token( TokenTypes.AT, getXPath(), currentPosition(), currentPosition()+1 ); consume(); return token; } Token colon() { Token token = new Token( TokenTypes.COLON, getXPath(), currentPosition(), currentPosition()+1 ); consume(); return token; } Token doubleColon() { Token token = new Token( TokenTypes.DOUBLE_COLON, getXPath(), currentPosition(), currentPosition()+2 ); consume(); consume(); return token; } Token not() { Token token = new Token( TokenTypes.NOT, getXPath(), currentPosition(), currentPosition() + 1 ); consume(); return token; } Token notEquals() { Token token = new Token( TokenTypes.NOT_EQUALS, getXPath(), currentPosition(), currentPosition() + 2 ); consume(); consume(); return token; } Token relationalOperator() { Token token = null; switch ( LA(1) ) { case '<': { if ( LA(2) == '=' ) { token = new Token( TokenTypes.LESS_THAN_EQUALS, getXPath(), currentPosition(), currentPosition() + 2 ); consume(); } else { token = new Token( TokenTypes.LESS_THAN, getXPath(), currentPosition(), currentPosition() + 1); } consume(); break; } case '>': { if ( LA(2) == '=' ) { token = new Token( TokenTypes.GREATER_THAN_EQUALS, getXPath(), currentPosition(), currentPosition() + 2 ); consume(); } else { token = new Token( TokenTypes.GREATER_THAN, getXPath(), currentPosition(), currentPosition() + 1 ); } consume(); break; } } return token; } Token star() { Token token = new Token( TokenTypes.STAR, getXPath(), currentPosition(), currentPosition()+1 ); consume(); return token; } Token literal() { Token token = null; char match = LA(1); consume(); int start = currentPosition(); while ( ( token == null ) && hasMoreChars() ) { if ( LA(1) == match ) { token = new Token( TokenTypes.LITERAL, getXPath(), start, currentPosition() ); } consume(); } return token; } Token dots() { Token token = null; switch ( LA(2) ) { case '.': { token = new Token( TokenTypes.DOT_DOT, getXPath(), currentPosition(), currentPosition()+2 ) ; consume(); consume(); break; } default: { token = new Token( TokenTypes.DOT, getXPath(), currentPosition(), currentPosition()+1 ); consume(); break; } } return token; } Token leftBracket() { Token token = new Token( TokenTypes.LEFT_BRACKET, getXPath(), currentPosition(), currentPosition()+1 ); consume(); return token; } Token rightBracket() { Token token = new Token( TokenTypes.RIGHT_BRACKET, getXPath(), currentPosition(), currentPosition()+1 ); consume(); return token; } Token leftParen() { Token token = new Token( TokenTypes.LEFT_PAREN, getXPath(), currentPosition(), currentPosition()+1 ); consume(); return token; } Token rightParen() { Token token = new Token( TokenTypes.RIGHT_PAREN, getXPath(), currentPosition(), currentPosition()+1 ); consume(); return token; } Token slashes() { Token token = null; switch ( LA(2) ) { case '/': { token = new Token( TokenTypes.DOUBLE_SLASH, getXPath(), currentPosition(), currentPosition()+2 ); consume(); consume(); break; } default: { token = new Token( TokenTypes.SLASH, getXPath(), currentPosition(), currentPosition()+1 ); consume(); } } return token; } char LA(int i) { if ( currentPosition + ( i - 1 ) >= endPosition() ) { return (char) -1; } return getXPath().charAt( currentPosition() + (i - 1) ); } void consume() { ++this.currentPosition; } void consume(int i) { this.currentPosition += i; } int currentPosition() { return this.currentPosition; } int endPosition() { return this.endPosition; } Token getPreviousToken() { return this.previousToken; } void setPreviousToken(Token previousToken) { this.previousToken = previousToken; } boolean hasMoreChars() { return currentPosition() < endPosition(); } boolean isIdentifierChar(char c) { switch ( c ) { case '-': case '.': return true; } return Character.isUnicodeIdentifierPart( c ); } boolean isIdentifierStartChar(char c) { return c == '_' || Character.isUnicodeIdentifierStart( c ); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/XPathReader.java100644 0 0 64442 10525225063 32324 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/XPathReader.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:43 $ * * ==================================================================== * * Copyright (C) 2000-2002 werken digital. * 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 "SAXPath" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact license@saxpath.org. * * 4. Products derived from this software may not be called "SAXPath", nor * may "SAXPath" appear in their name, without prior written permission * from the SAXPath Project Management (pm@saxpath.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 * SAXPath Project (http://www.saxpath.org/)." * Alternatively, the acknowledgment may be graphical using the logos * available at http://www.saxpath.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 SAXPath 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 SAXPath Project and was originally * created by bob mcwhirter and * James Strachan . For more information on the * SAXPath Project, please see . * * $Id: XPathReader.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.saxpath.com.werken.saxpath; import org.xmlpull.v1.builder.xpath.saxpath.XPathHandler; import org.xmlpull.v1.builder.xpath.saxpath.Axis; import org.xmlpull.v1.builder.xpath.saxpath.Operator; import org.xmlpull.v1.builder.xpath.saxpath.SAXPathException; import org.xmlpull.v1.builder.xpath.saxpath.XPathSyntaxException; import java.util.LinkedList; /** Implementation of SAXPath's XPathReader which * generates callbacks to an XPathHandler. * * @author bob mcwhirter (bob@werken.com) */ public class XPathReader implements org.xmlpull.v1.builder.xpath.saxpath.XPathReader, TokenTypes { private LinkedList tokens; private XPathLexer lexer; private XPathHandler handler; public XPathReader() { setXPathHandler( DefaultXPathHandler.getInstance() ); } public void setXPathHandler(XPathHandler handler) { this.handler = handler; } public XPathHandler getXPathHandler() { return this.handler; } public void parse(String xpath) throws SAXPathException { setUpParse( xpath ); getXPathHandler().startXPath(); expr(); getXPathHandler().endXPath(); if ( LA(1) != EOF ) { throwUnexpected(); } lexer = null; tokens = null; } void setUpParse(String xpath) { this.tokens = new LinkedList(); this.lexer = new XPathLexer( xpath ); } void pathExpr() throws SAXPathException { getXPathHandler().startPathExpr(); switch ( LA(1) ) { case INTEGER: case DOUBLE: case LITERAL: case LEFT_PAREN: case DOLLAR: { filterExpr(); if ( LA(1) == SLASH || LA(1) == DOUBLE_SLASH ) { locationPath( false ); } break; } case IDENTIFIER: { if ( ( ( LA(2) == LEFT_PAREN ) && ( ! isNodeTypeName( LT(1) ) ) ) ) { filterExpr(); if ( LA(1) == SLASH || LA(1) == DOUBLE_SLASH) { locationPath( false ); } break; } else { locationPath( false ); break; } } case DOT: case DOT_DOT: case STAR: case AT: { locationPath( false ); break; } case SLASH: case DOUBLE_SLASH: { locationPath( true ); break; } default: { //throw new XPathSyntaxException( "Unexpected '" + LT(1).getTokenText() + "'" ); throwUnexpected(); } } getXPathHandler().endPathExpr(); } void numberDouble() throws SAXPathException { Token token = match( DOUBLE ); getXPathHandler().number( Double.parseDouble( token.getTokenText() ) ); } void numberInteger() throws SAXPathException { Token token = match( INTEGER ); getXPathHandler().number( Integer.parseInt( token.getTokenText() ) ); } void literal() throws SAXPathException { Token token = match( LITERAL ); getXPathHandler().literal( token.getTokenText() ); } void functionCall() throws SAXPathException { String prefix = null; String functionName = null; if ( LA(2) == COLON ) { prefix = match( IDENTIFIER ).getTokenText(); match( COLON ); } else { prefix = ""; } functionName = match( IDENTIFIER ).getTokenText(); getXPathHandler().startFunction( prefix, functionName ); match ( LEFT_PAREN ); arguments(); match ( RIGHT_PAREN ); getXPathHandler().endFunction(); } void arguments() throws SAXPathException { while ( LA(1) != RIGHT_PAREN ) { expr(); if ( LA(1) == COMMA ) { match( COMMA ); } else { break; } } } void filterExpr() throws SAXPathException { getXPathHandler().startFilterExpr(); switch ( LA(1) ) { case INTEGER: { numberInteger(); break; } case DOUBLE: { numberDouble(); break; } case LITERAL: { literal(); break; } case LEFT_PAREN: { match( LEFT_PAREN ); expr(); match( RIGHT_PAREN ); break; } case IDENTIFIER: { functionCall(); break; } case DOLLAR: { variableReference(); break; } } predicates(); getXPathHandler().endFilterExpr(); } void variableReference() throws SAXPathException { match( DOLLAR ); String prefix = null; String variableName = null; if ( LA(2) == COLON ) { prefix = match( IDENTIFIER ).getTokenText(); match( COLON ); } else { prefix = ""; } variableName = match( IDENTIFIER ).getTokenText(); getXPathHandler().variableReference( prefix, variableName ); } void locationPath(boolean isAbsolute) throws SAXPathException { switch ( LA(1) ) { case SLASH: case DOUBLE_SLASH: { if ( isAbsolute ) { absoluteLocationPath(); } else { relativeLocationPath(); } break; } case AT: case IDENTIFIER: case DOT: case DOT_DOT: case STAR: { relativeLocationPath(); break; } default: { throwUnexpected(); break; } } } void absoluteLocationPath() throws SAXPathException { getXPathHandler().startAbsoluteLocationPath(); switch ( LA(1) ) { case SLASH: { match( SLASH ); switch ( LA(1) ) { case DOT: case DOT_DOT: case AT: case IDENTIFIER: case STAR: { steps(); break; } case EOF: { return; } } break; } case DOUBLE_SLASH: { getXPathHandler().startAllNodeStep( Axis.DESCENDANT_OR_SELF ); getXPathHandler().endAllNodeStep(); match( DOUBLE_SLASH ); switch ( LA(1) ) { case DOT: case DOT_DOT: case AT: case IDENTIFIER: case STAR: { steps(); break; } } break; } } getXPathHandler().endAbsoluteLocationPath(); } void relativeLocationPath() throws SAXPathException { getXPathHandler().startRelativeLocationPath(); switch ( LA(1) ) { case SLASH: { match( SLASH ); break; } case DOUBLE_SLASH: { getXPathHandler().startAllNodeStep( Axis.DESCENDANT_OR_SELF ); getXPathHandler().endAllNodeStep(); match( DOUBLE_SLASH ); break; } } steps(); getXPathHandler().endRelativeLocationPath(); } void steps() throws SAXPathException { switch ( LA(1) ) { case DOT: case DOT_DOT: case AT: case IDENTIFIER: case STAR: { step( true ); break; } case EOF: { return; } default: { throwSyntaxException( "Expected one of '.', '..', '@', '*', " ); //throw new XPathSyntaxException( "Expected one of '.', '..', '@', '*', " ); } } do { if ( ( LA(1) == SLASH) || ( LA(1) == DOUBLE_SLASH ) ) { switch ( LA(1) ) { case SLASH: { match( SLASH ); break; } case DOUBLE_SLASH: { getXPathHandler().startAllNodeStep( Axis.DESCENDANT_OR_SELF ); getXPathHandler().endAllNodeStep(); match( DOUBLE_SLASH ); break; } } } else { return; } switch ( LA(1) ) { case DOT: case DOT_DOT: case AT: case IDENTIFIER: case STAR: { step( false ); break; } default: { throwSyntaxException( "Expected one of '.', '..', '@', '*', " ); // throw new XPathSyntaxException( "Expected one of '.', '..', '@', '*', " ); } } } while ( true ); } void step(boolean first) throws SAXPathException { int axis = 0; switch ( LA(1) ) { case DOT: case DOT_DOT: { abbrStep(); return; } case AT: { axis = axisSpecifier(); break; } case IDENTIFIER: { if ( LA(2) == DOUBLE_COLON ) { axis = axisSpecifier(); } else { axis = Axis.CHILD; } break; } case STAR: { axis = Axis.CHILD; break; } } nodeTest( axis ); } int axisSpecifier() throws SAXPathException { int axis = 0; switch ( LA(1) ) { case AT: { match( AT ); axis = Axis.ATTRIBUTE; break; } case IDENTIFIER: { Token token = LT( 1 ); axis = Axis.lookup( token.getTokenText() ); if ( axis == Axis.INVALID_AXIS ) { throwInvalidAxis( token.getTokenText() ); } match( IDENTIFIER ); match( DOUBLE_COLON ); break; } } return axis; } void nodeTest(int axis) throws SAXPathException { switch ( LA(1) ) { case IDENTIFIER: { switch ( LA(2) ) { case LEFT_PAREN: { nodeTypeTest( axis ); break; } default: { nameTest( axis ); break; } } break; } case STAR: { nameTest( axis ); break; } } } void nodeTypeTest(int axis) throws SAXPathException { Token nodeTypeToken = match( IDENTIFIER ); String nodeType = nodeTypeToken.getTokenText(); match( LEFT_PAREN ); if ( "processing-instruction".equals( nodeType ) ) { String piName = ""; if ( LA(1) == LITERAL ) { piName = match( LITERAL ).getTokenText(); } match( RIGHT_PAREN ); getXPathHandler().startProcessingInstructionNodeStep( axis, piName ); predicates(); getXPathHandler().endProcessingInstructionNodeStep(); } else if ( "node".equals( nodeType ) ) { match( RIGHT_PAREN ); getXPathHandler().startAllNodeStep( axis ); predicates(); getXPathHandler().endAllNodeStep(); } else if ( "text".equals( nodeType ) ) { match( RIGHT_PAREN ); getXPathHandler().startTextNodeStep( axis ); predicates(); getXPathHandler().endTextNodeStep(); } else if ( "comment".equals( nodeType ) ) { match( RIGHT_PAREN ); getXPathHandler().startCommentNodeStep( axis ); predicates(); getXPathHandler().endCommentNodeStep(); } else { throwSyntaxException( "Expected node-type" ); } } void nameTest(int axis) throws SAXPathException { String prefix = null; String localName = null; switch ( LA(2) ) { case COLON: { switch ( LA(1) ) { case IDENTIFIER: { prefix = match( IDENTIFIER ).getTokenText(); match( COLON ); break; } } break; } } switch ( LA(1) ) { case IDENTIFIER: { localName = match( IDENTIFIER ).getTokenText(); break; } case STAR: { match( STAR ); localName = "*"; break; } } if ( prefix == null ) { prefix = ""; } getXPathHandler().startNameStep( axis, prefix, localName ); predicates(); getXPathHandler().endNameStep(); } void abbrStep() throws SAXPathException { switch ( LA(1) ) { case DOT: { match( DOT ); getXPathHandler().startAllNodeStep( Axis.SELF ); predicates(); getXPathHandler().endAllNodeStep(); break; } case DOT_DOT: { match( DOT_DOT ); getXPathHandler().startAllNodeStep( Axis.PARENT ); predicates(); getXPathHandler().endAllNodeStep(); break; } } } void predicates() throws SAXPathException { while (true ) { if ( LA(1) == LEFT_BRACKET ) { predicate(); } else { break; } } } void predicate() throws SAXPathException { getXPathHandler().startPredicate(); match( LEFT_BRACKET ); predicateExpr(); match( RIGHT_BRACKET ); getXPathHandler().endPredicate(); } void predicateExpr() throws SAXPathException { expr(); } void expr() throws SAXPathException { orExpr(); } void orExpr() throws SAXPathException { getXPathHandler().startOrExpr(); andExpr(); boolean create = false; switch ( LA(1) ) { case OR: { create = true; match( OR ); orExpr(); break; } } getXPathHandler().endOrExpr( create ); } void andExpr() throws SAXPathException { getXPathHandler().startAndExpr(); equalityExpr(); boolean create = false; switch ( LA(1) ) { case AND: { create = true; match( AND ); andExpr(); break; } } getXPathHandler().endAndExpr( create ); } void equalityExpr() throws SAXPathException { getXPathHandler().startEqualityExpr(); relationalExpr(); int operator = Operator.NO_OP; switch ( LA(1) ) { case EQUALS: { match( EQUALS ); equalityExpr(); operator = Operator.EQUALS; break; } case NOT_EQUALS: { match( NOT_EQUALS ); equalityExpr(); operator = Operator.NOT_EQUALS; break; } } getXPathHandler().endEqualityExpr( operator ); } void relationalExpr() throws SAXPathException { getXPathHandler().startRelationalExpr(); additiveExpr(); int operator = Operator.NO_OP; switch ( LA(1) ) { case LESS_THAN: { match( LESS_THAN ); relationalExpr(); operator = Operator.LESS_THAN; break; } case GREATER_THAN: { match( GREATER_THAN ); relationalExpr(); operator = Operator.GREATER_THAN; break; } case LESS_THAN_EQUALS: { match( LESS_THAN_EQUALS ); relationalExpr(); operator = Operator.LESS_THAN_EQUALS; break; } case GREATER_THAN_EQUALS: { match( GREATER_THAN_EQUALS ); relationalExpr(); operator = Operator.GREATER_THAN_EQUALS; break; } } getXPathHandler().endRelationalExpr( operator ); } void additiveExpr() throws SAXPathException { getXPathHandler().startAdditiveExpr(); multiplicativeExpr(); int operator = Operator.NO_OP; switch ( LA(1) ) { case PLUS: { match( PLUS ); operator = Operator.ADD; additiveExpr(); break; } case MINUS: { match( MINUS ); operator = Operator.SUBTRACT; additiveExpr(); break; } } getXPathHandler().endAdditiveExpr( operator ); } void multiplicativeExpr() throws SAXPathException { getXPathHandler().startMultiplicativeExpr(); unaryExpr(); int operator = Operator.NO_OP; switch ( LA(1) ) { case STAR: { match( STAR ); multiplicativeExpr(); operator = Operator.MULTIPLY; break; } case DIV: { match( DIV ); multiplicativeExpr(); operator = Operator.DIV; break; } case MOD: { match( MOD ); multiplicativeExpr(); operator = Operator.MOD; break; } } getXPathHandler().endMultiplicativeExpr( operator ); } void unaryExpr() throws SAXPathException { getXPathHandler().startUnaryExpr(); int operator = Operator.NO_OP; switch ( LA(1) ) { case MINUS: { match( MINUS ); operator = Operator.NEGATIVE; unaryExpr(); break; } default: { unionExpr(); break; } } getXPathHandler().endUnaryExpr( operator ); } void unionExpr() throws SAXPathException { getXPathHandler().startUnionExpr(); pathExpr(); boolean create = false; switch ( LA(1) ) { case PIPE: { match( PIPE ); create = true; expr(); break; } } getXPathHandler().endUnionExpr( create ); } Token match(int tokenType) { LT(1); Token token = (Token) tokens.get( 0 ); if ( token.getTokenType() == tokenType ) { tokens.removeFirst(); return token; } // throw an exception return null; } int LA(int position) { return LT(position).getTokenType(); } Token LT(int position) { if ( tokens.size() <= ( position - 1 ) ) { for ( int i = 0 ; i < position ; ++i ) { tokens.add( lexer.nextToken() ); } } return (Token) tokens.get( position - 1 ); } boolean isNodeTypeName(Token name) { String text = name.getTokenText(); if ( "node".equals( text ) || "comment".equals( text ) || "text".equals( text ) || "processing-instruction".equals( text ) ) { return true; } return false; } void throwSyntaxException(String message) throws SAXPathException { String xpath = this.lexer.getXPath(); int position = LT(1).getTokenBegin(); throw new XPathSyntaxException( xpath, position, message ); } void throwInvalidAxis(String invalidAxis) throws SAXPathException { String xpath = this.lexer.getXPath(); int position = LT(1).getTokenBegin(); String message = "Expected valid axis name instead of [" + invalidAxis + "]"; throw new XPathSyntaxException( xpath, position, message ); } void throwUnexpected() throws SAXPathException { throwSyntaxException( "Unexpected '" + LT(1).getTokenText() + "'" ); } } ././@LongLink100644 0 0 151 10525225067 10254 Lustar 0 0 xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/conformance/ConformanceXPathHandler.javaxpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/conformance/ConformanceXPathHandler.100644 0 0 21324 10525225063 32551 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/conformance/ConformanceXPathHandler.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ * $Revision: 1.1 $ * $Date: 2004/06/16 15:55:43 $ * * ==================================================================== * * Copyright (C) 2000-2002 werken digital. * 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 "SAXPath" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact license@saxpath.org. * * 4. Products derived from this software may not be called "SAXPath", nor * may "SAXPath" appear in their name, without prior written permission * from the SAXPath Project Management (pm@saxpath.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 * SAXPath Project (http://www.saxpath.org/)." * Alternatively, the acknowledgment may be graphical using the logos * available at http://www.saxpath.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 SAXPath 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 SAXPath Project and was originally * created by bob mcwhirter and * James Strachan . For more information on the * SAXPath Project, please see . * * $Id: ConformanceXPathHandler.java,v 1.1 2004/06/16 15:55:43 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.saxpath.conformance; import org.xmlpull.v1.builder.xpath.saxpath.XPathHandler; import java.util.List; import java.util.LinkedList; import java.util.Iterator; public class ConformanceXPathHandler implements XPathHandler { private List events; public ConformanceXPathHandler() { this.events = new LinkedList(); } public void startXPath() { addEvent( "startXPath()" ); } public void endXPath() { addEvent( "endXPath()" ); } public void startPathExpr() { addEvent( "startPathExpr()" ); } public void endPathExpr() { addEvent( "endPathExpr()" ); } public void startAbsoluteLocationPath() { addEvent( "startAbsoluteLocationPath()" ); } public void endAbsoluteLocationPath() { addEvent( "endAbsoluteLocationPath()" ); } public void startRelativeLocationPath() { addEvent( "startRelativeLocationPath()" ); } public void endRelativeLocationPath() { addEvent( "endRelativeLocationPath()" ); } public void startNameStep(int axis, String prefix, String localName) { addEvent( "startNameStep(" + axis + ", \"" + prefix + "\", \"" + localName + "\")" ); } public void endNameStep() { addEvent( "endNameStep()" ); } public void startTextNodeStep(int axis) { addEvent( "startTextNodeStep(" + axis + ")" ); } public void endTextNodeStep() { addEvent( "endTextNodeStep()" ); } public void startCommentNodeStep(int axis) { addEvent( "startCommentNodeStep(" + axis + ")" ); } public void endCommentNodeStep() { addEvent( "endCommentNodeStep()" ); } public void startAllNodeStep(int axis) { addEvent( "startAllNodeStep(" + axis + ")" ); } public void endAllNodeStep() { addEvent( "endAllNodeStep()" ); } public void startProcessingInstructionNodeStep(int axis, String name) { addEvent( "startProcessingInstructionNodeStep(" + axis + ", \"" + name + "\")" ); } public void endProcessingInstructionNodeStep() { addEvent( "endProcessingInstructionNodeStep()" ); } public void startPredicate() { addEvent( "startPredicate()" ); } public void endPredicate() { addEvent( "endPredicate()" ); } public void startFilterExpr() { addEvent( "startFilterExpr()" ); } public void endFilterExpr() { addEvent( "endFilterExpr()" ); } public void startOrExpr() { addEvent( "startOrExpr()" ); } public void endOrExpr(boolean create) { addEvent( "endOrExpr(" + create + ")" ); } public void startAndExpr() { addEvent( "startAndExpr()" ); } public void endAndExpr(boolean create) { addEvent( "endAndExpr(" + create + ")" ); } public void startEqualityExpr() { addEvent( "startEqualityExpr()" ); } public void endEqualityExpr(int operator) { addEvent( "endEqualityExpr(" + operator + ")" ); } public void startRelationalExpr() { addEvent( "startRelationalExpr()" ); } public void endRelationalExpr(int operator) { addEvent( "endRelationalExpr(" + operator + ")" ); } public void startAdditiveExpr() { addEvent( "startAdditiveExpr()" ); } public void endAdditiveExpr(int operator) { addEvent( "endAdditiveExpr(" + operator + ")" ); } public void startMultiplicativeExpr() { addEvent( "startMultiplicativeExpr()" ); } public void endMultiplicativeExpr(int operator) { addEvent( "endMultiplicativeExpr(" + operator + ")" ); } public void startUnaryExpr() { addEvent( "startUnaryExpr()" ); } public void endUnaryExpr(int operator) { addEvent( "endUnaryExpr(" + operator + ")" ); } public void startUnionExpr() { addEvent( "startUnionExpr()" ); } public void endUnionExpr(boolean create) { addEvent( "endUnionExpr(" + create + ")" ); } public void number(int number) { addEvent( "number(" + number + ")" ); } public void number(double number) { addEvent( "number(" + number + ")" ); } public void literal(String literal) { addEvent( "literal(\"" + literal + "\")" ); } public void variableReference(String prefix, String variableName) { addEvent( "variableReference(\"" + prefix + ":" + variableName + "\")" ); } public void startFunction(String prefix, String functionName) { addEvent( "startFunction(\"" + prefix + ":" + functionName + "\")" ); } public void endFunction() { addEvent( "endFunction()" ); } private void addEvent(String eventStr) { this.events.add( eventStr ); } public boolean equals(Object thatObj) { if ( thatObj instanceof ConformanceXPathHandler ) { ConformanceXPathHandler that = (ConformanceXPathHandler) thatObj; return ( this.events.equals( that.events ) ); } return false; } public String toString() { Iterator eventIter = this.events.iterator(); int i = 0; StringBuffer buf = new StringBuffer(); while( eventIter.hasNext() ) { buf.append("(").append(i).append(") ").append( eventIter.next().toString() ).append("\n"); ++i; } return buf.toString(); } } xpp3-1.1.4c/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/helpers/XPathReaderFactory.java100644 0 0 16703 10525225063 31572 0ustaraslomewww 0 0 /* * $Header: /l/extreme/cvs/codes/XPP3/java/src/java/xpath/org/xmlpull/v1/builder/xpath/saxpath/helpers/XPathReaderFactory.java,v 1.2 2004/10/01 08:33:20 aslom Exp $ * $Revision: 1.2 $ * $Date: 2004/10/01 08:33:20 $ * * ==================================================================== * * Copyright (C) 2000-2002 werken digital. * 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 "SAXPath" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact license@saxpath.org. * * 4. Products derived from this software may not be called "SAXPath", nor * may "SAXPath" appear in their name, without prior written permission * from the SAXPath Project Management (pm@saxpath.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 * SAXPath Project (http://www.saxpath.org/)." * Alternatively, the acknowledgment may be graphical using the logos * available at http://www.saxpath.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 SAXPath 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 SAXPath Project and was originally * created by bob mcwhirter and * James Strachan . For more information on the * SAXPath Project, please see . * * $Id: XPathReaderFactory.java,v 1.2 2004/10/01 08:33:20 aslom Exp $ */ package org.xmlpull.v1.builder.xpath.saxpath.helpers; import org.xmlpull.v1.builder.xpath.saxpath.XPathReader; import org.xmlpull.v1.builder.xpath.saxpath.SAXPathException; /** Create an {@link org.saxpath.XPathReader} from * either a system property, or a named class. * *

      * Similar to the SAX API, the XPathReaderFactory * can create an XPathReader from a name of a * class passed in directly, or by inspecting the system * property org.saxpath.driver. * * @author bob mcwhirter (bob@werken.com) */ public class XPathReaderFactory { /** The org.saxpath.driver property name. */ public static final String DRIVER_PROPERTY = "org.saxpath.driver"; /** The default driver to use if none is configured. */ //protected static final String DEFAULT_DRIVER = "com.werken.saxpath.XPathReader"; protected static final String DEFAULT_DRIVER = "org.xmlpull.v1.builder.xpath.saxpath.com.werken.saxpath.XPathReader"; /** Should the default driver be used */ private static boolean USE_DEFAULT = true; /** Create an XPathReader using the value of * the org.saxpath.driver system property. * * @return An instance of the XPathReader specified * by the org.saxpath.driver property. * * @throws SAXPathException if the property is unset, or if * the class can not be instantiated for some reason., * or if the class doesn't implement the XPathReader * interface. */ public static XPathReader createReader() throws SAXPathException { String className = null; boolean securityException = false; try { className = System.getProperty( DRIVER_PROPERTY ); } catch (SecurityException e) { securityException = true; } if ( className == null || "".equals( className ) ) { if ( USE_DEFAULT ) { className = DEFAULT_DRIVER; } else { if ( securityException ) { throw new SAXPathException( "Reading of property " + DRIVER_PROPERTY + " disallowed." ); } else { throw new SAXPathException( "Property " + DRIVER_PROPERTY + " not set" ); } } } return createReader( className ); } /** Create an XPathReader using the passed * in class name. * * @param className The name of the class which implements * the XPathReader interface. * * @throws SAXPathException if the class can not be * instantiated for some reason, or if the * class doesn't implement the XPathReader * interface. */ public static XPathReader createReader(String className) throws SAXPathException { Class readerClass = null; XPathReader reader = null; try { // Use the full version of Class.forName(), so as to // work better in sandboxed environments, such as // Servlet contains, and Applets. readerClass = Class.forName( className, true, XPathReaderFactory.class.getClassLoader() ); // Double-check that it's actually the right kind of class // before attempting instantiation. if ( ! XPathReader.class.isAssignableFrom( readerClass ) ) { throw new SAXPathException( "Class [" + className + "] does not implement the org.saxpath.XPathReader interface." ); } } catch (ClassNotFoundException e) { throw new SAXPathException( "class not found: " + e.getMessage() ); } try { reader = (XPathReader) readerClass.newInstance(); } catch (IllegalAccessException e) { throw new SAXPathException( e.getMessage() ); } catch (InstantiationException e) { throw new SAXPathException( e.getMessage() ); } if ( reader == null ) { throw new SAXPathException( "Unable to create XPathReader" ); } return reader; } } xpp3-1.1.4c/src/java/xpath_samples/XB1XPathTest.java100644 0 0 4046 10525225064 21276 0ustaraslomewww 0 0 import java.io.StringReader; import java.util.Iterator; import java.util.List; import junit.framework.TestCase; import junit.framework.TestSuite; import org.xmlpull.v1.builder.xpath.jaxen.JaxenException; import org.xmlpull.v1.builder.xpath.jaxen.XPath; import org.xmlpull.v1.builder.xpath.Xb1XPath; import org.xmlpull.v1.builder.XmlDocument; import org.xmlpull.v1.builder.XmlElement; import org.xmlpull.v1.builder.XmlInfosetBuilder; public class XB1XPathTest extends TestCase { public static void main (String[] args) { junit.textui.TestRunner.run (new TestSuite(XB1XPathTest.class)); } private static final String BASIC_XML = "\n"+ "\n"+ "\n"+ " \n"+ " \n"+ " \n"+ " \n"+ " \n"+ " \n"+ " \n"+ ""; public XB1XPathTest(String name) { super( name ); } public void testConstruction() { try { XPath xpath = new Xb1XPath( "/foo/bar/baz" ); } catch (JaxenException e) { fail( e.getMessage() ); } } public void testSelection() throws Exception { XPath xpath = new Xb1XPath( "/foo/bar/baz" ); XmlInfosetBuilder builder = XmlInfosetBuilder.newInstance(); XmlDocument doc = builder.parseReader( new StringReader( BASIC_XML )); List results = xpath.selectNodes( doc ); assertEquals( 3, results.size() ); Iterator iter = results.iterator(); assertEquals( "baz", ((XmlElement)iter.next()).getName() ); assertEquals( "baz", ((XmlElement)iter.next()).getName() ); assertEquals( "baz", ((XmlElement)iter.next()).getName() ); assertTrue( ! iter.hasNext() ); } } xpp3-1.1.4c/src/java/xpath_samples/Xb1XPathDemo.java100644 0 0 13003 10525225064 21314 0ustaraslomewww 0 0 /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/ /* * Copyright (c) 2002-2004 Extreme! Lab, Indiana University. All rights reserved. * * This software is open source. See the bottom of this file for the licence. * * $Id: Xb1XPathDemo.java,v 1.3 2006/04/22 22:51:26 aslom Exp $ */ import java.io.StringReader; import java.util.Iterator; import org.xmlpull.v1.builder.XmlBuilderException; import org.xmlpull.v1.builder.XmlDocument; import org.xmlpull.v1.builder.XmlElement; import org.xmlpull.v1.builder.XmlInfosetBuilder; import org.xmlpull.v1.builder.xpath.Xb1XPath; import org.xmlpull.v1.builder.xpath.jaxen.XPathSyntaxException; /** * Simpe demos of XPath suuprt in XB1. * * @author Aleksander Slominski * * @version $Revision: 1.3 $ */ public class Xb1XPathDemo { public static void main(String[] args) { String location = "Text"; String xpathExpr = "//"; if ( args.length != 2 ) { System.err.println("usage: "+Xb1XPathDemo.class.getName()+" "); //System.exit( 1 ); } if(args.length > 0) { location = args[0]; } if(args.length > 1) { xpathExpr = args[1]; } int pos = location.indexOf("://"); boolean useUrl = pos >= 0 && pos < 6; //simple heuristic to find "http://" and similiar try { XmlInfosetBuilder builder = XmlInfosetBuilder.newInstance(); System.out.println("Evaluating XPath '"+xpathExpr+"' against '" + location +"'"+(useUrl ? " URL" : "") ); XmlDocument doc = useUrl ? builder.parseLocation( location ) : builder.parseReader(new StringReader( location ) ); Xb1XPath xpath = new Xb1XPath( xpathExpr ); Iterator resultsIter = xpath.selectNodes( doc ).iterator(); //XmlElement root = doc.getDocumentElement(); //Iterator resultsIter = xpath.selectNodes( root ).iterator(); System.out.println("Results:" ); while ( resultsIter.hasNext() ) { Object infosetItem = resultsIter.next(); System.out.println("----------------------------------"); //+ infosetItem.getClass()); System.out.println(builder.serializeToString(infosetItem)); //what about attributes, namespaces???? } System.out.println("----------------------------------"); } catch (XPathSyntaxException e) { System.err.println( e.getMultilineMessage() ); } catch (XmlBuilderException e) { e.printStackTrace(); } } } /* * Indiana University Extreme! Lab Software License, Version 1.2 * * Copyright (c) 2002-2004 The Trustees of Indiana University. * 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) All redistributions of source code must retain the above * copyright notice, the list of authors in the original source * code, this list of conditions and the disclaimer listed in this * license; * * 2) All redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the disclaimer * listed in this license in the documentation and/or other * materials provided with the distribution; * * 3) Any documentation included with all redistributions must include * the following acknowledgement: * * "This product includes software developed by the Indiana * University Extreme! Lab. For further information please visit * http://www.extreme.indiana.edu/" * * Alternatively, this acknowledgment may appear in the software * itself, and wherever such third-party acknowledgments normally * appear. * * 4) The name "Indiana University" or "Indiana University * Extreme! Lab" shall not be used to endorse or promote * products derived from this software without prior written * permission from Indiana University. For written permission, * please contact http://www.extreme.indiana.edu/. * * 5) Products derived from this software may not use "Indiana * University" name nor may "Indiana University" appear in their name, * without prior written permission of the Indiana University. * * Indiana University provides no reassurances that the source code * provided does not infringe the patent or any other intellectual * property rights of any other entity. Indiana University disclaims any * liability to any recipient for claims brought by any other entity * based on infringement of intellectual property rights or otherwise. * * LICENSEE UNDERSTANDS THAT SOFTWARE IS PROVIDED "AS IS" FOR WHICH * NO WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. INDIANA * UNIVERSITY GIVES NO WARRANTIES AND MAKES NO REPRESENTATION THAT * SOFTWARE IS FREE OF INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR * OTHER PROPRIETARY RIGHTS. INDIANA UNIVERSITY MAKES NO WARRANTIES THAT * SOFTWARE IS FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP * DOORS", "WORMS", OR OTHER HARMFUL CODE. LICENSEE ASSUMES THE ENTIRE * RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR ASSOCIATED MATERIALS, * AND TO THE PERFORMANCE AND VALIDITY OF INFORMATION GENERATED USING * SOFTWARE. */ xpp3-1.1.4c/src/xml/tests/cdsect.xml100644 0 0 1353 10525225064 16372 0ustaraslomewww 0 0 <foo> <t> <![CDATA[fo]]>o<![CDATA[ ]]></t> </foo> http://xmlpull.org/v1/doc/features.html#process-namespaces xpp3-1.1.4c/src/xml/tests/cdsect_eol.xml100644 0 0 1425 10525225064 17231 0ustaraslomewww 0 0 <foo> <t> <![CDATA[fo]]>o<![CDATA[ ]]> </t> </foo> http://xmlpull.org/v1/doc/features.html#process-namespaces xpp3-1.1.4c/src/xml/tests/cdsect_mixed.xml100644 0 0 3211 10525225064 17553 0ustaraslomewww 0 0 <foo> <t><![CDATA[ f]]>o<![CDATA[o ]]></t> <t> <![CDATA[fo]]>o<![CDATA[ ]]></t> <t> <![CDATA[f]]>o<![CDATA[o]]> </t> <t><![CDATA[ f]]>o<![CDATA[o ]]></t> </foo> http://xmlpull.org/v1/doc/features.html#process-namespaces xpp3-1.1.4c/src/xml/tests/cdsect_more.xml100644 0 0 3400 10525225064 17407 0ustaraslomewww 0 0 <foo> <t><![CDATA[ foo]]> </t> <t><![CDATA[ foo ]]></t> <t> <![CDATA[foo ]]></t> <t><![CDATA[ foo]]> </t> <t> <![CDATA[foo]]> </t> <t> <![CDATA[fo]]><![CDATA[o]]> </t> <t> <![CDATA[fo]]>o<![CDATA[ ]]></t> <t> <![CDATA[f]]>o<![CDATA[o]]> </t> <t><![CDATA[ f]]>o<![CDATA[o ]]></t> </foo> http://xmlpull.org/v1/doc/features.html#process-namespaces xpp3-1.1.4c/src/xml/tests/simple.xml100644 0 0 2137 10525225064 16417 0ustaraslomewww 0 0 bar ]]> http://xmlpull.org/v1/doc/features.html#process-namespaces xpp3-1.1.4c/src/xml/tests/simple2.xml100644 0 0 1631 10525225064 16477 0ustaraslomewww 0 0 <?xml version="1.0" encoding="utf-8" ?> <Table> <ClientID> BS </ClientID>>/Table> ]]> http://xmlpull.org/v1/doc/features.html#process-namespaces xpp3-1.1.4c/src/xml/tests/typical.xml100644 0 0 727 10525225064 16556 0ustaraslomewww 0 0 bar&baz ]]> http://xmlpull.org/v1/doc/features.html#process-namespaces xpp3-1.1.4c/xpp3-1.1.4c.jar100644 0 0 352405 10525225062 14111 0ustaraslomewww 0 0 PK j5 META-INF/PK j5?{^jMETA-INF/MANIFEST.MFMLK-. K-*ϳR03rCq,HLHU%xRKRSt*AM u 4K|3+KRs<4yxPK j5META-INF/services/PK j5'6#!5META-INF/services/org.xmlpull.v1.XmlPullParserFactory/J׫)(˭(0H,*N-rKL./PK j5XPP3_1.1.4c_VERSIONPK j5javax/PK j5 javax/xml/PK j5javax/xml/namespace/PK j5-pF javax/xml/namespace/QName.classUsU$&-M b-_%ݴ"~H5RZT`6[7lJG|M}ExG:#3cGBgttFܻ4 Cνs~9g_~ p%82*UtㄊQc8OD0) ΨЄB"ī "8'_u!y!.qQCD8fU(eh兒se)6:Fy#elbl+%#LdV1kXFa|\͐i!2gh1m>Z-Lic";kMq!'oV$Bj`INҖ?e>˝5lHD#D8q+ aUYP9`qznm!Keް|l!LQBGF%##ZF aE/r.U d$`+7" Y^r̢]QW@#CY J0dZaS\yz]n 1`NÛHi؁ ;Vߝ,>kXG˳zHͦMT#Dev kNְKu6{:3,5Ca#)g}Mɘ/"J.@+8AUyb!VpYb@ٯ?ir,-wp֯3c |-R-:Ūk05Zմ)U sTDw?)}ټQ>JO %2}inBA]=i*銗Tg" G)C#;v'I(C/PK j5org/PK j5 org/xmlpull/PK j5org/xmlpull/mxp1/PK j5fRjorg/xmlpull/mxp1/MXParser.class|E?|f%BtIUJ@Br`Hb Ŋ ,X1 m aZֵ3O̙3s<7OH|_L%&嗒s7)t9Ws9Ws֐kɩ'g9ɹ-l%g9 l'g9דȹFrn"frn!Vrn#oN"Nr"nr!g79{KνG#g?9syyGyBq=d<z$9O49Y?g8_ ξ +TUf)E02; .?0jψsο ̿2?ueoT;r':~ GD77n#o2a ! lP Qn&-Cie8E6Dq?ѳ*78` !jQ]<賧L?p"K//XZmuY Z-Y\^f`biN฼gͧ& fN/8A{/=i'O+eqjaԼsFngNX 騬iG玞\RűjtmcGO%;#XQ2`s7Ĺ l$\S_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#/X")'UA>(]"74'GP?43'%HAlhNb^RVjr ##00b1I&6PK j5&-)org/xmlpull/v1/builder/XmlAttribute.class}PMO@}WYpƳ'cdPcm%vS̓?eBDof̛z@8v@=iB^~"g2Q0^ l!dHȎ^Xf7ɵfW^+={@SLIѢ͒ijdHE>̷J"f~3")KR,>j Ջ@4BS wcF[, =zEo&S-n+bZuZ?7&,W7nTU5581:\q Gs-l-pwJl.tPK j5nE0org/xmlpull/v1/builder/XmlBuilderException.classTkoG=kz&!!/ńY^ $IxU HSgC57:R@*.qLAgΜ{9wCybI cք:.H\.,sdW" &kXбcE@Yi[y؞S؛~}D%*Gk0ĽVuK2Uzxߕf"vrub?z.[-+ ꭆ%z";P^CFR=wdE7"陯X7+M”_: );%'#Inݾ©*Fc f?@Q΁Z7-$nd.< G1fa:NaZxӧ—scUT!U@S3]m.̤5L[8Iㆅqm贎; e>l*G\ Gi4Di7BÝ_I]]$/蝇q5;`3p2b׌bjb$)Tt'!~BlpPMpS4;#R1' mU8<jrڢ!'{cEknw r;8QD',T?p)lOQ3,&lW0>߿fQ\)i\g'CY !G,ؘyb׵;. Ϊ>ƹH|#V?w96E,RG\*,r]H:*'PK j5K*c *org/xmlpull/v1/builder/XmlCharacters.class}λ1xWX<Zhn+BA8sD2ٶclq8Uh tq=nJe3 ^0!ׁJxl` 9gX٨;W0UJb_̵4FޖTjo}{:so)m9mXU:{"&+G PK j5e'org/xmlpull/v1/builder/XmlComment.class}10 E 0p&` .iTIl C!.lx<_bI4AFȤza=aZ*r,NY'p#ˀNFkX(}]…,W҂0m@XsAw̹DcaO" N PK j5A)org/xmlpull/v1/builder/XmlContained.class;o>f]nvNv.FԒĢԼFu MtܜҜ2C̜"̼"kb. 4i12p%e22"Ie%%22(6)AX?'1/]?)+5Xda`Ҭ l@Fv8PK j5mho)org/xmlpull/v1/builder/XmlContainer.class;o>f]vvVv6FҢT̜TF̼"IJDFtܜҜ2C̜"}d  9yIY%@ h'PK j5H/]1#'org/xmlpull/v1/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:]I!<׈T)Qq2%Hp&]dRT5aGѭ9oK0;Λ1' a=?3PLW+@U5yrx"ca@m,ڪ:H:j׋TH{<8.o2R~|EBN{Z.,= :X3mNv/og{磌66 CܫOfޠI؍ I;c3%[(z"6;q9•?: 9-p9g寥4p lM5Ul̢{! 0n /_i d9Z",%{p#ˡR 75t k46l46M؄{z?]F5vk鮆-}ZTKp87%|-gPK j5 AMETA-INF/PK j5?{^j'META-INF/MANIFEST.MFPK j5AMETA-INF/services/PK j5'6#!5META-INF/services/org.xmlpull.v1.XmlPullParserFactoryPK j5]XPP3_1.1.4c_VERSIONPK j5Ajavax/PK j5 Ajavax/xml/PK j5Ajavax/xml/namespace/PK j5-pF javax/xml/namespace/QName.classPK j5Aorg/PK j5 Aorg/xmlpull/PK j5Aorg/xmlpull/mxp1/PK j5fRj org/xmlpull/mxp1/MXParser.classPK j5} -Zorg/xmlpull/mxp1/MXParserCachingStrings.classPK j5`f&horg/xmlpull/mxp1/MXParserFactory.classPK j5S8 ,ulorg/xmlpull/mxp1/MXParserNonValidating.classPK j5Avorg/xmlpull/mxp1_serializer/PK j5#H.vorg/xmlpull/mxp1_serializer/MXSerializer.classPK j5Aƚorg/xmlpull/v1/PK j5Aorg/xmlpull/v1/builder/PK j5A^%(org/xmlpull/v1/builder/Iterable.classPK j5&-)org/xmlpull/v1/builder/XmlAttribute.classPK j5nE0korg/xmlpull/v1/builder/XmlBuilderException.classPK j5K*c *org/xmlpull/v1/builder/XmlCharacters.classPK j5e' org/xmlpull/v1/builder/XmlComment.classPK j5A)org/xmlpull/v1/builder/XmlContained.classPK j5mho)org/xmlpull/v1/builder/XmlContainer.classPK j5H/]1#'org/xmlpull/v1/builder/XmlDoctype.classPK j5.,(org/xmlpull/v1/builder/XmlDocument.classPK j52-S'org/xmlpull/v1/builder/XmlElement.classPK j5*4 .Sorg/xmlpull/v1/builder/XmlInfosetBuilder.classPK j5w)Ӹorg/xmlpull/v1/builder/XmlNamespace.classPK j5s(org/xmlpull/v1/builder/XmlNotation.classPK j5Y8j5ºorg/xmlpull/v1/builder/XmlProcessingInstruction.classPK j5m!t,org/xmlpull/v1/builder/XmlSerializable.classPK j5*a9org/xmlpull/v1/builder/XmlUnexpandedEntityReference.classPK j5ch.6org/xmlpull/v1/builder/XmlUnparsedEntity.classPK j5Anorg/xmlpull/v1/builder/adapter/PK j5\wj8org/xmlpull/v1/builder/adapter/XmlAttributeAdapter.classPK j5z#)^7korg/xmlpull/v1/builder/adapter/XmlDocumentAdapter.classPK j5ER76org/xmlpull/v1/builder/adapter/XmlElementAdapter.classPK j5Aorg/xmlpull/v1/builder/impl/PK j59k 2 org/xmlpull/v1/builder/impl/XmlAttributeImpl.classPK j5\0org/xmlpull/v1/builder/impl/XmlCommentImpl.classPK j5|@93 org/xmlpull/v1/builder/impl/XmlDocumentImpl$1.classPK j5=1 j1org/xmlpull/v1/builder/impl/XmlDocumentImpl.classPK j5dL2Morg/xmlpull/v1/builder/impl/XmlElementImpl$1.classPK j5*;2torg/xmlpull/v1/builder/impl/XmlElementImpl$2.classPK j5HP72org/xmlpull/v1/builder/impl/XmlElementImpl$3.classPK j5:lGeorg/xmlpull/v1/builder/impl/XmlElementImpl$ElementsSimpleIterator.classPK j5hO#>org/xmlpull/v1/builder/impl/XmlElementImpl$EmptyIterator.classPK j5K  O7org/xmlpull/v1/builder/impl/XmlElementImpl$RequiredElementContentIterator.classPK j5̾=hJ0iorg/xmlpull/v1/builder/impl/XmlElementImpl.classPK j55$J/7"org/xmlpull/v1/builder/impl/XmlInfosetBuilderImpl.classPK j5^S26org/xmlpull/v1/builder/impl/XmlNamespaceImpl.classPK j5Aa:org/xmlpull/v1/dom2_builder/PK j5ԉ6:org/xmlpull/v1/dom2_builder/DOM2XmlPullBuilder$1.classPK j5qQLA;org/xmlpull/v1/dom2_builder/DOM2XmlPullBuilder$BuildProcess.classPK j5WKa,4~Dorg/xmlpull/v1/dom2_builder/DOM2XmlPullBuilder.classPK j5AKorg/xmlpull/v1/parser_pool/PK j5 g݃M 2Korg/xmlpull/v1/parser_pool/XmlPullParserPool.classPK j5APorg/xmlpull/v1/sax2/PK j5u#, Porg/xmlpull/v1/sax2/Driver.classPK j5AUdorg/xmlpull/v1/util/PK j5`%dorg/xmlpull/v1/util/XmlPullUtil.classPK j5Aimorg/xmlpull/v1/wrapper/PK j50+1morg/xmlpull/v1/wrapper/XmlPullParserWrapper.classPK j5~g 2oorg/xmlpull/v1/wrapper/XmlPullWrapperFactory.classPK j5&1torg/xmlpull/v1/wrapper/XmlSerializerWrapper.classPK j5Aworg/xmlpull/v1/wrapper/classic/PK j53,Kn ?Aworg/xmlpull/v1/wrapper/classic/StaticXmlPullParserWrapper.classPK j5@t{S'?iorg/xmlpull/v1/wrapper/classic/StaticXmlSerializerWrapper.classPK j5{0:Aorg/xmlpull/v1/wrapper/classic/XmlPullParserDelegate.classPK j5Ʈ:org/xmlpull/v1/wrapper/classic/XmlSerializerDelegate.classPK j5" "org/xmlpull/v1/XmlPullParser.classPK j5 |l+ org/xmlpull/v1/XmlPullParserException.classPK j5_! T)org/xmlpull/v1/XmlPullParserFactory.classPK j5cfSa"org/xmlpull/v1/XmlSerializer.classPKNNIxpp3-1.1.4c/xpp3_min-1.1.4c.jar100644 0 0 60574 10525225062 14737 0ustaraslomewww 0 0 PK j5 META-INF/PK j5?{^jMETA-INF/MANIFEST.MFMLK-. K-*ϳR03rCq,HLHU%xRKRSt*AM u 4K|3+KRs<4yxPK j5META-INF/services/PK j5QQQ.C5META-INF/services/org.xmlpull.v1.XmlPullParserFactory/J׫)(˭(0H,*N-G f&dV9\PK j5XPP3_1.1.4c_MIN_VERSIONPK j5org/PK j5 org/xmlpull/PK j5org/xmlpull/mxp1/PK j5fRjorg/xmlpull/mxp1/MXParser.class|E?|f%BtIUJ@Br`Hb Ŋ ,X1 m aZֵ3O̙3s<7OH|_L%&嗒s7)t9Ws9Ws֐kɩ'g9ɹ-l%g9 l'g9דȹFrn"frn!Vrn#oN"Nr"nr!g79{KνG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/PK j5QQQ.C5META-INF/services/org.xmlpull.v1.XmlPullParserFactoryPK j5hXPP3_1.1.4c_MIN_VERSIONPK j5Aorg/PK j5 Aorg/xmlpull/PK j5Aorg/xmlpull/mxp1/PK j5fRjorg/xmlpull/mxp1/MXParser.classPK j5ATorg/xmlpull/v1/PK j5" "Uorg/xmlpull/v1/XmlPullParser.classPK j5 |l+Zorg/xmlpull/v1/XmlPullParserException.classPK ?'^xpp3-1.1.4c/xpp3_xpath-1.1.4c.jar100644 0 0 604202 10525225062 15310 0ustaraslomewww 0 0 PK j5 META-INF/PK j5?{^jMETA-INF/MANIFEST.MFMLK-. K-*ϳR03rCq,HLHU%xRKRSt*AM u 4K|3+KRs<4yxPK j5org/PK j5 org/xmlpull/PK j5org/xmlpull/v1/PK j5org/xmlpull/v1/builder/PK j5org/xmlpull/v1/builder/xpath/PK j5cĸi+org/xmlpull/v1/builder/xpath/Xb1XPath.classRN1=ܸp1QDC -C3 ![4.?xQB齧|{EYXXh0y2g ; vO $C:M>GH;kP%̓2lq " oFkɐǁ0OYy'!G LU뮍%~:Z%M0&6Xji1lUȸ+1o[8 <~;QGjs'zƧ~\int]wʣ:ZX򴣩oQn`~d0iL"sS3{`/H=lc-d*}e4͐m.Кg}PK j5"org/xmlpull/v1/builder/xpath/impl/PK j5SJYI#9org/xmlpull/v1/builder/xpath/impl/DocumentNavigator.classXy`Ud7ݝ6i4--I!(G/hBZJlɖGCœCR) !\ ("h7M67߼}f-b4ܬ p=npx{䣆;%m( `wk%qO>?'w ~(~ݒcT<~T'X'5؏&<%D~ZIthx֏-*s Z!SK /+)W~]{X<)eΏryI5ǟg?N^\vk@e$J)=m&2hŭݙHL$t_k?m=>t=ke#Hz@yc&O[ܪ#13m&7QRja#HFM")@^ 9}bER'DMIklfl7ZFu]63^t&aƻI4^m~zE$&IJL#xL"^ 9 #?BR:~30BKR"mX/yL^?=6Gm<<-_~z2B3r)&w,p Ƒ rrkV DRkfRIql3H5{x,M7t 2[JT1y'+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>]B MwxXs:_XȤ?S+]{؍T* Qgo;}*bHsBo U4 )[&8ðM9E1Kc"t 2j] B1] V,!Q,A$'@N.@*52cĠXŝV)yR%5ĄK"R09?J U]9!R,Pg(71xgOh)hO#Ͳ Y J42zUJS%H У7|MS'Slc8t5' y](.PK j5">org/xmlpull/v1/builder/xpath/jaxen/SimpleFunctionContext.classU[OA=.Ү\ZDx( o X`KReqn>ߌYDef[J}hwd?G !t`X͈bDhMˢWe\1 q2Bㆌ2nɸМu͌C4h膚 dLd L~3u/^ Dfj.ly2sjq۰\PwFuW76-T"7%}2\Ltx!m6c%f%\FЃIM1m^ _y|_(JI3EV%csק*o5`<._ |3ܡb[eKs74,r(8.*) :x>r5C|CW$`3 bV1 6 a+ ycGص"hlt{@&a `^MYdw0րJ$\?vAu$^* jYn:^#Q)j}4Y77jWJCNaUK!Xz1}vewj[m{`WpHB~rR<DK7P:RN'f8ADqf>ov<}览LhLy@ n'T7F>kPH߱H.ZEڨ#rhCWac(htWa0M!Vf8qO E%6a$PK j5եNO?org/xmlpull/v1/builder/xpath/jaxen/SimpleNamespaceContext.classU[sDVƖؤL \D 6.$$m6b+ȒF2.?h'0V? 8++H;={v;߹_fUkx7 #{)RR,iI;IZP>R,IaE'V5i!ih& oZwLb*ԅgڢ,d73<2~$҆5Nr2n{iՅgt\7}Q1[%GdVd 'HI^_DK~yJ,lpJ]d cso_|ש-_3$iànT @‹$W;5c53蔙ri-2joG5 v!Sґ8Wk숉et\%L?unRuゆ:ᾆ Pֱ-s) cu젪!б/Nb=y  gItcvM `;v;p]E]G f^.7DIb(\m=mfnv9 ^*jw.L UA"[ w 鮵ʭ>|7 TM}_d6%=\n9LtX͑NW$"P2伂?0=>QG9~F|fxPK j5*X7>org/xmlpull/v1/builder/xpath/jaxen/SimpleVariableContext.classU[SH==,zY:3ƻx/Xxyh I*LZ>e*ʥj}GYu23LŇ]Fw q@ V~ ' tT7N㌚Ϊ霎a t`D .dpQ W1Us2L.@-:/HGҹ 6 uN:b*\]ʐt+ܞi@56`IȤ/Z m۪Bi ߪ{f驓 {!ڻ"ZBڸt7U' 50Ñ=O8 m[q/e*~I`+/>VX4不QJk`Hͮ!> !=B'z2cϴ2 WhmC5t?BOWPueɫESPYp0"!RuG"8ڠOttl t/eD7;m;ԢS$)sӪHޑZQorg/xmlpull/v1/builder/xpath/jaxen/UnresolvableException.classP=O0}!P(Tխ D,Nj'r>ńG!.w5cP]) qZJL2>3B2Ce}F>H3X蹰H\2l›TּRz!-orQ.J4GceU4K1ʢI%`U6w됋Vփu0 [#8atE e쉐bбS.l :^7k|PK j5-LXAorg/xmlpull/v1/builder/xpath/jaxen/UnsupportedAxisException.classPMK0}֭y\]уV%MK.[8Ef޼̛y=`Sz?SFUp!kaR>2ip8cp/D2 CemE>H3 X虰H0b 3!Ecv?F/:ݬNPK j5i|jO8org/xmlpull/v1/builder/xpath/jaxen/VariableContext.classP0 GGLH=-VIe*U(D:,=A&C/a;Jdt\f-d-KJO K !YJxo*я4|8vݴ@ bLYK΢x #,>9hKWu\Ђ&0(ீ ;PK j5<.org/xmlpull/v1/builder/xpath/jaxen/XPath.classKo@ϔRIKy) Eb t)RhbG8ocG!L ^|G_á4Ded"ߖzf:ͳÑFI J?c*`0,Qd?}.gFyK"?*ưc/ OrLr;S|a)w2.3 r̔r7*)cxc{^J"Ks2<)_aQ+W9| G^h 79Z<R)fxcGr,]8ڥP7n[Cymn{i(66u;ih_Ysh_M2h_F{>Îv7ٱ}ϯP?:fƊ 0=aёz6 U*bNR:uה){LjzM;N&VSME7z9A# pI ]i&L/ǧ’iQ' kV0ꮤc'u_âP1YS.R|ݴSCdmI'9 Ő'5)' 5-tglMgX͐\F&-sأ ㏑%-9"θ%T4 _^sTL M)4"kjX6*]嚹ѶudD'54 tǥ9[h; Eu|BO5! JbviBJe^dhh:WɖDYS^IeݲYJJŲּ@˗FiŎ&.ǥRmܦ;\z!8W^Y 7Gnv Kn{:}yő"-ah)]_iVmarKC荆I^'y1i 2[%y°S=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ko2L(6*:),* o0ox?~_x;woZ![D46,d)ƍln&;I):9j!b!6Vds>t "͔؀uni܊?;l#A PG8>Tk `h/eh/.6f`=Co!=PK j5y)B@org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultLogicalExpr.classQ=O0}NCR֎|bCPJ UW䴦q&W[L(9l޻' a? T χQff\jWorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultMinusExpr.classT{OPݵP7*ʞ19QȢteve~>?xn V{w='$䰡B~LH"542*ȩ.d*f@CUHci"ÇdqzjfoZ5F:o7\}B4TA^sjad|?pwרX$Ia |G({fa8Egi~3 Y1-Urs`{ 2$Sea5:aG /T5x+FۮGhJ52d`Qt2%8л]}M*+2*oxc74r/AuEOve(%)@g¸;T] RPK j5UhɅUGorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultMultiplicativeExpr.classSmkA~6wyZX.imB[R DD6&p]JGwARvya7.N㚍. Xtp7d-q]c߳ۨ2XOT H 5NTЕO"PLd$9EWJdkPJR<#}gR)B?fV_*++s=oeV|03b:ϒH][}Ni؂E!eB, 1ظ"1"!CKS6E!'jSXSe'' v Oq/]+I5cp%PK j5=uAorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultMultiplyExpr.classTR@ (XQ+K) x)0 g[ I'$$/3>x6h53{9{|䰢^H"Տ42:)e:&q[}pW=XÛdjfsϮm6&J`[3u)S4랹L[;TA]r@rZW&$I*ܳ$0qҲ0,bxwْ'k_ 0Lvy6wjYNL{E)j:hh]Q MFZl7X]L< -^[>UfU}u5'~ X#  $P0p4Ŝ7 @2+=Zf(+3,UdOޮC˸ýVqң j.3ۍ=CFb0(5ްjQw]ۃ~;p\i ?Uce Ъ5J2E}&2FO?U)`i 1 Z:=Hd tO*N5!!!!I%*F9 `stJ}hCCѳΈ-8&獬{d P2Ɛ9@'WI"Y7Gm^! t(^0zd]KDc+=J7JB>:!]'Kn c PK j5q =org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultNameStep.classV[leݝvؖm XD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'~Ʌ]`WMh7pWyA_#ڷXqq~ Ϗj+kF))f72â%O.t4BGO 6uG(06?CtD7QC&zX[곡b&DYhk]D%6`h._b؆hÅLt q.э[D>)q@8$p؋E ! .q*q$q,1%'AlvPN+]+Y5ּ \FKWiU\孱UltxUƫ%M$p3ۅ|[q<&XPL'|tg,{˫%pӿ^'Sּ7 |CW IRC-0鄧)>8PK j5v8org/xmlpull/v1/builder/xpath/jaxen/expr/FilterExpr.classPJA }i׎3Pޔz(B ޼MwCeYe̓G)^7\L c|qݵs|X]%sk76tJ,s)m̔.T;!enmcp^tQpסM.m!Z F@ctfcPK j5̫>org/xmlpull/v1/builder/xpath/jaxen/expr/FunctionCallExpr.class= @EWxa'X%Y4aM’=PbZi1S z?`B_a0$%ObKm !WvwSTpJL-Bt ax+ 10 ,*<ۉ1mdJ-ͯ}¤]`#ٕaO x:K: =PK j5Z9org/xmlpull/v1/builder/xpath/jaxen/expr/LiteralExpr.class10'BN8DGYNQ;JVڭvycAa` յ]%F>7^cܮ%zWsx0rl&`[cwA(RRy_Q2B#0aPK j5w:org/xmlpull/v1/builder/xpath/jaxen/expr/LocationPath.classNN@ 7[ʫE|D"Jz@O@*mFKm6~>B8{D,.ruGX%Y*m7X+w+Ɩ)&kt#u aVi?6=2IZ23_:ϟu߱UM4/M&DIԶ\72By6Olv j-a1uUz`@bqAB < oN'8PK j5,X8org/xmlpull/v1/builder/xpath/jaxen/expr/NumberExpr.class 0D' |PBv IJȳQ0C!{ycBխs터H8%VpBũq>:ÁM]'[e# eۊJz&CA dcsL!0PK j5-נ6org/xmlpull/v1/builder/xpath/jaxen/expr/PathExpr.classj@1jZkN%zk33z:#Q!JۤinJKxLM6ee K>VԖR/Tsֲ^G夝@ ƶKC-@*h/*kaB"Skz^3;¬͇}#.z>[}³L\r/PK j52_7org/xmlpull/v1/builder/xpath/jaxen/expr/Predicate.classOAN07i 70=!IMp&D)Oxb q W;3;_pps'N=DUS`~7]TZzJ4)}hd%-$rC^ΟRm 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ath/jaxen/expr/VariableReferenceExpr.class1PYQZY{u,5~!+ lCpjޟ ֘9aJ֧zM ˋ\ӓk>~SH']3[3]ss!AK?b`ؤ6տ ¨o!q#LPK j5K:7org/xmlpull/v1/builder/xpath/jaxen/expr/XPathExpr.classON0=nҤP !tĂʀ*BN0GS>*e>uNq0Q1 ;o<,LfZkVI)}KȜKZ1#4R{X1/Zp-ǶTyFJ _1Q-TE.MnI#^[tޤUczǦ.Syd>ޒynn"M~)cY*՛H6d:4 [a>-bӌ7PK j5&: :org/xmlpull/v1/builder/xpath/jaxen/expr/XPathFactory.class͖n0Ǐ¾m[(LWtRQie;pSRIp*} N6SfZ%.69>~y؇45[ǁ{` eoB=2.Y~ztK-צWt-afU禅Y?0ːAS%>ȫ }c Ja0'+rӡWxCt$>qKϯ$\QF+1fl_@:{iX܏ZF֚V' \(m ~OPc1=2)Fe8OuERBG-*V'ˆ8O)$u%MN:p(FUHRPgSnX< ww:q]wr93.jUr2C/b`d `f )Na_ !i:Dbp,S8 s\ A ΉiA,’BcdV5*d=F.Fl–B.AN!a[!;pE!WZ\W [pG!wB1#Bׁ?_PK j5-org/xmlpull/v1/builder/xpath/jaxen/expr/iter/PK j5z;Gorg/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableAncestorAxis.classSn@=vͥ)riBR U" QT Ogn-{|+ <Œwv.?~x6Mq]W2;$X0\P ӑH>"Kk\D'2ed*Δf(j,/><'8&O@:JzL K32"e>ò cL{p4.Z((Nɒi9%u2lX\o*;-)^\ /CuX(Lml~eI HSyxfN‚mc}<1 //Q` `?g%cϰ2|&'<;l5A1j` 1kWyHٙsf}v?Q41[M`mܱq=땊ah1x T$٩/Ci@"U? 63a!ls?S@̝9g=c K-xu7FX^(k1h=3莸)VctjlɬnHewdO\X6ͭm9΍L'r H]4쀦Ry_꒖:]R)2_xJZo㙞Gewׅi2*7NOqnzywCg}h[2oH`[X{ؒFE'pY~&K=-[9 ?Cչv &m|ջmE(gb*|D7iOT_Ӕ{~5*{%Ӯj:r7^VqPK j58Z/Dorg/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableChildAxis.classSMo@}v PGhWSqBA(B/6*hk[:ς ~blWXڝ7oogu<&Vppplܶq`T2}Bw I8Tc|c͑0 `L՜j%/;qƩ2X7 =ʼn G}Q35VBH>a5G %/L,E8>g20e q%-YRtYɹQqR{^R.& dlTmlI ߪ\1%‚mc6ڸ>'2ř#dQ:9a܉4#Pu\@OX炕Z~ՂZ~UZ6~xnw@D[X8 ksll=z _+BǂlUd.U;uθG<PK j52/CIorg/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableDescendantAxis.classS]o0=nd4᫃(3&2@U{MUDSg (u2EBd_{uuQ@ Ep$e`C`%q|G 2y,1\\q•G/ñ\=2eòI:J>uS1<ᄿM{TG>8Jt[dZ:~6,~o);-).C eU66?ėѰ=_'.,66]}\<C?\,%cx*PޙEdp'RLMʞx.rna, kToɼ#;s:rn{a zx櫁ۤy}kd7/E aX--X,\%'+gPsP֩ep' LNx.r-nd4 Tpp~գ9=:Fdymkdkhn٥5Zf[X8 AO+sddͯ=z +BRlL\BwpWq ҸVp\PK j5b{ ?Horg/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableFollowingAxis.classS]o0=nd4bka&P$L Til/<(uJ~B$S$Dɾ_'x&p%,;;6ڸ`=4 9"rOF DEZ=pu9cW=^vT)o R"񲘛co3y"O4}$E&] W)2a>F' ۽pO( F"0Y Ȉq,<SQ'(-`K |"6RGc+4 ľ%\.,6V]aƆdxb3<;I΀=NET)sf P>Ȱ',Q!ϒϰHR̯ڱ=VѠG5.i'oY7/E aX(-X,\%+sdd=z +BRJV9VYqXPK j55k[Oorg/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableFollowingSiblingAxis.classS]o0=nd4a MBªT ONje8J/ x7ɔ*MD=:׿~&a+ ;[6n`^XVp~(c1ʎ灢HgCx* 82rư?iG*ɔ^I5'zSyzPԧi'Gc(2r90̹ʈ 2| |={LEhձgIS3W,:SQ'Fw.`* 秨~"1R3ubOJv%4.,6.஍{.ߤgxq* ;X!>PL Pep#aF|.?\K:I>\$_hoA.l8tѢY| fi^%oY7/e ai UYp,q+|MW4G5ElJ\Dwp q-ѸZr\PK j5.(?Horg/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableNamespaceAxis.classS]o0=nd4bka`&P$ 4\I8U~B$SDɾ_'x&p:;6ڸ`=W2 9&s% d? dQ 4EZX*O sW0lTk>T題y s"Yse(єb"HE.TXǰg  ڽ E0c<QƦ)YRty"_n[NJ |22* ki7*pec`XwM[.c\$%;(8MsPޙ%dpGTʎxs`, EvlhǙu4_ ,K'Fz Kf}Kw,8p  q8y \:Yg+j^ТTCAVUdU;넸AEh,8PK j5_g3Eorg/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableParentAxis.classS[o0vք[k f  MHL'7:WYN^@G!).}}(%? 63%*(͢țxLFC<\ĞSIMQ&?P"Cr92Mx+M&׉b{C`$ݝ^k,M%2*O@T ʴ~߭K1㒂24HLⱍL4.MU9 UkX!6^ /.DRb3`3Ѐ*v-! ݙ"*y_U;*W3wIWJV9VnYqXPK j5*IO[Oorg/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterablePrecedingSiblingAxis.classS]o0=nd4f MBHaU7\yI:U~B$S^P7ɾ_'xmf6ظkcz"evZ=Hf7HCQv5E:8PO-sf {8 y~Lk>~DS1\(TfL8227,I KfBT QK1س2LMq*Ki\Xmt]}\<#IL\vct"ZS Ҍ\UA7u| *H8ނ]pE`ҼJ ֓o`_s4{X-Y,⠧KWpyddh̓+CрHE]a  ڽ E4o6p-qID۝J%GTa1cib>\= w]Aij2|XG]+d[xDh/H\4-Q6l,c˸yك-ئIet,Qׅ׫O+ c+_7rV&U>L\Jcn`pq w1{1c!6k-bq؃PK j5=_#95Aorg/xmlpull/v1/builder/xpath/jaxen/function/CeilingFunction.classTRA=CBh$/Qf"$hVx6a ZvqJ5~p*},{vE|>t'B%QFFF.Y|9L aREU<*᱊'R⩂iy3 a w!LU{3DKKF;+F$Od b8B;ΰ. %۩ s3M5W=aqGoo0?{V0U_C&d/8ry͗F=WzI4|*pUUR `SIS> ηk|SVNCe+ shN G ]Ȯ6'\.d-\$ dލZn_cZ  `Vix ^j(: S=sXɐT_ 2ɢ<EAL!gied;`ccF|gqZ p,\(,,Dv<X62bpk՘_У~2=hէH0 u }q\UʼFaD0,N'3.PWمS[*Y%WI>]hnQfg'PK j57$>@org/xmlpull/v1/builder/xpath/jaxen/function/ConcatFunction.classUVA ys'D@Q4++Mة9_ҕ[݀9K U' C<.{*_Fci!W>p.:⸠ᢎDR .Z긆àZkᦆ[ M fj!6 \4ϻ6wgxsMNa0C׵V>tyX"Z=[:g H8@(2L;!o)*r ZY$RU˽5_$dͮZ3d&J<(P`oaVlQT(s7R1inɍ9^v \S2pe(.ۂ=.,eQR ]W>凁-FU΍U:ѥᶁ! kc.F q+;` l`= ]ex:Jˤ+xI& ?IeɒÞC4px14+va{Rln<:fh8TRD9ʐy2![L4FTC©Lm+[aQʘH]7]Q{8ݚ%l8(gIND҇hK9 C}=|Dtn 14Hހ=>X] R47q|[ 6i2DPK j5B7f?org/xmlpull/v1/builder/xpath/jaxen/function/CountFunction.classS[OA,kAxnKaKHBlӄXYvv4o|He<圙3go .m5 H6P4Ay #/]3`I_<6"|4ϫAB 1$YS8MJaeA`I3$d$.k#=_8U>^l\rpn^u"i0q:(Zw71w@GbHfyE(PO{=sL s>5PK j5vBorg/xmlpull/v1/builder/xpath/jaxen/function/DocumentFunction.classTNA-lٮ((XD Z%4pee(K]6/+x#P3R՛9gw~f~AWvw0.bRH "t f1 seK X|!PD/ gL277c}rw*Rv*z}EZ}+Ъ5..L0FG#N#@ /ScHEbho0ƖtΆ(\ qB2XԮ $ԛȢ`@&p2q 5ö4w85pPK j5s?org/xmlpull/v1/builder/xpath/jaxen/function/FalseFunction.classSn@=8qF)RRIf Q#!Y 66hc{E| _Qx) ( -<;;2ࣁ0{'F㻑{%t([S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oC"!tlbm[EAkS"Zb<E9CFu JM嵐"/L(АPK j5 G  Corg/xmlpull/v1/builder/xpath/jaxen/function/SubstringFunction.classV]Se~^Ɇ%*j`[B?T4B(݄mXfn8xa/`{yw@.p9gy99{$hxC Ә0R\P1Ĝ5\e W𑆫XKqSŭVI(p`9՟2}`yf=f\/oy`;ק$5u?W*L+,:o \zƁ>= }+pBԭpp(b5tvm~RjρlANgr}@׺t_|T;9]Ӫ8GE)*xc|#\fG4j`BvDz*PswPS xğ40FKx2k8yJb+GNbb(**Cy^OG3^?w,H11P`yn0Bb(y!L-"dZ[UOHԉ|!RxiZ2_bzK( G:Q[@,ʀGAC8WRA L`2nX- cZ 9+i0 S|9Lb_’z[ wAQC ?kX3$ny .q~P6%&ʡ\< 90 L0pfY}g0y˧ewj19f SńyhWI͸|I6 eM\c\YԂzScg '(pe`I]$wgH&0gyymsq!0aq fIEFRſ1/1 LL"+epLყYDQyșŁQyƟ-!KisUg 6YoO sh"<,"B7f'|_8U({-bz1KKv6Zz PK j56d` Corg/xmlpull/v1/builder/xpath/jaxen/function/TranslateFunction.classVKlTUμn{v(AD δ BRB)r;23ܹ >+_ wbd36Qƅ;čqa;w!iC?~;ffu'oϊcV.3yD]úgæ4󣲆5 =b;{;!x⠓v /,^7-:P(V8:W/<w̧ Puk然2<]P޵3F);wٜ.lFSNiaT!'.eAbOO:x6Nma0ka9viZ|ulL?e,@SJZ1mK8ryӸ*45hJCj5HhT/7T-|H,=XXNKagȸF3_NaELөYtFE pI":G xgq߀} p"u8>縄p~»7|?( z+8[kn<òmBxY[I)=MhI5Y@WBJxS|B'[Dʻmworg/xmlpull/v1/builder/xpath/jaxen/function/TrueFunction.classSMo@}qi)壅ϤMpCq j%$ PqtuSKΏBPB!=xvwv͛㟿~GGkydQ<,&nٸm㎍2CyĐ.WF/\˧Q%æhi,'U|;-s  laW"oEJː{J|Ϩ0C0V3km95p &o9j38IT/ՄpeuTkhX04 V<2l;rg==L>3ieޑ҅$140ô2Q:7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jHKEJ_I(]P_uBjLeI(?Z]By'h'PO.߲H^o#{iOj)G&->T6.bȍc>!D'N),%pTɧU9R[˪ƣJκK[LVzDbvubη15M~[ Dn8^]>Kx.*oawKI[C787窻̍χFȘQi,=Y2yghn=GC_ o_F0whuρ8~D=~d} _qlcW+ z+;qSKvLp%=z6PK j5(org/xmlpull/v1/builder/xpath/jaxen/util/PK j5DrXjBorg/xmlpull/v1/builder/xpath/jaxen/util/AncestorAxisIterator.classSMo@}5u[g[>qR@d\PgnpmYGYB~? 15ȿ2 tÝ*➁ ,3nPM;#<;݁UۍqMe\;Hvsü+C]݀njn`'RˊڗCItR%g+Ő29Q"u~*)/\xa} ݛ'+q8gdUCF^N"!q%Jt2_JF!q(M|Z-7umtja <u6.#>(ӗV_(tyOi׷6 Noy"Bu,c> +S4C2evMʀKr\A|;!p< "x.y eO{p0):ۑ3|b ߫9Cg Z۞-w7h R ΀!kliNaɛfP[B 9;\)#qJ]mxҭ?ڭ#{iaFY C QEVPbxz3l- C]uc`(v<ѼJZ۟Dx>cs8.FΦQ^)'gsWjdiL$ͫ70ZM/H6Jus_ D5\PXh|Ev-ZCъI+EHaq⩯e\xI4lϙcHIZkv).F'׉9ɧO83M8SٯPK j5KmDorg/xmlpull/v1/builder/xpath/jaxen/util/DescendantAxisIterator.classSn@=5MLB˫S-ԏPA;=&VԂ7[a8cYM 9ggbfus j+6QΛ`ոPK j5g+Jorg/xmlpull/v1/builder/xpath/jaxen/util/DescendantOrSelfAxisIterator.classSKo@6 5I ) P<4!P TdB{K][:ÙK(Ĭ %Kyffg~e "Gwz*5zVHO(p{Tݍ .| hYBGG 8M.yZ$/2 6P4+n-\%&نefqB/ƫSfq&mdw^k{nCqN/rw}}{N?|B. DWWpяDVjJtaY>/z Ёnű# >_def t%7-U89:=[UU:$C5BnC;f[z3%-T7R0q%Wэf+Ւ+jU3ԓ| ,IRbۚCpR7u*Tig#YaLړ*9Ψ9CTeUcEuκNG6kMU`hJnVf-{[ lEkH0/Jd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'O^k|d;H߲|7\=Bx+6Lۑ A(50W S۾]tXU>ЌU>י/=0x}?0?@B8˹$'?iOѾʹEC e;bLCd.sC |3hcJ"]@ZCSH Y`-Lƈ9 (:aTe J i E a6D۝n!8UzIRtC'h򅟪.H@l%}q~*xVBkCye ~O p"}55m%(v6g3Q[+zL8boŷ{{ۮ䏲#kk PK j50=>org/xmlpull/v1/builder/xpath/jaxen/util/SelfAxisIterator.classjAƿ&tMM_JT bLJ ^lٰ]6a_wB`P W2̙3wO + X2k&nY(`m Zkb9ӎH$aP0cgpwy?]E/urO"z= D:μS' c㳇PD< 9c'>>Hk)"GI2--Z_j%H"nSb$&LLRl8WTxheT\FeGE.3BZV'Ńц'&—ϴqn0_mLIX`8 ڡ5O*.ѩ#}f.Qlo y.N;ӯR¹>{/ȢvnjL8 0\ANX %nCPZQ.P,ST hCh_UEe*^P|I:A^aV.M˰F3Yz =2c+7ha蟠kgW8k*ppuaWC@,0KGȟ,xmKj2_z 0U8Y0 JuPK j5z  =org/xmlpull/v1/builder/xpath/jaxen/util/StackedIterator.classVO[U~N)\h/)(N(nǜC ƥ &j`,$q~ĿF}ιv8{}㯟AŽ&"a % "hiry^LSxU ryQ(z1#g3.EprgV\qK\f^kru YY^Y]esLRjjqzmrMq=3"*]H⊕KeV4%)0vܥjT)RkSzes*2e]@g]iKn9cmX hxV G!-tn4:hǛc=k 7ǩB~2EҫH'GsM.~] ~3*>?5s@t؏6ƈOH~ 'd:N{S< `P|Np̷ Dߩ"Dߍ峣V|'~'CM 9DѡWfok6gU!a sT_?iEEr}`}d:n|d*GpF7#TU 'KFY[ud5ByPK j5%org/xmlpull/v1/builder/xpath/saxpath/PK j5c/org/xmlpull/v1/builder/xpath/saxpath/Axis.classTk#Uncs}6ݸk4I&5e̶N31ZAAA/"2">XPAQDAK&tv}{=B$pj8!aICVCNC^ò '5NixLib(ư* kCϭge Ldfk6kݳBO =9@"/g\PQ̘@t5SPH@rXR8,p`h'zY_28'VKl>wDT >Z"4J/'QȜΗW3>ƲҺ?} F]ָͤY֩[SFizU]16i85^3 dN{#mz9vjw[fw31cfY)c1ӶHFs1<\Y{>i} s(;vZn('ܣ*p9m=ZխNjYe-hffuNi;ض<46GrUpܯ⟇l6%KYR(g(g)OS:eCy2ɰ'#z2I͓qO&<9ɤ''<9 o"m!VSxXK(eCG,E 3)/N"%5 -=6#CC C+CC;CC'CW p{X~{PK j5C@3org/xmlpull/v1/builder/xpath/saxpath/Operator.classMN@ x*TlRZ+`JIi Cg177{~}| UZ .f8_bD @}r`;B['ݖ m`g BX<譖,UzzӓΑ;}3֋tg-P2,R6ںg  h?N,Hat7+~Ih{mLW? iK;-KeZ qL'FHNe I@%9r@.2e.sǼO2')||M}PK j5 \а?=org/xmlpull/v1/builder/xpath/saxpath/SAXPathEventSource.class;o>f]nvNv.FԒĒ ļ"F3 tܜҜ2C̜":DZ3 hT:Qd_Zꖙ v-K+He%%22e6vF9yIY%l L  " ad`3pPK j5+w: ;org/xmlpull/v1/builder/xpath/saxpath/SAXPathException.classPMK@}FcZwoZŃP)))n%]|IJ'?%Nxqy3of7tpKw`{ULޓX Eq0*&3*]Hy[Ɓ4"Ф 4z&/.*g{xԚNyP*W(<-;*YdЉ- &7^4==Xc8vy/[݌}Xati-.eS-왘ۨub{m6mj<۟PK j5!z @org/xmlpull/v1/builder/xpath/saxpath/SAXPathParseException.classPMK@}Dco@RSBxݤK`-O@8Iŋ^ty;of;:8#cp*UaKHcFd`dsU*$QEBτQM%B c?31WZ%+:bӔp*L!oHC')f L$T3  W߃aG臛&[+ 1 .EU}&u-Fzv?PK j5s{Ъ7org/xmlpull/v1/builder/xpath/saxpath/XPathHandler.class[S@OR(-PBP }` 8TƷmbn6|wid;iw&)ë2YP %,?+tsiGڂqʽDŶ~>u*Fqv,8pT.)8c(S[PU1+9!mڔcm7/I8 )/0ӋN @iO^JvCJNAnSJDptM&d\j} JzX5N%PWݣTA8|&0XSB6$PsWQ5䞡~`{="̗? ]&sp’g|}#Rl;LotYPn7mĉH۔ yl~ݢqOꞔ Lh]KOZѯTPX+p?x|JQD¥ՠpQG`'N:cNwiE>pz:!1BuӅ.+-aT,`g9PR1Eʈ#2HIDANfsd9Y@"rssr#rB6"+p'GVs9sr֐c#g99DrmT ;9S͑g<]}_xPK j5eE6org/xmlpull/v1/builder/xpath/saxpath/XPathReader.classO1n@ ?@E"THhs2FmϖF(B hv; U h j&*4*l_5+(36k?maSwnVџ0Nl(˃Iscd1<2ܕeʓ2S7~q^T? YBQ@CU, +h^PK j54 ??org/xmlpull/v1/builder/xpath/saxpath/XPathSyntaxException.classS[OQNeY, BrU@P$./$Knb|O$7uvi*cL3s|_A@O%"р\(ܖň;\ߕy["$~1!bRb&zar9oer( C9QvK,!ՊZ%vdjy )bQ\cVW-(5!IdhDvm+6CK @J^hMB'Cޞf@chTɰuO%+-zM$9NUmhg_1D\P#fPDX<[ p2`@ 0};I2npVF)wmɮkeff]_ncpsw\Y- C?ZcHA]$)C~/X,s O,~ ᓓM2ܧ $Z8hB3:su)w_>/?A v !b7:|zz =T~1B/sia&B|#~CW!G>H!BC4IY꼃4[riDE1 #LNk cgnPQtn>wnMЂCzCewD_bJUfIC PK j5)org/xmlpull/v1/builder/xpath/saxpath/com/PK j50org/xmlpull/v1/builder/xpath/saxpath/com/werken/PK j58org/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/PK j5EsZ[org/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/DefaultXPathHandler$Singleton.classRNA}2 8*Dj/DE= -6=dM?X3xC׫zJYb ,by,R*L IkGwcyoM׮<C4cX>XGW28`QCvkM2[WF^W7T'tC*Gd.jxLK7 Ω12jRw9CCO8dM%Vh{=᠈9(fʉliKIzWXd5yzt1SqBFӴCJ:`Feܼ>y \?;Jӱ (&yfaPK j5&BQorg/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/DefaultXPathHandler.classV=pE~k+,vl;LD6@sH"GpIZ;gV{trPPPPPPPPPPPPLf``  o,Ṳ{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pers/XPathReaderFactory.classVWU\Xe^;V@]!"$^4ޅٙufG#5:~+NNGOQwf]{_G>v ?Nj7~bQA88I?©Bixُ 0'nL>pA$Q ABBxN]A{ʇsBnxazaya܋ /&J{;;z{zt1gq9h2mMLK֬AYMsH@1g(v CGLMV7Fk'j*㍵#iEsv2%[cc\Mqì=CT/I#",ݘb(ȧMt 4k[JaSPТhu!~ӦǩҨtrECʆ"h5Jqnxc؍ݸapn}T3lկi3(̫㱴XS1]m[-'I\_=mxD٘Ŕw|RTu['%顿+=.e/U2IKx1a%|+MCpv24r;r|/Ĉ7rm>ZmlPOSNʚ +S5=t+hrKJnJtu(J%N #qKh^k7 W Æ;N$DOJO:7킔dJIYAYUg*ō! qƂxCB@PgOW~*+>h-AK:2 eK99c}=AtB7vI?f?ʭ.M%b]]J+ L'i2lYPG#K˪,Shs=}K(]dTw:.g9" ppLN´3m[H(%L{!MfG1;w <-   (ƎH( b( E=T.N sܤ8*b8YK,QI#8IMQIT1+U8)nAZЎC.#8LbxŦ`v]N]L!$wXu5xf!J~6Ręņ9l`mvdl٦x+ԈQ1t[~TeAQ Twgl%Yx4Q}t@)EztMݤ=8 D͸Z{ܶFPND}Cߡ?Rc~";d5L͟d=OC7io~vTFPE->BqXZFin<갑-U,]O|\`u]GN5l0zyYPf (딍pԎkmH,IZ섻PK j5 AMETA-INF/PK j5?{^j'META-INF/MANIFEST.MFPK j5Aorg/PK j5 Aorg/xmlpull/PK j5Aorg/xmlpull/v1/PK j5A0org/xmlpull/v1/builder/PK j5Aeorg/xmlpull/v1/builder/xpath/PK j5cĸi+org/xmlpull/v1/builder/xpath/Xb1XPath.classPK j5"ARorg/xmlpull/v1/builder/xpath/impl/PK j5SJYI#9org/xmlpull/v1/builder/xpath/impl/DocumentNavigator.classPK j5p6q62org/xmlpull/v1/builder/xpath/impl/XPathNamespace.classPK j5#Aorg/xmlpull/v1/builder/xpath/jaxen/PK j5ey 28org/xmlpull/v1/builder/xpath/jaxen/BaseXPath.classPK j5~S 0!org/xmlpull/v1/builder/xpath/jaxen/Context.classPK j5'%I 7%org/xmlpull/v1/builder/xpath/jaxen/ContextSupport.classPK j5vxO9@*org/xmlpull/v1/builder/xpath/jaxen/DefaultNavigator.classPK j5;10org/xmlpull/v1/builder/xpath/jaxen/Function.classPK j5D o>1org/xmlpull/v1/builder/xpath/jaxen/FunctionCallException.classPK j52e8a5org/xmlpull/v1/builder/xpath/jaxen/FunctionContext.classPK j5>| 7}6org/xmlpull/v1/builder/xpath/jaxen/JaxenException.classPK j5H15u8org/xmlpull/v1/builder/xpath/jaxen/JaxenHandler.classPK j5uU9iGorg/xmlpull/v1/builder/xpath/jaxen/NamespaceContext.classPK j5ww2mHorg/xmlpull/v1/builder/xpath/jaxen/Navigator.classPK j5Q(/*6Korg/xmlpull/v1/builder/xpath/jaxen/QualifiedName.classPK j5">!Norg/xmlpull/v1/builder/xpath/jaxen/SimpleFunctionContext.classPK j5եNO?Qorg/xmlpull/v1/builder/xpath/jaxen/SimpleNamespaceContext.classPK j5*X7>Uorg/xmlpull/v1/builder/xpath/jaxen/SimpleVariableContext.classPK j5S_( >rYorg/xmlpull/v1/builder/xpath/jaxen/UnresolvableException.classPK j5-LXAZorg/xmlpull/v1/builder/xpath/jaxen/UnsupportedAxisException.classPK j5i|jO8I\org/xmlpull/v1/builder/xpath/jaxen/VariableContext.classPK j5<.h]org/xmlpull/v1/builder/xpath/jaxen/XPath.classPK j5[FdG{_org/xmlpull/v1/builder/xpath/jaxen/XPathFunctionContext$Singleton.classPK j5 =_aorg/xmlpull/v1/builder/xpath/jaxen/XPathFunctionContext.classPK j58:}=]gorg/xmlpull/v1/builder/xpath/jaxen/XPathSyntaxException.classPK j5(Ajorg/xmlpull/v1/builder/xpath/jaxen/expr/PK j5Cĝ8jorg/xmlpull/v1/builder/xpath/jaxen/expr/BinaryExpr.classPK j5q,G Ikorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultAbsoluteLocationPath.classPK j5 P=AQporg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultAdditiveExpr.classPK j5X=0@rorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultAllNodeStep.classPK j5hs(A<'uorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultAndExpr.classPK j5cE>xorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultArithExpr.classPK j5Z}??{org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultBinaryExpr.classPK j5;"L/8DQorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultCommentNodeStep.classPK j5ry$<Vorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultDivExpr.classPK j5#ӾArorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultEqualityExpr.classPK j56ju?org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultEqualsExpr.classPK j5x}9org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultExpr.classPK j5SNZڣ$?org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultFilterExpr.classPK j5Eorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultFunctionCallExpr.classPK j5¡HIϞorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultGreaterThanEqualExpr.classPK j5OqDorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultGreaterThanExpr.classPK j5t.Forg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultLessThanEqualExpr.classPK j5Y ADorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultLessThanExpr.classPK j5wE@`org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultLiteralExpr.classPK j5^Aթorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultLocationPath.classPK j5y)B@org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultLogicalExpr.classPK j5n8b>org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultMinusExpr.classPK j5&<org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultModExpr.classPK j5UhɅUGiorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultMultiplicativeExpr.classPK j5=uAorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultMultiplyExpr.classPK j5q =پorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultNameStep.classPK j5'hdBorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultNotEqualsExpr.classPK j5R#0?Sorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultNumberExpr.classPK j5org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultPredicate.classPK j5[?org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultPredicated.classPK j59qRorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultProcessingInstructionNodeStep.classPK j5AѤ C org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultRelationalExpr.classPK j51폕vI org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultRelativeLocationPath.classPK j5 | 9org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultStep.classPK j5RT_uA5org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultTextNodeStep.classPK j5D2>org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultTruthExpr.classPK j5+eI>org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultUnaryExpr.classPK j5R ߳"- >&org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultUnionExpr.classPK j5 #{Jorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultVariableReferenceExpr.classPK j57=3>/org/xmlpull/v1/builder/xpath/jaxen/expr/DefaultXPathExpr.classPK j5J m)Arorg/xmlpull/v1/builder/xpath/jaxen/expr/DefaultXPathFactory.classPK j5ļ2 org/xmlpull/v1/builder/xpath/jaxen/expr/Expr.classPK j5v8#org/xmlpull/v1/builder/xpath/jaxen/expr/FilterExpr.classPK j5̫>Lorg/xmlpull/v1/builder/xpath/jaxen/expr/FunctionCallExpr.classPK j5Z9Sorg/xmlpull/v1/builder/xpath/jaxen/expr/LiteralExpr.classPK j5w:3org/xmlpull/v1/builder/xpath/jaxen/expr/LocationPath.classPK j5,X8worg/xmlpull/v1/builder/xpath/jaxen/expr/NumberExpr.classPK j5-נ6Uorg/xmlpull/v1/builder/xpath/jaxen/expr/PathExpr.classPK j52_7vorg/xmlpull/v1/builder/xpath/jaxen/expr/Predicate.classPK j5\I:org/xmlpull/v1/builder/xpath/jaxen/expr/PredicateSet.classPK j5j({8org/xmlpull/v1/builder/xpath/jaxen/expr/Predicated.classPK j5n*?2org/xmlpull/v1/builder/xpath/jaxen/expr/Step.classPK j5؎5K7.!org/xmlpull/v1/builder/xpath/jaxen/expr/UnaryExpr.classPK j5I7""org/xmlpull/v1/builder/xpath/jaxen/expr/UnionExpr.classPK j5MNӐC#org/xmlpull/v1/builder/xpath/jaxen/expr/VariableReferenceExpr.classPK j5K:7#org/xmlpull/v1/builder/xpath/jaxen/expr/XPathExpr.classPK j5&: :e%org/xmlpull/v1/builder/xpath/jaxen/expr/XPathFactory.classPK j5-Ad(org/xmlpull/v1/builder/xpath/jaxen/expr/iter/PK j5z;G(org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableAncestorAxis.classPK j55xSM*org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableAncestorOrSelfAxis.classPK j58!?H=-org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableAttributeAxis.classPK j5ץ?/org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableAxis.classPK j58Z/D}1org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableChildAxis.classPK j52/CI3org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableDescendantAxis.classPK j5W[O5org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableDescendantOrSelfAxis.classPK j5b{ ?HM8org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableFollowingAxis.classPK j55k[O:org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableFollowingSiblingAxis.classPK j5.(?H<org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableNamespaceAxis.classPK j5_g3E#?org/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableParentAxis.classPK j5[?HaAorg/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterablePrecedingAxis.classPK j5*IO[OCorg/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterablePrecedingSiblingAxis.classPK j56hg+CEorg/xmlpull/v1/builder/xpath/jaxen/expr/iter/IterableSelfAxis.classPK j5,A,Horg/xmlpull/v1/builder/xpath/jaxen/function/PK j5-VDZAvHorg/xmlpull/v1/builder/xpath/jaxen/function/BooleanFunction.classPK j5=_#95A/Lorg/xmlpull/v1/builder/xpath/jaxen/function/CeilingFunction.classPK j57$>@[Oorg/xmlpull/v1/builder/xpath/jaxen/function/ConcatFunction.classPK j5BRorg/xmlpull/v1/builder/xpath/jaxen/function/ContainsFunction.classPK j5B7f?@Vorg/xmlpull/v1/builder/xpath/jaxen/function/CountFunction.classPK j5vBYorg/xmlpull/v1/builder/xpath/jaxen/function/DocumentFunction.classPK j5s?\org/xmlpull/v1/builder/xpath/jaxen/function/FalseFunction.classPK j5HG.?^org/xmlpull/v1/builder/xpath/jaxen/function/FloorFunction.classPK j5!  <aorg/xmlpull/v1/builder/xpath/jaxen/function/IdFunction.classPK j5_D8v>forg/xmlpull/v1/builder/xpath/jaxen/function/LastFunction.classPK j5aYeC1iorg/xmlpull/v1/builder/xpath/jaxen/function/LocalNameFunction.classPK j5ԝj>%morg/xmlpull/v1/builder/xpath/jaxen/function/NameFunction.classPK j5 aB; Fqorg/xmlpull/v1/builder/xpath/jaxen/function/NamespaceUriFunction.classPK j57CHtorg/xmlpull/v1/builder/xpath/jaxen/function/NormalizeSpaceFunction.classPK j5rJ=xorg/xmlpull/v1/builder/xpath/jaxen/function/NotFunction.classPK j5 M] @{org/xmlpull/v1/builder/xpath/jaxen/function/NumberFunction.classPK j5:Borg/xmlpull/v1/builder/xpath/jaxen/function/PositionFunction.classPK j5 FZ@!?Rorg/xmlpull/v1/builder/xpath/jaxen/function/RoundFunction.classPK j58Dorg/xmlpull/v1/builder/xpath/jaxen/function/StartsWithFunction.classPK j5i%i @Worg/xmlpull/v1/builder/xpath/jaxen/function/StringFunction.classPK j5Fʏorg/xmlpull/v1/builder/xpath/jaxen/function/StringLengthFunction.classPK j5+Horg/xmlpull/v1/builder/xpath/jaxen/function/SubstringAfterFunction.classPK j5glIorg/xmlpull/v1/builder/xpath/jaxen/function/SubstringBeforeFunction.classPK j5 G  Corg/xmlpull/v1/builder/xpath/jaxen/function/SubstringFunction.classPK j5AX=Iorg/xmlpull/v1/builder/xpath/jaxen/function/SumFunction.classPK j56d` Corg/xmlpull/v1/builder/xpath/jaxen/function/TranslateFunction.classPK j5OF+>org/xmlpull/v1/builder/xpath/jaxen/function/TrueFunction.classPK j50A6org/xmlpull/v1/builder/xpath/jaxen/function/ext/PK j5uSForg/xmlpull/v1/builder/xpath/jaxen/function/ext/EndsWithFunction.classPK j5\ Forg/xmlpull/v1/builder/xpath/jaxen/function/ext/EvaluateFunction.classPK j5qv Korg/xmlpull/v1/builder/xpath/jaxen/function/ext/LocaleFunctionSupport.classPK j5hRCGorg/xmlpull/v1/builder/xpath/jaxen/function/ext/LowerFunction.classPK j575Uorg/xmlpull/v1/builder/xpath/jaxen/function/ext/MatrixConcatFunction$MatrixEnum.classPK j5“. J org/xmlpull/v1/builder/xpath/jaxen/function/ext/MatrixConcatFunction.classPK j5MCTorg/xmlpull/v1/builder/xpath/jaxen/function/ext/UpperFunction.classPK j5+Aorg/xmlpull/v1/builder/xpath/jaxen/pattern/PK j5=e[~AKorg/xmlpull/v1/builder/xpath/jaxen/pattern/AnyChildNodeTest.classPK j59N<)org/xmlpull/v1/builder/xpath/jaxen/pattern/AnyNodeTest.classPK j5@%Dorg/xmlpull/v1/builder/xpath/jaxen/pattern/LocationPathPattern.classPK j58D9org/xmlpull/v1/builder/xpath/jaxen/pattern/NameTest.classPK j5}X >org/xmlpull/v1/builder/xpath/jaxen/pattern/NamespaceTest.classPK j5,! J;}org/xmlpull/v1/builder/xpath/jaxen/pattern/NoNodeTest.classPK j5`TTlq9org/xmlpull/v1/builder/xpath/jaxen/pattern/NodeTest.classPK j5dS=Z=org/xmlpull/v1/builder/xpath/jaxen/pattern/NodeTypeTest.classPK j56%y58org/xmlpull/v1/builder/xpath/jaxen/pattern/Pattern.classPK j5h M?org/xmlpull/v1/builder/xpath/jaxen/pattern/PatternHandler.classPK j5kl !>org/xmlpull/v1/builder/xpath/jaxen/pattern/PatternParser.classPK j5A=ku=org/xmlpull/v1/builder/xpath/jaxen/pattern/TextNodeTest.classPK j5^H =org/xmlpull/v1/builder/xpath/jaxen/pattern/UnionPattern.classPK j5(A org/xmlpull/v1/builder/xpath/jaxen/util/PK j5DrXjBB org/xmlpull/v1/builder/xpath/jaxen/util/AncestorAxisIterator.classPK j58ؿ4 H org/xmlpull/v1/builder/xpath/jaxen/util/AncestorOrSelfAxisIterator.classPK j5KmD0org/xmlpull/v1/builder/xpath/jaxen/util/DescendantAxisIterator.classPK j5g+Jorg/xmlpull/v1/builder/xpath/jaxen/util/DescendantOrSelfAxisIterator.classPK j5!ӫbCorg/xmlpull/v1/builder/xpath/jaxen/util/FollowingAxisIterator.classPK j5̛bJorg/xmlpull/v1/builder/xpath/jaxen/util/FollowingSiblingAxisIterator.classPK j5H?org/xmlpull/v1/builder/xpath/jaxen/util/IdentityHashMap$1.classPK j5q\0?!org/xmlpull/v1/builder/xpath/jaxen/util/IdentityHashMap$2.classPK j54*g ?$org/xmlpull/v1/builder/xpath/jaxen/util/IdentityHashMap$3.classPK j5-7VO(org/xmlpull/v1/builder/xpath/jaxen/util/IdentityHashMap$EmptyHashIterator.classPK j5hMZC+org/xmlpull/v1/builder/xpath/jaxen/util/IdentityHashMap$Entry.classPK j5(b J /org/xmlpull/v1/builder/xpath/jaxen/util/IdentityHashMap$HashIterator.classPK j5Aֈ]#=l4org/xmlpull/v1/builder/xpath/jaxen/util/IdentityHashMap.classPK j5ȹT<$Eorg/xmlpull/v1/builder/xpath/jaxen/util/LinkedIterator.classPK j5SRgYHorg/xmlpull/v1/builder/xpath/jaxen/util/PrecedingAxisIterator$ReverseDescendantOrSelfAxisIterator.classPK j5{BF C0Lorg/xmlpull/v1/builder/xpath/jaxen/util/PrecedingAxisIterator.classPK j5sWtJvQorg/xmlpull/v1/builder/xpath/jaxen/util/PrecedingSiblingAxisIterator.classPK j50=>5Vorg/xmlpull/v1/builder/xpath/jaxen/util/SelfAxisIterator.classPK j5e$BXorg/xmlpull/v1/builder/xpath/jaxen/util/SingleObjectIterator.classPK j5z  =Zorg/xmlpull/v1/builder/xpath/jaxen/util/StackedIterator.classPK j5%A `org/xmlpull/v1/builder/xpath/saxpath/PK j5c/L`org/xmlpull/v1/builder/xpath/saxpath/Axis.classPK j5C@3dorg/xmlpull/v1/builder/xpath/saxpath/Operator.classPK j5 \а?=forg/xmlpull/v1/builder/xpath/saxpath/SAXPathEventSource.classPK j5+w: ;&gorg/xmlpull/v1/builder/xpath/saxpath/SAXPathException.classPK j5!z @horg/xmlpull/v1/builder/xpath/saxpath/SAXPathParseException.classPK j5s{Ъ7iorg/xmlpull/v1/builder/xpath/saxpath/XPathHandler.classPK j5eE6lorg/xmlpull/v1/builder/xpath/saxpath/XPathReader.classPK j54 ??morg/xmlpull/v1/builder/xpath/saxpath/XPathSyntaxException.classPK j5)AOqorg/xmlpull/v1/builder/xpath/saxpath/com/PK j50Aqorg/xmlpull/v1/builder/xpath/saxpath/com/werken/PK j58Aqorg/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/PK j5EsZ[:rorg/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/DefaultXPathHandler$Singleton.classPK j5&BQ torg/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/DefaultXPathHandler.classPK j5;wCyorg/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/Token.classPK j5v6BH|org/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/TokenTypes.classPK j5l" H*org/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/XPathLexer.classPK j5@ 1I{org/xmlpull/v1/builder/xpath/saxpath/com/werken/saxpath/XPathReader.classPK j51Aorg/xmlpull/v1/builder/xpath/saxpath/conformance/PK j5*o$ N=org/xmlpull/v1/builder/xpath/saxpath/conformance/ConformanceXPathHandler.classPK j5-Aͬorg/xmlpull/v1/builder/xpath/saxpath/helpers/PK j56& Eorg/xmlpull/v1/builder/xpath/saxpath/helpers/XPathReaderFactory.classPKTg/xmlpull/v1/builder/xpath/jaxen/function/FloorFunction.classPK j5!  <aorg/xmlpull/v1/builder/xpath/jaxen/function/IdFunction.classPK j5_D8v>forg/xmlpull/v1/builder/xpath/jaxen/function/LastFunction.classPK j5aYeC1iorg/xmlpull/v1/builder/xpath/jaxen/function/LocalNameFunction.classPK j5ԝj>%morg/xmlpull/v1/builder/xpath/jaxen/function/NameFunction.classPK j5 aB; Fqorg/xmlpull/v1/builder/xpath/jaxen/function/NamespaceUriFunction.classPK j57CHtorg/xmlpull/v1/builder/xpath/jaxen/function/NormalizeSpaceFunction.classPK j5rJ=xorg/xmlpull/v1/builder/xpath/jaxen/function/NotFunction.classPK j5 M] @{org/xmlpull/v1/builder/xpath/jaxen/function/NumberFunction.classPK j5:Borg/xmlpull/v1/builder/xpath/jaxen/function/PositionFunction.classPK j5 FZ@!?Rorg/xmlpull/v1/builder/xpath/jaxen/function/RoundFunction.classPK j58Dorg/xmlpull/v1/builder/xpath/jaxen/function/StartsWithFunction.classPK j5i%i @Worg/xmlpull/v1/builder/xpath/jaxen/function/StringFunction.classPK j5Fʏorg/xmlpull/v1/builder/xpath/jaxen/function/StringLengthFunction.classPK j5+Horg/xmlpull/v1/builder/xpath/jaxen/function/SubstringAfterFunction.classPK j5glIorg/xmlpull/v1/builder/xpath/jaxen/function/SubstringBeforeFunction.classPK j5 G  Corg/xmlpull/v1/builder/xpath/jaxen/function/SubstringFunction.classPK j5AX=Iorg/xmlpull/v1/builder/xpath/jaxen/function/SumFunction.classPK j56d` Corg/xmlpull/v1/builder/xpath/jaxen/function/TranslateFunction.classPK j5OF+>org/xmlpull/v1/builder/xpath/jaxen/function/TrueFunction.classPK j50A6org/xmlpull/v1/builder/xpath/jaxen/function/ext/PK j5uSForg/xmlpull/v1/builder/xpath/jaxen/function/ext/EndsWithFunction.classPK j5\ Forg/xmlpull/v1/builder/xpath/jaxen/function/ext/EvaluateFunction.classPK j5qv Kor