dbertoni 00/06/07 14:12:03
Modified: c/src/XSLT Stylesheet.cpp
Log:
Updated code to put new pattern on the front of the list of matching
patterns. (cnfr10)
Revision Changes Path
1.21 +9 -5 xml-xalan/c/src/XSLT/Stylesheet.cpp
Index: Stylesheet.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/Stylesheet.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- Stylesheet.cpp 2000/06/07 18:35:01 1.20
+++ Stylesheet.cpp 2000/06/07 21:12:03 1.21
@@ -238,7 +238,6 @@
ElemTemplateElement* nsContext,
const AttributeList& atts,
StylesheetConstructionContext& constructionContext)
-// throws XSLProcessorException
{
const XalanDOMChar* nameAttr = 0;
XPath* matchAttr = 0;
@@ -503,7 +502,7 @@
xp, tmpl, pos, target, this);
// Put it in the map...
- m_patternTable[target].push_back(newMatchPat);
+ m_patternTable[target].push_front(newMatchPat);
}
}
}
@@ -693,7 +692,8 @@
if (matchPatternList != 0)
{
- XalanDOMString prevPat;
+ XalanDOMString prevPat;
+ const MatchPattern2* prevMatchPat = 0;
// These are iterators into the current table.
// Note that we may re-seat these iterators to
@@ -708,6 +708,7 @@
while(theCurrentEntry != theTableEnd)
{
const MatchPattern2* matchPat =
*theCurrentEntry;
+ assert(matchPat != 0);
ElemTemplate* rule =
matchPat->getTemplate();
@@ -728,10 +729,13 @@
{
const XalanDOMString
patterns = matchPat->getPattern();
- if((!isEmpty(patterns)) &&
- !(!isEmpty(prevPat) &&
equals(prevPat, patterns)))
+ if(!isEmpty(patterns) &&
+ !(prevMatchPat != 0 &&
+ equals(prevPat, patterns)
&&
+
prevMatchPat->getTemplate()->getPriority() ==
matchPat->getTemplate()->getPriority()))
{
prevPat = patterns;
+ prevMatchPat = matchPat;
const XPath* const
xpath = matchPat->getExpression();