src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/Lexer.java

Print this page




 620         uName = m_namespaceContext.getNamespaceForPrefix(prefix);
 621       }
 622     }
 623     else
 624     {
 625       uName = prefix;
 626     }
 627 
 628     if ((null != uName) && (uName.length() > 0))
 629     {
 630       addToTokenQueue(uName);
 631       addToTokenQueue(":");
 632 
 633       String s = pat.substring(posOfNSSep + 1, posOfScan);
 634 
 635       if (s.length() > 0)
 636         addToTokenQueue(s);
 637     }
 638     else
 639     {
 640         // To older XPath code it doesn't matter if
 641         // error() is called or errorForDOM3().
 642                 m_processor.errorForDOM3(XPATHErrorResources.ER_PREFIX_MUST_RESOLVE,
 643                                                  new String[] {prefix});  //"Prefix must resolve to a namespace: {0}";
 644 
 645 /** old code commented out 17-Sep-2004
 646 // error("Could not locate namespace for prefix: "+prefix);
 647 //                m_processor.error(XPATHErrorResources.ER_PREFIX_MUST_RESOLVE,
 648 //                                       new String[] {prefix});  //"Prefix must resolve to a namespace: {0}";
 649 */
 650 
 651       /***  Old code commented out 10-Jan-2001
 652       addToTokenQueue(prefix);
 653       addToTokenQueue(":");
 654 
 655       String s = pat.substring(posOfNSSep + 1, posOfScan);
 656 
 657       if (s.length() > 0)
 658         addToTokenQueue(s);
 659       ***/
 660     }
 661 
 662     return -1;
 663   }
 664 }


 620         uName = m_namespaceContext.getNamespaceForPrefix(prefix);
 621       }
 622     }
 623     else
 624     {
 625       uName = prefix;
 626     }
 627 
 628     if ((null != uName) && (uName.length() > 0))
 629     {
 630       addToTokenQueue(uName);
 631       addToTokenQueue(":");
 632 
 633       String s = pat.substring(posOfNSSep + 1, posOfScan);
 634 
 635       if (s.length() > 0)
 636         addToTokenQueue(s);
 637     }
 638     else
 639     {
 640         m_processor.error(XPATHErrorResources.ER_PREFIX_MUST_RESOLVE,


 641                 new String[] {prefix});  //"Prefix must resolve to a namespace: {0}";
















 642     }
 643 
 644     return -1;
 645   }
 646 }