You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ne...@apache.org on 2002/09/04 17:51:40 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xpath XPath.java

neilg       2002/09/04 08:51:40

  Modified:    java/src/org/apache/xerces/impl/xpath XPath.java
  Log:
  "fix" for bug 5950.  The bug itself is not valid,
  but a modification of it whowed that our handling of . in XPath expressions--both
  with and without surrounding whitespace--was broken when unions are in use.
  
  Revision  Changes    Path
  1.9       +22 -3     xml-xerces/java/src/org/apache/xerces/impl/xpath/XPath.java
  
  Index: XPath.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xpath/XPath.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XPath.java	29 Aug 2002 23:25:43 -0000	1.8
  +++ XPath.java	4 Sep 2002 15:51:40 -0000	1.9
  @@ -1422,6 +1422,25 @@
                           addToken(tokens, XPath.Tokens.EXPRTOKEN_PERIOD);
                           starIsMultiplyOperator = true;
                           currentOffset++;
  +                    } else if (ch == '|') {
  +                        addToken(tokens, XPath.Tokens.EXPRTOKEN_PERIOD);
  +                        starIsMultiplyOperator = true;
  +                        currentOffset++;
  +                        break;
  +                    } else if (ch == ' ' || ch == 0x0A || ch == 0x09 || ch == 0x0D) {
  +                        // this is legal if the next token is non-existent or |
  +                        do {
  +                            if (++currentOffset == endOffset) {
  +                                break;
  +                            }
  +                            ch = data.charAt(currentOffset);
  +                        } while (ch == ' ' || ch == 0x0A || ch == 0x09 || ch == 0x0D); 
  +                        if (currentOffset == endOffset || ch == '|') {
  +                            addToken(tokens, XPath.Tokens.EXPRTOKEN_PERIOD);
  +                            starIsMultiplyOperator = true;
  +                            break;
  +                        }
  +                        throw new XPathException ("c-general-xpath");
                       } else {                    // '.'
                           throw new XPathException ("c-general-xpath");
                       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org