dbertoni 2002/09/23 18:42:37
Modified: c/src/XSLT Constants.hpp ElemApplyImport.cpp
ElemApplyTemplates.cpp ElemAttribute.cpp
ElemAttributeSet.cpp ElemCallTemplate.cpp
ElemChoose.cpp ElemComment.cpp ElemCopy.cpp
ElemCopyOf.cpp ElemDecimalFormat.cpp
ElemElement.cpp ElemEmpty.cpp ElemExtensionCall.cpp
ElemFallback.cpp ElemForEach.cpp ElemIf.cpp
ElemLiteralResult.cpp ElemLiteralResult.hpp
ElemMessage.cpp ElemNumber.cpp ElemOtherwise.cpp
ElemPI.cpp ElemParam.cpp ElemSort.cpp
ElemTemplate.cpp ElemTemplateElement.cpp
ElemText.cpp ElemTextLiteral.cpp ElemUse.cpp
ElemUse.hpp ElemValueOf.cpp ElemVariable.cpp
ElemVariable.hpp ElemWhen.cpp ElemWithParam.cpp
Stylesheet.cpp StylesheetConstructionContext.cpp
StylesheetConstructionContext.hpp
StylesheetConstructionContextDefault.cpp
StylesheetConstructionContextDefault.hpp
StylesheetExecutionContextDefault.cpp
StylesheetHandler.cpp TraceListenerDefault.cpp
XSLTEngineImpl.cpp
Log:
Element names table cleanup.
Revision Changes Path
1.20 +2 -2 xml-xalan/c/src/XSLT/Constants.hpp
Index: Constants.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/Constants.hpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- Constants.hpp 6 Sep 2002 01:39:17 -0000 1.19
+++ Constants.hpp 24 Sep 2002 01:42:34 -0000 1.20
@@ -89,7 +89,7 @@
*/
static void
terminate();
-
+#if 0
/**
* IDs for XSL element types. These are associated
* with the string literals in the XSLTProcessor class.
@@ -159,7 +159,7 @@
// Next free number: 85
};
-
+#endif
/**
* Literals for XSL element names. Note that there are more
* names than IDs, because some names map to the same ID.
1.17 +1 -1 xml-xalan/c/src/XSLT/ElemApplyImport.cpp
Index: ElemApplyImport.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemApplyImport.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ElemApplyImport.cpp 16 Apr 2002 05:45:50 -0000 1.16
+++ ElemApplyImport.cpp 24 Sep 2002 01:42:34 -0000 1.17
@@ -90,7 +90,7 @@
stylesheetTree,
lineNumber,
columnNumber,
-
Constants::ELEMNAME_APPLY_IMPORTS)
+
StylesheetConstructionContext::ELEMNAME_APPLY_IMPORTS)
{
const unsigned int nAttrs = atts.getLength();
1.25 +3 -3 xml-xalan/c/src/XSLT/ElemApplyTemplates.cpp
Index: ElemApplyTemplates.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemApplyTemplates.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- ElemApplyTemplates.cpp 6 Sep 2002 01:39:17 -0000 1.24
+++ ElemApplyTemplates.cpp 24 Sep 2002 01:42:34 -0000 1.25
@@ -81,7 +81,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_APPLY_TEMPLATES),
+
StylesheetConstructionContext::ELEMNAME_APPLY_TEMPLATES),
m_isDefaultTemplate(false),
m_mode()
{
@@ -203,8 +203,8 @@
switch(xslToken)
{
- case Constants::ELEMNAME_SORT:
- case Constants::ELEMNAME_WITHPARAM:
+ case StylesheetConstructionContext::ELEMNAME_SORT:
+ case StylesheetConstructionContext::ELEMNAME_WITH_PARAM:
fResult = true;
break;
1.40 +16 -21 xml-xalan/c/src/XSLT/ElemAttribute.cpp
Index: ElemAttribute.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemAttribute.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- ElemAttribute.cpp 21 Sep 2002 01:24:41 -0000 1.39
+++ ElemAttribute.cpp 24 Sep 2002 01:42:34 -0000 1.40
@@ -88,7 +88,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_ATTRIBUTE),
+
StylesheetConstructionContext::ELEMNAME_ATTRIBUTE),
m_pNameAVT(0),
m_pNamespaceAVT(0)
{
@@ -103,7 +103,7 @@
m_pNameAVT = new AVT(getLocator(), aname,
atts.getValue(i),
*this, constructionContext);
}
- else if(equals(aname,Constants::ATTRNAME_NAMESPACE))
+ else if(equals(aname, Constants::ATTRNAME_NAMESPACE))
{
m_pNamespaceAVT = new AVT(getLocator(), aname,
atts.getValue(i),
*this, constructionContext);
@@ -422,25 +422,20 @@
switch(xslToken)
{
// char-instructions
- case Constants::ELEMNAME_TEXTLITERALRESULT:
- case Constants::ELEMNAME_APPLY_TEMPLATES:
- case Constants::ELEMNAME_APPLY_IMPORTS:
- case Constants::ELEMNAME_CALLTEMPLATE:
- case Constants::ELEMNAME_FOREACH:
- case Constants::ELEMNAME_VALUEOF:
- case Constants::ELEMNAME_COPY_OF:
- case Constants::ELEMNAME_NUMBER:
- case Constants::ELEMNAME_CHOOSE:
- case Constants::ELEMNAME_IF:
- case Constants::ELEMNAME_TEXT:
- case Constants::ELEMNAME_COPY:
- case Constants::ELEMNAME_VARIABLE:
- case Constants::ELEMNAME_MESSAGE:
- // instructions
- // case Constants.ELEMNAME_PI:
- // case Constants.ELEMNAME_COMMENT:
- // case Constants.ELEMNAME_ELEMENT:
- // case Constants.ELEMNAME_ATTRIBUTE:
+ case StylesheetConstructionContext::ELEMNAME_TEXT_LITERAL_RESULT:
+ case StylesheetConstructionContext::ELEMNAME_APPLY_TEMPLATES:
+ case StylesheetConstructionContext::ELEMNAME_APPLY_IMPORTS:
+ case StylesheetConstructionContext::ELEMNAME_CALL_TEMPLATE:
+ case StylesheetConstructionContext::ELEMNAME_FOR_EACH:
+ case StylesheetConstructionContext::ELEMNAME_VALUE_OF:
+ case StylesheetConstructionContext::ELEMNAME_COPY_OF:
+ case StylesheetConstructionContext::ELEMNAME_NUMBER:
+ case StylesheetConstructionContext::ELEMNAME_CHOOSE:
+ case StylesheetConstructionContext::ELEMNAME_IF:
+ case StylesheetConstructionContext::ELEMNAME_TEXT:
+ case StylesheetConstructionContext::ELEMNAME_COPY:
+ case StylesheetConstructionContext::ELEMNAME_VARIABLE:
+ case StylesheetConstructionContext::ELEMNAME_MESSAGE:
fResult = true;
break;
1.21 +3 -3 xml-xalan/c/src/XSLT/ElemAttributeSet.cpp
Index: ElemAttributeSet.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemAttributeSet.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- ElemAttributeSet.cpp 21 Sep 2002 01:24:41 -0000 1.20
+++ ElemAttributeSet.cpp 24 Sep 2002 01:42:34 -0000 1.21
@@ -79,7 +79,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_DEFINEATTRIBUTESET),
+ StylesheetConstructionContext::ELEMNAME_ATTRIBUTE_SET),
m_QName()
{
const unsigned int nAttrs = atts.getLength();
@@ -88,7 +88,7 @@
{
const XalanDOMChar* const aname = atts.getName(i);
- if(equals(aname,Constants::ATTRNAME_NAME))
+ if(equals(aname, Constants::ATTRNAME_NAME))
{
m_QName.set(atts.getValue(i),
stylesheetTree.getNamespaces());
@@ -171,7 +171,7 @@
switch(xslToken)
{
- case Constants::ELEMNAME_ATTRIBUTE:
+ case StylesheetConstructionContext::ELEMNAME_ATTRIBUTE:
fResult = true;
break;
1.24 +2 -2 xml-xalan/c/src/XSLT/ElemCallTemplate.cpp
Index: ElemCallTemplate.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemCallTemplate.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- ElemCallTemplate.cpp 21 Sep 2002 01:24:41 -0000 1.23
+++ ElemCallTemplate.cpp 24 Sep 2002 01:42:34 -0000 1.24
@@ -86,7 +86,7 @@
stylesheetTree,
lineNumber,
columnNumber,
-
Constants::ELEMNAME_CALLTEMPLATE),
+
StylesheetConstructionContext::ELEMNAME_CALL_TEMPLATE),
m_templateName(),
m_template(0)
{
@@ -194,7 +194,7 @@
switch(xslToken)
{
// char-instructions
- case Constants::ELEMNAME_WITHPARAM:
+ case StylesheetConstructionContext::ELEMNAME_WITH_PARAM:
fResult = true;
break;
1.19 +4 -4 xml-xalan/c/src/XSLT/ElemChoose.cpp
Index: ElemChoose.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemChoose.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- ElemChoose.cpp 16 Apr 2002 05:45:50 -0000 1.18
+++ ElemChoose.cpp 24 Sep 2002 01:42:34 -0000 1.19
@@ -87,7 +87,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_CHOOSE)
+
StylesheetConstructionContext::ELEMNAME_CHOOSE)
{
const unsigned int nAttrs = atts.getLength();
@@ -129,7 +129,7 @@
{
const int type = node->getXSLToken();
- if(Constants::ELEMNAME_WHEN == type)
+ if(StylesheetConstructionContext::ELEMNAME_WHEN == type)
{
const ElemWhen* when =
#if defined(XALAN_OLD_STYLE_CASTS)
@@ -180,8 +180,8 @@
switch(xslToken)
{
// char-instructions
- case Constants::ELEMNAME_WHEN:
- case Constants::ELEMNAME_OTHERWISE:
+ case StylesheetConstructionContext::ELEMNAME_WHEN:
+ case StylesheetConstructionContext::ELEMNAME_OTHERWISE:
fResult = true;
break;
1.16 +15 -15 xml-xalan/c/src/XSLT/ElemComment.cpp
Index: ElemComment.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemComment.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ElemComment.cpp 9 Jul 2002 06:19:40 -0000 1.15
+++ ElemComment.cpp 24 Sep 2002 01:42:34 -0000 1.16
@@ -82,7 +82,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_COMMENT)
+
StylesheetConstructionContext::ELEMNAME_COMMENT)
{
const unsigned int nAttrs = atts.getLength();
@@ -137,20 +137,20 @@
switch(xslToken)
{
// char-instructions
- case Constants::ELEMNAME_TEXTLITERALRESULT:
- case Constants::ELEMNAME_APPLY_TEMPLATES:
- case Constants::ELEMNAME_APPLY_IMPORTS:
- case Constants::ELEMNAME_CALLTEMPLATE:
- case Constants::ELEMNAME_FOREACH:
- case Constants::ELEMNAME_VALUEOF:
- case Constants::ELEMNAME_COPY_OF:
- case Constants::ELEMNAME_NUMBER:
- case Constants::ELEMNAME_CHOOSE:
- case Constants::ELEMNAME_IF:
- case Constants::ELEMNAME_TEXT:
- case Constants::ELEMNAME_COPY:
- case Constants::ELEMNAME_VARIABLE:
- case Constants::ELEMNAME_MESSAGE:
+ case StylesheetConstructionContext::ELEMNAME_TEXT_LITERAL_RESULT:
+ case StylesheetConstructionContext::ELEMNAME_APPLY_TEMPLATES:
+ case StylesheetConstructionContext::ELEMNAME_APPLY_IMPORTS:
+ case StylesheetConstructionContext::ELEMNAME_CALL_TEMPLATE:
+ case StylesheetConstructionContext::ELEMNAME_FOR_EACH:
+ case StylesheetConstructionContext::ELEMNAME_VALUE_OF:
+ case StylesheetConstructionContext::ELEMNAME_COPY_OF:
+ case StylesheetConstructionContext::ELEMNAME_NUMBER:
+ case StylesheetConstructionContext::ELEMNAME_CHOOSE:
+ case StylesheetConstructionContext::ELEMNAME_IF:
+ case StylesheetConstructionContext::ELEMNAME_TEXT:
+ case StylesheetConstructionContext::ELEMNAME_COPY:
+ case StylesheetConstructionContext::ELEMNAME_VARIABLE:
+ case StylesheetConstructionContext::ELEMNAME_MESSAGE:
fResult = true;
break;
1.19 +1 -1 xml-xalan/c/src/XSLT/ElemCopy.cpp
Index: ElemCopy.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemCopy.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- ElemCopy.cpp 23 Feb 2002 04:23:16 -0000 1.18
+++ ElemCopy.cpp 24 Sep 2002 01:42:34 -0000 1.19
@@ -85,7 +85,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_COPY)
+ StylesheetConstructionContext::ELEMNAME_COPY)
{
const unsigned int nAttrs = atts.getLength();
1.28 +1 -1 xml-xalan/c/src/XSLT/ElemCopyOf.cpp
Index: ElemCopyOf.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemCopyOf.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- ElemCopyOf.cpp 10 Jul 2002 06:49:07 -0000 1.27
+++ ElemCopyOf.cpp 24 Sep 2002 01:42:34 -0000 1.28
@@ -88,7 +88,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_COPY_OF),
+
StylesheetConstructionContext::ELEMNAME_COPY_OF),
m_selectPattern(0),
m_isDot(false)
{
1.11 +1 -1 xml-xalan/c/src/XSLT/ElemDecimalFormat.cpp
Index: ElemDecimalFormat.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemDecimalFormat.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ElemDecimalFormat.cpp 21 Sep 2002 01:24:41 -0000 1.10
+++ ElemDecimalFormat.cpp 24 Sep 2002 01:42:34 -0000 1.11
@@ -82,7 +82,7 @@
stylesheetTree,
lineNumber,
columnNumber,
-
Constants::ELEMNAME_DECIMALFORMAT),
+
StylesheetConstructionContext::ELEMNAME_DECIMAL_FORMAT),
m_countMatchPattern(0),
m_fromMatchPattern(0),
m_valueExpr(0),
1.40 +2 -2 xml-xalan/c/src/XSLT/ElemElement.cpp
Index: ElemElement.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemElement.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- ElemElement.cpp 21 Sep 2002 01:24:41 -0000 1.39
+++ ElemElement.cpp 24 Sep 2002 01:42:34 -0000 1.40
@@ -84,7 +84,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_ELEMENT),
+ StylesheetConstructionContext::ELEMNAME_ELEMENT),
m_nameAVT(0),
m_namespaceAVT(0)
{
@@ -370,7 +370,7 @@
for (ElemTemplateElement* node = getFirstChildElem(); node !=
0; node = node->getNextSiblingElem())
{
- if (node->getXSLToken() !=
Constants::ELEMNAME_ATTRIBUTE)
+ if (node->getXSLToken() !=
StylesheetConstructionContext::ELEMNAME_ATTRIBUTE)
{
node->execute(executionContext);
}
1.10 +2 -2 xml-xalan/c/src/XSLT/ElemEmpty.cpp
Index: ElemEmpty.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemEmpty.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ElemEmpty.cpp 8 May 2002 20:55:26 -0000 1.9
+++ ElemEmpty.cpp 24 Sep 2002 01:42:34 -0000 1.10
@@ -61,7 +61,7 @@
#include <cassert>
-#include "Constants.hpp"
+#include "StylesheetConstructionContext.hpp"
@@ -75,7 +75,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_UNDEFINED),
+
StylesheetConstructionContext::ELEMNAME_UNDEFINED),
m_elementName(elementName)
{
}
1.12 +3 -3 xml-xalan/c/src/XSLT/ElemExtensionCall.cpp
Index: ElemExtensionCall.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemExtensionCall.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ElemExtensionCall.cpp 21 Sep 2002 01:24:41 -0000 1.11
+++ ElemExtensionCall.cpp 24 Sep 2002 01:42:34 -0000 1.12
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -79,7 +79,7 @@
atts,
lineNumber,
columnNumber,
- Constants::ELEMNAME_EXTENSIONCALL),
+
StylesheetConstructionContext::ELEMNAME_EXTENSION_CALL),
m_name(constructionContext.getPooledString(name)),
m_nsh(ns),
m_localPart(constructionContext.getPooledString(localpart))
@@ -103,7 +103,7 @@
for (const ElemTemplateElement* child = getFirstChildElem(); child !=
0; child = child->getNextSiblingElem())
{
- if(child->getXSLToken() == Constants::ELEMNAME_FALLBACK)
+ if(child->getXSLToken() ==
StylesheetConstructionContext::ELEMNAME_FALLBACK)
{
child->execute(executionContext);
}
1.13 +2 -2 xml-xalan/c/src/XSLT/ElemFallback.cpp
Index: ElemFallback.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemFallback.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ElemFallback.cpp 6 Sep 2002 01:39:17 -0000 1.12
+++ ElemFallback.cpp 24 Sep 2002 01:42:34 -0000 1.13
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -85,7 +85,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_FALLBACK)
+
StylesheetConstructionContext::ELEMNAME_FALLBACK)
{
const unsigned int nAttrs = atts.getLength();
1.27 +1 -1 xml-xalan/c/src/XSLT/ElemForEach.cpp
Index: ElemForEach.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemForEach.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- ElemForEach.cpp 24 Jul 2002 23:19:43 -0000 1.26
+++ ElemForEach.cpp 24 Sep 2002 01:42:34 -0000 1.27
@@ -97,7 +97,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_FOREACH),
+
StylesheetConstructionContext::ELEMNAME_FOR_EACH),
m_selectPattern(0),
m_sortElems(),
m_sortElemsCount(0)
1.20 +2 -2 xml-xalan/c/src/XSLT/ElemIf.cpp
Index: ElemIf.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemIf.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- ElemIf.cpp 21 Sep 2002 01:24:41 -0000 1.19
+++ ElemIf.cpp 24 Sep 2002 01:42:34 -0000 1.20
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -90,7 +90,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_IF),
+
StylesheetConstructionContext::ELEMNAME_IF),
m_test(0)
{
const unsigned int nAttrs = atts.getLength();
1.54 +34 -1 xml-xalan/c/src/XSLT/ElemLiteralResult.cpp
Index: ElemLiteralResult.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemLiteralResult.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- ElemLiteralResult.cpp 21 Sep 2002 01:24:41 -0000 1.53
+++ ElemLiteralResult.cpp 24 Sep 2002 01:42:34 -0000 1.54
@@ -92,6 +92,28 @@
const XalanDOMChar* name,
const AttributeList& atts,
int
lineNumber,
+ int
columnNumber) :
+ ElemUse(constructionContext,
+ stylesheetTree,
+ lineNumber,
+ columnNumber,
+ StylesheetConstructionContext::ELEMNAME_LITERAL_RESULT),
+ m_elementName(constructionContext.getPooledString(name)),
+ m_avts(),
+ m_attrCount(0),
+ m_hasPrefix(indexOf(name, XalanUnicode::charColon) < length(name) ?
true : false)
+{
+ init(constructionContext, stylesheetTree, atts);
+}
+
+
+
+ElemLiteralResult::ElemLiteralResult(
+ StylesheetConstructionContext& constructionContext,
+ Stylesheet&
stylesheetTree,
+ const XalanDOMChar* name,
+ const AttributeList& atts,
+ int
lineNumber,
int
columnNumber,
int
xslToken) :
ElemUse(constructionContext,
@@ -104,6 +126,17 @@
m_attrCount(0),
m_hasPrefix(indexOf(name, XalanUnicode::charColon) < length(name) ?
true : false)
{
+ init(constructionContext, stylesheetTree, atts);
+}
+
+
+
+void
+ElemLiteralResult::init(
+ StylesheetConstructionContext& constructionContext,
+ Stylesheet&
stylesheetTree,
+ const AttributeList& atts)
+{
const unsigned int nAttrs = atts.getLength();
m_avts.reserve(nAttrs);
@@ -257,7 +290,7 @@
// is another LRE, then we won't generate any
attributes.
// Otherwise, we might...
if (hasSingleTextChild() == false &&
- getFirstChildElem()->getXSLToken() !=
Constants::ELEMNAME_LITERALRESULT)
+ getFirstChildElem()->getXSLToken() !=
StylesheetConstructionContext::ELEMNAME_LITERAL_RESULT)
{
canGenerateAttributes(true);
}
1.28 +36 -2 xml-xalan/c/src/XSLT/ElemLiteralResult.hpp
Index: ElemLiteralResult.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemLiteralResult.hpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- ElemLiteralResult.hpp 21 Sep 2002 01:24:41 -0000 1.27
+++ ElemLiteralResult.hpp 24 Sep 2002 01:42:34 -0000 1.28
@@ -93,8 +93,7 @@
const XalanDOMChar* name,
const AttributeList& atts,
int
lineNumber,
- int
columnNumber,
- int
xslToken = Constants::ELEMNAME_LITERALRESULT);
+ int
columnNumber);
virtual
~ElemLiteralResult();
@@ -124,6 +123,41 @@
#else
typedef std::vector<const AVT*> AVTVectorType;
#endif
+
+protected:
+
+ /**
+ * Do common initialization.
+ *
+ * @param constructionContext context for construction of object
+ * @param stylesheetTree stylesheet containing element
+ * @param atts list of attributes for element
+ */
+ void
+ init(
+ StylesheetConstructionContext& constructionContext,
+ Stylesheet&
stylesheetTree,
+ const AttributeList& atts);
+
+ /**
+ * Construct an object corresponding to a literal result element
+ *
+ * @param constructionContext context for construction of object
+ * @param stylesheetTree stylesheet containing element
+ * @param name name of element
+ * @param atts list of attributes for element
+ * @param lineNumber line number in document
+ * @param columnNumber column number in document
+ * @param xslToken The xsl token value for this
class
+ */
+ ElemLiteralResult(
+ StylesheetConstructionContext& constructionContext,
+ Stylesheet&
stylesheetTree,
+ const XalanDOMChar* name,
+ const AttributeList& atts,
+ int
lineNumber,
+ int
columnNumber,
+ int
xslToken);
private:
1.18 +1 -1 xml-xalan/c/src/XSLT/ElemMessage.cpp
Index: ElemMessage.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemMessage.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- ElemMessage.cpp 10 Sep 2002 06:45:05 -0000 1.17
+++ ElemMessage.cpp 24 Sep 2002 01:42:34 -0000 1.18
@@ -82,7 +82,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_MESSAGE),
+
StylesheetConstructionContext::ELEMNAME_MESSAGE),
m_terminate(false)
{
const unsigned int nAttrs = atts.getLength();
1.64 +1 -1 xml-xalan/c/src/XSLT/ElemNumber.cpp
Index: ElemNumber.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemNumber.cpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- ElemNumber.cpp 21 Sep 2002 01:24:41 -0000 1.63
+++ ElemNumber.cpp 24 Sep 2002 01:42:34 -0000 1.64
@@ -112,7 +112,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_NUMBER),
+
StylesheetConstructionContext::ELEMNAME_NUMBER),
m_countMatchPattern(0),
m_fromMatchPattern(0),
m_valueExpr(0),
1.10 +2 -2 xml-xalan/c/src/XSLT/ElemOtherwise.cpp
Index: ElemOtherwise.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemOtherwise.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ElemOtherwise.cpp 16 Apr 2002 05:45:50 -0000 1.9
+++ ElemOtherwise.cpp 24 Sep 2002 01:42:34 -0000 1.10
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -81,7 +81,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_OTHERWISE)
+
StylesheetConstructionContext::ELEMNAME_OTHERWISE)
{
const unsigned int nAttrs = atts.getLength();
1.23 +16 -16 xml-xalan/c/src/XSLT/ElemPI.cpp
Index: ElemPI.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemPI.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- ElemPI.cpp 21 Sep 2002 01:24:41 -0000 1.22
+++ ElemPI.cpp 24 Sep 2002 01:42:34 -0000 1.23
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -82,7 +82,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_PI),
+
StylesheetConstructionContext::ELEMNAME_PI),
m_nameAVT(0)
{
const unsigned int nAttrs = atts.getLength();
@@ -172,20 +172,20 @@
switch(xslToken)
{
// char-instructions
- case Constants::ELEMNAME_TEXTLITERALRESULT:
- case Constants::ELEMNAME_APPLY_TEMPLATES:
- case Constants::ELEMNAME_APPLY_IMPORTS:
- case Constants::ELEMNAME_CALLTEMPLATE:
- case Constants::ELEMNAME_FOREACH:
- case Constants::ELEMNAME_VALUEOF:
- case Constants::ELEMNAME_COPY_OF:
- case Constants::ELEMNAME_NUMBER:
- case Constants::ELEMNAME_CHOOSE:
- case Constants::ELEMNAME_IF:
- case Constants::ELEMNAME_TEXT:
- case Constants::ELEMNAME_COPY:
- case Constants::ELEMNAME_VARIABLE:
- case Constants::ELEMNAME_MESSAGE:
+ case StylesheetConstructionContext::ELEMNAME_TEXT_LITERAL_RESULT:
+ case StylesheetConstructionContext::ELEMNAME_APPLY_TEMPLATES:
+ case StylesheetConstructionContext::ELEMNAME_APPLY_IMPORTS:
+ case StylesheetConstructionContext::ELEMNAME_CALL_TEMPLATE:
+ case StylesheetConstructionContext::ELEMNAME_FOR_EACH:
+ case StylesheetConstructionContext::ELEMNAME_VALUE_OF:
+ case StylesheetConstructionContext::ELEMNAME_COPY_OF:
+ case StylesheetConstructionContext::ELEMNAME_NUMBER:
+ case StylesheetConstructionContext::ELEMNAME_CHOOSE:
+ case StylesheetConstructionContext::ELEMNAME_IF:
+ case StylesheetConstructionContext::ELEMNAME_TEXT:
+ case StylesheetConstructionContext::ELEMNAME_COPY:
+ case StylesheetConstructionContext::ELEMNAME_VARIABLE:
+ case StylesheetConstructionContext::ELEMNAME_MESSAGE:
fResult = true;
break;
1.13 +2 -1 xml-xalan/c/src/XSLT/ElemParam.cpp
Index: ElemParam.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemParam.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ElemParam.cpp 9 Mar 2001 16:19:59 -0000 1.12
+++ ElemParam.cpp 24 Sep 2002 01:42:34 -0000 1.13
@@ -64,6 +64,7 @@
#include "Constants.hpp"
#include "Stylesheet.hpp"
+#include "StylesheetConstructionContext.hpp"
#include "StylesheetExecutionContext.hpp"
#include "StylesheetRoot.hpp"
#include "TracerEvent.hpp"
@@ -81,7 +82,7 @@
atts,
lineNumber,
columnNumber,
- Constants::ELEMNAME_PARAMVARIABLE)
+ StylesheetConstructionContext::ELEMNAME_PARAM)
{
}
1.15 +2 -2 xml-xalan/c/src/XSLT/ElemSort.cpp
Index: ElemSort.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemSort.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ElemSort.cpp 21 Sep 2002 01:24:41 -0000 1.14
+++ ElemSort.cpp 24 Sep 2002 01:42:34 -0000 1.15
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -81,7 +81,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_SORT),
+
StylesheetConstructionContext::ELEMNAME_SORT),
m_selectPattern(0),
m_langAVT(0),
m_dataTypeAVT(0),
1.25 +1 -1 xml-xalan/c/src/XSLT/ElemTemplate.cpp
Index: ElemTemplate.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemTemplate.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- ElemTemplate.cpp 6 Sep 2002 01:39:18 -0000 1.24
+++ ElemTemplate.cpp 24 Sep 2002 01:42:34 -0000 1.25
@@ -87,7 +87,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_TEMPLATE),
+
StylesheetConstructionContext::ELEMNAME_TEMPLATE),
m_matchPattern(0),
m_name(),
m_mode(),
1.78 +8 -7 xml-xalan/c/src/XSLT/ElemTemplateElement.cpp
Index: ElemTemplateElement.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemTemplateElement.cpp,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -r1.77 -r1.78
--- ElemTemplateElement.cpp 21 Sep 2002 01:24:41 -0000 1.77
+++ ElemTemplateElement.cpp 24 Sep 2002 01:42:34 -0000 1.78
@@ -678,7 +678,8 @@
{
// Find the XSL template that is the best match for the
// element...
- const bool isApplyImports =
xslInstruction.getXSLToken() == Constants::ELEMNAME_APPLY_IMPORTS;
+ const bool isApplyImports =
xslInstruction.getXSLToken() ==
+ StylesheetConstructionContext::ELEMNAME_APPLY_IMPORTS;
const Stylesheet* stylesheetTree = isApplyImports ?
&xslInstruction.getStylesheet() :
@@ -1086,14 +1087,14 @@
const int theToken = node->getXSLToken();
if (hasVariables() == false &&
- (theToken == Constants::ELEMNAME_VARIABLE ||
- theToken == Constants::ELEMNAME_PARAMVARIABLE))
+ (theToken ==
StylesheetConstructionContext::ELEMNAME_VARIABLE ||
+ theToken ==
StylesheetConstructionContext::ELEMNAME_PARAM))
{
m_optimizationFlags |= eHasVariables;
}
if (hasParams() == false &&
- theToken == Constants::ELEMNAME_WITHPARAM)
+ theToken ==
StylesheetConstructionContext::ELEMNAME_WITH_PARAM)
{
m_optimizationFlags |= eHasParams;
}
@@ -1105,12 +1106,12 @@
// There are opportunities for optimization if there's only one
// xsl:text child node. See childrenToString()...
- if (theToken == Constants::ELEMNAME_TEXTLITERALRESULT &&
+ if (theToken ==
StylesheetConstructionContext::ELEMNAME_TEXT_LITERAL_RESULT &&
m_firstChild->getNextSibling() == 0)
{
m_optimizationFlags |= eHasSingleTextChild;
}
- else if (theToken == Constants::ELEMNAME_CALLTEMPLATE &&
+ else if (theToken ==
StylesheetConstructionContext::ELEMNAME_CALL_TEMPLATE &&
m_firstChild->getNextSibling() == 0)
{
// Just a single xsl:call-template child, so we don't
need to
@@ -1133,7 +1134,7 @@
}
}
else if (canGenerateAttributes() == false &&
- theToken != Constants::ELEMNAME_LITERALRESULT)
+ theToken !=
StylesheetConstructionContext::ELEMNAME_LITERAL_RESULT)
{
m_optimizationFlags |= eCanGenerateAttributes;
}
1.8 +3 -3 xml-xalan/c/src/XSLT/ElemText.cpp
Index: ElemText.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemText.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ElemText.cpp 23 Feb 2002 04:23:16 -0000 1.7
+++ ElemText.cpp 24 Sep 2002 01:42:34 -0000 1.8
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -86,7 +86,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_TEXT),
+
StylesheetConstructionContext::ELEMNAME_TEXT),
m_disableOutputEscaping(false)
{
const unsigned int nAttrs = atts.getLength();
@@ -136,7 +136,7 @@
switch(xslToken)
{
// char-instructions
- case Constants::ELEMNAME_TEXTLITERALRESULT:
+ case StylesheetConstructionContext::ELEMNAME_TEXT_LITERAL_RESULT:
fResult = true;
break;
1.18 +2 -2 xml-xalan/c/src/XSLT/ElemTextLiteral.cpp
Index: ElemTextLiteral.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemTextLiteral.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- ElemTextLiteral.cpp 21 Sep 2002 01:24:41 -0000 1.17
+++ ElemTextLiteral.cpp 24 Sep 2002 01:42:34 -0000 1.18
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -87,7 +87,7 @@
stylesheetTree,
lineNumber,
columnNumber,
-
Constants::ELEMNAME_TEXTLITERALRESULT),
+
StylesheetConstructionContext::ELEMNAME_TEXT_LITERAL_RESULT),
m_isCData(isCData),
m_preserveSpace(preserveSpace),
m_disableOutputEscaping(disableOutputEscaping),
1.19 +2 -2 xml-xalan/c/src/XSLT/ElemUse.cpp
Index: ElemUse.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemUse.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- ElemUse.cpp 24 Jul 2002 23:19:43 -0000 1.18
+++ ElemUse.cpp 24 Sep 2002 01:42:35 -0000 1.19
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -164,7 +164,7 @@
{
bool isUAS = false;
- if(Constants::ELEMNAME_LITERALRESULT == getXSLToken())
+ if(StylesheetConstructionContext::ELEMNAME_LITERAL_RESULT ==
getXSLToken())
{
const XalanQNameByValue qname(attrName,
getStylesheet().getNamespaces());
1.17 +1 -1 xml-xalan/c/src/XSLT/ElemUse.hpp
Index: ElemUse.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemUse.hpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ElemUse.hpp 2 Apr 2002 05:38:25 -0000 1.16
+++ ElemUse.hpp 24 Sep 2002 01:42:35 -0000 1.17
@@ -103,7 +103,7 @@
Stylesheet&
stylesheetTree,
int
lineNumber,
int
columnNumber,
- int
xslToken = Constants::ELEMNAME_USE);
+ int
xslToken);
virtual
~ElemUse();
1.30 +1 -1 xml-xalan/c/src/XSLT/ElemValueOf.cpp
Index: ElemValueOf.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemValueOf.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- ElemValueOf.cpp 6 Sep 2002 01:39:18 -0000 1.29
+++ ElemValueOf.cpp 24 Sep 2002 01:42:35 -0000 1.30
@@ -94,7 +94,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_VALUEOF),
+
StylesheetConstructionContext::ELEMNAME_VALUE_OF),
m_selectPattern(0),
m_disableOutputEscaping(false),
m_isDot(false)
1.26 +39 -6 xml-xalan/c/src/XSLT/ElemVariable.cpp
Index: ElemVariable.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemVariable.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- ElemVariable.cpp 6 Sep 2002 01:39:18 -0000 1.25
+++ ElemVariable.cpp 24 Sep 2002 01:42:35 -0000 1.26
@@ -83,6 +83,28 @@
Stylesheet&
stylesheetTree,
const AttributeList& atts,
int
lineNumber,
+ int
columnNumber) :
+ ElemTemplateElement(constructionContext,
+ stylesheetTree,
+ lineNumber,
+ columnNumber,
+
StylesheetConstructionContext::ELEMNAME_VARIABLE),
+ m_qname(),
+ m_selectPattern(0),
+ m_isTopLevel(false),
+ m_value(0),
+ m_varContext(0)
+{
+ init(constructionContext, stylesheetTree, atts);
+}
+
+
+
+ElemVariable::ElemVariable(
+ StylesheetConstructionContext& constructionContext,
+ Stylesheet&
stylesheetTree,
+ const AttributeList& atts,
+ int
lineNumber,
int
columnNumber,
int
xslToken) :
ElemTemplateElement(constructionContext,
@@ -96,6 +118,23 @@
m_value(0),
m_varContext(0)
{
+ init(constructionContext, stylesheetTree, atts);
+}
+
+
+
+ElemVariable::~ElemVariable()
+{
+}
+
+
+
+void
+ElemVariable::init(
+ StylesheetConstructionContext& constructionContext,
+ Stylesheet&
stylesheetTree,
+ const AttributeList& atts)
+{
const unsigned int nAttrs = atts.getLength();
for(unsigned int i = 0; i < nAttrs; i++)
@@ -130,12 +169,6 @@
0,
this);
}
-}
-
-
-
-ElemVariable::~ElemVariable()
-{
}
1.17 +33 -3 xml-xalan/c/src/XSLT/ElemVariable.hpp
Index: ElemVariable.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemVariable.hpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ElemVariable.hpp 10 Jul 2002 05:09:48 -0000 1.16
+++ ElemVariable.hpp 24 Sep 2002 01:42:35 -0000 1.17
@@ -105,8 +105,7 @@
Stylesheet&
stylesheetTree,
const AttributeList& atts,
int
lineNumber,
- int
columnNumber,
- int
xslToken = Constants::ELEMNAME_VARIABLE);
+ int
columnNumber);
virtual
~ElemVariable();
@@ -158,6 +157,37 @@
XalanNode*
sourceNode) const;
protected:
+
+ /**
+ * Construct an object corresponding to an "xsl:variable" element
+ *
+ * @param constructionContext context for construction of object
+ * @param stylesheetTree stylesheet containing element
+ * @param atts list of attributes for element
+ * @param lineNumber line number in document
+ * @param columnNumber column number in document
+ */
+ ElemVariable(
+ StylesheetConstructionContext& constructionContext,
+ Stylesheet&
stylesheetTree,
+ const AttributeList& atts,
+ int
lineNumber,
+ int
columnNumber,
+ int
xslToken);
+
+ /**
+ * Do common initialization.
+ *
+ * @param constructionContext context for construction of object
+ * @param stylesheetTree stylesheet containing element
+ * @param atts list of attributes for element
+ */
+ void
+ init(
+ StylesheetConstructionContext& constructionContext,
+ Stylesheet&
stylesheetTree,
+ const AttributeList& atts);
+
XalanQNameByValue m_qname;
1.14 +1 -1 xml-xalan/c/src/XSLT/ElemWhen.cpp
Index: ElemWhen.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemWhen.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ElemWhen.cpp 6 Sep 2002 01:39:18 -0000 1.13
+++ ElemWhen.cpp 24 Sep 2002 01:42:35 -0000 1.14
@@ -81,7 +81,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_WHEN),
+
StylesheetConstructionContext::ELEMNAME_WHEN),
m_pTest(0)
{
const unsigned int nAttrs = atts.getLength();
1.12 +1 -1 xml-xalan/c/src/XSLT/ElemWithParam.cpp
Index: ElemWithParam.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemWithParam.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ElemWithParam.cpp 23 Feb 2002 04:23:16 -0000 1.11
+++ ElemWithParam.cpp 24 Sep 2002 01:42:35 -0000 1.12
@@ -82,7 +82,7 @@
stylesheetTree,
lineNumber,
columnNumber,
- Constants::ELEMNAME_WITHPARAM),
+
StylesheetConstructionContext::ELEMNAME_WITH_PARAM),
m_selectPattern(0),
m_qname()
{
1.80 +1 -1 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.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- Stylesheet.cpp 12 Sep 2002 16:48:46 -0000 1.79
+++ Stylesheet.cpp 24 Sep 2002 01:42:35 -0000 1.80
@@ -1248,7 +1248,7 @@
ElemVariable* const var = m_topLevelVariables[i];
bool isParam =
- Constants::ELEMNAME_PARAMVARIABLE ==
var->getXSLToken();
+ StylesheetConstructionContext::ELEMNAME_PARAM
== var->getXSLToken();
if(isParam == true)
{
1.2 +1 -1 xml-xalan/c/src/XSLT/StylesheetConstructionContext.cpp
Index: StylesheetConstructionContext.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetConstructionContext.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StylesheetConstructionContext.cpp 26 Jan 2000 14:29:44 -0000 1.1
+++ StylesheetConstructionContext.cpp 24 Sep 2002 01:42:35 -0000 1.2
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
1.15 +66 -4 xml-xalan/c/src/XSLT/StylesheetConstructionContext.hpp
Index: StylesheetConstructionContext.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetConstructionContext.hpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- StylesheetConstructionContext.hpp 21 Sep 2002 01:24:41 -0000 1.14
+++ StylesheetConstructionContext.hpp 24 Sep 2002 01:42:35 -0000 1.15
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -96,6 +96,69 @@
{
public:
+ /**
+ * IDs for XSL element types. These are the values
+ * that must be returned by getElementToken().
+ */
+ enum eElementToken
+ {
+ ELEMNAME_UNDEFINED = -2,
+ ELEMNAME_EMPTY = -1,
+ ELEMNAME_WITH_PARAM,
+ ELEMNAME_APPLY_TEMPLATES,
+ ELEMNAME_CHOOSE,
+ ELEMNAME_COMMENT,
+ ELEMNAME_COPY,
+ ELEMNAME_COPY_OF,
+ ELEMNAME_ATTRIBUTE,
+ ELEMNAME_ATTRIBUTE_SET,
+ ELEMNAME_EXTENSION,
+ ELEMNAME_FOR_EACH,
+ ELEMNAME_KEY,
+ ELEMNAME_IF,
+ ELEMNAME_IMPORT,
+ ELEMNAME_INCLUDE,
+ ELEMNAME_CALL_TEMPLATE,
+ ELEMNAME_PARAM,
+ ELEMNAME_NUMBER,
+ ELEMNAME_OTHERWISE,
+ ELEMNAME_PI,
+ ELEMNAME_PRESERVE_SPACE,
+ ELEMNAME_TEMPLATE,
+ ELEMNAME_SORT,
+ ELEMNAME_STRIP_SPACE,
+ ELEMNAME_STYLESHEET,
+ ELEMNAME_TEXT,
+ ELEMNAME_VALUE_OF,
+ ELEMNAME_WHEN,
+ ELEMNAME_FALLBACK,
+ ELEMNAME_ELEMENT,
+
+ ELEMNAME_APPLY_IMPORTS,
+
+ ELEMNAME_VARIABLE,
+ ELEMNAME_MESSAGE,
+
+ ELEMNAME_OUTPUT,
+ ELEMNAME_DECIMAL_FORMAT,
+ ELEMNAME_NAMESPACE_ALIAS,
+
+ // This one doesn't really have a name.
+ // It's used for any literal result
+ // element.
+ ELEMNAME_LITERAL_RESULT,
+
+ // This one doesn't really have a name.
+ // It's used for any literal text in
+ // the content of a literal result
+ // element.
+ ELEMNAME_TEXT_LITERAL_RESULT,
+
+ // Extension handling.
+ ELEMNAME_EXTENSION_CALL,
+ ELEMNAME_EXTENSION_HANDLER
+ };
+
typedef URISupport::URLAutoPtrType URLAutoPtrType;
explicit
@@ -321,11 +384,10 @@
/**
* Given an XSL tag name, return an integer token that corresponds to
- * ELEMNAME_XXX constants defined in Constants.hpp
+ * the enums defined above.
*
* @param name a probable xsl:xxx element
- * @return Constants.ELEMNAME_XXX token, -1 if in XSL or Xalan
namespace,
- * or -2 if not in known namespace
+ * @return The enum value for that token, or ELEMNAME_UNDEFINED
*/
virtual int
getElementToken(const XalanDOMString& name) const = 0;
1.23 +688 -3
xml-xalan/c/src/XSLT/StylesheetConstructionContextDefault.cpp
Index: StylesheetConstructionContextDefault.cpp
===================================================================
RCS file:
/home/cvs/xml-xalan/c/src/XSLT/StylesheetConstructionContextDefault.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- StylesheetConstructionContextDefault.cpp 23 Sep 2002 21:30:54 -0000
1.22
+++ StylesheetConstructionContextDefault.cpp 24 Sep 2002 01:42:35 -0000
1.23
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -516,9 +516,42 @@
int
-StylesheetConstructionContextDefault::getElementToken(const XalanDOMString&
name) const
+StylesheetConstructionContextDefault::getElementToken(const XalanDOMString&
name)
{
- return m_processor.getElementToken(name);
+ return StylesheetConstructionContextDefault::getElementToken(name);
+}
+
+
+
+int
+StylesheetConstructionContextDefault::getElementToken(const XalanDOMString&
name)
+{
+ // Find the entity, if any...
+ const ElementTokenTableEntry* theFirst = s_elementTokenTable;
+ const ElementTokenTableEntry* theLast = &s_elementTokenTableLast;
+
+ while(theFirst <= theLast)
+ {
+ const ElementTokenTableEntry* const
+ theCurrent = theFirst + (theLast - theFirst) / 2;
+
+ const int theResult = compareIgnoreCaseASCII(name,
theCurrent->m_name);
+
+ if (theResult < 0)
+ {
+ theLast = theCurrent - 1;
+ }
+ else if (theResult > 0)
+ {
+ theFirst = theCurrent + 1;
+ }
+ else
+ {
+ return theCurrent->m_token;
+ }
+ }
+
+ return s_elementTokenTableDummy.m_token;
}
@@ -581,3 +614,655 @@
return theVector;
}
+
+
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_if[] =
+{
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_f,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_key[] =
+{
+ XalanUnicode::charLetter_k,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_y,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_copy[] =
+{
+ XalanUnicode::charLetter_c,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_y,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_sort[] =
+{
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_t,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_text[] =
+{
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_x,
+ XalanUnicode::charLetter_t,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_when[] =
+{
+ XalanUnicode::charLetter_w,
+ XalanUnicode::charLetter_h,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_n,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_empty[] =
+{
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_m,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_y,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_param[] =
+{
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_m,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_choose[] =
+{
+ XalanUnicode::charLetter_c,
+ XalanUnicode::charLetter_h,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_e,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_import[] =
+{
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_m,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_t,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_number[] =
+{
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_u,
+ XalanUnicode::charLetter_m,
+ XalanUnicode::charLetter_b,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_r,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_output[] =
+{
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_u,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_u,
+ XalanUnicode::charLetter_t,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_comment[] =
+{
+ XalanUnicode::charLetter_c,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_m,
+ XalanUnicode::charLetter_m,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_t,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_copyOf[] =
+{
+ XalanUnicode::charLetter_c,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_y,
+ XalanUnicode::charHyphenMinus,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_f,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_element[] =
+{
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_m,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_t,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_include[] =
+{
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_c,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_u,
+ XalanUnicode::charLetter_d,
+ XalanUnicode::charLetter_e,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_message[] =
+{
+ XalanUnicode::charLetter_m,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_g,
+ XalanUnicode::charLetter_e,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_fallback[] =
+{
+ XalanUnicode::charLetter_f,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_b,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_c,
+ XalanUnicode::charLetter_k,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_forEach[] =
+{
+ XalanUnicode::charLetter_f,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charHyphenMinus,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_c,
+ XalanUnicode::charLetter_h,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_template[] =
+{
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_m,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_e,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_valueOf[] =
+{
+ XalanUnicode::charLetter_v,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_u,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charHyphenMinus,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_f,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_variable[] =
+{
+ XalanUnicode::charLetter_v,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_b,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_e,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_attribute[] =
+{
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_b,
+ XalanUnicode::charLetter_u,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_e,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_otherwise[] =
+{
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_h,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_w,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_e,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_transform[] =
+{
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_f,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_m,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_stylesheet[] =
+{
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_y,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_h,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_t,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_withParam[] =
+{
+ XalanUnicode::charLetter_w,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_h,
+ XalanUnicode::charHyphenMinus,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_m,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_stripSpace[] =
+{
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charHyphenMinus,
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_c,
+ XalanUnicode::charLetter_e,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_applyImports[] =
+{
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_y,
+ XalanUnicode::charHyphenMinus,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_m,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_s,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_attributeSet[] =
+{
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_b,
+ XalanUnicode::charLetter_u,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charHyphenMinus,
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_t,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_callTemplate[] =
+{
+ XalanUnicode::charLetter_c,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charHyphenMinus,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_m,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_e,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_decimalFormat[]
=
+{
+ XalanUnicode::charLetter_d,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_c,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_m,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charHyphenMinus,
+ XalanUnicode::charLetter_f,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_m,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_t,
+ 0
+};
+
+const XalanDOMChar StylesheetConstructionContextDefault::s_preserveSpace[]
=
+{
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_v,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charHyphenMinus,
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_c,
+ XalanUnicode::charLetter_e,
+ 0
+};
+
+const XalanDOMChar
StylesheetConstructionContextDefault::s_applyTemplates[] =
+{
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_y,
+ XalanUnicode::charHyphenMinus,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_m,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_s,
+ 0
+};
+
+const XalanDOMChar
StylesheetConstructionContextDefault::s_namespaceAlias[] =
+{
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_m,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_c,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charHyphenMinus,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_s,
+ 0
+};
+
+const XalanDOMChar
StylesheetConstructionContextDefault::s_processingInstruction[] =
+{
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_c,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_g,
+ XalanUnicode::charHyphenMinus,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_u,
+ XalanUnicode::charLetter_c,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_n,
+ 0
+};
+
+
+const StylesheetConstructionContextDefault::ElementTokenTableEntry
StylesheetConstructionContextDefault::s_elementTokenTable[] =
+{
+ {
+ s_if,
+ ELEMNAME_IF
+ },
+ {
+ s_key,
+ ELEMNAME_KEY
+ },
+ {
+ s_copy,
+ ELEMNAME_COPY
+ },
+ {
+ s_sort,
+ ELEMNAME_SORT
+ },
+ {
+ s_text,
+ ELEMNAME_TEXT
+ },
+ {
+ s_when,
+ ELEMNAME_WHEN
+ },
+ {
+ s_empty,
+ ELEMNAME_EMPTY
+ },
+ {
+ s_param,
+ ELEMNAME_PARAM
+ },
+ {
+ s_choose,
+ ELEMNAME_CHOOSE
+ },
+ {
+ s_import,
+ ELEMNAME_IMPORT
+ },
+ {
+ s_number,
+ ELEMNAME_NUMBER
+ },
+ {
+ s_output,
+ ELEMNAME_OUTPUT
+ },
+ {
+ s_comment,
+ ELEMNAME_COMMENT
+ },
+ {
+ s_copyOf,
+ ELEMNAME_COPY_OF
+ },
+ {
+ s_element,
+ ELEMNAME_ELEMENT
+ },
+ {
+ s_include,
+ ELEMNAME_INCLUDE
+ },
+ {
+ s_message,
+ ELEMNAME_MESSAGE
+ },
+ {
+ s_fallback,
+ ELEMNAME_FALLBACK
+ },
+ {
+ s_forEach,
+ ELEMNAME_FOR_EACH
+ },
+ {
+ s_template,
+ ELEMNAME_TEMPLATE
+ },
+ {
+ s_valueOf,
+ ELEMNAME_VALUE_OF
+ },
+ {
+ s_variable,
+ ELEMNAME_VARIABLE
+ },
+ {
+ s_attribute,
+ ELEMNAME_ATTRIBUTE
+ },
+ {
+ s_otherwise,
+ ELEMNAME_OTHERWISE
+ },
+ {
+ s_transform,
+ ELEMNAME_STYLESHEET
+ },
+ {
+ s_stylesheet,
+ ELEMNAME_STYLESHEET
+ },
+ {
+ s_withParam,
+ ELEMNAME_WITH_PARAM
+ },
+ {
+ s_stripSpace,
+ ELEMNAME_STRIP_SPACE
+ },
+ {
+ s_applyImports,
+ ELEMNAME_APPLY_IMPORTS
+ },
+ {
+ s_attributeSet,
+ ELEMNAME_ATTRIBUTE_SET
+ },
+ {
+ s_callTemplate,
+ ELEMNAME_CALL_TEMPLATE
+ },
+ {
+ s_decimalFormat,
+ ELEMNAME_DECIMAL_FORMAT
+ },
+ {
+ s_preserveSpace,
+ ELEMNAME_PRESERVE_SPACE
+ },
+ {
+ s_applyTemplates,
+ ELEMNAME_APPLY_TEMPLATES
+ },
+ {
+ s_namespaceAlias,
+ ELEMNAME_NAMESPACE_ALIAS
+ },
+ {
+ s_processingInstruction,
+ ELEMNAME_PI
+ },
+ // This must be the last one...
+ {
+ 0,
+ ELEMNAME_UNDEFINED
+ }
+};
+
+const unsigned int
StylesheetConstructionContextDefault::s_elementTokenTableSize =
+ sizeof(s_elementTokenTable) / sizeof(s_elementTokenTable[0]);
+
+const StylesheetConstructionContextDefault::ElementTokenTableEntry&
StylesheetConstructionContextDefault::s_elementTokenTableLast =
+
StylesheetConstructionContextDefault::s_elementTokenTable[s_elementTokenTableSize
- 2];
+
+const StylesheetConstructionContextDefault::ElementTokenTableEntry&
StylesheetConstructionContextDefault::s_elementTokenTableDummy =
+
StylesheetConstructionContextDefault::s_elementTokenTable[s_elementTokenTableSize
- 1];
1.23 +129 -1
xml-xalan/c/src/XSLT/StylesheetConstructionContextDefault.hpp
Index: StylesheetConstructionContextDefault.hpp
===================================================================
RCS file:
/home/cvs/xml-xalan/c/src/XSLT/StylesheetConstructionContextDefault.hpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- StylesheetConstructionContextDefault.hpp 21 Sep 2002 01:24:41 -0000
1.22
+++ StylesheetConstructionContextDefault.hpp 24 Sep 2002 01:42:35 -0000
1.23
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -334,6 +334,134 @@
XalanDOMCharVectorAllocatorType m_xalanDOMCharVectorAllocator;
mutable XalanDOMString m_tempBuffer;
+
+
+ // Static strings for stylesheet compilation...
+
+ // The string "if"
+ static const XalanDOMChar s_if[];
+
+ // The string "key"
+ static const XalanDOMChar s_key[];
+
+ // The string "copy"
+ static const XalanDOMChar s_copy[];
+
+ // The string "sort"
+ static const XalanDOMChar s_sort[];
+
+ // The string "text"
+ static const XalanDOMChar s_text[];
+
+ // The string "when"
+ static const XalanDOMChar s_when[];
+
+ // The string "empty"
+ static const XalanDOMChar s_empty[];
+
+ // The string "param"
+ static const XalanDOMChar s_param[];
+
+ // The string "choose"
+ static const XalanDOMChar s_choose[];
+
+ // The string "import"
+ static const XalanDOMChar s_import[];
+
+ // The string "number"
+ static const XalanDOMChar s_number[];
+
+ // The string "output"
+ static const XalanDOMChar s_output[];
+
+ // The string "comment"
+ static const XalanDOMChar s_comment[];
+
+ // The string "copy-of"
+ static const XalanDOMChar s_copyOf[];
+
+ // The string "element"
+ static const XalanDOMChar s_element[];
+
+ // The string "include"
+ static const XalanDOMChar s_include[];
+
+ // The string "message"
+ static const XalanDOMChar s_message[];
+
+ // The string "fallback"
+ static const XalanDOMChar s_fallback[];
+
+ // The string "for-each"
+ static const XalanDOMChar s_forEach[];
+
+ // The string "template"
+ static const XalanDOMChar s_template[];
+
+ // The string "value-of"
+ static const XalanDOMChar s_valueOf[];
+
+ // The string "variable"
+ static const XalanDOMChar s_variable[];
+
+ // The string "attribute"
+ static const XalanDOMChar s_attribute[];
+
+ // The string "otherwise"
+ static const XalanDOMChar s_otherwise[];
+
+ // The string "transform"
+ static const XalanDOMChar s_transform[];
+
+ // The string "stylesheet"
+ static const XalanDOMChar s_stylesheet[];
+
+ // The string "with-param"
+ static const XalanDOMChar s_withParam[];
+
+ // The string "strip-space"
+ static const XalanDOMChar s_stripSpace[];
+
+ // The string "apply-imports"
+ static const XalanDOMChar s_applyImports[];
+
+ // The string "attribute-set"
+ static const XalanDOMChar s_attributeSet[];
+
+ // The string "call-template"
+ static const XalanDOMChar s_callTemplate[];
+
+ // The string "decimal-format"
+ static const XalanDOMChar s_decimalFormat[];
+
+ // The string "preserve-space"
+ static const XalanDOMChar s_preserveSpace[];
+
+ // The string "apply-templates"
+ static const XalanDOMChar s_applyTemplates[];
+
+ // The string "namespace-alias"
+ static const XalanDOMChar s_namespaceAlias[];
+
+ // The string "processing-instruction"
+ static const XalanDOMChar s_processingInstruction[];
+
+ // A struct for an array that maps stylesheet element names
+ // to int tokens.
+ struct ElementTokenTableEntry
+ {
+ const XalanDOMChar* m_name;
+
+ eElementToken m_token;
+ };
+
+ static const ElementTokenTableEntry s_elementTokenTable[];
+
+ static const unsigned int
s_elementTokenTableSize;
+
+ static const ElementTokenTableEntry& s_elementTokenTableLast;
+
+ static const ElementTokenTableEntry& s_elementTokenTableDummy;
};
1.100 +4 -3
xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.cpp
Index: StylesheetExecutionContextDefault.cpp
===================================================================
RCS file:
/home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.cpp,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -r1.99 -r1.100
--- StylesheetExecutionContextDefault.cpp 21 Sep 2002 01:24:41 -0000
1.99
+++ StylesheetExecutionContextDefault.cpp 24 Sep 2002 01:42:35 -0000
1.100
@@ -103,6 +103,7 @@
#include "Constants.hpp"
#include "ElemTemplateElement.hpp"
#include "ElemWithParam.hpp"
+#include "StylesheetConstructionContext.hpp"
#include "StylesheetRoot.hpp"
#include "XSLTEngineImpl.hpp"
#include "XSLTProcessorException.hpp"
@@ -1759,9 +1760,9 @@
{
if (equals(theNamespace, XSLTEngineImpl::getXSLNameSpaceURL()) == true)
{
- const int xslToken =
XSLTEngineImpl::getElementToken(elementName);
+ const int xslToken =
StylesheetConstructionContext::getElementToken(elementName);
- return xslToken == -2 ? false : true;
+ return xslToken < 0 ? false : true;
}
else
{
@@ -2368,7 +2369,7 @@
while(0 != child)
{
- if(Constants::ELEMNAME_WITHPARAM ==
child->getXSLToken())
+ if(StylesheetConstructionContext::ELEMNAME_WITH_PARAM
== child->getXSLToken())
{
const ElemWithParam* const xslParamElement
=
#if defined(XALAN_OLD_STYLE_CASTS)
1.87 +86 -96 xml-xalan/c/src/XSLT/StylesheetHandler.cpp
Index: StylesheetHandler.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetHandler.cpp,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -r1.86 -r1.87
--- StylesheetHandler.cpp 21 Sep 2002 01:24:41 -0000 1.86
+++ StylesheetHandler.cpp 24 Sep 2002 01:42:35 -0000 1.87
@@ -417,31 +417,31 @@
{
switch(xslToken)
{
- case Constants::ELEMNAME_APPLY_TEMPLATES:
+ case
StylesheetConstructionContext::ELEMNAME_APPLY_TEMPLATES:
elem = new
ElemApplyTemplates(m_constructionContext,
m_stylesheet,
atts, lineNumber, columnNumber);
break;
- case Constants::ELEMNAME_CALLTEMPLATE:
+ case
StylesheetConstructionContext::ELEMNAME_CALL_TEMPLATE:
elem = new
ElemCallTemplate(m_constructionContext,
m_stylesheet,
atts, lineNumber, columnNumber);
break;
- case Constants::ELEMNAME_WITHPARAM:
+ case
StylesheetConstructionContext::ELEMNAME_WITH_PARAM:
elem = new
ElemWithParam(m_constructionContext,
m_stylesheet,
atts, lineNumber, columnNumber);
break;
- case Constants::ELEMNAME_FOREACH:
+ case
StylesheetConstructionContext::ELEMNAME_FOR_EACH:
elem = new
ElemForEach(m_constructionContext,
m_stylesheet,
atts, lineNumber, columnNumber);
break;
- case Constants::ELEMNAME_SORT:
+ case
StylesheetConstructionContext::ELEMNAME_SORT:
{
if (m_elemStack.empty() == true)
{
@@ -454,8 +454,8 @@
const int xslToken =
theElement->getXSLToken();
- if (xslToken !=
Constants::ELEMNAME_FOREACH &&
- xslToken !=
Constants::ELEMNAME_APPLY_TEMPLATES)
+ if (xslToken !=
StylesheetConstructionContext::ELEMNAME_FOR_EACH &&
+ xslToken !=
StylesheetConstructionContext::ELEMNAME_APPLY_TEMPLATES)
{
error("Misplaced
xsl:sort.", locator);
}
@@ -484,7 +484,7 @@
}
break;
- case Constants::ELEMNAME_APPLY_IMPORTS:
+ case
StylesheetConstructionContext::ELEMNAME_APPLY_IMPORTS:
{
if (m_elemStack.empty() == true)
{
@@ -497,7 +497,7 @@
const int xslToken =
theElement->getXSLToken();
- if (xslToken ==
Constants::ELEMNAME_FOREACH)
+ if (xslToken ==
StylesheetConstructionContext::ELEMNAME_FOR_EACH)
{
error("xsl:apply-imports is not allowed at this position in the stylesheet",
locator);
}
@@ -508,19 +508,19 @@
}
break;
- case Constants::ELEMNAME_VALUEOF:
+ case
StylesheetConstructionContext::ELEMNAME_VALUE_OF:
elem = new
ElemValueOf(m_constructionContext,
m_stylesheet,
atts, lineNumber, columnNumber);
break;
- case Constants::ELEMNAME_NUMBER:
+ case
StylesheetConstructionContext::ELEMNAME_NUMBER:
elem = new
ElemNumber(m_constructionContext,
m_stylesheet,
atts, lineNumber, columnNumber);
break;
- case Constants::ELEMNAME_VARIABLE:
+ case
StylesheetConstructionContext::ELEMNAME_VARIABLE:
{
XalanAutoPtr<ElemVariable>
newVar(
new ElemVariable(
@@ -536,19 +536,19 @@
}
break;
- case Constants::ELEMNAME_PARAMVARIABLE:
+ case
StylesheetConstructionContext::ELEMNAME_PARAM:
elem = new
ElemParam(m_constructionContext,
m_stylesheet,
atts, lineNumber, columnNumber);
break;
- case Constants::ELEMNAME_IF:
+ case StylesheetConstructionContext::ELEMNAME_IF:
elem = new ElemIf(m_constructionContext,
m_stylesheet,
atts,
lineNumber, columnNumber);
break;
- case Constants::ELEMNAME_FALLBACK:
+ case
StylesheetConstructionContext::ELEMNAME_FALLBACK:
elem = new ElemFallback(
m_constructionContext,
m_stylesheet,
@@ -557,22 +557,22 @@
columnNumber);
break;
- case Constants::ELEMNAME_CHOOSE:
+ case
StylesheetConstructionContext::ELEMNAME_CHOOSE:
elem = new
ElemChoose(m_constructionContext,
m_stylesheet,
atts, lineNumber, columnNumber);
break;
- case Constants::ELEMNAME_WHEN:
+ case
StylesheetConstructionContext::ELEMNAME_WHEN:
{
ElemTemplateElement* const
parent = m_elemStack.back();
- if(Constants::ELEMNAME_CHOOSE
== parent->getXSLToken())
+
if(StylesheetConstructionContext::ELEMNAME_CHOOSE == parent->getXSLToken())
{
ElemTemplateElement*
const lastChild = parent->getLastChildElem();
if(0 == lastChild ||
-
Constants::ELEMNAME_WHEN == lastChild->getXSLToken() ||
+
StylesheetConstructionContext::ELEMNAME_WHEN == lastChild->getXSLToken() ||
lastChild->isWhitespace() == true)
{
elem = new
ElemWhen(m_constructionContext,
@@ -591,16 +591,16 @@
}
break;
- case Constants::ELEMNAME_OTHERWISE:
+ case
StylesheetConstructionContext::ELEMNAME_OTHERWISE:
{
ElemTemplateElement* parent =
m_elemStack.back();
- if(Constants::ELEMNAME_CHOOSE
== parent->getXSLToken())
+
if(StylesheetConstructionContext::ELEMNAME_CHOOSE == parent->getXSLToken())
{
ElemTemplateElement*
lastChild = parent->getLastChildElem();
if(0 == lastChild ||
-
Constants::ELEMNAME_WHEN == lastChild->getXSLToken() ||
+
StylesheetConstructionContext::ELEMNAME_WHEN == lastChild->getXSLToken() ||
lastChild->isWhitespace() == true)
{
elem = new
ElemOtherwise(m_constructionContext,
@@ -619,19 +619,19 @@
}
break;
- case Constants::ELEMNAME_COPY_OF:
+ case
StylesheetConstructionContext::ELEMNAME_COPY_OF:
elem = new
ElemCopyOf(m_constructionContext,
m_stylesheet,
atts, lineNumber, columnNumber);
break;
- case Constants::ELEMNAME_COPY:
+ case
StylesheetConstructionContext::ELEMNAME_COPY:
elem = new
ElemCopy(m_constructionContext,
m_stylesheet,
atts,
lineNumber, columnNumber);
break;
- case Constants::ELEMNAME_TEXT:
+ case
StylesheetConstructionContext::ELEMNAME_TEXT:
// Just push the element on the stack to
signal
// that space should be preserved.
m_elemStack.push_back(new
ElemText(m_constructionContext,
@@ -639,52 +639,46 @@
atts, lineNumber, columnNumber));
break;
- case Constants::ELEMNAME_USE:
- elem = new
ElemUse(m_constructionContext,
-
m_stylesheet,
-
lineNumber, columnNumber);
- break;
-
- case Constants::ELEMNAME_ATTRIBUTE:
+ case
StylesheetConstructionContext::ELEMNAME_ATTRIBUTE:
elem = new
ElemAttribute(m_constructionContext,
m_stylesheet,
atts, lineNumber, columnNumber);
break;
- case Constants::ELEMNAME_ELEMENT:
+ case
StylesheetConstructionContext::ELEMNAME_ELEMENT:
elem = new
ElemElement(m_constructionContext,
m_stylesheet,
atts, lineNumber, columnNumber);
break;
- case Constants::ELEMNAME_PI:
+ case StylesheetConstructionContext::ELEMNAME_PI:
elem = new ElemPI(m_constructionContext,
m_stylesheet,
atts,
lineNumber, columnNumber);
break;
- case Constants::ELEMNAME_COMMENT:
+ case
StylesheetConstructionContext::ELEMNAME_COMMENT:
elem = new
ElemComment(m_constructionContext,
m_stylesheet,
atts, lineNumber, columnNumber);
break;
- case Constants::ELEMNAME_MESSAGE:
+ case
StylesheetConstructionContext::ELEMNAME_MESSAGE:
elem = new
ElemMessage(m_constructionContext,
m_stylesheet,
atts, lineNumber, columnNumber);
break;
- case Constants::ELEMNAME_TEMPLATE:
- case Constants::ELEMNAME_DEFINEATTRIBUTESET:
- case Constants::ELEMNAME_EXTENSION:
- case Constants::ELEMNAME_EXTENSIONHANDLER:
- case Constants::ELEMNAME_KEY:
- case Constants::ELEMNAME_IMPORT:
- case Constants::ELEMNAME_INCLUDE:
- case Constants::ELEMNAME_PRESERVESPACE:
- case Constants::ELEMNAME_STRIPSPACE:
+ case
StylesheetConstructionContext::ELEMNAME_TEMPLATE:
+ case
StylesheetConstructionContext::ELEMNAME_ATTRIBUTE_SET:
+ case
StylesheetConstructionContext::ELEMNAME_EXTENSION:
+ case
StylesheetConstructionContext::ELEMNAME_EXTENSION_HANDLER:
+ case
StylesheetConstructionContext::ELEMNAME_KEY:
+ case
StylesheetConstructionContext::ELEMNAME_IMPORT:
+ case
StylesheetConstructionContext::ELEMNAME_INCLUDE:
+ case
StylesheetConstructionContext::ELEMNAME_PRESERVE_SPACE:
+ case
StylesheetConstructionContext::ELEMNAME_STRIP_SPACE:
{
const XalanDOMString
msg(XalanDOMString(name) + " is not allowed inside a template.");
@@ -932,7 +926,7 @@
bool& fPreserveSpace,
bool&
fSpaceAttrProcessed)
{
- if(m_foundStylesheet && Constants::ELEMNAME_IMPORT != xslToken)
+ if(m_foundStylesheet && StylesheetConstructionContext::ELEMNAME_IMPORT
!= xslToken)
{
m_foundNotImport = true;
}
@@ -942,7 +936,7 @@
switch(xslToken)
{
- case Constants::ELEMNAME_TEMPLATE:
+ case StylesheetConstructionContext::ELEMNAME_TEMPLATE:
assert(m_pTemplate == 0);
m_pTemplate = new ElemTemplate(
@@ -958,17 +952,17 @@
m_inScopeVariableNamesStack.push_back(QNameSetVectorType::value_type());
break;
- case Constants::ELEMNAME_EXTENSION:
+ case StylesheetConstructionContext::ELEMNAME_EXTENSION:
if(!equalsIgnoreCaseASCII(ns,
m_constructionContext.getXalanXSLNameSpaceURL()))
{
m_constructionContext.warn("Old syntax: the functions
instruction should use a url of " +
m_constructionContext.getXalanXSLNameSpaceURL());
}
break;
- case Constants::ELEMNAME_VARIABLE:
- case Constants::ELEMNAME_PARAMVARIABLE:
+ case StylesheetConstructionContext::ELEMNAME_VARIABLE:
+ case StylesheetConstructionContext::ELEMNAME_PARAM:
{
- ElemVariable* varelem =
(Constants::ELEMNAME_PARAMVARIABLE == xslToken)
+ ElemVariable* varelem =
(StylesheetConstructionContext::ELEMNAME_PARAM == xslToken)
?
new ElemParam(m_constructionContext,
m_stylesheet,
atts,
@@ -994,12 +988,12 @@
}
break;
- case Constants::ELEMNAME_PRESERVESPACE:
- case Constants::ELEMNAME_STRIPSPACE:
+ case StylesheetConstructionContext::ELEMNAME_PRESERVE_SPACE:
+ case StylesheetConstructionContext::ELEMNAME_STRIP_SPACE:
processPreserveStripSpace(name, atts, locator, xslToken);
break;
- case Constants::ELEMNAME_KEY:
+ case StylesheetConstructionContext::ELEMNAME_KEY:
{
ElemEmpty nsContext(m_constructionContext,
m_stylesheet, lineNumber, columnNumber);
@@ -1007,7 +1001,7 @@
}
break;
- case Constants::ELEMNAME_DEFINEATTRIBUTESET:
+ case StylesheetConstructionContext::ELEMNAME_ATTRIBUTE_SET:
{
m_inTemplate = true; // fake it out
m_inScopeVariableNamesStack.push_back(QNameSetVectorType::value_type());
@@ -1022,19 +1016,19 @@
}
break;
- case Constants::ELEMNAME_INCLUDE:
+ case StylesheetConstructionContext::ELEMNAME_INCLUDE:
processInclude(name, atts, locator);
break;
- case Constants::ELEMNAME_IMPORT:
+ case StylesheetConstructionContext::ELEMNAME_IMPORT:
processImport(name, atts, locator);
break;
- case Constants::ELEMNAME_OUTPUT:
+ case StylesheetConstructionContext::ELEMNAME_OUTPUT:
m_stylesheet.getStylesheetRoot().processOutputSpec(name, atts,
m_constructionContext);
break;
- case Constants::ELEMNAME_DECIMALFORMAT:
+ case StylesheetConstructionContext::ELEMNAME_DECIMAL_FORMAT:
m_stylesheet.processDecimalFormatElement(
new ElemDecimalFormat(
m_constructionContext,
@@ -1044,34 +1038,30 @@
columnNumber));
break;
- case Constants::ELEMNAME_NSALIAS:
+ case StylesheetConstructionContext::ELEMNAME_NAMESPACE_ALIAS:
m_stylesheet.processNSAliasElement(name, atts,
m_constructionContext);
break;
- case Constants::ELEMNAME_WITHPARAM:
- case Constants::ELEMNAME_ATTRIBUTE:
- case Constants::ELEMNAME_APPLY_TEMPLATES:
- case Constants::ELEMNAME_USE:
- case Constants::ELEMNAME_CHILDREN:
- case Constants::ELEMNAME_CHOOSE:
- case Constants::ELEMNAME_COMMENT:
- case Constants::ELEMNAME_CONSTRUCT:
- case Constants::ELEMNAME_CONTENTS:
- case Constants::ELEMNAME_COPY:
- case Constants::ELEMNAME_COPY_OF:
- case Constants::ELEMNAME_FOREACH:
- case Constants::ELEMNAME_IF:
- case Constants::ELEMNAME_CALLTEMPLATE:
- case Constants::ELEMNAME_MESSAGE:
- case Constants::ELEMNAME_NUMBER:
- case Constants::ELEMNAME_OTHERWISE:
- case Constants::ELEMNAME_PI:
- case Constants::ELEMNAME_SORT:
- case Constants::ELEMNAME_TEXT:
- case Constants::ELEMNAME_VALUEOF:
- case Constants::ELEMNAME_WHEN:
- case Constants::ELEMNAME_ELEMENT:
- case Constants::ELEMNAME_APPLY_IMPORTS:
+ case StylesheetConstructionContext::ELEMNAME_WITH_PARAM:
+ case StylesheetConstructionContext::ELEMNAME_ATTRIBUTE:
+ case StylesheetConstructionContext::ELEMNAME_APPLY_TEMPLATES:
+ case StylesheetConstructionContext::ELEMNAME_CHOOSE:
+ case StylesheetConstructionContext::ELEMNAME_COMMENT:
+ case StylesheetConstructionContext::ELEMNAME_COPY:
+ case StylesheetConstructionContext::ELEMNAME_COPY_OF:
+ case StylesheetConstructionContext::ELEMNAME_FOR_EACH:
+ case StylesheetConstructionContext::ELEMNAME_IF:
+ case StylesheetConstructionContext::ELEMNAME_CALL_TEMPLATE:
+ case StylesheetConstructionContext::ELEMNAME_MESSAGE:
+ case StylesheetConstructionContext::ELEMNAME_NUMBER:
+ case StylesheetConstructionContext::ELEMNAME_OTHERWISE:
+ case StylesheetConstructionContext::ELEMNAME_PI:
+ case StylesheetConstructionContext::ELEMNAME_SORT:
+ case StylesheetConstructionContext::ELEMNAME_TEXT:
+ case StylesheetConstructionContext::ELEMNAME_VALUE_OF:
+ case StylesheetConstructionContext::ELEMNAME_WHEN:
+ case StylesheetConstructionContext::ELEMNAME_ELEMENT:
+ case StylesheetConstructionContext::ELEMNAME_APPLY_IMPORTS:
if (inExtensionElement() == false)
{
const XalanDOMString msg("(StylesheetHandler) " +
XalanDOMString(name) + " not allowed inside a stylesheet.");
@@ -1080,7 +1070,7 @@
}
break;
- case Constants::ELEMNAME_STYLESHEET:
+ case StylesheetConstructionContext::ELEMNAME_STYLESHEET:
processStylesheet(name, atts, locator, fPreserveSpace,
fSpaceAttrProcessed);
break;
@@ -1357,7 +1347,7 @@
bool foundIt = false;
- const bool isPreserveSpace = Constants::ELEMNAME_PRESERVESPACE ==
xslToken? true : false;
+ const bool isPreserveSpace =
StylesheetConstructionContext::ELEMNAME_PRESERVE_SPACE == xslToken? true :
false;
for(unsigned int i = 0; i < nAttrs; i++)
{
@@ -1487,7 +1477,7 @@
// Pop anything that's not an empty element...
while(m_elemStack.empty() == false &&
- m_elemStack.back()->getXSLToken() !=
Constants::ELEMNAME_UNDEFINED)
+ m_elemStack.back()->getXSLToken() !=
StylesheetConstructionContext::ELEMNAME_UNDEFINED)
{
m_elemStackParentedElements.erase(m_elemStack.back());
m_elemStack.pop_back();
@@ -1691,14 +1681,14 @@
m_inScopeVariableNamesStack.pop_back();
}
- if(Constants::ELEMNAME_TEMPLATE == tok)
+ if(StylesheetConstructionContext::ELEMNAME_TEMPLATE == tok)
{
m_inTemplate = false;
m_stylesheet.addTemplate(m_pTemplate, m_constructionContext);
m_pTemplate = 0;
}
- else if((Constants::ELEMNAME_PARAMVARIABLE == tok) ||
- Constants::ELEMNAME_VARIABLE == tok)
+ else if((StylesheetConstructionContext::ELEMNAME_PARAM == tok) ||
+ StylesheetConstructionContext::ELEMNAME_VARIABLE ==
tok)
{
#if defined(XALAN_OLD_STYLE_CASTS)
const ElemVariable* const var = (const
ElemVariable*)m_lastPopped;
@@ -1712,12 +1702,12 @@
m_inTemplate = false;
}
}
- else if(Constants::ELEMNAME_DEFINEATTRIBUTESET == tok)
+ else if(StylesheetConstructionContext::ELEMNAME_ATTRIBUTE_SET == tok)
{
m_inTemplate = false;
}
- else if (tok == Constants::ELEMNAME_UNDEFINED ||
- tok == Constants::ELEMNAME_TEXT)
+ else if (tok == StylesheetConstructionContext::ELEMNAME_UNDEFINED ||
+ tok == StylesheetConstructionContext::ELEMNAME_TEXT)
{
// These are stray elements, so stuff them away
// to be deleted when we're finished...
@@ -1863,7 +1853,7 @@
bool preserveSpace = m_preserveSpaceStack.back();
bool disableOutputEscaping = false;
- if (preserveSpace == false && parent->getXSLToken() ==
Constants::ELEMNAME_TEXT)
+ if (preserveSpace == false && parent->getXSLToken() ==
StylesheetConstructionContext::ELEMNAME_TEXT)
{
#if defined(XALAN_OLD_STYLE_CASTS)
disableOutputEscaping =
((ElemText*)parent)->getDisableOutputEscaping();
@@ -1922,10 +1912,10 @@
{
// If it was surrounded by xsl:text, it will
count as an element.
const bool isPrevCharData =
- Constants::ELEMNAME_TEXTLITERALRESULT
== last->getXSLToken();
+
StylesheetConstructionContext::ELEMNAME_TEXT_LITERAL_RESULT ==
last->getXSLToken();
const bool isLastPoppedXSLText =
(m_lastPopped != 0) &&
- (Constants::ELEMNAME_TEXT ==
m_lastPopped->getXSLToken());
+
(StylesheetConstructionContext::ELEMNAME_TEXT == m_lastPopped->getXSLToken());
if(isPrevCharData && ! isLastPoppedXSLText)
{
1.12 +4 -3 xml-xalan/c/src/XSLT/TraceListenerDefault.cpp
Index: TraceListenerDefault.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/TraceListenerDefault.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- TraceListenerDefault.cpp 26 Sep 2001 21:30:23 -0000 1.11
+++ TraceListenerDefault.cpp 24 Sep 2002 01:42:35 -0000 1.12
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2000 The Apache Software Foundation. All rights
+ * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -77,6 +77,7 @@
#include "ElemTemplate.hpp"
#include "GenerateEvent.hpp"
#include "SelectionEvent.hpp"
+#include "StylesheetConstructionContext.hpp"
#include "StylesheetRoot.hpp"
#include "TracerEvent.hpp"
@@ -109,7 +110,7 @@
{
switch(ev.m_styleNode.getXSLToken())
{
- case Constants::ELEMNAME_TEXTLITERALRESULT:
+ case StylesheetConstructionContext::ELEMNAME_TEXT_LITERAL_RESULT:
if(m_traceElements == true)
{
m_printWriter.print(XALAN_STATIC_UCODE_STRING("Line
#"));
@@ -132,7 +133,7 @@
}
break;
- case Constants::ELEMNAME_TEMPLATE:
+ case StylesheetConstructionContext::ELEMNAME_TEMPLATE:
if(m_traceTemplates == true || m_traceElements == true)
{
const ElemTemplate& et =
1.156 +82 -0 xml-xalan/c/src/XSLT/XSLTEngineImpl.cpp
Index: XSLTEngineImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTEngineImpl.cpp,v
retrieving revision 1.155
retrieving revision 1.156
diff -u -r1.155 -r1.156
--- XSLTEngineImpl.cpp 21 Sep 2002 01:24:41 -0000 1.155
+++ XSLTEngineImpl.cpp 24 Sep 2002 01:42:35 -0000 1.156
@@ -3452,6 +3452,7 @@
void
XSLTEngineImpl::initializeElementKeysTable(ElementKeysMapType&
theElementKeys)
{
+#if 0
theElementKeys[Constants::ELEMNAME_APPLY_TEMPLATES_STRING] =
Constants::ELEMNAME_APPLY_TEMPLATES;
theElementKeys[Constants::ELEMNAME_WITHPARAM_STRING] =
Constants::ELEMNAME_WITHPARAM;
theElementKeys[Constants::ELEMNAME_CONSTRUCT_STRING] =
Constants::ELEMNAME_CONSTRUCT;
@@ -3499,6 +3500,7 @@
theElementKeys[Constants::ELEMNAME_DECIMALFORMAT_STRING] =
Constants::ELEMNAME_DECIMALFORMAT;
theElementKeys[Constants::ELEMNAME_NSALIAS_STRING] =
Constants::ELEMNAME_NSALIAS;
+#endif
}
@@ -3556,6 +3558,86 @@
const XSLTEngineImpl::ElementKeysMapType&
XSLTEngineImpl::s_elementKeys = ::s_elementKeys;
+
+#if 0
+#include <fstream>
+
+void
+dumpTable(
+ const XSLTEngineImpl::ElementKeysMapType&
theTable,
+ std::ostream&
theSourceStream,
+ std::ostream&
theHeaderStream)
+{
+ XSLTEngineImpl::ElementKeysMapType::const_iterator i =
theTable.begin();
+
+ while(i != theTable.end())
+ {
+ theSourceStream << "const XalanDOMChar\tXSLTEngineImpl::s_";
+
+ const XalanDOMString& theString = (*i).first;
+
+ theHeaderStream << "\t// The string \"" << theString <<
"\"\n\tstatic const XalanDOMChar\ts_";
+
+ bool nextCap = false;
+
+ XalanDOMString::const_iterator j = theString.begin();
+
+ while(*j)
+ {
+ if (*j == '-')
+ {
+ nextCap = true;
+ }
+ else
+ {
+ assert(*j >= 'a' && *j <= 'z');
+
+ if (nextCap)
+ {
+ theSourceStream << char(*j -'a' + 'A');
+ theHeaderStream << char(*j -'a' + 'A');
+
+ nextCap = false;
+ }
+ else
+ {
+ theSourceStream << char(*j);
+ theHeaderStream << char(*j);
+ }
+ }
+
+ ++j;
+ }
+
+ j = theString.begin();
+
+ theSourceStream << "[] =\n{\n";
+ theHeaderStream << "[];\n\n";
+
+ while(*j)
+ {
+ if (*j == '-')
+ {
+ theSourceStream <<
"\tXalanUnicode::charHyphenMinus,\n";
+ }
+ else
+ {
+ assert(*j >= 'a' && *j <= 'z');
+
+ theSourceStream <<
"\tXalanUnicode::charLetter_";
+
+ theSourceStream << char(*j) << ",\n";
+ }
+
+ ++j;
+ }
+
+ theSourceStream << "\t0\n};\n\n";
+
+ ++i;
+ }
+}
+#endif
void
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]