You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2001/12/07 20:58:10 UTC

cvs commit: xml-xalan/c/src/XSLT AVT.cpp AVT.hpp

dbertoni    01/12/07 11:58:10

  Modified:    c/src/XSLT AVT.cpp AVT.hpp
  Log:
  Report an error if an AVT has a '{', but no matchin '}'.
  
  Revision  Changes    Path
  1.15      +28 -6     xml-xalan/c/src/XSLT/AVT.cpp
  
  Index: AVT.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/AVT.cpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- AVT.cpp	2001/09/26 21:30:23	1.14
  +++ AVT.cpp	2001/12/07 19:58:10	1.15
  @@ -156,7 +156,7 @@
   			}
   			else
   			{
  -				tokenizer.nextToken(t);
  +				nextToken(constructionContext, locator, tokenizer, t);
   			}
   
   			if(length(t) == 1)
  @@ -168,7 +168,7 @@
   					case(XalanUnicode::charLeftCurlyBracket):
   					{
   						// Attribute Value Template start
  -						tokenizer.nextToken(lookahead);
  +						nextToken(constructionContext, locator, tokenizer, lookahead);
   
   						if(equals(lookahead, theLeftCurlyBracketString))
   						{
  @@ -205,13 +205,13 @@
   											const XalanDOMString	quote = lookahead;
   
   											// Consume stuff 'till next quote
  -											tokenizer.nextToken(lookahead);
  +											nextToken(constructionContext, locator, tokenizer, lookahead);
   
   											while(!equals(lookahead, quote))
   											{
   												append(exprBuffer, lookahead);
   
  -												 tokenizer.nextToken(lookahead);
  +												 nextToken(constructionContext, locator, tokenizer, lookahead);
   											}
   
   											append(exprBuffer,lookahead);
  @@ -238,7 +238,7 @@
   									append(exprBuffer,lookahead);
   								}
   
  -								tokenizer.nextToken(lookahead);
  +								nextToken(constructionContext, locator, tokenizer, lookahead);
   							} // end while(!equals(lookahead, "}"))
   							assert(equals(lookahead, theRightCurlyBracketString));
   
  @@ -266,7 +266,7 @@
   					}
   					case(XalanUnicode::charRightCurlyBracket):
   					{
  -						tokenizer.nextToken(lookahead);
  +						nextToken(constructionContext, locator, tokenizer, lookahead);
   
   						if(equals(lookahead, theRightCurlyBracketString))
   						{
  @@ -371,6 +371,28 @@
   				m_parts[i]->evaluate(buf, contextNode, prefixResolver, executionContext);
   			}
   		}
  +	}
  +}
  +
  +
  +
  +void
  +AVT::nextToken(
  +			StylesheetConstructionContext&	constructionContext,
  +			const Locator*					locator,
  +			StringTokenizer&				tokenizer,
  +			XalanDOMString&					token)
  +{
  +	if (tokenizer.hasMoreTokens() == false)
  +	{
  +		constructionContext.error(
  +			"The attribute value template has a missing a '}'",
  +			0,
  +			locator);
  +	}
  +	else
  +	{
  +		tokenizer.nextToken(token);
   	}
   }
   
  
  
  
  1.13      +9 -1      xml-xalan/c/src/XSLT/AVT.hpp
  
  Index: AVT.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/AVT.hpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- AVT.hpp	2001/07/12 05:05:29	1.12
  +++ AVT.hpp	2001/12/07 19:58:10	1.13
  @@ -58,7 +58,7 @@
   #define XALAN_AVT_HEADER_GUARD 
   
   /**
  - * $Id: AVT.hpp,v 1.12 2001/07/12 05:05:29 dbertoni Exp $
  + * $Id: AVT.hpp,v 1.13 2001/12/07 19:58:10 dbertoni Exp $
    * 
    * $State: Exp $
    * 
  @@ -82,6 +82,7 @@
   class PrefixResolver;
   class XPathExecutionContext;
   class XalanNode;
  +class StringTokenizer;
   class StylesheetConstructionContext;
   
   
  @@ -175,6 +176,13 @@
   #endif
   
   private:
  +
  +	void
  +	nextToken(
  +			StylesheetConstructionContext&	constructionContext,
  +			const Locator*					locator,
  +			StringTokenizer&				tokenizer,
  +			XalanDOMString&					token);
   
   	/**
   	 * Get the prefix from theName, if any.
  
  
  

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