You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by ga...@apache.org on 2001/01/11 10:48:38 UTC

cvs commit: xml-xalan/java/src/org/apache/xpath/compiler Lexer.java

garyp       01/01/11 01:48:37

  Modified:    java/src/org/apache/xpath/compiler Lexer.java
  Log:
  Undefined namespace prefix now generates appropriate error.  Formerly, it was mapped to a URI which was the same as the prefix.
  
  Revision  Changes    Path
  1.6       +10 -1     xml-xalan/java/src/org/apache/xpath/compiler/Lexer.java
  
  Index: Lexer.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/compiler/Lexer.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Lexer.java	2000/12/17 05:20:08	1.5
  +++ Lexer.java	2001/01/11 09:48:34	1.6
  @@ -593,11 +593,14 @@
      * @param posOfNSSep The position of the namespace seperator (':').
      * @param posOfScan The end of the name index.
      *
  +   * @throws javax.xml.transform.TransformerException
  +   *
      * @return -1 always.
      */
     private int mapNSTokens(String pat, int startSubstring, int posOfNSSep,
                             int posOfScan)
  -  {
  +           throws javax.xml.transform.TransformerException
  + {
   
       String prefix = pat.substring(startSubstring, posOfNSSep);
       String uName;
  @@ -659,6 +662,11 @@
       {
   
         // error("Could not locate namespace for prefix: "+prefix);
  +      m_processor.error(XPATHErrorResources.ER_PREFIX_MUST_RESOLVE,
  +                 new String[] {prefix});  //"Prefix must resolve to a namespace: {0}";
  +
  +
  +      /***  Old code commented out 10-Jan-2001
         addToTokenQueue(prefix);
         addToTokenQueue(":");
   
  @@ -666,6 +674,7 @@
   
         if (s.length() > 0)
           addToTokenQueue(s);
  +      ***/
       }
   
       return -1;