You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by ra...@apache.org on 2005/03/23 18:50:29 UTC

cvs commit: xml-security/src/org/apache/xml/security/transforms/implementations TransformXPath2Filter.java TransformXPathFilterCHGP.java TransformXPath2Filter04.java TransformXPath.java

raul        2005/03/23 09:50:29

  Modified:    src/org/apache/xml/security/transforms/implementations
                        TransformXPath2Filter.java
                        TransformXPathFilterCHGP.java
                        TransformXPath2Filter04.java TransformXPath.java
  Log:
  Resets the Cache of Xpath here instead of the Resolve method.
  
  Remove wantsOctectStream wantsNodeSet and his returns pair they are not used, right now and some are incorrect.
  
  Revision  Changes    Path
  1.16      +1 -11     xml-security/src/org/apache/xml/security/transforms/implementations/TransformXPath2Filter.java
  
  Index: TransformXPath2Filter.java
  ===================================================================
  RCS file: /home/cvs/xml-security/src/org/apache/xml/security/transforms/implementations/TransformXPath2Filter.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- TransformXPath2Filter.java	12 Feb 2005 12:04:36 -0000	1.15
  +++ TransformXPath2Filter.java	23 Mar 2005 17:50:29 -0000	1.16
  @@ -80,16 +80,6 @@
      private static final String FSubtract = "subtract";
      private static final String FIntersect = "intersect";
   
  -   /** @inheritDoc */
  -   public boolean wantsOctetStream ()   { return false; }
  -   /** @inheritDoc */
  -   public boolean wantsNodeSet ()       { return true; }
  -   /** @inheritDoc */
  -   public boolean returnsOctetStream () { return false; }
  -   /** @inheritDoc */
  -   public boolean returnsNodeSet ()     { return true; }
  -
  -   //J+
   
      /**
       * Method engineGetURI
  @@ -111,7 +101,7 @@
       */
      protected XMLSignatureInput enginePerformTransform(XMLSignatureInput input)
              throws TransformationException {
  -
  +	  CachedXPathAPIHolder.setDoc(this._transformObject.getElement().getOwnerDocument());
         try {
   
            this._inputSet = input.getNodeSet(true);
  
  
  
  1.14      +1 -12     xml-security/src/org/apache/xml/security/transforms/implementations/TransformXPathFilterCHGP.java
  
  Index: TransformXPathFilterCHGP.java
  ===================================================================
  RCS file: /home/cvs/xml-security/src/org/apache/xml/security/transforms/implementations/TransformXPathFilterCHGP.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- TransformXPathFilterCHGP.java	13 Feb 2005 12:05:18 -0000	1.13
  +++ TransformXPathFilterCHGP.java	23 Mar 2005 17:50:29 -0000	1.14
  @@ -59,17 +59,6 @@
      public static final String implementedTransformURI =
         Transforms.TRANSFORM_XPATHFILTERCHGP;
   
  -   //J-
  -   /** @inheritDoc */
  -   public boolean wantsOctetStream ()   { return false; }
  -   /** @inheritDoc */
  -   public boolean wantsNodeSet ()       { return true; }
  -   /** @inheritDoc */
  -   public boolean returnsOctetStream () { return false; }
  -   /** @inheritDoc */
  -   public boolean returnsNodeSet ()     { return true; }
  -   //J+
  -   //J-
   
      // values for state and stateStack
      static final Integer STATE_INCLUDE =            new Integer(0);
  @@ -116,7 +105,7 @@
       */
      protected XMLSignatureInput enginePerformTransform(XMLSignatureInput input)
              throws TransformationException {
  -
  +	  CachedXPathAPIHolder.setDoc(this._transformObject.getElement().getOwnerDocument());
         try {
            this.inputSet = input.getNodeSet(true);
   
  
  
  
  1.12      +1 -11     xml-security/src/org/apache/xml/security/transforms/implementations/TransformXPath2Filter04.java
  
  Index: TransformXPath2Filter04.java
  ===================================================================
  RCS file: /home/cvs/xml-security/src/org/apache/xml/security/transforms/implementations/TransformXPath2Filter04.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TransformXPath2Filter04.java	12 Feb 2005 12:04:36 -0000	1.11
  +++ TransformXPath2Filter04.java	23 Mar 2005 17:50:29 -0000	1.12
  @@ -65,16 +65,6 @@
      public static final String implementedTransformURI =
         Transforms.TRANSFORM_XPATH2FILTER04;
   
  -   //J-
  -   /** @inheritDoc */
  -   public boolean wantsOctetStream ()   { return false; }
  -   /** @inheritDoc */
  -   public boolean wantsNodeSet ()       { return true; }
  -   /** @inheritDoc */
  -   public boolean returnsOctetStream () { return false; }
  -   /** @inheritDoc */
  -   public boolean returnsNodeSet ()     { return true; }
  -   //J+
   
      /**
       * Method engineGetURI
  @@ -88,7 +78,7 @@
      /** @inheritDoc */
      protected XMLSignatureInput enginePerformTransform(XMLSignatureInput input)
              throws TransformationException {
  -
  +	  CachedXPathAPIHolder.setDoc(this._transformObject.getElement().getOwnerDocument());
         try {
            Set inputSet = input.getNodeSet(true);
            if (log.isDebugEnabled())
  
  
  
  1.20      +16 -12    xml-security/src/org/apache/xml/security/transforms/implementations/TransformXPath.java
  
  Index: TransformXPath.java
  ===================================================================
  RCS file: /home/cvs/xml-security/src/org/apache/xml/security/transforms/implementations/TransformXPath.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- TransformXPath.java	12 Feb 2005 12:04:36 -0000	1.19
  +++ TransformXPath.java	23 Mar 2005 17:50:29 -0000	1.20
  @@ -64,16 +64,6 @@
      public static final String implementedTransformURI =
         Transforms.TRANSFORM_XPATH;
   
  -   //J-
  -   /** @inheritDoc */
  -   public boolean wantsOctetStream ()   { return false; }
  -   /** @inheritDoc */
  -   public boolean wantsNodeSet ()       { return true; }
  -   /** @inheritDoc */
  -   public boolean returnsOctetStream () { return false; }
  -   /** @inheritDoc */
  -   public boolean returnsNodeSet ()     { return true; }
  -   //J+
   
      /**
       * Method engineGetURI
  @@ -107,7 +97,7 @@
             * The evaluation of this expression includes all of the document's nodes
             * (including comments) in the node-set representing the octet stream.
             */
  -
  +		  CachedXPathAPIHolder.setDoc(this._transformObject.getElement().getOwnerDocument());
            
            CachedXPathFuncHereAPI xPathFuncHereAPI =
               new CachedXPathFuncHereAPI(CachedXPathAPIHolder.getCachedXPathAPI());
  @@ -155,7 +145,21 @@
            }
   
            Iterator iterator = inputSet.iterator();
  -         
  +//		 if (iterator.hasNext()) {
  +//			 System.err.println(str);
  +//			 Node n1=(Node)iterator.next();		 
  +//			 XObject objects=xPathFuncHereAPI.selectNodeList(XMLUtils.getOwnerDocument(n1),
  +//                 xpathnode, str,prefixResolver);
  +//			 NodeList nl=objects.nodelist();
  +//			 int length=nl.getLength();
  +//			 for (int i=0;i<length; i++) {
  +//				 Node n=nl.item(i);
  +//				 if (inputSet.contains(n)) {
  +//					 resultNodes.add(n);
  +//				 }			 				 
  +//			 }
  +//		 }
  +				 
            while (iterator.hasNext()) {
               Node currentNode = (Node) iterator.next();