dbertoni 01/07/11 22:06:51
Modified: c/src/XSLT AVT.cpp AVT.hpp ElemApplyImport.cpp
ElemApplyTemplates.cpp ElemAttribute.cpp
ElemAttributeSet.cpp ElemCallTemplate.cpp
ElemChoose.cpp ElemComment.cpp ElemCopy.cpp
ElemCopyOf.cpp ElemDecimalFormat.cpp
ElemElement.cpp ElemForEach.cpp ElemIf.cpp
ElemLiteralResult.cpp ElemNumber.cpp ElemPI.cpp
ElemSort.cpp ElemTemplate.cpp
ElemTemplateElement.cpp ElemTemplateElement.hpp
ElemValueOf.cpp ElemVariable.cpp ElemWhen.cpp
ElemWithParam.cpp Stylesheet.cpp
StylesheetConstructionContext.hpp
StylesheetConstructionContextDefault.cpp
StylesheetConstructionContextDefault.hpp
StylesheetHandler.cpp XSLTEngineImpl.cpp
XSLTEngineImpl.hpp XSLTProcessor.hpp
XSLTProcessorException.cpp
XSLTProcessorException.hpp
Log:
Implemented improved exception information.
Revision Changes Path
1.13 +6 -1 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.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- AVT.cpp 2001/06/14 19:14:54 1.12
+++ AVT.cpp 2001/07/12 05:05:28 1.13
@@ -115,6 +115,7 @@
* on to the string if the AVT is simple.
*/
AVT::AVT(
+ const Locator* locator,
const XalanDOMChar* name,
const XalanDOMChar* type,
const XalanDOMChar*
stringedValue,
@@ -245,7 +246,11 @@
// expression.
clear(buffer);
- const XPath* const
xpath = constructionContext.createXPath(exprBuffer, resolver);
+ const XPath* const
xpath =
+
constructionContext.createXPath(
+
locator,
+
exprBuffer,
+
resolver);
assert(xpath != 0);
m_parts.push_back(new
AVTPartXPath(xpath));
1.12 +5 -2 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.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- AVT.hpp 2001/06/06 21:55:15 1.11
+++ AVT.hpp 2001/07/12 05:05:29 1.12
@@ -58,7 +58,7 @@
#define XALAN_AVT_HEADER_GUARD
/**
- * $Id: AVT.hpp,v 1.11 2001/06/06 21:55:15 dbertoni Exp $
+ * $Id: AVT.hpp,v 1.12 2001/07/12 05:05:29 dbertoni Exp $
*
* $State: Exp $
*
@@ -78,6 +78,7 @@
class AVTPart;
+class Locator;
class PrefixResolver;
class XPathExecutionContext;
class XalanNode;
@@ -96,7 +97,8 @@
* Construct an Attribute Value Template(AVT) by parsing the string, and
* either constructing a vector of AVTParts, or simply hold on to the
* string if the AVT is simple.
- *
+ *
+ * @param ownerElement the Locator for the AVT. May be null.
* @param name name of AVT
* @param type type of AVT
* @param stringedValue string value to parse
@@ -104,6 +106,7 @@
* @param constructionContext context for construction of AVT
*/
AVT(
+ const Locator* locator,
const XalanDOMChar* name,
const XalanDOMChar* type,
const XalanDOMChar*
stringedValue,
1.14 +9 -5 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.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ElemApplyImport.cpp 2001/06/29 18:53:10 1.13
+++ ElemApplyImport.cpp 2001/07/12 05:05:30 1.14
@@ -100,7 +100,10 @@
if(isAttrOK(aname, atts, i, constructionContext) == false)
{
-
constructionContext.error(Constants::ELEMNAME_APPLY_IMPORTS_WITH_PREFIX_STRING
+ " has an illegal attribute: " + aname);
+ constructionContext.error(
+ "xsl:apply-imports has an illegal attribute",
+ 0,
+ this);
}
}
}
@@ -123,10 +126,11 @@
XalanNode* const sourceNode = executionContext.getCurrentNode();
assert(sourceNode != 0);
- transformChild(executionContext,
- *this,
- 0,
- sourceNode);
+ transformChild(
+ executionContext,
+ *this,
+ 0,
+ sourceNode);
}
1.18 +9 -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.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- ElemApplyTemplates.cpp 2001/06/14 19:29:53 1.17
+++ ElemApplyTemplates.cpp 2001/07/12 05:05:31 1.18
@@ -98,7 +98,7 @@
switch(tok)
{
case Constants::TATTRNAME_SELECT:
- m_selectPattern =
constructionContext.createXPath(atts.getValue(i), *this);
+ m_selectPattern = constructionContext.createXPath(this,
atts.getValue(i), *this);
break;
case Constants::TATTRNAME_MODE:
@@ -108,7 +108,10 @@
default:
if(!isAttrOK(aname, atts, i, constructionContext))
{
-
constructionContext.error(Constants::ELEMNAME_APPLY_TEMPLATES_WITH_PREFIX_STRING
+ " has an illegal attribute: " + aname);
+ constructionContext.error(
+ "xsl:apply-templates has an illegal
attribute",
+ 0,
+ this);
}
break;
}
@@ -116,7 +119,10 @@
if(0 == m_selectPattern)
{
- m_selectPattern =
constructionContext.createXPath(XALAN_STATIC_UCODE_STRING("node()"), *this);
+ m_selectPattern = constructionContext.createXPath(
+ this,
+ Constants::PSEUDONAME_NODE,
+ *this);
}
assert(m_selectPattern != 0);
1.28 +10 -4 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.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- ElemAttribute.cpp 2001/06/25 21:58:51 1.27
+++ ElemAttribute.cpp 2001/07/12 05:05:32 1.28
@@ -100,18 +100,21 @@
if(equals(aname, Constants::ATTRNAME_NAME))
{
- m_pNameAVT = new AVT(aname, atts.getType(i),
atts.getValue(i),
+ m_pNameAVT = new AVT(this, aname, atts.getType(i),
atts.getValue(i),
*this, constructionContext);
}
else if(equals(aname,Constants::ATTRNAME_NAMESPACE))
{
- m_pNamespaceAVT = new AVT(aname, atts.getType(i),
atts.getValue(i),
+ m_pNamespaceAVT = new AVT(this, aname, atts.getType(i),
atts.getValue(i),
*this, constructionContext);
}
else if(!(isAttrOK(aname, atts, i, constructionContext) ||
processSpaceAttr(aname, atts, i)))
{
-
constructionContext.error(Constants::ELEMNAME_ATTRIBUTE_WITH_PREFIX_STRING + "
has an illegal attribute: " + aname);
+ constructionContext.error(
+ "xsl:attribute has an illegal attribute",
+ 0,
+ this);
}
}
@@ -123,7 +126,10 @@
delete m_pNamespaceAVT;
#endif
-
constructionContext.error(Constants::ELEMNAME_ATTRIBUTE_WITH_PREFIX_STRING + "
must have a name attribute.");
+ constructionContext.error(
+ "xsl:attribute must have a \"name\" attribute",
+ 0,
+ this);
}
}
1.13 +8 -2 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.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ElemAttributeSet.cpp 2001/06/29 18:53:12 1.12
+++ ElemAttributeSet.cpp 2001/07/12 05:05:33 1.13
@@ -98,13 +98,19 @@
else if(!(processUseAttributeSets(constructionContext, aname,
atts, i) ||
isAttrOK(aname, atts, i,
constructionContext)))
{
-
constructionContext.error(Constants::ELEMNAME_ATTRIBUTESET_WITH_PREFIX_STRING +
" has an illegal attribute: " + aname);
+ constructionContext.error(
+ "xsl:attribute-set has an illegal attribute",
+ 0,
+ this);
}
}
if(isEmpty(m_QName.getLocalPart()))
{
-
constructionContext.error(Constants::ELEMNAME_ATTRIBUTESET_WITH_PREFIX_STRING +
" must have a name attribute.");
+ constructionContext.error(
+ "xsl:attribute-set must have a \"name\" attribute",
+ 0,
+ this);
}
}
1.17 +8 -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.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ElemCallTemplate.cpp 2001/06/06 21:55:19 1.16
+++ ElemCallTemplate.cpp 2001/07/12 05:05:34 1.17
@@ -102,13 +102,19 @@
}
else if(!isAttrOK(aname, atts, i, constructionContext))
{
-
constructionContext.error(Constants::ELEMNAME_CALLTEMPLATE_WITH_PREFIX_STRING +
" has an illegal attribute: " + aname);
+ constructionContext.error(
+ "xsl:call-template has an illegal attribute",
+ 0,
+ this);
}
}
if (m_templateName.isEmpty() == true)
{
-
constructionContext.error(Constants::ELEMNAME_CALLTEMPLATE_WITH_PREFIX_STRING +
" requires a name attribute!");
+ constructionContext.error(
+ "xsl:call-template must have a \"name\" attribute",
+ 0,
+ this);
}
}
1.15 +4 -1 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.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ElemChoose.cpp 2001/03/29 22:21:34 1.14
+++ ElemChoose.cpp 2001/07/12 05:05:35 1.15
@@ -98,7 +98,10 @@
if(isAttrOK(aname, atts, i, constructionContext) == false ||
processSpaceAttr(aname, atts, i))
{
-
constructionContext.error(Constants::ELEMNAME_CHOOSE_WITH_PREFIX_STRING + " has
an illegal attribute: " + aname);
+ constructionContext.error(
+ "xsl:choose has an illegal attribute",
+ 0,
+ this);
}
}
}
1.12 +4 -8 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.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ElemComment.cpp 2001/06/25 21:58:52 1.11
+++ ElemComment.cpp 2001/07/12 05:05:36 1.12
@@ -92,7 +92,10 @@
if(isAttrOK(aname, atts, i, constructionContext) == false ||
processSpaceAttr(aname, atts, i))
{
-
constructionContext.error(Constants::ELEMNAME_COMMENT_WITH_PREFIX_STRING + "
has an illegal attribute: " + aname);
+ constructionContext.error(
+ "xsl:comment has an illegal attribute",
+ 0,
+ this);
}
}
}
@@ -145,13 +148,6 @@
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:
-
fResult = true;
break;
1.14 +4 -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.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ElemCopy.cpp 2001/03/09 16:20:05 1.13
+++ ElemCopy.cpp 2001/07/12 05:05:37 1.14
@@ -97,7 +97,10 @@
processSpaceAttr(aname, atts, i) ||
isAttrOK(aname, atts, i, constructionContext)))
{
-
constructionContext.error(Constants::ELEMNAME_COPY_WITH_PREFIX_STRING + " has
an illegal attribute: " + aname);
+ constructionContext.error(
+ "xsl:copy has an illegal attribute",
+ 0,
+ this);
}
}
}
1.19 +9 -3 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.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- ElemCopyOf.cpp 2001/07/08 18:41:21 1.18
+++ ElemCopyOf.cpp 2001/07/12 05:05:38 1.19
@@ -108,17 +108,23 @@
m_isDot = true;
}
- m_selectPattern =
constructionContext.createXPath(avalue, *this);
+ m_selectPattern = constructionContext.createXPath(this,
avalue, *this);
}
else if(!isAttrOK(aname, atts, i, constructionContext))
{
- constructionContext.error(XalanDOMString("xsl:copy-of
has an illegal attribute: ") + aname);
+ constructionContext.error(
+ "xsl:copy-of has an illegal attribute",
+ 0,
+ this);
}
}
if (m_selectPattern == 0)
{
- constructionContext.error("xsl:copy-of must have a \"select\"
attribute.");
+ constructionContext.error(
+ "xsl:copy-of must have a \"select\" attribute",
+ 0,
+ this);
}
}
1.7 +5 -5 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.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ElemDecimalFormat.cpp 2001/03/09 16:20:04 1.6
+++ ElemDecimalFormat.cpp 2001/07/12 05:05:40 1.7
@@ -230,7 +230,7 @@
}
else if(!isAttrOK(aname, atts, i, constructionContext))
{
- constructionContext.error("Illegal attribute value", 0,
this);
+ constructionContext.error("xsl:decimal-format has an
illegal attribute", 0, this);
}
}
@@ -249,7 +249,7 @@
{
if
(getStylesheet().getDecimalFormatSymbols(Constants::DEFAULT_DECIMAL_FORMAT) !=
0)
{
- constructionContext.warn("Only one default
xsl:decimal-format is allowed!!!", 0, this);
+ constructionContext.warn("Only one default
xsl:decimal-format is allowed", 0, this);
}
m_name_avt = Constants::DEFAULT_DECIMAL_FORMAT;
@@ -259,7 +259,7 @@
{
if (getStylesheet().getDecimalFormatSymbols(m_name_avt) != 0)
{
- constructionContext.warn("All xsl:decimal-format
elements must be unique!!!", 0, this);
+ constructionContext.warn("All xsl:decimal-format
elements must be unique", 0, this);
}
}
}
@@ -281,7 +281,7 @@
void
-ElemDecimalFormat::execute(StylesheetExecutionContext&
executionContext) const
-{
+ElemDecimalFormat::execute(StylesheetExecutionContext&
executionContext) const
+{
ElemTemplateElement::execute(executionContext);
}
1.29 +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.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- ElemElement.cpp 2001/05/17 18:07:02 1.28
+++ ElemElement.cpp 2001/07/12 05:05:40 1.29
@@ -100,12 +100,12 @@
if(equals(aname, Constants::ATTRNAME_NAME))
{
- m_nameAVT = new AVT(aname, atts.getType(i),
atts.getValue(i),
+ m_nameAVT = new AVT(this, aname,
atts.getType(i), atts.getValue(i),
*this, constructionContext);
}
else if(equals(aname, Constants::ATTRNAME_NAMESPACE))
{
- m_namespaceAVT = new AVT(aname, atts.getType(i),
atts.getValue(i),
+ m_namespaceAVT = new AVT(this, aname, atts.getType(i),
atts.getValue(i),
*this, constructionContext);
}
else if(!(processUseAttributeSets(constructionContext, aname,
atts, i) || processSpaceAttr(aname, atts, i) ||
1.15 +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.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ElemForEach.cpp 2001/06/06 21:55:21 1.14
+++ ElemForEach.cpp 2001/07/12 05:05:42 1.15
@@ -103,7 +103,7 @@
if(equals(aname, Constants::ATTRNAME_SELECT))
{
- m_selectPattern =
constructionContext.createXPath(atts.getValue(i), *this);
+ m_selectPattern = constructionContext.createXPath(this,
atts.getValue(i), *this);
}
else if(!(isAttrOK(aname, atts, i, constructionContext) ||
processSpaceAttr(aname, atts, i)))
{
1.14 +9 -3 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.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ElemIf.cpp 2001/03/09 16:20:01 1.13
+++ ElemIf.cpp 2001/07/12 05:05:42 1.14
@@ -105,7 +105,7 @@
switch(tok)
{
case Constants::TATTRNAME_TEST:
- m_test =
constructionContext.createXPath(atts.getValue(i), *this);
+ m_test = constructionContext.createXPath(this,
atts.getValue(i), *this);
break;
case Constants::TATTRNAME_XMLSPACE:
@@ -115,14 +115,20 @@
default:
if(!isAttrOK(aname, atts, i, constructionContext))
{
-
constructionContext.error(Constants::ELEMNAME_IF_WITH_PREFIX_STRING + " has an
illegal attribute: " + aname);
+ constructionContext.error(
+ XalanDOMString("xsl:if has an illegal
attribute"),
+ 0,
+ this);
}
}
}
if(0 == m_test)
{
-
constructionContext.error(Constants::ELEMNAME_IF_WITH_PREFIX_STRING + " must
have a 'test' attribute.");
+ constructionContext.error(
+ Constants::ELEMNAME_IF_WITH_PREFIX_STRING + " must have
a 'test' attribute.",
+ 0,
+ this);
}
}
1.40 +1 -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.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- ElemLiteralResult.cpp 2001/06/29 18:53:12 1.39
+++ ElemLiteralResult.cpp 2001/07/12 05:05:43 1.40
@@ -157,7 +157,7 @@
if(! processUseAttributeSets(constructionContext,
aname, atts, i) &&
isAttrOK(aname, atts, i,
constructionContext))
{
- m_avts.push_back(new AVT(aname,
atts.getType(i), atts.getValue(i),
+ m_avts.push_back(new AVT(this, aname,
atts.getType(i), atts.getValue(i),
*this,
constructionContext));
}
}
1.45 +8 -8 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.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- ElemNumber.cpp 2001/07/08 18:48:39 1.44
+++ ElemNumber.cpp 2001/07/12 05:05:44 1.45
@@ -143,39 +143,39 @@
}
else if(equals(aname, Constants::ATTRNAME_COUNT))
{
- m_countMatchPattern =
constructionContext.createMatchPattern(atts.getValue(i), *this);
+ m_countMatchPattern =
constructionContext.createMatchPattern(this, atts.getValue(i), *this);
}
else if(equals(aname, Constants::ATTRNAME_FROM))
{
- m_fromMatchPattern =
constructionContext.createMatchPattern(atts.getValue(i), *this);
+ m_fromMatchPattern =
constructionContext.createMatchPattern(this, atts.getValue(i), *this);
}
else if(equals(aname, Constants::ATTRNAME_VALUE))
{
- m_valueExpr =
constructionContext.createXPath(atts.getValue(i), *this);
+ m_valueExpr = constructionContext.createXPath(this,
atts.getValue(i), *this);
}
else if(equals(aname, Constants::ATTRNAME_FORMAT))
{
- m_format_avt = new AVT(aname, atts.getType(i),
+ m_format_avt = new AVT(this, aname, atts.getType(i),
atts.getValue(i), *this,
constructionContext);
}
else if(equals(aname, Constants::ATTRNAME_LANG))
{
- m_lang_avt = new AVT(aname, atts.getType(i),
+ m_lang_avt = new AVT(this, aname, atts.getType(i),
atts.getValue(i), *this,
constructionContext);
}
else if(equals(aname, Constants::ATTRNAME_LETTERVALUE))
{
- m_lettervalue_avt = new AVT(aname, atts.getType(i),
+ m_lettervalue_avt = new AVT(this, aname,
atts.getType(i),
atts.getValue(i), *this,
constructionContext);
}
else if(equals(aname,Constants::ATTRNAME_GROUPINGSEPARATOR))
{
- m_groupingSeparator_avt = new AVT(aname,
atts.getType(i),
+ m_groupingSeparator_avt = new AVT(this, aname,
atts.getType(i),
atts.getValue(i), *this,
constructionContext);
}
else if(equals(aname,Constants::ATTRNAME_GROUPINGSIZE))
{
- m_groupingSize_avt = new AVT(aname, atts.getType(i),
+ m_groupingSize_avt = new AVT(this, aname,
atts.getType(i),
atts.getValue(i), *this,
constructionContext);
}
else if(!isAttrOK(aname, atts, i, constructionContext))
1.16 +1 -1 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.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ElemPI.cpp 2001/06/25 21:58:52 1.15
+++ ElemPI.cpp 2001/07/12 05:05:46 1.16
@@ -93,7 +93,7 @@
if(equals(aname, Constants::ATTRNAME_NAME))
{
- m_nameAVT = new AVT(aname, atts.getType(i),
atts.getValue(i),
+ m_nameAVT = new AVT(this, aname, atts.getType(i),
atts.getValue(i),
*this, constructionContext);
}
else if(isAttrOK(aname, atts, i, constructionContext) == false
|| processSpaceAttr(aname, atts, i))
1.9 +8 -8 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.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ElemSort.cpp 2001/02/27 22:06:16 1.8
+++ ElemSort.cpp 2001/07/12 05:05:47 1.9
@@ -97,28 +97,28 @@
if(equals(aname, Constants::ATTRNAME_SELECT))
{
m_selectPattern
- =
constructionContext.createXPath(atts.getValue(i), *this);
+ = constructionContext.createXPath(this,
atts.getValue(i), *this);
}
else if(equals(aname, Constants::ATTRNAME_LANG))
{
- m_langAVT = new AVT(aname, atts.getType(i),
atts.getValue(i),
+ m_langAVT = new AVT(this, aname, atts.getType(i),
atts.getValue(i),
*this, constructionContext);
}
else if(equals(aname, Constants::ATTRNAME_DATATYPE))
{
- m_dataTypeAVT = new AVT(aname, atts.getType(i),
atts.getValue(i),
+ m_dataTypeAVT = new AVT(this, aname, atts.getType(i),
atts.getValue(i),
*this, constructionContext);
}
else if(equals(aname, Constants::ATTRNAME_ORDER))
{
- m_orderAVT = new AVT(aname, atts.getType(i),
atts.getValue(i),
+ m_orderAVT = new AVT(this, aname, atts.getType(i),
atts.getValue(i),
*this, constructionContext);
}
else if(equals(aname, Constants::ATTRNAME_CASEORDER))
{
constructionContext.warn("Xalan C++ does not yet handle
the " + Constants::ATTRNAME_CASEORDER + " attribute!");
- m_caseOrderAVT = new AVT(aname, atts.getType(i),
atts.getValue(i),
+ m_caseOrderAVT = new AVT(this, aname, atts.getType(i),
atts.getValue(i),
*this, constructionContext);
}
else if(!isAttrOK(aname, atts, i, constructionContext))
@@ -129,19 +129,19 @@
if(0 == m_dataTypeAVT)
{
- m_dataTypeAVT = new AVT(c_wstr(Constants::ATTRNAME_DATATYPE),
c_wstr(Constants::ATTRTYPE_CDATA), c_wstr(Constants::ATTRVAL_DATATYPE_TEXT),
+ m_dataTypeAVT = new AVT(this,
c_wstr(Constants::ATTRNAME_DATATYPE), c_wstr(Constants::ATTRTYPE_CDATA),
c_wstr(Constants::ATTRVAL_DATATYPE_TEXT),
*this, constructionContext);
}
if(0 == m_orderAVT)
{
- m_orderAVT = new AVT(c_wstr(Constants::ATTRNAME_ORDER),
c_wstr(Constants::ATTRTYPE_CDATA), c_wstr(Constants::ATTRVAL_ORDER_ASCENDING),
+ m_orderAVT = new AVT(this, c_wstr(Constants::ATTRNAME_ORDER),
c_wstr(Constants::ATTRTYPE_CDATA), c_wstr(Constants::ATTRVAL_ORDER_ASCENDING),
*this, constructionContext);
}
if(0 == m_selectPattern)
{
- m_selectPattern =
constructionContext.createXPath(StaticStringToDOMString(XALAN_STATIC_UCODE_STRING(".")),
*this);
+ m_selectPattern = constructionContext.createXPath(this,
StaticStringToDOMString(XALAN_STATIC_UCODE_STRING(".")), *this);
}
}
1.16 +9 -3 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.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ElemTemplate.cpp 2001/07/08 18:48:39 1.15
+++ ElemTemplate.cpp 2001/07/12 05:05:48 1.16
@@ -105,7 +105,7 @@
switch(tok)
{
case Constants::TATTRNAME_MATCH:
- m_matchPattern =
constructionContext.createMatchPattern(atts.getValue(i), *this);
+ m_matchPattern =
constructionContext.createMatchPattern(this, atts.getValue(i), *this);
break;
case Constants::TATTRNAME_NAME:
@@ -131,14 +131,20 @@
default:
if(!isAttrOK(aname, atts, i, constructionContext))
{
-
constructionContext.error(Constants::ELEMNAME_TEMPLATE_WITH_PREFIX_STRING + "
has an illegal attribute: " + aname);
+ constructionContext.error(
+ "xsl:template has an illegal attribute",
+ 0,
+ this);
}
}
}
if(0 == m_matchPattern && m_name.isEmpty() == true)
{
-
constructionContext.error(Constants::ELEMNAME_TEMPLATE_WITH_PREFIX_STRING + "
requires either a name or a match attribute.");
+ constructionContext.error(
+ "xsl:template requires either a name or a match
attribute",
+ 0,
+ this);
}
}
1.62 +33 -0 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.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- ElemTemplateElement.cpp 2001/06/29 18:53:13 1.61
+++ ElemTemplateElement.cpp 2001/07/12 05:05:49 1.62
@@ -121,6 +121,7 @@
int
xslToken) :
XalanElement(),
PrefixResolver(),
+ Locator(),
m_finishedConstruction(false),
m_namespacesHandler(stylesheetTree.getNamespacesHandler(),
stylesheetTree.getNamespaces(),
@@ -1497,6 +1498,38 @@
ElemTemplateElement::getURI() const
{
return m_baseIndentifier;
+}
+
+
+
+int
+ElemTemplateElement::getLineNumber() const
+{
+ return m_lineNumber;
+}
+
+
+
+int
+ElemTemplateElement::getColumnNumber() const
+{
+ return m_columnNumber;
+}
+
+
+
+const XMLCh*
+ElemTemplateElement::getPublicId() const
+{
+ return 0;
+}
+
+
+
+const XMLCh*
+ElemTemplateElement::getSystemId() const
+{
+ return c_wstr(m_baseIndentifier);
}
1.33 +22 -23 xml-xalan/c/src/XSLT/ElemTemplateElement.hpp
Index: ElemTemplateElement.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemTemplateElement.hpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- ElemTemplateElement.hpp 2001/06/29 18:53:14 1.32
+++ ElemTemplateElement.hpp 2001/07/12 05:05:51 1.33
@@ -69,6 +69,10 @@
+#include <sax/Locator.hpp>
+
+
+
#include <XalanDOM/XalanDOMString.hpp>
#include <XalanDOM/XalanElement.hpp>
#include <XalanDOM/XalanEmptyNamedNodeMap.hpp>
@@ -98,7 +102,7 @@
-class ElemTemplateElement : public XalanElement, public PrefixResolver
+class XALAN_XSLT_EXPORT ElemTemplateElement : public XalanElement, public
PrefixResolver, public Locator
{
public:
@@ -309,28 +313,6 @@
virtual void
error(const char* msg) const;
- /**
- * Get the line number where the element occurs in the xsl file.
- *
- * @return line number
- */
- int
- getLineNumber() const
- {
- return m_lineNumber;
- }
-
- /**
- * Get the column offset where the element occurs in the xsl file.
- *
- * @return column number
- */
- int
- getColumnNumber() const
- {
- return m_columnNumber;
- }
-
virtual const XalanDOMString&
getElementName() const = 0;
@@ -662,6 +644,23 @@
virtual const XalanDOMString&
getURI() const;
+
+ // These interfaces are inherited from Locator...
+
+ virtual const XMLCh*
+ getPublicId() const;
+
+ virtual const XMLCh*
+ getSystemId() const;
+
+ virtual int
+ getLineNumber() const;
+
+ virtual int
+ getColumnNumber() const;
+
+
+ // These optimization interfaces are new to ElemTemplateElement...
bool
hasParams() const
{
1.24 +5 -2 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.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- ElemValueOf.cpp 2001/05/02 15:55:48 1.23
+++ ElemValueOf.cpp 2001/07/12 05:05:53 1.24
@@ -120,8 +120,11 @@
m_isDot = true;
}
- m_selectPattern =
constructionContext.createXPath(avalue,
-
*this);
+ m_selectPattern =
+ constructionContext.createXPath(
+ this,
+ avalue,
+ *this);
}
break;
1.18 +6 -3 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.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- ElemVariable.cpp 2001/06/14 19:24:25 1.17
+++ ElemVariable.cpp 2001/07/12 05:05:54 1.18
@@ -108,7 +108,7 @@
switch(tok)
{
case Constants::TATTRNAME_SELECT:
- m_selectPattern =
constructionContext.createXPath(atts.getValue(i),
+ m_selectPattern = constructionContext.createXPath(this,
atts.getValue(i),
*this);
break;
@@ -123,14 +123,17 @@
default:
if(!isAttrOK(aname, atts, i, constructionContext))
{
-
constructionContext.error(Constants::ELEMNAME_VARIABLE_WITH_PREFIX_STRING + "
has an illegal attribute: " + aname);
+ constructionContext.error("xsl:variable has an
illegal attribute", 0, this);
}
}
}
if(m_qname.isEmpty())
{
-
constructionContext.error(Constants::ELEMNAME_VARIABLE_WITH_PREFIX_STRING + "
must have a 'name' attribute.");
+ constructionContext.error(
+ "xsl:variable must have a 'name' attribute.",
+ 0,
+ this);
}
}
1.7 +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.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ElemWhen.cpp 2001/02/12 02:34:53 1.6
+++ ElemWhen.cpp 2001/07/12 05:05:55 1.7
@@ -96,7 +96,7 @@
switch(tok)
{
case Constants::TATTRNAME_TEST:
- m_pTest =
constructionContext.createXPath(atts.getValue(i), *this);
+ m_pTest = constructionContext.createXPath(this,
atts.getValue(i), *this);
break;
case Constants::TATTRNAME_XMLSPACE:
1.8 +9 -3 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.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ElemWithParam.cpp 2001/02/12 02:34:54 1.7
+++ ElemWithParam.cpp 2001/07/12 05:05:56 1.8
@@ -94,7 +94,7 @@
if(equals(aname, Constants::ATTRNAME_SELECT))
{
- m_selectPattern =
constructionContext.createXPath(atts.getValue(i), *this);
+ m_selectPattern = constructionContext.createXPath(this,
atts.getValue(i), *this);
}
else if(equals(aname, Constants::ATTRNAME_NAME))
{
@@ -102,13 +102,19 @@
}
else if(!isAttrOK(aname, atts, i, constructionContext))
{
-
constructionContext.error(Constants::ELEMNAME_WITHPARAM_WITH_PREFIX_STRING + "
has an illegal attribute: " + aname);
+ constructionContext.error(
+ "xsl:with-param has an illegal attribute",
+ 0,
+ this);
}
}
if(m_qname.isEmpty() == true)
{
- constructionContext.error("xsl:with-param must have a 'name'
attribute.");
+ constructionContext.error(
+ "xsl:with-param must have a 'name' attribute",
+ 0,
+ this);
}
}
1.60 +12 -11 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.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- Stylesheet.cpp 2001/07/08 18:48:39 1.59
+++ Stylesheet.cpp 2001/07/12 05:05:58 1.60
@@ -251,6 +251,7 @@
{
matchAttr =
constructionContext.createMatchPattern(
+ 0,
XalanDOMString(atts.getValue(i)),
*nsContext);
}
@@ -258,6 +259,7 @@
{
useAttr =
constructionContext.createXPath(
+ 0,
atts.getValue(i),
*nsContext);
}
@@ -891,8 +893,6 @@
}
else
{
- const ElemTemplate* theResult = 0;
-
const ElemTemplate* bestMatchedRule = 0;
const MatchPattern2* bestMatchedPattern = 0; // Syncs with
bestMatchedRule
const double matchScoreNoneValue =
@@ -1162,17 +1162,19 @@
if (arg.getXObject().null() == false)
{
-
executionContext.pushVariable(arg.getName(),
-
arg.getXObject(),
-
0);
+ executionContext.pushVariable(
+ arg.getName(),
+ arg.getXObject(),
+ 0);
}
else
{
-
executionContext.pushVariable(arg.getName(),
-
0,
-
arg.getExpression(),
-
executionContext.getRootDocument(),
-
*this);
+ executionContext.pushVariable(
+ arg.getName(),
+ 0,
+ arg.getExpression(),
+
executionContext.getRootDocument(),
+ *this);
}
break;
@@ -1187,7 +1189,6 @@
var->getParentNodeElem());
}
}
-
}
1.11 +33 -28 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.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- StylesheetConstructionContext.hpp 2000/11/02 01:46:27 1.10
+++ StylesheetConstructionContext.hpp 2001/07/12 05:05:59 1.11
@@ -66,11 +66,6 @@
-// Base class header file...
-#include <PlatformSupport/ExecutionContext.hpp>
-
-
-
#include <PlatformSupport/URISupport.hpp>
@@ -80,11 +75,13 @@
class DocumentHandler;
+class ElemTemplateElement;
class Locator;
class PrefixResolver;
class Stylesheet;
class StylesheetRoot;
class XalanDocument;
+class XalanNode;
class XPath;
class XMLURL;
class XSLTInputSource;
@@ -95,7 +92,7 @@
// An abstract class which provides support for constructing the internal
// representation of a stylesheet.
//
-class XALAN_XSLT_EXPORT StylesheetConstructionContext : public
ExecutionContext
+class XALAN_XSLT_EXPORT StylesheetConstructionContext
{
public:
@@ -238,12 +235,14 @@
* is to be used by stylesheet elements that need an XPath that is
* guaranteed to persist while it lives.
*
- * @param str string to match
+ * @param locator the locator for the XPath. May be null.
+ * @param str string to match
* @param resolver resolver for namespace resolution
* @return XPath for match pattern
*/
virtual XPath*
createMatchPattern(
+ const Locator* locator,
const XalanDOMString& str,
const PrefixResolver& resolver) = 0;
@@ -252,12 +251,14 @@
* is to be used by stylesheet elements that need an XPath that is
* guaranteed to persist while it lives.
*
- * @param str string to match
+ * @param locator the locator for the XPath. May be null.
+ * @param str string to match
* @param resolver resolver for namespace resolution
* @return XPath for match pattern
*/
virtual XPath*
createMatchPattern(
+ const Locator* locator,
const XalanDOMChar* str,
const PrefixResolver& resolver) = 0;
@@ -266,12 +267,14 @@
* stylesheet elements that need an XPath that is guaranteed to persist
* while it lives.
*
- * @param str string to match
+ * @param locator the locator for the XPath. May be null.
+ * @param str string to match
* @param resolver resolver for namespace resolution
* @return XPath for string matched
*/
virtual XPath*
createXPath(
+ const Locator* locator,
const XalanDOMString& str,
const PrefixResolver& resolver) = 0;
@@ -280,12 +283,14 @@
* stylesheet elements that need an XPath that is guaranteed to persist
* while it lives.
*
- * @param str string to match
+ * @param locator the locator for the XPath. May be null.
+ * @param str string to match
* @param resolver resolver for namespace resolution
* @return XPath for string matched
*/
virtual XPath*
createXPath(
+ const Locator* locator,
const XalanDOMChar* str,
const PrefixResolver& resolver) = 0;
@@ -360,39 +365,39 @@
virtual void
error(
- const XalanDOMString& msg,
- const XalanNode* sourceNode = 0,
- const XalanNode* styleNode = 0) const =
0;
+ const XalanDOMString& msg,
+ const XalanNode* sourceNode = 0,
+ const ElemTemplateElement* styleNode = 0) const =
0;
virtual void
error(
- const char* msg,
- const XalanNode* sourceNode = 0,
- const XalanNode* styleNode = 0) const = 0;
+ const char* msg,
+ const XalanNode* sourceNode = 0,
+ const ElemTemplateElement* styleNode = 0) const =
0;
virtual void
warn(
- const XalanDOMString& msg,
- const XalanNode* sourceNode = 0,
- const XalanNode* styleNode = 0) const =
0;
+ const XalanDOMString& msg,
+ const XalanNode* sourceNode = 0,
+ const ElemTemplateElement* styleNode = 0) const =
0;
virtual void
warn(
- const char* msg,
- const XalanNode* sourceNode = 0,
- const XalanNode* styleNode = 0) const = 0;
+ const char* msg,
+ const XalanNode* sourceNode = 0,
+ const ElemTemplateElement* styleNode = 0) const =
0;
virtual void
message(
- const XalanDOMString& msg,
- const XalanNode* sourceNode = 0,
- const XalanNode* styleNode = 0) const =
0;
+ const XalanDOMString& msg,
+ const XalanNode* sourceNode = 0,
+ const ElemTemplateElement* styleNode = 0) const =
0;
virtual void
message(
- const char* msg,
- const XalanNode* sourceNode = 0,
- const XalanNode* styleNode = 0) const = 0;
+ const char* msg,
+ const XalanNode* sourceNode = 0,
+ const ElemTemplateElement* styleNode = 0) const =
0;
};
1.17 +52 -29
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.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- StylesheetConstructionContextDefault.cpp 2001/06/14 19:28:21 1.16
+++ StylesheetConstructionContextDefault.cpp 2001/07/12 05:06:00 1.17
@@ -80,6 +80,7 @@
+#include "ElemTemplateElement.hpp"
#include "StylesheetRoot.hpp"
#include "XSLTEngineImpl.hpp"
#include "XSLTInputSource.hpp"
@@ -124,20 +125,20 @@
void
StylesheetConstructionContextDefault::error(
- const XalanDOMString& msg,
- const XalanNode* sourceNode,
- const XalanNode* styleNode) const
+ const XalanDOMString& msg,
+ const XalanNode* sourceNode,
+ const ElemTemplateElement* styleNode) const
{
- m_processor.error(msg, styleNode, sourceNode);
+ m_processor.error(msg, sourceNode, styleNode);
}
void
StylesheetConstructionContextDefault::error(
- const char* msg,
- const XalanNode* sourceNode,
- const XalanNode* styleNode) const
+ const char* msg,
+ const XalanNode* sourceNode,
+ const ElemTemplateElement* styleNode) const
{
error(TranscodeFromLocalCodePage(msg), sourceNode, styleNode);
}
@@ -146,20 +147,20 @@
void
StylesheetConstructionContextDefault::warn(
- const XalanDOMString& msg,
- const XalanNode* sourceNode,
- const XalanNode* styleNode) const
+ const XalanDOMString& msg,
+ const XalanNode* sourceNode,
+ const ElemTemplateElement* styleNode) const
{
- m_processor.warn(msg, styleNode, sourceNode);
+ m_processor.warn(msg, sourceNode, styleNode);
}
void
StylesheetConstructionContextDefault::warn(
- const char* msg,
- const XalanNode* sourceNode,
- const XalanNode* styleNode) const
+ const char* msg,
+ const XalanNode* sourceNode,
+ const ElemTemplateElement* styleNode) const
{
warn(TranscodeFromLocalCodePage(msg), sourceNode, styleNode);
}
@@ -168,20 +169,20 @@
void
StylesheetConstructionContextDefault::message(
- const XalanDOMString& msg,
- const XalanNode* sourceNode,
- const XalanNode* styleNode) const
+ const XalanDOMString& msg,
+ const XalanNode* sourceNode,
+ const ElemTemplateElement* styleNode) const
{
- m_processor.message(msg, styleNode, sourceNode);
+ m_processor.message(msg, sourceNode, styleNode);
}
void
StylesheetConstructionContextDefault::message(
- const char* msg,
- const XalanNode* sourceNode,
- const XalanNode* styleNode) const
+ const char* msg,
+ const XalanNode* sourceNode,
+ const ElemTemplateElement* styleNode) const
{
message(TranscodeFromLocalCodePage(msg), sourceNode, styleNode);
}
@@ -337,17 +338,27 @@
XPath*
StylesheetConstructionContextDefault::createMatchPattern(
+ const Locator* locator,
const XalanDOMString& str,
const PrefixResolver& resolver)
{
XPath* const xpath = m_xpathFactory.create();
- m_xpathProcessor->initMatchPattern(*xpath,
- str,
-
resolver);
+ // Note that we use the current locator from the
+ // processing stack, and not the locator passed in.
+ // This is because the locator on the stack is active,
+ // during construction, while the locator passed in
+ // will be used at run-time.
+ m_xpathProcessor->initMatchPattern(
+ *xpath,
+ str,
+ resolver,
+ getLocatorFromStack());
xpath->setInStylesheet(true);
+ xpath->setLocator(locator);
+
return xpath;
}
@@ -355,6 +366,7 @@
XPath*
StylesheetConstructionContextDefault::createMatchPattern(
+ const Locator* locator,
const XalanDOMChar* str,
const PrefixResolver& resolver)
{
@@ -362,24 +374,34 @@
assign(m_tempBuffer, str);
- return createMatchPattern(m_tempBuffer, resolver);
+ return createMatchPattern(locator, m_tempBuffer, resolver);
}
XPath*
StylesheetConstructionContextDefault::createXPath(
+ const Locator* locator,
const XalanDOMString& str,
const PrefixResolver& resolver)
{
XPath* const xpath = m_xpathFactory.create();
- m_xpathProcessor->initXPath(*xpath,
- str,
- resolver);
+ // Note that we use the current locator from the
+ // processing stack, and not the locator passed in.
+ // This is because the locator on the stack is active,
+ // during construction, while the locator passed in
+ // will be used at run-time.
+ m_xpathProcessor->initXPath(
+ *xpath,
+ str,
+ resolver,
+ getLocatorFromStack());
xpath->setInStylesheet(true);
+ xpath->setLocator(locator);
+
return xpath;
}
@@ -387,6 +409,7 @@
XPath*
StylesheetConstructionContextDefault::createXPath(
+ const Locator* locator,
const XalanDOMChar* str,
const PrefixResolver& resolver)
{
@@ -394,7 +417,7 @@
assign(m_tempBuffer, str);
- return createXPath(m_tempBuffer, resolver);
+ return createXPath(locator, m_tempBuffer, resolver);
}
1.18 +22 -18
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.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- StylesheetConstructionContextDefault.hpp 2001/06/14 19:28:22 1.17
+++ StylesheetConstructionContextDefault.hpp 2001/07/12 05:06:01 1.18
@@ -144,39 +144,39 @@
virtual void
error(
- const XalanDOMString& msg,
- const XalanNode* sourceNode = 0,
- const XalanNode* styleNode = 0) const;
+ const XalanDOMString& msg,
+ const XalanNode* sourceNode = 0,
+ const ElemTemplateElement* styleNode = 0) const;
virtual void
error(
- const char* msg,
- const XalanNode* sourceNode = 0,
- const XalanNode* styleNode = 0) const;
+ const char* msg,
+ const XalanNode* sourceNode = 0,
+ const ElemTemplateElement* styleNode = 0) const;
virtual void
warn(
- const XalanDOMString& msg,
- const XalanNode* sourceNode = 0,
- const XalanNode* styleNode = 0) const;
+ const XalanDOMString& msg,
+ const XalanNode* sourceNode = 0,
+ const ElemTemplateElement* styleNode = 0) const;
virtual void
warn(
- const char* msg,
- const XalanNode* sourceNode = 0,
- const XalanNode* styleNode = 0) const;
+ const char* msg,
+ const XalanNode* sourceNode = 0,
+ const ElemTemplateElement* styleNode = 0) const;
virtual void
message(
- const XalanDOMString& msg,
- const XalanNode* sourceNode = 0,
- const XalanNode* styleNode = 0) const;
+ const XalanDOMString& msg,
+ const XalanNode* sourceNode = 0,
+ const ElemTemplateElement* styleNode = 0) const;
virtual void
message(
- const char* msg,
- const XalanNode* sourceNode = 0,
- const XalanNode* styleNode = 0) const;
+ const char* msg,
+ const XalanNode* sourceNode = 0,
+ const ElemTemplateElement* styleNode = 0) const;
// These interfaces are inherited from StylesheetConstructionContext...
@@ -224,21 +224,25 @@
virtual XPath*
createMatchPattern(
+ const Locator* locator,
const XalanDOMString& str,
const PrefixResolver& resolver);
virtual XPath*
createMatchPattern(
+ const Locator* locator,
const XalanDOMChar* str,
const PrefixResolver& resolver);
virtual XPath*
createXPath(
+ const Locator* locator,
const XalanDOMString& str,
const PrefixResolver& resolver);
virtual XPath*
createXPath(
+ const Locator* locator,
const XalanDOMChar* str,
const PrefixResolver& resolver);
1.66 +1 -1 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.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- StylesheetHandler.cpp 2001/06/29 18:52:05 1.65
+++ StylesheetHandler.cpp 2001/07/12 05:06:02 1.66
@@ -1253,7 +1253,7 @@
* to make sure it's a WildcardName.
*/
const XPath* const matchPat =
-
m_constructionContext.createMatchPattern(wildcardName, nsNode);
+
m_constructionContext.createMatchPattern(0, wildcardName, nsNode);
if(Constants::ELEMNAME_PRESERVESPACE ==
xslToken)
{
1.107 +286 -252 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.106
retrieving revision 1.107
diff -u -r1.106 -r1.107
--- XSLTEngineImpl.cpp 2001/07/08 18:48:40 1.106
+++ XSLTEngineImpl.cpp 2001/07/12 05:06:03 1.107
@@ -261,128 +261,114 @@
StylesheetConstructionContext& constructionContext,
StylesheetExecutionContext&
executionContext)
{
- try
+ XalanDOMString xslIdentifier;
+
+ if (0 == stylesheetSource.getSystemId())
{
- XalanDOMString xslIdentifier;
+ xslIdentifier = XalanDOMString(XALAN_STATIC_UCODE_STRING("Input
XSL"));
+ }
+ else
+ {
+ xslIdentifier = stylesheetSource.getSystemId();
+ }
- if (0 == stylesheetSource.getSystemId())
- {
- xslIdentifier =
XalanDOMString(XALAN_STATIC_UCODE_STRING("Input XSL"));
- }
- else
- {
- xslIdentifier = stylesheetSource.getSystemId();
- }
+ bool totalTimeID = true;
- bool totalTimeID = true;
+ pushTime(&totalTimeID);
- pushTime(&totalTimeID);
+ XalanNode* sourceTree = getSourceTreeFromInput(inputSource);
- XalanNode* sourceTree =
getSourceTreeFromInput(inputSource);
+ m_stylesheetRoot = processStylesheet(stylesheetSource,
constructionContext);
- try
- {
- m_stylesheetRoot = processStylesheet(stylesheetSource,
constructionContext);
- }
- catch(const XSLException&)
- {
- }
- catch(const SAXException&)
- {
- }
- catch(const XMLException&)
- {
- }
-
- if(0 != sourceTree && m_stylesheetRoot == 0)
- {
- // Didn't get a stylesheet from the input source, so
look for a
- // stylesheet processing instruction...
- XalanDOMString stylesheetURI;
+ if(0 != sourceTree && m_stylesheetRoot == 0)
+ {
+ // Didn't get a stylesheet from the input source, so look for a
+ // stylesheet processing instruction...
+ XalanDOMString stylesheetURI;
- // The PI must be a child of the document...
- XalanNode* child =
sourceTree->getFirstChild();
+ // The PI must be a child of the document...
+ XalanNode* child =
sourceTree->getFirstChild();
#if !defined(XALAN_NO_NAMESPACES)
- using std::vector;
+ using std::vector;
#endif
+
+ vector<XalanDOMString> hrefs;
- vector<XalanDOMString> hrefs;
+ // $$$ ToDo: is this first one style valid?
+ const XalanDOMString
stylesheetNodeName1(XALAN_STATIC_UCODE_STRING("xml-stylesheet"));
+ const XalanDOMString
stylesheetNodeName2(XALAN_STATIC_UCODE_STRING("xml:stylesheet"));
- // $$$ ToDo: is this first one style valid?
- const XalanDOMString
stylesheetNodeName1(XALAN_STATIC_UCODE_STRING("xml-stylesheet"));
- const XalanDOMString
stylesheetNodeName2(XALAN_STATIC_UCODE_STRING("xml:stylesheet"));
-
- // $$$ ToDo: This code is much like that in
getStyleSheetURIFromDoc().
- // Why is it repeated???
- // $$$ ToDo: Move these embedded strings from inside
these loops
- // out here...
- // $$$ ToDo: These loops are a mess of repeated use of
the
- // same data values.
- while(child != 0)
+ // $$$ ToDo: This code is much like that in
getStyleSheetURIFromDoc().
+ // Why is it repeated???
+ // $$$ ToDo: Move these embedded strings from inside these loops
+ // out here...
+ // $$$ ToDo: These loops are a mess of repeated use of the
+ // same data values.
+ while(child != 0)
+ {
+ if(XalanNode::PROCESSING_INSTRUCTION_NODE ==
child->getNodeType())
{
- if(XalanNode::PROCESSING_INSTRUCTION_NODE ==
child->getNodeType())
- {
- const XalanDOMString
nodeName(child->getNodeName());
+ const XalanDOMString
nodeName(child->getNodeName());
- if(equals(nodeName,
stylesheetNodeName1) ||
- equals(nodeName,
stylesheetNodeName2))
- {
- bool isOK = true;
+ if(equals(nodeName, stylesheetNodeName1) ||
+ equals(nodeName, stylesheetNodeName2))
+ {
+ bool isOK = true;
- StringTokenizer
tokenizer(child->getNodeValue(), XALAN_STATIC_UCODE_STRING(" \t="));
+ StringTokenizer
tokenizer(child->getNodeValue(), XALAN_STATIC_UCODE_STRING(" \t="));
- while(tokenizer.hasMoreTokens())
+ while(tokenizer.hasMoreTokens())
+ {
+
if(equals(tokenizer.nextToken(), XALAN_STATIC_UCODE_STRING("type")))
{
-
if(equals(tokenizer.nextToken(), XALAN_STATIC_UCODE_STRING("type")))
- {
- XalanDOMString
typeVal = tokenizer.nextToken();
+ XalanDOMString typeVal
= tokenizer.nextToken();
- typeVal =
substring(typeVal, 1, length(typeVal) - 1);
+ typeVal =
substring(typeVal, 1, length(typeVal) - 1);
-
if(!equals(typeVal, XALAN_STATIC_UCODE_STRING("text/xsl")))
- {
- isOK =
false;
- }
+ if(!equals(typeVal,
XALAN_STATIC_UCODE_STRING("text/xsl")))
+ {
+ isOK = false;
}
- }
+ }
+ }
- if(isOK)
+ if(isOK)
+ {
+ StringTokenizer
tokenizer(child->getNodeValue(), XALAN_STATIC_UCODE_STRING(" \t="));
+
+ while(tokenizer.hasMoreTokens())
{
- StringTokenizer
tokenizer(child->getNodeValue(), XALAN_STATIC_UCODE_STRING(" \t="));
+ const XalanDOMString
theCurrentToken = tokenizer.nextToken();
-
while(tokenizer.hasMoreTokens())
+
if(equals(theCurrentToken, XALAN_STATIC_UCODE_STRING("href")))
{
- const
XalanDOMString theCurrentToken = tokenizer.nextToken();
-
-
if(equals(theCurrentToken, XALAN_STATIC_UCODE_STRING("href")))
- {
-
stylesheetURI = tokenizer.nextToken();
-
stylesheetURI = substring(stylesheetURI, 1, length(stylesheetURI) - 1);
-
hrefs.push_back(stylesheetURI);
- }
+ stylesheetURI =
tokenizer.nextToken();
+ stylesheetURI =
substring(stylesheetURI, 1, length(stylesheetURI) - 1);
+
hrefs.push_back(stylesheetURI);
}
}
}
}
-
- child = child->getNextSibling();
}
+
+ child = child->getNextSibling();
+ }
- bool isRoot = true;
- Stylesheet* prevStylesheet = 0;
+ bool isRoot = true;
+ Stylesheet* prevStylesheet = 0;
- if (hrefs.empty() == false)
- {
- const XalanDOMChar* const pxch =
inputSource.getSystemId();
+ if (hrefs.empty() == false)
+ {
+ const XalanDOMChar* const pxch =
inputSource.getSystemId();
- const XalanDOMString sysid(pxch == 0
? &s_dummyString : pxch);
+ const XalanDOMString sysid(pxch == 0 ?
&s_dummyString : pxch);
- do
- {
- const XalanDOMString& ref =
hrefs.back();
+ do
+ {
+ const XalanDOMString& ref = hrefs.back();
- Stylesheet* stylesheet =
+ Stylesheet* stylesheet =
getStylesheetFromPIURL(
ref,
*sourceTree,
@@ -390,53 +376,40 @@
isRoot,
constructionContext);
- if(false == isRoot)
- {
-
prevStylesheet->addImport(stylesheet, false);
- }
+ if(false == isRoot)
+ {
+ prevStylesheet->addImport(stylesheet,
false);
+ }
- prevStylesheet = stylesheet;
- isRoot = false;
- hrefs.pop_back();
- } while(!hrefs.empty());
- }
+ prevStylesheet = stylesheet;
+ isRoot = false;
+ hrefs.pop_back();
+ } while(!hrefs.empty());
}
+ }
- if(0 == m_stylesheetRoot)
- {
- error("Failed to process stylesheet!");
- }
- else if(0 != sourceTree)
- {
- executionContext.setStylesheetRoot(m_stylesheetRoot);
+ if(0 == m_stylesheetRoot)
+ {
+ error("Failed to process stylesheet!");
+ }
+ else if(0 != sourceTree)
+ {
+ executionContext.setStylesheetRoot(m_stylesheetRoot);
- FormatterListener* const theFormatter =
+ FormatterListener* const theFormatter =
outputTarget.getDocumentHandler();
-
- if (theFormatter != 0)
- {
- theFormatter->setPrefixResolver(this);
- }
-
- m_stylesheetRoot->process(sourceTree, outputTarget,
executionContext);
- if(0 != m_diagnosticsPrintWriter)
- {
-
displayDuration(StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("Total
time")), &totalTimeID);
- }
+ if (theFormatter != 0)
+ {
+ theFormatter->setPrefixResolver(this);
}
- }
- catch(SAXException& se)
- {
- message("SAX Exception");
- throw se;
- }
- catch (...)
- {
- message("Unknown Exception");
+ m_stylesheetRoot->process(sourceTree, outputTarget,
executionContext);
- throw;
+ if(0 != m_diagnosticsPrintWriter)
+ {
+
displayDuration(StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("Total
time")), &totalTimeID);
+ }
}
}
@@ -488,18 +461,9 @@
const XalanDOMString& xsldocURLString,
StylesheetConstructionContext& constructionContext)
{
- try
- {
- XSLTInputSource input(c_wstr(xsldocURLString));
-
- return processStylesheet(input, constructionContext);
- }
- catch(SAXException& se)
- {
- message("processStylesheet not successfull!");
+ const XSLTInputSource input(c_wstr(xsldocURLString));
- throw se;
- }
+ return processStylesheet(input, constructionContext);
return 0;
}
@@ -520,55 +484,37 @@
{
XalanDOMString xslIdentifier;
- try
- {
- theStylesheet =
constructionContext.create(stylesheetSource);
+ theStylesheet = constructionContext.create(stylesheetSource);
- StylesheetHandler
stylesheetProcessor(*theStylesheet, constructionContext);
+ StylesheetHandler stylesheetProcessor(*theStylesheet,
constructionContext);
- if(stylesheetNode != 0)
- {
- xslIdentifier =
XALAN_STATIC_UCODE_STRING("Input XSL");
+ if(stylesheetNode != 0)
+ {
+ xslIdentifier = XALAN_STATIC_UCODE_STRING("Input XSL");
- FormatterTreeWalker tw(stylesheetProcessor);
+ FormatterTreeWalker tw(stylesheetProcessor);
- tw.traverse(stylesheetSource.getNode());
- }
- else
+ tw.traverse(stylesheetSource.getNode());
+ }
+ else
+ {
+ if (systemID != 0)
{
- if (systemID != 0)
- {
- xslIdentifier = systemID;
- }
-
- diag(XALAN_STATIC_UCODE_STRING("=========
Parsing ") + xslIdentifier + XALAN_STATIC_UCODE_STRING(" =========="));
- pushTime(&xslIdentifier);
- m_parserLiaison.parseXMLStream(stylesheetSource,
-
stylesheetProcessor);
- if(0 != m_diagnosticsPrintWriter)
-
displayDuration(XALAN_STATIC_UCODE_STRING("Parse of ") + xslIdentifier,
&xslIdentifier);
+ xslIdentifier = systemID;
}
- theStylesheet->postConstruction(constructionContext);
- }
- catch(const XSLException&)
- {
- message("Error parsing " + xslIdentifier);
+ diag(XALAN_STATIC_UCODE_STRING("========= Parsing ") +
xslIdentifier + XALAN_STATIC_UCODE_STRING(" =========="));
- throw;
- }
- catch(const SAXException&)
- {
- message("Error parsing " + xslIdentifier);
+ pushTime(&xslIdentifier);
- throw;
- }
- catch(const XMLException&)
- {
- message("Error parsing " + xslIdentifier);
+ m_parserLiaison.parseXMLStream(stylesheetSource,
+
stylesheetProcessor);
- throw;
+ if(0 != m_diagnosticsPrintWriter)
+
displayDuration(XALAN_STATIC_UCODE_STRING("Parse of ") + xslIdentifier,
&xslIdentifier);
}
+
+ theStylesheet->postConstruction(constructionContext);
}
return theStylesheet;
@@ -593,40 +539,34 @@
// In case we have a fragment identifier, go ahead and
// try to parse the XML here.
- try
- {
- diag(XALAN_STATIC_UCODE_STRING("========= Parsing ") +
+ diag(XALAN_STATIC_UCODE_STRING("========= Parsing ") +
xmlIdentifier +
XALAN_STATIC_UCODE_STRING("
=========="));
- pushTime(&xmlIdentifier);
+ pushTime(&xmlIdentifier);
#if defined(XALAN_VQ_SPECIAL_TRACE)
- QuantifyStartRecordingData();
+ QuantifyStartRecordingData();
#endif
- XalanDocument* const theDocument =
+
+ XalanDocument* const theDocument =
m_parserLiaison.parseXMLStream(inputSource,
xmlIdentifier);
- assert(theDocument != 0);
+ assert(theDocument != 0);
#if defined(XALAN_VQ_SPECIAL_TRACE)
- QuantifyStopRecordingData();
+ QuantifyStopRecordingData();
#endif
- if(0 != m_diagnosticsPrintWriter)
-
displayDuration(XALAN_STATIC_UCODE_STRING("Parse of ") +
-
xmlIdentifier,
- &xmlIdentifier);
-
- m_xpathEnvSupport.setSourceDocument(xmlIdentifier,
theDocument);
-
- sourceTree = theDocument;
- }
- // catch(Exception e)
- // $$$ ToDo: Fix this!!!
- catch(...)
+ if(0 != m_diagnosticsPrintWriter)
{
- error("Could not parse " + xmlIdentifier + "
document!");
+ displayDuration(
+ XALAN_STATIC_UCODE_STRING("Parse of ") +
xmlIdentifier,
+ &xmlIdentifier);
}
+
+ m_xpathEnvSupport.setSourceDocument(xmlIdentifier, theDocument);
+
+ sourceTree = theDocument;
}
return sourceTree;
@@ -1229,22 +1169,21 @@
void
XSLTEngineImpl::message(
const XalanDOMString& msg,
- const XalanNode* styleNode,
- const XalanNode* sourceNode) const
+ const XalanNode* sourceNode,
+ const XalanNode* styleNode) const
{
- if (m_problemListener != 0)
- {
- const bool shouldThrow =
-
m_problemListener->problem(ProblemListener::eXSLPROCESSOR,
-
ProblemListener::eMESSAGE,
-
styleNode, sourceNode,
- msg,
0, 0, 0);
+ problem(msg, ProblemListener::eMESSAGE, sourceNode, styleNode);
+}
- if(shouldThrow == true)
- {
- throw XSLTProcessorException(msg);
- }
- }
+
+
+void
+XSLTEngineImpl::message(
+ const XalanDOMString& msg,
+ const XalanNode* sourceNode,
+ const ElemTemplateElement* styleNode) const
+{
+ problem(msg, ProblemListener::eMESSAGE, sourceNode, styleNode);
}
@@ -1264,31 +1203,114 @@
XSLTEngineImpl::problem(
const XalanDOMString& msg,
ProblemListener::eClassification classification,
- const XalanNode*
styleNode,
- const XalanNode*
sourceNode) const
+ const XalanNode*
sourceNode,
+ const XalanNode*
styleNode) const
{
- if (m_problemListener == 0) return;
+ const Locator* const locator = getLocatorFromStack();
+
+ const XalanDOMChar* id = 0;
+
+ XalanDOMString uri;
+
+ int lineNumber = -1;
+ int columnNumber = -1;
+
+ if (locator != 0)
+ {
+ id = locator->getPublicId();
+
+ if (id == 0)
+ {
+ id = locator->getSystemId();
+ }
+
+ if (id != 0)
+ {
+ uri = id;
+ }
+
+ lineNumber = locator->getLineNumber();
+ columnNumber = locator->getColumnNumber();
+ }
+ if (m_problemListener != 0)
+ {
+ m_problemListener->problem(
+ ProblemListener::eXSLPROCESSOR,
+ classification,
+ styleNode,
+ sourceNode,
+ msg,
+ id,
+ lineNumber,
+ columnNumber);
+ }
+
+ if (classification == ProblemListener::eERROR)
+ {
+ throw XSLTProcessorException(msg, uri, lineNumber,
columnNumber);
+ }
+}
+
+
+
+void
+XSLTEngineImpl::problem(
+ const XalanDOMString& msg,
+ ProblemListener::eClassification classification,
+ const XalanNode*
sourceNode,
+ const ElemTemplateElement*
styleNode) const
+{
const Locator* const locator = getLocatorFromStack();
+
+ const XalanDOMChar* id = 0;
+
+ XalanDOMString uri;
+
+ int lineNumber = -1;
+ int columnNumber = -1;
+
+ if (locator != 0)
+ {
+ id = locator->getPublicId();
+
+ if (id == 0)
+ {
+ id = locator->getSystemId();
+ }
+
+ if (id != 0)
+ {
+ uri = id;
+ }
+
+ lineNumber = locator->getLineNumber();
+ columnNumber = locator->getColumnNumber();
+ }
+ else if (styleNode != 0)
+ {
+ lineNumber = styleNode->getLineNumber();
+ columnNumber = styleNode->getColumnNumber();
- const XalanDOMChar* id = (0 == locator) ?
- 0 : (0 ==
locator->getPublicId()) ?
- locator->getPublicId() :
locator->getSystemId();
+ uri = styleNode->getURI();
+ }
- const bool shouldThrow =
+ if (m_problemListener != 0)
+ {
m_problemListener->problem(
- ProblemListener::eXSLPROCESSOR,
- classification,
- styleNode,
- sourceNode,
- msg,
- id,
- (0 == locator) ? 0: locator->getLineNumber(),
- (0 == locator) ? 0: locator->getColumnNumber());
+ ProblemListener::eXSLPROCESSOR,
+ classification,
+ styleNode,
+ sourceNode,
+ msg,
+ id,
+ lineNumber,
+ columnNumber);
+ }
- if(shouldThrow == true)
+ if (classification == ProblemListener::eERROR)
{
- throw XSLTProcessorException(msg);
+ throw XSLTProcessorException(msg, uri, lineNumber,
columnNumber);
}
}
@@ -1297,10 +1319,21 @@
void
XSLTEngineImpl::warn(
const XalanDOMString& msg,
- const XalanNode* styleNode,
- const XalanNode* sourceNode) const
+ const XalanNode* sourceNode,
+ const XalanNode* styleNode) const
+{
+ problem(msg, ProblemListener::eWARNING, sourceNode, styleNode);
+}
+
+
+
+void
+XSLTEngineImpl::warn(
+ const XalanDOMString& msg,
+ const XalanNode* sourceNode,
+ const ElemTemplateElement* styleNode) const
{
- problem(msg, ProblemListener::eWARNING, styleNode, sourceNode);
+ problem(msg, ProblemListener::eWARNING, sourceNode, styleNode);
}
@@ -1319,10 +1352,21 @@
void
XSLTEngineImpl::error(
const XalanDOMString& msg,
- const XalanNode* styleNode,
- const XalanNode* sourceNode) const
+ const XalanNode* sourceNode,
+ const XalanNode* styleNode) const
+{
+ problem(msg, ProblemListener::eERROR, sourceNode, styleNode);
+}
+
+
+
+void
+XSLTEngineImpl::error(
+ const XalanDOMString& msg,
+ const XalanNode* sourceNode,
+ const ElemTemplateElement* styleNode) const
{
- problem(msg, ProblemListener::eERROR, styleNode, sourceNode);
+ problem(msg, ProblemListener::eERROR, sourceNode, styleNode);
}
@@ -1339,43 +1383,31 @@
void
-XSLTEngineImpl::pushTime(const void* key) const
+XSLTEngineImpl::pushTime(const void* key)
{
if(0 != key)
{
-#if defined(XALAN_NO_MUTABLE)
-
((XSLTEngineImpl*)this)->m_durationsTable.insert(DurationsTableMapType::value_type(key,
clock()));
-#else
- m_durationsTable.insert(DurationsTableMapType::value_type(key,
clock()));
-#endif
+ m_durationsTable[key] = clock();
}
}
clock_t
-XSLTEngineImpl::popDuration(const void* key) const
+XSLTEngineImpl::popDuration(const void* key)
{
clock_t clockTicksDuration = 0;
if(0 != key)
{
const DurationsTableMapType::iterator i =
-#if defined(XALAN_NO_MUTABLE)
-
((XSLTEngineImpl*)this)->m_durationsTable.find(key);
-#else
m_durationsTable.find(key);
-#endif
if (i != m_durationsTable.end())
{
clockTicksDuration = clock() - (*i).second;
-#if defined(XALAN_NO_MUTABLE)
- ((XSLTEngineImpl*)this)->m_durationsTable.erase(i);
-#else
m_durationsTable.erase(i);
-#endif
}
}
@@ -1387,7 +1419,7 @@
void
XSLTEngineImpl::displayDuration(
const XalanDOMString& info,
- const void* key) const
+ const void* key)
{
if(0 != key)
{
@@ -2664,7 +2696,8 @@
m_xpathProcessor->initXPath(*theXPath,
str,
-
*executionContext.getPrefixResolver());
+
*executionContext.getPrefixResolver(),
+
getLocatorFromStack());
return theXPath->execute(executionContext.getCurrentNode(),
*executionContext.getPrefixResolver(),
@@ -2687,7 +2720,8 @@
m_xpathProcessor->initXPath(*theXPath,
str,
- prefixResolver);
+ prefixResolver,
+
getLocatorFromStack());
return theXPath->execute(contextNode, prefixResolver, executionContext);
}
@@ -2721,7 +2755,7 @@
{
XPath* const xpath = m_xpathFactory.create();
- m_xpathProcessor->initMatchPattern(*xpath, str, resolver);
+ m_xpathProcessor->initMatchPattern(*xpath, str, resolver,
getLocatorFromStack());
return xpath;
}
1.72 +50 -35 xml-xalan/c/src/XSLT/XSLTEngineImpl.hpp
Index: XSLTEngineImpl.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTEngineImpl.hpp,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -r1.71 -r1.72
--- XSLTEngineImpl.hpp 2001/07/01 14:43:17 1.71
+++ XSLTEngineImpl.hpp 2001/07/12 05:06:04 1.72
@@ -748,70 +748,77 @@
virtual void
message(
const XalanDOMString& msg,
- const XalanNode* styleNode = 0,
- const XalanNode* sourceNode = 0) const;
+ const XalanNode* sourceNode = 0,
+ const XalanNode* styleNode = 0) const;
virtual void
message(
- const char* msg,
- const XalanNode* styleNode = 0,
- const XalanNode* sourceNode = 0) const;
+ const XalanDOMString& msg,
+ const XalanNode* sourceNode,
+ const ElemTemplateElement* styleNode) const;
/**
- * Tell the user of an warning, and probably throw an exception.
+ * Report a message
*
* @param msg text of message to output
* @param sourceNode node in source where error occurred
* @param styleNode node in stylesheet where error occurred
- * @exception XSLProcessorException
*/
virtual void
+ message(
+ const char* msg,
+ const XalanNode* sourceNode = 0,
+ const XalanNode* styleNode = 0) const;
+
+ virtual void
warn(
const XalanDOMString& msg,
- const XalanNode* styleNode = 0,
- const XalanNode* sourceNode = 0) const;
+ const XalanNode* sourceNode = 0,
+ const XalanNode* styleNode = 0) const;
+
+ virtual void
+ warn(
+ const XalanDOMString& msg,
+ const XalanNode* sourceNode,
+ const ElemTemplateElement* styleNode) const;
/**
- * Tell the user of an warning, and probably throw an exception.
+ * Report a warning.
*
* @param msg text of message to output
* @param sourceNode node in source where error occurred
* @param styleNode node in stylesheet where error occurred
- * @exception XSLProcessorException
*/
virtual void
warn(
const char* msg,
- const XalanNode* styleNode = 0,
- const XalanNode* sourceNode = 0) const;
+ const XalanNode* sourceNode = 0,
+ const XalanNode* styleNode = 0) const;
- /**
- * Tell the user of an error, and probably throw an exception.
- *
- * @param msg text of message to output
- * @param sourceNode node in source where error occurred
- * @param styleNode node in stylesheet where error occurred
- * @exception XSLProcessorException
- */
virtual void
error(
const XalanDOMString& msg,
- const XalanNode* styleNode = 0,
- const XalanNode* sourceNode = 0) const;
+ const XalanNode* sourceNode = 0,
+ const XalanNode* styleNode = 0) const;
+
+ virtual void
+ error(
+ const XalanDOMString& msg,
+ const XalanNode* sourceNode,
+ const ElemTemplateElement* styleNode) const;
/**
- * Tell the user of an error, and probably throw an exception.
+ * Report an error, and throw an exception.
*
* @param msg text of message to output
* @param sourceNode node in source where error occurred
* @param styleNode node in stylesheet where error occurred
- * @exception XSLProcessorException
*/
virtual void
error(
const char* msg,
- const XalanNode* styleNode = 0,
- const XalanNode* sourceNode = 0) const;
+ const XalanNode* sourceNode = 0,
+ const XalanNode* styleNode = 0) const;
/**
* Mark the time, so that displayDuration can later display the elapsed
@@ -820,7 +827,7 @@
* @param theKey pointer to element to push
*/
void
- pushTime(const void* key) const;
+ pushTime(const void* key);
/**
* Returns the duration since pushTime was called for element
@@ -829,7 +836,7 @@
* @param key pointer to element involved
*/
clock_t
- popDuration(const void* key) const;
+ popDuration(const void* key);
/**
* Display the duration since pushTime was called for element in
@@ -841,7 +848,7 @@
void
displayDuration(
const XalanDOMString& info,
- const void* key) const;
+ const void* key);
/**
@@ -850,7 +857,9 @@
* @return true for diagnostics output
*/
bool doDiagnosticsOutput()
- { return 0 != m_diagnosticsPrintWriter; }
+ {
+ return 0 != m_diagnosticsPrintWriter ? true : false;
+ }
/**
* Print a diagnostics string to the output device
@@ -1568,7 +1577,7 @@
PrintWriter* m_diagnosticsPrintWriter;
/* For diagnostics */
- mutable DurationsTableMapType m_durationsTable;
+ DurationsTableMapType m_durationsTable;
/**
* List of listeners who are interested in tracing what's
@@ -1581,9 +1590,15 @@
problem(
const XalanDOMString& msg,
ProblemListener::eClassification classification,
- const XalanNode*
styleNode = 0,
- const XalanNode*
sourceNode = 0) const;
+ const XalanNode*
sourceNode,
+ const XalanNode*
styleNode) const;
+ void
+ problem(
+ const XalanDOMString& msg,
+ ProblemListener::eClassification classification,
+ const XalanNode*
sourceNode,
+ const ElemTemplateElement*
styleNode) const;
//==========================================================
// SECTION: Function to do with attribute handling
@@ -1593,7 +1608,7 @@
* This is used whenever a unique namespace is needed.
*/
unsigned long m_uniqueNSValue;
-
+
ParamVectorType m_topLevelParams;
public:
1.23 +48 -11 xml-xalan/c/src/XSLT/XSLTProcessor.hpp
Index: XSLTProcessor.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTProcessor.hpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- XSLTProcessor.hpp 2001/06/14 19:28:28 1.22
+++ XSLTProcessor.hpp 2001/07/12 05:06:05 1.23
@@ -421,7 +421,7 @@
setDiagnosticsOutput(PrintWriter* pw) = 0;
/**
- * Give the user a message.
+ * Report a message.
*
* @param msg text of message to output
* @param sourceNode node in source where message occurred
@@ -430,36 +430,73 @@
virtual void
message(
const XalanDOMString& msg,
- const XalanNode* styleNode = 0,
- const XalanNode* sourceNode = 0) const =
0;
+ const XalanNode* sourceNode = 0,
+ const XalanNode* styleNode = 0) const =
0;
/**
- * Tell the user of an warning, and probably throw an exception.
+ * Report a message.
*
* @param msg text of message to output
+ * @param sourceNode node in source where message occurred
+ * @param styleNode node in stylesheet where message occurred
+ */
+ virtual void
+ message(
+ const XalanDOMString& msg,
+ const XalanNode* sourceNode,
+ const ElemTemplateElement* styleNode) const = 0;
+
+ /**
+ * Report a warning.
+ *
+ * @param msg text of message to output
* @param sourceNode node in source where error occurred
* @param styleNode node in stylesheet where error occurred
- * @exception XSLProcessorException
*/
virtual void
warn(
const XalanDOMString& msg,
- const XalanNode* styleNode = 0,
- const XalanNode* sourceNode = 0) const =
0;
+ const XalanNode* sourceNode = 0,
+ const XalanNode* styleNode = 0) const =
0;
/**
- * Tell the user of an error, and probably throw an exception.
+ * Report a warning.
*
* @param msg text of message to output
* @param sourceNode node in source where error occurred
* @param styleNode node in stylesheet where error occurred
- * @exception XSLProcessorException
*/
virtual void
+ warn(
+ const XalanDOMString& msg,
+ const XalanNode* sourceNode,
+ const ElemTemplateElement* styleNode) const = 0;
+
+ /**
+ * Report an error and throw an exception.
+ *
+ * @param msg text of message to output
+ * @param sourceNode node in source where error occurred
+ * @param styleNode node in stylesheet where error occurred
+ */
+ virtual void
error(
const XalanDOMString& msg,
- const XalanNode* styleNode = 0,
- const XalanNode* sourceNode = 0) const =
0;
+ const XalanNode* sourceNode = 0,
+ const XalanNode* styleNode = 0) const =
0;
+
+ /**
+ * Report an error and throw an exception.
+ *
+ * @param msg text of message to output
+ * @param sourceNode node in source where error occurred
+ * @param styleNode node in stylesheet where error occurred
+ */
+ virtual void
+ error(
+ const XalanDOMString& msg,
+ const XalanNode* sourceNode,
+ const ElemTemplateElement* styleNode) const = 0;
};
1.4 +12 -0 xml-xalan/c/src/XSLT/XSLTProcessorException.cpp
Index: XSLTProcessorException.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTProcessorException.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XSLTProcessorException.cpp 2000/11/02 01:46:28 1.3
+++ XSLTProcessorException.cpp 2001/07/12 05:06:06 1.4
@@ -65,6 +65,18 @@
XSLTProcessorException::XSLTProcessorException(
const XalanDOMString& theMessage,
+ const XalanDOMString& theURI,
+ int theLineNumber,
+ int theColumnNumber,
+ const XalanDOMString& theType) :
+ XSLException(theMessage, theURI, theLineNumber, theColumnNumber,
theType)
+{
+}
+
+
+
+XSLTProcessorException::XSLTProcessorException(
+ const XalanDOMString& theMessage,
const XalanDOMString& theType) :
XSLException(theMessage, theType)
{
1.5 +17 -2 xml-xalan/c/src/XSLT/XSLTProcessorException.hpp
Index: XSLTProcessorException.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTProcessorException.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XSLTProcessorException.hpp 2000/11/02 01:46:28 1.4
+++ XSLTProcessorException.hpp 2001/07/12 05:06:07 1.5
@@ -77,8 +77,23 @@
* Construct an XSLT Processor exception object
*
* @param theMessage message to print when exception thrown
- * @param theType type of exception string, default
- * "XSLTProcessorException"
+ * @param theURI the URI of the related document, if known
+ * @param theLineNumber the line number of the related document, or -1
if not known
+ * @param theColumnNumber the column number of the related document, or
-1 if not known
+ * @param theType type of exception string, default is
"XSLTProcessorException"
+ */
+ XSLTProcessorException(
+ const XalanDOMString& theMessage,
+ const XalanDOMString& theURI,
+ int theLineNumber,
+ int theColumnNumber,
+ const XalanDOMString& theType =
XalanDOMString(XALAN_STATIC_UCODE_STRING("XSLTProcessorException")));
+
+ /**
+ * Construct an XSLT Processor exception object
+ *
+ * @param theMessage message to print when exception thrown
+ * @param theType type of exception string, default is
"XSLTProcessorException"
*/
XSLTProcessorException(
const XalanDOMString& theMessage,
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]