mmidy       01/01/24 08:04:36

  Modified:    java/src/org/apache/xalan/processor StylesheetPIHandler.java
  Log:
  Need to check if there are more tokens before advancing to the next
  
  Revision  Changes    Path
  1.9       +22 -19    
xml-xalan/java/src/org/apache/xalan/processor/StylesheetPIHandler.java
  
  Index: StylesheetPIHandler.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/StylesheetPIHandler.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- StylesheetPIHandler.java  2001/01/22 23:17:50     1.8
  +++ StylesheetPIHandler.java  2001/01/24 16:04:35     1.9
  @@ -185,26 +185,29 @@
                  (token.equals(" " ) || token.equals("\t") || 
token.equals("=")))
               token = tokenizer.nextToken();
             href = token;
  -          token = tokenizer.nextToken();
  -          // If the href value has parameters to be passed to a 
  -          // servlet(something like "foobar?id=12..."), 
  -          // we want to make sure we get them added to
  -          // the href value. Without this check, we would move on 
  -          // to try to process another attribute and that would be
  -          // wrong.
  -          // We need to set lookedAhead here to flag that we
  -          // already have the next token. 
  -          while ( token.equals("="))
  -          {  
  -            href = href + token + tokenizer.nextToken();
  -            if (tokenizer.hasMoreTokens())
  +          if (tokenizer.hasMoreTokens())
  +          {
  +            token = tokenizer.nextToken();
  +            // If the href value has parameters to be passed to a 
  +            // servlet(something like "foobar?id=12..."), 
  +            // we want to make sure we get them added to
  +            // the href value. Without this check, we would move on 
  +            // to try to process another attribute and that would be
  +            // wrong.
  +            // We need to set lookedAhead here to flag that we
  +            // already have the next token. 
  +            while ( token.equals("=") && tokenizer.hasMoreTokens())
               {  
  -              token = tokenizer.nextToken();
  -              lookedAhead = true;
  -            }
  -            else
  -            {
  -              break;
  +              href = href + token + tokenizer.nextToken();
  +              if (tokenizer.hasMoreTokens())
  +              {  
  +                token = tokenizer.nextToken();
  +                lookedAhead = true;
  +              }
  +              else
  +              {
  +                break;
  +              }
               }
             }
             href = href.substring(1, href.length() - 1);
  
  
  

Reply via email to