xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vill...@apache.org
Subject cvs commit: xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl KindTestImpl.java
Date Fri, 25 Jul 2003 15:46:09 GMT
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 @@
  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
   <html>
  -<title>XPath 2.0 API Implementation</title>
  +<head>
  +  <title>XPath 2.0 API Implementation</title>
  +</head>
   <body>
  -<p>Public interfaces for XPath expression Abstract Syntax Tree nodes.  
  -Primary external APIs for this XPath AST model.<p>
  +<p>Public interfaces for XPath expression Abstract Syntax Tree nodes.
  +Primary external APIs for this XPath AST model.</p>
  +<p>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:</p>
  +<ul>
  +  <li style="font-weight: bold;">Read/Write: <span
  + style="font-weight: normal;">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</span><span style="font-weight: normal;"> expression </span><span
  + style="font-weight: normal;">writing is done through a bunch of
  +set-like methods.</span><br>
  +  </li>
  +  <li><span style="font-weight: bold;">Application-independent</span>:
  +it should be suitable to be used by a variety of applications
  +efficiently.<span style="font-weight: bold;"> </span>It should provide
  +solutions to plug in application-dependent features, like
  +namespace/qname manager and AST generalization and specialisation (see
  +implementation package).<span style="font-weight: bold;"><br>
  +    </span></li>
  +  <li style="font-weight: bold;">Compactness: <span
  + style="font-weight: normal;">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.</span></li>
  +</ul>
  +Right now, the XPath API do not provide a standard way to evaluate
  +expressions. This should be done.<br>
  +<p></p>
   </body>
   </html>
  -
  -
  
  
  
  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


Mime
View raw message