You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by jd...@locus.apache.org on 2000/03/14 20:34:43 UTC
cvs commit: xml-xalan/c/src/XSLT AVT.cpp
jdonohue 00/03/14 11:34:43
Modified: c/src/XSLT AVT.cpp
Log:
Fixed parsing problem causing crash in test lre06
Revision Changes Path
1.3 +9 -26 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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AVT.cpp 2000/01/26 14:28:06 1.2
+++ AVT.cpp 2000/03/14 19:34:43 1.3
@@ -66,7 +66,6 @@
#include "StylesheetConstructionContext.hpp"
-
/**
* Construct an AVT by parsing the string, and either
* constructing a vector of AVTParts, or simply hold
@@ -131,14 +130,6 @@
lookahead = DOMString();
break; // from switch
}
- /*
- else if(lookahead.equals("\"") || lookahead.equals("\'"))
- {
- // Error. Expressions can not begin with quotes.
- error = "Expressions can not begin with quotes.";
- break; // from switch
- }
- */
else
{
if(length(buffer) > 0)
@@ -148,10 +139,8 @@
}
exprBuffer = DOMString();
- append(exprBuffer,lookahead);
while(length(lookahead) > 0 && !equals(lookahead, "}"))
{
- lookahead = tokenizer.nextToken();
if(length(lookahead) == 1)
{
switch(lookahead.charAt(0))
@@ -178,21 +167,6 @@
error = "Error: Can not have \"{\" within expression.";
break;
}
- case '}':
- {
- // Proper close of attribute template.
- // Evaluate the expression.
- // XObject xobj = evalXPathStr(expression, contextNode, namespaceContext);
- // buffer.append(xobj.str());
- buffer = DOMString();
-
- XPath *xpath = constructionContext.createXPath(exprBuffer, resolver);
-
- m_parts.push_back(new AVTPartXPath(xpath));
-
- lookahead = DOMString(); // breaks out of inner while loop
- break;
- }
default:
{
// part of the template stuff, just add it.
@@ -205,7 +179,16 @@
// part of the template stuff, just add it.
append(exprBuffer,lookahead);
}
+ lookahead = tokenizer.nextToken();
} // end while(!lookahead.equals("}"))
+ assert(equals(lookahead, "}"));
+
+ // Proper close of attribute template. Evaluate the
+ // expression.
+ buffer = DOMString();
+ XPath *xpath = constructionContext.createXPath(exprBuffer, resolver);
+ m_parts.push_back(new AVTPartXPath(xpath));
+ lookahead = DOMString(); // breaks out of inner while loop
if(length(error) > 0)
{
break; // from inner while loop