zongaro     2003/09/18 17:50:20

  Modified:    java/src/org/apache/xpath/compiler XPathParser.java
  Log:
  Applying patch from Joanne Tong ([EMAIL PROTECTED]) for Bugzilla bug report
  23200.  The XPath syntax for a number is "Digits ('.' Digits?)? | '.' Digits".
  The XPath parser accepted anything accepted by the Java double literal syntax,
  including values using "E" exponential notation.  The fix was to guard against
  any value using exponential notation.
  
  Revision  Changes    Path
  1.26      +3 -0      
xml-xalan/java/src/org/apache/xpath/compiler/XPathParser.java
  
  Index: XPathParser.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xpath/compiler/XPathParser.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- XPathParser.java  30 Jan 2003 18:46:25 -0000      1.25
  +++ XPathParser.java  19 Sep 2003 00:50:20 -0000      1.26
  @@ -2054,6 +2054,9 @@
   
         try
         {
  +             // XPath 1.0 does not support number in exp notation
  +             if ((m_token.indexOf('e') > -1)||(m_token.indexOf('E') > -1))
  +                     throw new NumberFormatException();
           num = Double.valueOf(m_token).doubleValue();
         }
         catch (NumberFormatException nfe)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to