Return-Path: Delivered-To: apmail-xml-xalan-cvs-archive@xml.apache.org Received: (qmail 23707 invoked by uid 500); 25 Jul 2003 15:46:10 -0000 Mailing-List: contact xalan-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: Delivered-To: mailing list xalan-cvs@xml.apache.org Received: (qmail 23691 invoked from network); 25 Jul 2003 15:46:10 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 25 Jul 2003 15:46:10 -0000 Received: (qmail 76048 invoked by uid 1636); 25 Jul 2003 15:46:09 -0000 Date: 25 Jul 2003 15:46:09 -0000 Message-ID: <20030725154609.76047.qmail@icarus.apache.org> From: villard@apache.org To: xml-xalan-cvs@apache.org Subject: cvs commit: xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl KindTestImpl.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N villard 2003/07/25 08:46:09 Modified: java/xpath_rwapi/src2/org/apache/xpath/expression Tag: xslt20 package.html NodeTest.java java/xpath_rwapi/src2/org/apache/xpath/impl Tag: xslt20 KindTestImpl.java Log: Support for pi target in NodeTest interface Revision Changes Path No revision No revision 1.1.2.2 +35 -5 xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/expression/Attic/package.html Index: package.html =================================================================== RCS file: /home/cvs//xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/expression/Attic/package.html,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- package.html 16 Apr 2003 14:39:47 -0000 1.1.2.1 +++ package.html 25 Jul 2003 15:46:09 -0000 1.1.2.2 @@ -1,9 +1,39 @@ + -XPath 2.0 API Implementation + + XPath 2.0 API Implementation + -

Public interfaces for XPath expression Abstract Syntax Tree nodes. -Primary external APIs for this XPath AST model.

+

Public interfaces for XPath expression Abstract Syntax Tree nodes. +Primary external APIs for this XPath AST model.

+

This XPath API is a compact set of Java interfaces that allow to +encode and handle XPath 2.0/XQuery 1.0 expressions (although only XPath +2.0 expressions are currently supported). It was designed to fulfill +the following requirements:

+
    +
  • Read/Write: capability of visiting and modifying the +internal representation of expressions. The expression reading is +performed by using either the visitor pattern or the get-like methods. +Similarly, the expression writing is done through a bunch of +set-like methods.
    +
  • +
  • Application-independent: +it should be suitable to be used by a variety of applications +efficiently. It should provide +solutions to plug in application-dependent features, like +namespace/qname manager and AST generalization and specialisation (see +implementation package).
    +
  • +
  • Compactness: keep the interface set as minimal as +possible by factoring similar concepts. The best example is the +interface OperatorExpr which allows to represent more than ten +expressions types.
  • +
+Right now, the XPath API do not provide a standard way to evaluate +expressions. This should be done.
+

- - 1.1.2.3 +8 -5 xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/expression/Attic/NodeTest.java Index: NodeTest.java =================================================================== RCS file: /home/cvs//xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/expression/Attic/NodeTest.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- NodeTest.java 28 Mar 2003 22:47:41 -0000 1.1.2.2 +++ NodeTest.java 25 Jul 2003 15:46:09 -0000 1.1.2.3 @@ -105,13 +105,13 @@ static final short TEXT_TEST = 3; /** - * The node test is a context item test + * The node test is a context item test (belong to the kind test group) */ static final short CONTEXT_ITEM_TEST = 4; /** * Full name of kind tests. - * This array is synchronized with kind test constants + * This array is synchronized with the kind test constants */ static final String[] KIND_TEST_NAME = { "processing-instruction()", "comment()", "node()", "text()", "." }; @@ -128,16 +128,19 @@ boolean isKindTest(); /** - * Gets the kind test + * Gets the kind test code. * @return short One of the kind test constant value * @throws XPathException whenever this node test isn't a kind test */ short getKindTest() throws XPathException; /** - * Gets the local part of the name test + * Gets the qualified name of the name test or the name of the 'PITarget' + * when the node test is pi kind test. For the later, only the local + * part of the qualified name is relevant. * @return QName The name test or {@link #WILDCARD} - * @throws XPathException whenever this node test isn't name test + * @throws XPathException whenever this node test isn't a name test + * or a pi kind test */ QName getNameTest() throws XPathException; No revision No revision 1.1.2.4 +13 -1 xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/Attic/KindTestImpl.java Index: KindTestImpl.java =================================================================== RCS file: /home/cvs//xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/Attic/KindTestImpl.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- KindTestImpl.java 28 Mar 2003 22:47:40 -0000 1.1.2.3 +++ KindTestImpl.java 25 Jul 2003 15:46:09 -0000 1.1.2.4 @@ -76,6 +76,11 @@ * The type of kindtest */ protected short m_kindTest; + + /** + * PI target + */ + protected QName m_pitarget; /** * Creates an any kind test node. Internal uses only @@ -151,7 +156,14 @@ */ public QName getNameTest() throws XPathException { - throw new XPathException("Invalid call this method on kind test"); // I18N + if (m_kindTest == PROCESSING_INSTRUCTION_TEST) + { + return m_pitarget; + } + else + { + throw new XPathException("Invalid call this method on kind test"); // I18N + } } /** --------------------------------------------------------------------- To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org For additional commands, e-mail: xalan-cvs-help@xml.apache.org