You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2001/01/03 20:32:53 UTC
cvs commit: xml-xalan/c/src/XSLT ElemApplyImport.cpp ElemNumber.cpp StylesheetExecutionContext.hpp StylesheetExecutionContextDefault.cpp StylesheetExecutionContextDefault.hpp XSLTEngineImpl.cpp XSLTEngineImpl.hpp
dbertoni 01/01/03 11:32:53
Modified: c/src/TestXPath TestXPath.cpp
c/src/XPath FunctionID.cpp FunctionID.hpp FunctionLang.cpp
FunctionLocalName.cpp FunctionName.cpp
FunctionNamespaceURI.cpp FunctionSum.cpp
SimpleNodeLocator.cpp XObject.cpp XObject.hpp
XPath.cpp XPathExecutionContext.hpp
XPathExecutionContextDefault.cpp
XPathExecutionContextDefault.hpp XPathSupport.hpp
XPathSupportDefault.cpp XPathSupportDefault.hpp
c/src/XSLT ElemApplyImport.cpp ElemNumber.cpp
StylesheetExecutionContext.hpp
StylesheetExecutionContextDefault.cpp
StylesheetExecutionContextDefault.hpp
XSLTEngineImpl.cpp XSLTEngineImpl.hpp
Log:
Performance tweaks requiring that XObject comparison functions be passed an XPathExecutionContext instance. Made some DOMServices static functions inline, and removed the virtual calls into the support objects.
Revision Changes Path
1.26 +1 -1 xml-xalan/c/src/TestXPath/TestXPath.cpp
Index: TestXPath.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/TestXPath/TestXPath.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- TestXPath.cpp 2000/11/30 21:09:42 1.25
+++ TestXPath.cpp 2001/01/03 19:32:34 1.26
@@ -766,7 +766,7 @@
thePrintWriter.println(XALAN_STATIC_UCODE_STRING(" failed!"));
}
- if (theResult1->equals(*theResult2) == true)
+ if (theResult1->equals(*theResult2, theExecutionContext) == true)
{
thePrintWriter.print(XALAN_STATIC_UCODE_STRING("theResult1 is equal to theResult2"));
thePrintWriter.println();
1.6 +105 -2 xml-xalan/c/src/XPath/FunctionID.cpp
Index: FunctionID.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionID.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FunctionID.cpp 2000/12/06 21:00:23 1.5
+++ FunctionID.cpp 2001/01/03 19:32:36 1.6
@@ -58,6 +58,10 @@
+#include <DOMSupport/DOMServices.hpp>
+
+
+
#include "XObjectFactory.hpp"
@@ -157,8 +161,7 @@
{
thePreviousTokens.insert(theToken);
- XalanNode* const theNode =
- executionContext.getElementByID(theToken, *theDocContext);
+ XalanNode* const theNode = theDocContext->getElementById(theToken);
if (theNode != 0)
{
@@ -236,3 +239,103 @@
"The id() function takes one argument!");
}
+
+
+FunctionID::FunctionIDXObjectTypeCallback::FunctionIDXObjectTypeCallback(XPathExecutionContext& theExecutionContext) :
+ XObjectTypeCallback(),
+ m_resultString(),
+ m_executionContext(theExecutionContext)
+{
+}
+
+
+
+const XalanDOMString&
+FunctionID::FunctionIDXObjectTypeCallback::processCallback(const XObject& theXObject)
+{
+ theXObject.ProcessXObjectTypeCallback(*this);
+
+ return m_resultString;
+}
+
+
+
+void
+FunctionID::FunctionIDXObjectTypeCallback::Number(
+ const XObject& theXObject,
+ double /* theValue */)
+{
+ m_resultString = theXObject.str();
+}
+
+
+
+void
+FunctionID::FunctionIDXObjectTypeCallback::Boolean(
+ const XObject& theXObject,
+ bool /* theValue */)
+{
+ m_resultString = theXObject.str();
+}
+
+
+
+void
+FunctionID::FunctionIDXObjectTypeCallback::String(
+ const XObject& theXObject,
+ const XalanDOMString& /* theValue */)
+{
+ m_resultString = theXObject.str();
+}
+
+
+
+void
+FunctionID::FunctionIDXObjectTypeCallback::ResultTreeFragment(
+ const XObject& theXObject,
+ const ResultTreeFragBase& /* theValue */)
+{
+ m_resultString = theXObject.str();
+}
+
+
+
+void
+FunctionID::FunctionIDXObjectTypeCallback::ResultTreeFragment(
+ const XObject& theXObject,
+ ResultTreeFragBase& /* theValue */)
+{
+ m_resultString = theXObject.str();
+}
+
+
+
+void
+FunctionID::FunctionIDXObjectTypeCallback::NodeSet(
+ const XObject& /* theXObject */,
+ const NodeRefListBase& theValue)
+{
+ const unsigned int theNodeCount = theValue.getLength();
+
+ for (unsigned int i = 0 ; i < theNodeCount; i++)
+ {
+ DOMServices::getNodeData(*theValue.item(i), m_resultString);
+
+ append(m_resultString, XalanDOMChar(XalanUnicode::charSpace));
+ }
+}
+
+
+
+void
+FunctionID::FunctionIDXObjectTypeCallback::Unknown(
+ const XObject& /* theObject */,
+ const XalanDOMString& /* theName */)
+{
+}
+
+
+void
+FunctionID::FunctionIDXObjectTypeCallback::Null(const XObject& /* theObject */)
+{
+}
1.20 +24 -56 xml-xalan/c/src/XPath/FunctionID.hpp
Index: FunctionID.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionID.hpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- FunctionID.hpp 2000/12/06 21:00:24 1.19
+++ FunctionID.hpp 2001/01/03 19:32:37 1.20
@@ -150,82 +150,50 @@
{
public:
- FunctionIDXObjectTypeCallback(XPathExecutionContext& theExecutionContext) :
- XObjectTypeCallback(),
- m_resultString(),
- m_executionContext(theExecutionContext)
- {
- }
+ FunctionIDXObjectTypeCallback(XPathExecutionContext& theExecutionContext);
const XalanDOMString&
- processCallback(const XObject& theXObject)
- {
- theXObject.ProcessXObjectTypeCallback(*this);
+ processCallback(const XObject& theXObject);
- return m_resultString;
- }
-
// These methods are inherited from XObjectTypeCallback ...
virtual void
- Number(const XObject& theXObject,
- double /* theValue */)
- {
- m_resultString = theXObject.str();
- }
+ Number(
+ const XObject& theXObject,
+ double /* theValue */);
virtual void
- Boolean(const XObject& theXObject,
- bool /* theValue */)
- {
- m_resultString = theXObject.str();
- }
+ Boolean(
+ const XObject& theXObject,
+ bool /* theValue */);
virtual void
- String(const XObject& theXObject,
- const XalanDOMString& /* theValue */)
- {
- m_resultString = theXObject.str();
- }
+ String(
+ const XObject& theXObject,
+ const XalanDOMString& /* theValue */);
virtual void
- ResultTreeFragment(const XObject& theXObject,
- const ResultTreeFragBase& /* theValue */)
- {
- m_resultString = theXObject.str();
- }
+ ResultTreeFragment(
+ const XObject& theXObject,
+ const ResultTreeFragBase& /* theValue */);
virtual void
- ResultTreeFragment(const XObject& theXObject,
- ResultTreeFragBase& /* theValue */)
- {
- m_resultString = theXObject.str();
- }
+ ResultTreeFragment(
+ const XObject& theXObject,
+ ResultTreeFragBase& /* theValue */);
virtual void
- NodeSet(const XObject& /* theXObject */,
- const NodeRefListBase& theValue)
- {
- const unsigned int theNodeCount = theValue.getLength();
-
- for (unsigned int i = 0 ; i < theNodeCount; i++)
- {
- m_executionContext.getNodeData(*theValue.item(i), m_resultString);
-
- append(m_resultString, XalanDOMChar(XalanUnicode::charSpace));
- }
- }
+ NodeSet(
+ const XObject& /* theXObject */,
+ const NodeRefListBase& theValue);
virtual void
- Unknown(const XObject& /* theObject */,
- const XalanDOMString& /* theName */)
- {
- }
+ Unknown(
+ const XObject& /* theObject */,
+ const XalanDOMString& /* theName */);
virtual void
- Null(const XObject& /* theObject */)
- {
- }
+ Null(const XObject& /* theObject */);
private:
1.6 +5 -1 xml-xalan/c/src/XPath/FunctionLang.cpp
Index: FunctionLang.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionLang.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FunctionLang.cpp 2000/12/06 21:00:25 1.5
+++ FunctionLang.cpp 2001/01/03 19:32:37 1.6
@@ -58,6 +58,10 @@
+#include <DOMSupport/DOMServices.hpp>
+
+
+
#include "XObjectFactory.hpp"
@@ -132,7 +136,7 @@
}
}
- parent = executionContext.getParentOfNode(*parent);
+ parent = DOMServices::getParentOfNode(*parent);
}
return executionContext.getXObjectFactory().createBoolean(fMatch);
1.9 +8 -4 xml-xalan/c/src/XPath/FunctionLocalName.cpp
Index: FunctionLocalName.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionLocalName.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- FunctionLocalName.cpp 2000/12/21 04:29:29 1.8
+++ FunctionLocalName.cpp 2001/01/03 19:32:37 1.9
@@ -58,6 +58,10 @@
+#include <DOMSupport/DOMServices.hpp>
+
+
+
#include "XObjectFactory.hpp"
@@ -95,9 +99,9 @@
XObjectPtr
FunctionLocalName::execute(
- XPathExecutionContext& executionContext,
- XalanNode* context,
- const XObjectPtr arg1)
+ XPathExecutionContext& executionContext,
+ XalanNode* /* context */,
+ const XObjectPtr arg1)
{
assert(arg1.null() == false);
@@ -170,7 +174,7 @@
theType == XalanNode::ELEMENT_NODE ||
theType == XalanNode::PROCESSING_INSTRUCTION_NODE)
{
- return executionContext.getXObjectFactory().createStringReference(executionContext.getLocalNameOfNode(node));
+ return executionContext.getXObjectFactory().createStringReference(DOMServices::getLocalNameOfNode(node));
}
else
{
1.8 +6 -2 xml-xalan/c/src/XPath/FunctionName.cpp
Index: FunctionName.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionName.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FunctionName.cpp 2000/12/21 15:05:33 1.7
+++ FunctionName.cpp 2001/01/03 19:32:38 1.8
@@ -58,6 +58,10 @@
+#include <DOMSupport/DOMServices.hpp>
+
+
+
#include "XObjectFactory.hpp"
@@ -88,7 +92,7 @@
}
else
{
- return executionContext.getXObjectFactory().createStringReference(executionContext.getNameOfNode(*context));
+ return executionContext.getXObjectFactory().createStringReference(DOMServices::getNameOfNode(*context));
}
}
@@ -112,7 +116,7 @@
{
assert(theNodeList.item(0) != 0);
- const XalanDOMString& theData = executionContext.getNameOfNode(*theNodeList.item(0));
+ const XalanDOMString& theData = DOMServices::getNameOfNode(*theNodeList.item(0));
return executionContext.getXObjectFactory().createStringReference(theData);
}
1.8 +4 -0 xml-xalan/c/src/XPath/FunctionNamespaceURI.cpp
Index: FunctionNamespaceURI.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionNamespaceURI.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FunctionNamespaceURI.cpp 2000/12/21 04:29:29 1.7
+++ FunctionNamespaceURI.cpp 2001/01/03 19:32:38 1.8
@@ -58,6 +58,10 @@
+#include <DOMSupport/DOMServices.hpp>
+
+
+
#include "XObjectFactory.hpp"
1.6 +13 -9 xml-xalan/c/src/XPath/FunctionSum.cpp
Index: FunctionSum.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionSum.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FunctionSum.cpp 2000/12/06 21:01:05 1.5
+++ FunctionSum.cpp 2001/01/03 19:32:38 1.6
@@ -58,6 +58,10 @@
+#include <DOMSupport/DOMServices.hpp>
+
+
+
#include "XObjectFactory.hpp"
@@ -88,9 +92,9 @@
XObjectPtr
FunctionSum::execute(
- XPathExecutionContext& executionContext,
- XalanNode* /* context */,
- const XObjectPtr arg1)
+ XPathExecutionContext& executionContext,
+ XalanNode* /* context */,
+ const XObjectPtr arg1)
{
assert(arg1.null() == false);
@@ -100,13 +104,15 @@
const unsigned int count = nl.getLength();
+ XPathExecutionContext::GetAndReleaseCachedString theData(executionContext);
+
for (unsigned int i = 0; i < count; i++)
{
- XalanDOMString theData;
+ DOMServices::getNodeData(*nl.item(i), theData);
- executionContext.getNodeData(*nl.item(i), theData);
-
sum += DoubleSupport::toDouble(theData);
+
+ clear(theData);
}
return executionContext.getXObjectFactory().createNumber(sum);
@@ -172,7 +178,5 @@
const XalanDOMString
FunctionSum::getError() const
{
- return XALAN_STATIC_UCODE_STRING(
- "The sum() function takes one argument!");
+ return XALAN_STATIC_UCODE_STRING("The sum() function takes one argument!");
}
-
1.28 +17 -17 xml-xalan/c/src/XPath/SimpleNodeLocator.cpp
Index: SimpleNodeLocator.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/SimpleNodeLocator.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- SimpleNodeLocator.cpp 2000/11/21 21:08:20 1.27
+++ SimpleNodeLocator.cpp 2001/01/03 19:32:39 1.28
@@ -352,7 +352,7 @@
scoreHolder = xpath.s_MatchScoreOther;
- localContext = executionContext.getParentOfNode(*localContext);
+ localContext = DOMServices::getParentOfNode(*localContext);
if(0 == localContext)
{
@@ -457,7 +457,7 @@
if(xpath.s_MatchScoreNone != score)
break;
- localContext = executionContext.getParentOfNode(*localContext);
+ localContext = DOMServices::getParentOfNode(*localContext);
}
}
}
@@ -569,7 +569,7 @@
executionContext.setThrowFoundIndex(false);
XalanNode* const parentContext =
- executionContext.getParentOfNode(*localContext);
+ DOMServices::getParentOfNode(*localContext);
typedef XPathExecutionContext::BorrowReturnMutableNodeRefList BorrowReturnMutableNodeRefList;
@@ -662,7 +662,7 @@
opPos += 3;
- XalanNode* const theParent = executionContext.getParentOfNode(*context);
+ XalanNode* const theParent = DOMServices::getParentOfNode(*context);
if(0 != theParent)
{
@@ -747,7 +747,7 @@
xpath.getExpression();
XalanNode* contextNode =
- executionContext.getParentOfNode(*context);
+ DOMServices::getParentOfNode(*context);
// $$ ToDO: Can we reduce this to some call on the
// XPathExpression interface?
@@ -770,7 +770,7 @@
subQueryResults.addNode(contextNode);
}
- contextNode = executionContext.getParentOfNode(*contextNode);
+ contextNode = DOMServices::getParentOfNode(*contextNode);
}
return argLen + 3;
@@ -816,7 +816,7 @@
subQueryResults.addNode(contextNode);
}
- contextNode = executionContext.getParentOfNode(*contextNode);
+ contextNode = DOMServices::getParentOfNode(*contextNode);
}
return argLen + 3;
@@ -988,7 +988,7 @@
if(0 == nextNode)
{
- pos = executionContext.getParentOfNode(*pos);
+ pos = DOMServices::getParentOfNode(*pos);
if(context == pos || pos == 0)
{
@@ -1066,9 +1066,9 @@
// following axis.
if (pos->getNodeType() == XalanNode::ATTRIBUTE_NODE)
{
- assert(executionContext.getParentOfNode(*pos) != 0);
+ assert(DOMServices::getParentOfNode(*pos) != 0);
- nextNode = executionContext.getParentOfNode(*pos)->getFirstChild();
+ nextNode = DOMServices::getParentOfNode(*pos)->getFirstChild();
}
else
{
@@ -1077,7 +1077,7 @@
if(0 == nextNode)
{
- pos = executionContext.getParentOfNode(*pos);
+ pos = DOMServices::getParentOfNode(*pos);
if(doc == pos || 0 == pos)
{
@@ -1170,7 +1170,7 @@
context->getNodeType() == XalanNode::ATTRIBUTE_NODE ? true : false;
const XalanNode* const theAttributeContextParent =
- contextIsAttribute == true ? executionContext.getParentOfNode(*context) : 0;
+ contextIsAttribute == true ? DOMServices::getParentOfNode(*context) : 0;
while(0 != pos)
{
@@ -1192,7 +1192,7 @@
// sure there's a better way to check for the parent.
bool isParent = false;
- XalanNode* parent = executionContext.getParentOfNode(*context);
+ XalanNode* parent = DOMServices::getParentOfNode(*context);
while(0 != parent)
{
@@ -1202,7 +1202,7 @@
break;
}
- parent = executionContext.getParentOfNode(*parent);
+ parent = DOMServices::getParentOfNode(*parent);
}
if(isParent == false)
@@ -1231,7 +1231,7 @@
if(0 == nextNode)
{
- pos = executionContext.getParentOfNode(*pos);
+ pos = DOMServices::getParentOfNode(*pos);
if(doc == pos)
{
@@ -1557,7 +1557,7 @@
if (isNamespace == false)
{
const XalanDOMString& localAttrName =
- executionContext.getLocalNameOfNode(*context);
+ DOMServices::getLocalNameOfNode(*context);
if (equals(localAttrName, targetLocalName) == true)
{
@@ -1600,7 +1600,7 @@
}
else
{
- if (equals(executionContext.getLocalNameOfNode(*context),
+ if (equals(DOMServices::getLocalNameOfNode(*context),
targetLocalName) == true)
{
score = xpath.s_MatchScoreQName;
1.18 +190 -495 xml-xalan/c/src/XPath/XObject.cpp
Index: XObject.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/XObject.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- XObject.cpp 2000/12/21 04:43:48 1.17
+++ XObject.cpp 2001/01/03 19:32:39 1.18
@@ -59,10 +59,6 @@
-//#include <stdexcept>
-
-
-
#include <XalanDOM/XalanNode.hpp>
@@ -77,6 +73,7 @@
#include "NodeRefList.hpp"
#include "XObjectFactory.hpp"
+#include "XPathExecutionContext.hpp"
@@ -209,14 +206,15 @@
struct
getStringFromNodeFunction
{
- getStringFromNodeFunction()
+ getStringFromNodeFunction(XPathExecutionContext& executionContext) :
+ m_executionContext(executionContext)
{
}
const XalanDOMString
operator()(const XalanNode& theNode) const
{
- XalanDOMString theString;
+ XPathExecutionContext::GetAndReleaseCachedString theString(m_executionContext);
getStringFromNode(theNode, theString);
@@ -230,36 +228,19 @@
{
getStringFromNode(theNode, theString);
}
-};
-
-
-
-double
-getNumberFromNode(const XalanNode& theNode)
-{
- XalanDOMString theString;
-
- getStringFromNode(theNode, theString);
-
- return DoubleSupport::toDouble(theString);
-}
-
+private:
-void
-getNumberFromNode(
- const XalanNode& theNode,
- double& theNumber)
-{
- theNumber = getNumberFromNode(theNode);
-}
+ XPathExecutionContext& m_executionContext;
+};
struct
getNumberFromNodeFunction
{
- getNumberFromNodeFunction()
+ getNumberFromNodeFunction(XPathExecutionContext& executionContext) :
+ m_executionContext(executionContext)
{
}
@@ -276,18 +257,40 @@
{
getNumberFromNode(theNode, theNumber);
}
-};
+private:
+
+ double
+ getNumberFromNode(const XalanNode& theNode) const
+ {
+ XPathExecutionContext::GetAndReleaseCachedString theString(m_executionContext);
+
+ getStringFromNode(theNode, theString);
+
+ return DoubleSupport::toDouble(theString);
+ }
+
+ void
+ getNumberFromNode(
+ const XalanNode& theNode,
+ double& theNumber) const
+ {
+ theNumber = getNumberFromNode(theNode);
+ }
+ XPathExecutionContext& m_executionContext;
+};
+
template<class CompareFunction, class TypeFunction>
bool
doCompareNodeSets(
const NodeRefListBase& theLHSNodeSet,
const NodeRefListBase& theRHSNodeSet,
const TypeFunction& theTypeFunction,
- const CompareFunction& theCompareFunction)
+ const CompareFunction& theCompareFunction,
+ XPathExecutionContext& executionContext)
{
// From http://www.w3.org/TR/xpath:
// If both objects to be compared are node-sets, then the comparison
@@ -311,23 +314,25 @@
const XalanNode* const theLHSNode = theLHSNodeSet.item(i);
assert(theLHSNode != 0);
- XalanDOMString s1;
+ XPathExecutionContext::GetAndReleaseCachedString s1(executionContext);
theTypeFunction(*theLHSNode, s1);
+ XPathExecutionContext::GetAndReleaseCachedString s2(executionContext);
+
for(unsigned int k = 0; k < len2 && theResult == false; k++)
{
const XalanNode* const theRHSNode = theRHSNodeSet.item(k);
assert(theRHSNode != 0);
- XalanDOMString s2;
-
theTypeFunction(*theRHSNode, s2);
if(theCompareFunction(s1, s2) == true)
{
theResult = true;
}
+
+ clear(s2);
}
}
@@ -336,31 +341,34 @@
-template<class CompareFunction, class TypeFunction, class Type>
+template<class CompareFunction, class StringFunction>
bool
-doCompare(
+doCompareString(
const NodeRefListBase& theLHSNodeSet,
- const TypeFunction& theTypeFunction,
- const Type& theRHS,
- const CompareFunction& theCompareFunction)
+ const StringFunction& theStringFunction,
+ const XalanDOMString& theRHS,
+ const CompareFunction& theCompareFunction,
+ XPathExecutionContext& executionContext)
{
bool theResult = false;
const unsigned int len1 = theLHSNodeSet.getLength();
+ XPathExecutionContext::GetAndReleaseCachedString theLHS(executionContext);
+
for(unsigned int i = 0; i < len1 && theResult == false; i++)
{
const XalanNode* const theLHSNode = theLHSNodeSet.item(i);
assert(theLHSNode != 0);
- Type theLHS;
+ theStringFunction(*theLHSNode, theLHS);
- theTypeFunction(*theLHSNode, theLHS);
-
if (theCompareFunction(theLHS, theRHS) == true)
{
theResult = true;
}
+
+ clear(theLHS);
}
return theResult;
@@ -368,105 +376,45 @@
+template<class CompareFunction, class NumberFunction>
bool
-equalNodeSet(
- const XObject& theLHS,
- const XObject& theRHS,
- XObject::eObjectType theRHSType)
+doCompareNumber(
+ const NodeRefListBase& theLHSNodeSet,
+ const NumberFunction& theNumberFunction,
+ const double theRHS,
+ const CompareFunction& theCompareFunction)
{
- bool theResult = false;
-
- if(theRHSType == XObject::eTypeNodeSet)
- {
- // Compare as node sets...
- theResult = doCompareNodeSets(
- theLHS.nodeset(),
- theRHS.nodeset(),
- getStringFromNodeFunction(),
- DOMStringEqualsFunction());
+ bool theResult = false;
- }
- else if(theRHSType == XObject::eTypeBoolean)
- {
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a boolean,
- // then the comparison will be true if and only if the result of
- // performing the comparison on the boolean and on the result of
- // converting the node-set to a boolean using the boolean function
- // is true.
- const double num1 = theLHS.boolean() == true ? 1.0 : 0.0;
+ const unsigned int len1 = theLHSNodeSet.getLength();
- theResult = DoubleSupport::equal(num1, theRHS.num());
- }
- else if(theRHSType == XObject::eTypeNumber)
+ for(unsigned int i = 0; i < len1 && theResult == false; i++)
{
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a number,
- // then the comparison will be true if and only if there is a
- // node in the node-set such that the result of performing the
- // comparison on the number to be compared and on the result of
- // converting the string-value of that node to a number using
- // the number function is true.
+ const XalanNode* const theLHSNode = theLHSNodeSet.item(i);
+ assert(theLHSNode != 0);
- theResult = doCompare(
- theLHS.nodeset(),
- getNumberFromNodeFunction(),
- theRHS.num(),
- DoubleSupport::equalFunction());
- }
- else if(theRHSType == XObject::eTypeResultTreeFrag)
- {
- // hmmm...
- const double theRHSNumber = theRHS.num();
+ const double theLHS = theNumberFunction(*theLHSNode);
- if(DoubleSupport::isNaN(theRHSNumber) == false)
- {
- // Compare as number...
- theResult = doCompare(
- theLHS.nodeset(),
- getNumberFromNodeFunction(),
- theRHS.num(),
- DoubleSupport::equalFunction());
- }
- else
+ if (theCompareFunction(theLHS, theRHS) == true)
{
- // Compare as string...
- theResult = doCompare(
- theLHS.nodeset(),
- getStringFromNodeFunction(),
- theRHS.str(),
- DOMStringEqualsFunction());
+ theResult = true;
}
}
- else if(theRHSType == XObject::eTypeString)
- {
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a
- // string, then the comparison will be true if and only if there
- // is a node in the node-set such that the result of performing
- // the comparison on the string-value of the node and the other
- // string is true.
- theResult = doCompare(
- theLHS.nodeset(),
- getStringFromNodeFunction(),
- theRHS.str(),
- DOMStringEqualsFunction());
- }
- else
- {
- assert(false);
- }
return theResult;
}
+template<class StringCompareFunction, class NumberCompareFunction>
bool
-notEqualNodeSet(
- const XObject& theLHS,
- const XObject& theRHS,
- XObject::eObjectType theRHSType)
+compareNodeSets(
+ const XObject& theLHS,
+ const XObject& theRHS,
+ XObject::eObjectType theRHSType,
+ const StringCompareFunction& theStringCompareFunction,
+ const NumberCompareFunction& theNumberCompareFunction,
+ XPathExecutionContext& executionContext)
{
bool theResult = false;
@@ -476,8 +424,9 @@
theResult = doCompareNodeSets(
theLHS.nodeset(),
theRHS.nodeset(),
- getStringFromNodeFunction(),
- DOMStringNotEqualsFunction());
+ getStringFromNodeFunction(executionContext),
+ theStringCompareFunction,
+ executionContext);
}
else if(theRHSType == XObject::eTypeBoolean)
@@ -490,7 +439,7 @@
// is true.
const double num1 = theLHS.boolean() == true ? 1.0 : 0.0;
- theResult = DoubleSupport::notEqual(num1, theRHS.num());
+ theResult = theNumberCompareFunction(num1, theRHS.num());
}
else if(theRHSType == XObject::eTypeNumber)
{
@@ -502,11 +451,11 @@
// converting the string-value of that node to a number using
// the number function is true.
- theResult = doCompare(
+ theResult = doCompareNumber(
theLHS.nodeset(),
- getNumberFromNodeFunction(),
+ getNumberFromNodeFunction(executionContext),
theRHS.num(),
- DoubleSupport::notEqualFunction());
+ theNumberCompareFunction);
}
else if(theRHSType == XObject::eTypeResultTreeFrag)
{
@@ -516,20 +465,21 @@
if(DoubleSupport::isNaN(theRHSNumber) == false)
{
// Compare as number...
- theResult = doCompare(
+ theResult = doCompareNumber(
theLHS.nodeset(),
- getNumberFromNodeFunction(),
+ getNumberFromNodeFunction(executionContext),
theRHS.num(),
- DoubleSupport::notEqualFunction());
+ theNumberCompareFunction);
}
else
{
// Compare as string...
- theResult = doCompare(
+ theResult = doCompareString(
theLHS.nodeset(),
- getStringFromNodeFunction(),
+ getStringFromNodeFunction(executionContext),
theRHS.str(),
- DOMStringNotEqualsFunction());
+ theStringCompareFunction,
+ executionContext);
}
}
else if(theRHSType == XObject::eTypeString)
@@ -540,11 +490,12 @@
// is a node in the node-set such that the result of performing
// the comparison on the string-value of the node and the other
// string is true.
- theResult = doCompare(
+ theResult = doCompareString(
theLHS.nodeset(),
- getStringFromNodeFunction(),
+ getStringFromNodeFunction(executionContext),
theRHS.str(),
- DOMStringNotEqualsFunction());
+ theStringCompareFunction,
+ executionContext);
}
else
{
@@ -556,384 +507,118 @@
-bool
-lessThanNodeSet(
+inline bool
+equalNodeSet(
const XObject& theLHS,
const XObject& theRHS,
- XObject::eObjectType theRHSType)
+ XObject::eObjectType theRHSType,
+ XPathExecutionContext& executionContext)
{
- bool theResult = false;
+ return compareNodeSets(
+ theLHS,
+ theRHS,
+ theRHSType,
+ DOMStringEqualsFunction(),
+ DoubleSupport::equalFunction(),
+ executionContext);
+}
- if(theRHSType == XObject::eTypeNodeSet)
- {
- // Compare as node sets...
- theResult = doCompareNodeSets(
- theLHS.nodeset(),
- theRHS.nodeset(),
- getStringFromNodeFunction(),
- DOMStringLessThanFunction());
- }
- else if(theRHSType == XObject::eTypeBoolean)
- {
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a boolean,
- // then the comparison will be true if and only if the result of
- // performing the comparison on the boolean and on the result of
- // converting the node-set to a boolean using the boolean function
- // is true.
- const double num1 = theLHS.boolean() == true ? 1.0 : 0.0;
- theResult = DoubleSupport::lessThan(num1, theRHS.num());
- }
- else if(theRHSType == XObject::eTypeNumber)
- {
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a number,
- // then the comparison will be true if and only if there is a
- // node in the node-set such that the result of performing the
- // comparison on the number to be compared and on the result of
- // converting the string-value of that node to a number using
- // the number function is true.
+inline bool
+notEqualNodeSet(
+ const XObject& theLHS,
+ const XObject& theRHS,
+ XObject::eObjectType theRHSType,
+ XPathExecutionContext& executionContext)
+{
+ return compareNodeSets(
+ theLHS,
+ theRHS,
+ theRHSType,
+ DOMStringNotEqualsFunction(),
+ DoubleSupport::notEqualFunction(),
+ executionContext);
+}
- theResult = doCompare(
- theLHS.nodeset(),
- getNumberFromNodeFunction(),
- theRHS.num(),
- DoubleSupport::lessThanFunction());
- }
- else if(theRHSType == XObject::eTypeResultTreeFrag)
- {
- // hmmm...
- const double theRHSNumber = theRHS.num();
- if(DoubleSupport::isNaN(theRHSNumber) == false)
- {
- // Compare as number...
- theResult = doCompare(
- theLHS.nodeset(),
- getNumberFromNodeFunction(),
- theRHS.num(),
- DoubleSupport::lessThanFunction());
- }
- else
- {
- // Compare as string...
- theResult = doCompare(
- theLHS.nodeset(),
- getStringFromNodeFunction(),
- theRHS.str(),
- DOMStringLessThanFunction());
- }
- }
- else if(theRHSType == XObject::eTypeString)
- {
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a
- // string, then the comparison will be true if and only if there
- // is a node in the node-set such that the result of performing
- // the comparison on the string-value of the node and the other
- // string is true.
- theResult = doCompare(
- theLHS.nodeset(),
- getStringFromNodeFunction(),
- theRHS.str(),
- DOMStringLessThanFunction());
- }
- else
- {
- assert(false);
- }
- return theResult;
+inline bool
+lessThanNodeSet(
+ const XObject& theLHS,
+ const XObject& theRHS,
+ XObject::eObjectType theRHSType,
+ XPathExecutionContext& executionContext)
+{
+ return compareNodeSets(
+ theLHS,
+ theRHS,
+ theRHSType,
+ DOMStringLessThanFunction(),
+ DoubleSupport::lessThanFunction(),
+ executionContext);
}
-bool
+inline bool
lessThanOrEqualNodeSet(
const XObject& theLHS,
const XObject& theRHS,
- XObject::eObjectType theRHSType)
+ XObject::eObjectType theRHSType,
+ XPathExecutionContext& executionContext)
{
- bool theResult = false;
-
- if(theRHSType == XObject::eTypeNodeSet)
- {
- // Compare as node sets...
- theResult = doCompareNodeSets(
- theLHS.nodeset(),
- theRHS.nodeset(),
- getStringFromNodeFunction(),
- DOMStringLessThanOrEqualFunction());
-
- }
- else if(theRHSType == XObject::eTypeBoolean)
- {
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a boolean,
- // then the comparison will be true if and only if the result of
- // performing the comparison on the boolean and on the result of
- // converting the node-set to a boolean using the boolean function
- // is true.
- const double num1 = theLHS.boolean() == true ? 1.0 : 0.0;
-
- theResult = DoubleSupport::lessThanOrEqual(num1, theRHS.num());
- }
- else if(theRHSType == XObject::eTypeNumber)
- {
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a number,
- // then the comparison will be true if and only if there is a
- // node in the node-set such that the result of performing the
- // comparison on the number to be compared and on the result of
- // converting the string-value of that node to a number using
- // the number function is true.
-
- theResult = doCompare(
- theLHS.nodeset(),
- getNumberFromNodeFunction(),
- theRHS.num(),
- DoubleSupport::lessThanOrEqualFunction());
- }
- else if(theRHSType == XObject::eTypeResultTreeFrag)
- {
- // hmmm...
- const double theRHSNumber = theRHS.num();
-
- if(DoubleSupport::isNaN(theRHSNumber) == false)
- {
- // Compare as number...
- theResult = doCompare(
- theLHS.nodeset(),
- getNumberFromNodeFunction(),
- theRHS.num(),
- DoubleSupport::lessThanOrEqualFunction());
- }
- else
- {
- // Compare as string...
- theResult = doCompare(
- theLHS.nodeset(),
- getStringFromNodeFunction(),
- theRHS.str(),
- DOMStringLessThanOrEqualFunction());
- }
- }
- else if(theRHSType == XObject::eTypeString)
- {
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a
- // string, then the comparison will be true if and only if there
- // is a node in the node-set such that the result of performing
- // the comparison on the string-value of the node and the other
- // string is true.
- theResult = doCompare(
- theLHS.nodeset(),
- getStringFromNodeFunction(),
- theRHS.str(),
- DOMStringLessThanOrEqualFunction());
- }
- else
- {
- assert(false);
- }
-
- return theResult;
+ return compareNodeSets(
+ theLHS,
+ theRHS,
+ theRHSType,
+ DOMStringLessThanOrEqualFunction(),
+ DoubleSupport::lessThanOrEqualFunction(),
+ executionContext);
}
-bool
+inline bool
greaterThanNodeSet(
const XObject& theLHS,
const XObject& theRHS,
- XObject::eObjectType theRHSType)
+ XObject::eObjectType theRHSType,
+ XPathExecutionContext& executionContext)
{
- bool theResult = false;
-
- if(theRHSType == XObject::eTypeNodeSet)
- {
- // Compare as node sets...
- theResult = doCompareNodeSets(
- theLHS.nodeset(),
- theRHS.nodeset(),
- getStringFromNodeFunction(),
- DOMStringGreaterThanFunction());
-
- }
- else if(theRHSType == XObject::eTypeBoolean)
- {
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a boolean,
- // then the comparison will be true if and only if the result of
- // performing the comparison on the boolean and on the result of
- // converting the node-set to a boolean using the boolean function
- // is true.
- const double num1 = theLHS.boolean() == true ? 1.0 : 0.0;
-
- theResult = DoubleSupport::greaterThan(num1, theRHS.num());
- }
- else if(theRHSType == XObject::eTypeNumber)
- {
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a number,
- // then the comparison will be true if and only if there is a
- // node in the node-set such that the result of performing the
- // comparison on the number to be compared and on the result of
- // converting the string-value of that node to a number using
- // the number function is true.
-
- theResult = doCompare(
- theLHS.nodeset(),
- getNumberFromNodeFunction(),
- theRHS.num(),
- DoubleSupport::greaterThanFunction());
- }
- else if(theRHSType == XObject::eTypeResultTreeFrag)
- {
- // hmmm...
- const double theRHSNumber = theRHS.num();
-
- if(DoubleSupport::isNaN(theRHSNumber) == false)
- {
- // Compare as number...
- theResult = doCompare(
- theLHS.nodeset(),
- getNumberFromNodeFunction(),
- theRHS.num(),
- DoubleSupport::greaterThanFunction());
- }
- else
- {
- // Compare as string...
- theResult = doCompare(
- theLHS.nodeset(),
- getStringFromNodeFunction(),
- theRHS.str(),
- DOMStringGreaterThanFunction());
- }
- }
- else if(theRHSType == XObject::eTypeString)
- {
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a
- // string, then the comparison will be true if and only if there
- // is a node in the node-set such that the result of performing
- // the comparison on the string-value of the node and the other
- // string is true.
- theResult = doCompare(
- theLHS.nodeset(),
- getStringFromNodeFunction(),
- theRHS.str(),
- DOMStringGreaterThanFunction());
- }
- else
- {
- assert(false);
- }
-
- return theResult;
+ return compareNodeSets(
+ theLHS,
+ theRHS,
+ theRHSType,
+ DOMStringGreaterThanFunction(),
+ DoubleSupport::greaterThanFunction(),
+ executionContext);
}
-bool
+inline bool
greaterThanOrEqualNodeSet(
const XObject& theLHS,
const XObject& theRHS,
- XObject::eObjectType theRHSType)
+ XObject::eObjectType theRHSType,
+ XPathExecutionContext& executionContext)
{
- bool theResult = false;
-
- if(theRHSType == XObject::eTypeNodeSet)
- {
- // Compare as node sets...
- theResult = doCompareNodeSets(
- theLHS.nodeset(),
- theRHS.nodeset(),
- getStringFromNodeFunction(),
- DOMStringGreaterThanOrEqualFunction());
-
- }
- else if(theRHSType == XObject::eTypeBoolean)
- {
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a boolean,
- // then the comparison will be true if and only if the result of
- // performing the comparison on the boolean and on the result of
- // converting the node-set to a boolean using the boolean function
- // is true.
- const double num1 = theLHS.boolean() == true ? 1.0 : 0.0;
-
- theResult = DoubleSupport::greaterThanOrEqual(num1, theRHS.num());
- }
- else if(theRHSType == XObject::eTypeNumber)
- {
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a number,
- // then the comparison will be true if and only if there is a
- // node in the node-set such that the result of performing the
- // comparison on the number to be compared and on the result of
- // converting the string-value of that node to a number using
- // the number function is true.
-
- theResult = doCompare(
- theLHS.nodeset(),
- getNumberFromNodeFunction(),
- theRHS.num(),
- DoubleSupport::greaterThanOrEqualFunction());
- }
- else if(theRHSType == XObject::eTypeResultTreeFrag)
- {
- // hmmm...
- const double theRHSNumber = theRHS.num();
-
- if(DoubleSupport::isNaN(theRHSNumber) == false)
- {
- // Compare as number...
- theResult = doCompare(
- theLHS.nodeset(),
- getNumberFromNodeFunction(),
- theRHS.num(),
- DoubleSupport::greaterThanOrEqualFunction());
- }
- else
- {
- // Compare as string...
- theResult = doCompare(
- theLHS.nodeset(),
- getStringFromNodeFunction(),
- theRHS.str(),
- DOMStringGreaterThanOrEqualFunction());
- }
- }
- else if(theRHSType == XObject::eTypeString)
- {
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a
- // string, then the comparison will be true if and only if there
- // is a node in the node-set such that the result of performing
- // the comparison on the string-value of the node and the other
- // string is true.
- theResult = doCompare(
- theLHS.nodeset(),
- getStringFromNodeFunction(),
- theRHS.str(),
- DOMStringGreaterThanOrEqualFunction());
- }
- else
- {
- assert(false);
- }
-
- return theResult;
+ return compareNodeSets(
+ theLHS,
+ theRHS,
+ theRHSType,
+ DOMStringGreaterThanOrEqualFunction(),
+ DoubleSupport::greaterThanOrEqualFunction(),
+ executionContext);
}
bool
-XObject::equals(const XObject& theRHS) const
+XObject::equals(
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const
{
if (this == &theRHS)
{
@@ -953,7 +638,7 @@
}
else if (theLHSType == eTypeNodeSet)
{
- return equalNodeSet(*this, theRHS, theRHS.getType());
+ return equalNodeSet(*this, theRHS, theRHS.getType(), executionContext);
}
else
{
@@ -961,7 +646,7 @@
if (theRHSType == eTypeNodeSet)
{
- return equalNodeSet(theRHS, *this, theLHSType);
+ return equalNodeSet(theRHS, *this, theLHSType, executionContext);
}
else
{
@@ -985,7 +670,9 @@
bool
-XObject::notEquals(const XObject& theRHS) const
+XObject::notEquals(
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const
{
if (this == &theRHS)
{
@@ -1005,7 +692,7 @@
}
else if (theLHSType == eTypeNodeSet)
{
- return notEqualNodeSet(*this, theRHS, theRHS.getType());
+ return notEqualNodeSet(*this, theRHS, theRHS.getType(), executionContext);
}
else
{
@@ -1013,7 +700,7 @@
if (theRHSType == eTypeNodeSet)
{
- return notEqualNodeSet(theRHS, *this, theLHSType);
+ return notEqualNodeSet(theRHS, *this, theLHSType, executionContext);
}
else
{
@@ -1037,7 +724,9 @@
bool
-XObject::lessThan(const XObject& theRHS) const
+XObject::lessThan(
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const
{
if (this == &theRHS)
{
@@ -1053,11 +742,11 @@
}
else if (theLHSType == eTypeNodeSet)
{
- return lessThanNodeSet(*this, theRHS, theRHS.getType());
+ return lessThanNodeSet(*this, theRHS, theRHS.getType(), executionContext);
}
else if (theRHS.getType() == eTypeNodeSet)
{
- return greaterThanNodeSet(theRHS, *this, theLHSType);
+ return greaterThanNodeSet(theRHS, *this, theLHSType, executionContext);
}
else
{
@@ -1069,7 +758,9 @@
bool
-XObject::lessThanOrEqual(const XObject& theRHS) const
+XObject::lessThanOrEquals(
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const
{
if (this == &theRHS)
{
@@ -1085,11 +776,11 @@
}
else if (theLHSType == eTypeNodeSet)
{
- return lessThanOrEqualNodeSet(*this, theRHS, theRHS.getType());
+ return lessThanOrEqualNodeSet(*this, theRHS, theRHS.getType(), executionContext);
}
else if (theRHS.getType() == eTypeNodeSet)
{
- return greaterThanOrEqualNodeSet(theRHS, *this, theLHSType);
+ return greaterThanOrEqualNodeSet(theRHS, *this, theLHSType, executionContext);
}
else
{
@@ -1101,7 +792,9 @@
bool
-XObject::greaterThan(const XObject& theRHS) const
+XObject::greaterThan(
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const
{
if (this == &theRHS)
{
@@ -1117,11 +810,11 @@
}
else if (theLHSType == eTypeNodeSet)
{
- return greaterThanNodeSet(*this, theRHS, theRHS.getType());
+ return greaterThanNodeSet(*this, theRHS, theRHS.getType(), executionContext);
}
else if (theRHS.getType() == eTypeNodeSet)
{
- return lessThanNodeSet(theRHS, *this, theLHSType);
+ return lessThanNodeSet(theRHS, *this, theLHSType, executionContext);
}
else
{
@@ -1133,7 +826,9 @@
bool
-XObject::greaterThanOrEqual(const XObject& theRHS) const
+XObject::greaterThanOrEquals(
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const
{
if (this == &theRHS)
{
@@ -1149,11 +844,11 @@
}
else if (theLHSType == eTypeNodeSet)
{
- return greaterThanOrEqualNodeSet(*this, theRHS, theRHS.getType());
+ return greaterThanOrEqualNodeSet(*this, theRHS, theRHS.getType(), executionContext);
}
else if (theRHS.getType() == eTypeNodeSet)
{
- return lessThanOrEqualNodeSet(theRHS, *this, theLHSType);
+ return lessThanOrEqualNodeSet(theRHS, *this, theLHSType, executionContext);
}
else
{
1.15 +19 -66 xml-xalan/c/src/XPath/XObject.hpp
Index: XObject.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/XObject.hpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- XObject.hpp 2000/12/21 04:43:49 1.14
+++ XObject.hpp 2001/01/03 19:32:39 1.15
@@ -205,7 +205,9 @@
* @return true if they are equal
*/
bool
- equals(const XObject& theRHS) const;
+ equals(
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const;
/**
* Tell if two objects are functionally not equal.
@@ -215,7 +217,9 @@
* @return true if they are equal
*/
bool
- notEquals(const XObject& theRHS) const;
+ notEquals(
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const;
/**
* Tell if one object is less than the other.
@@ -224,7 +228,9 @@
* @return true if they are equal
*/
bool
- lessThan(const XObject& theRHS) const;
+ lessThan(
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const;
/**
* Tell if one object is less than or equal
@@ -234,7 +240,9 @@
* @return true if they are equal
*/
bool
- lessThanOrEqual(const XObject& theRHS) const;
+ lessThanOrEquals(
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const;
/**
* Tell if one object is greater than the other.
@@ -243,7 +251,9 @@
* @return true if they are equal
*/
bool
- greaterThan(const XObject& theRHS) const;
+ greaterThan(
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const;
/**
* Tell if one object is greater than or equal
@@ -253,7 +263,9 @@
* @return true if they are equal
*/
bool
- greaterThanOrEqual(const XObject& theRHS) const;
+ greaterThanOrEquals(
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const;
/**
* Tell what kind of class this is.
@@ -358,66 +370,6 @@
-inline bool
-operator==(
- const XObject& theLHS,
- const XObject& theRHS)
-{
- return theLHS.equals(theRHS);
-}
-
-
-
-inline bool
-operator!=(
- const XObject& theLHS,
- const XObject& theRHS)
-{
- return theLHS.notEquals(theRHS);
-}
-
-
-
-inline bool
-operator<(
- const XObject& theLHS,
- const XObject& theRHS)
-{
- return theLHS.lessThan(theRHS);
-}
-
-
-
-inline bool
-operator<=(
- const XObject& theLHS,
- const XObject& theRHS)
-{
- return theLHS.lessThanOrEqual(theRHS);
-}
-
-
-
-inline bool
-operator>(
- const XObject& theLHS,
- const XObject& theRHS)
-{
- return theLHS.greaterThan(theRHS);
-}
-
-
-
-inline bool
-operator>=(
- const XObject& theLHS,
- const XObject& theRHS)
-{
- return theLHS.greaterThanOrEqual(theRHS);
-}
-
-
-
/**
* Class to hold XObjectPtr return types.
*/
@@ -426,6 +378,7 @@
public:
friend bool operator==(const XObjectPtr&, const XObjectPtr&);
+
/**
* Create an XObjectPtr.
*/
1.38 +6 -6 xml-xalan/c/src/XPath/XPath.cpp
Index: XPath.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/XPath.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- XPath.cpp 2000/12/04 20:48:17 1.37
+++ XPath.cpp 2001/01/03 19:32:40 1.38
@@ -733,7 +733,7 @@
const XObjectPtr expr2(executeMore(context, expr2Pos, executionContext));
assert(expr2.get() != 0);
- return executionContext.getXObjectFactory().createBoolean(*expr1.get() != *expr2.get());
+ return executionContext.getXObjectFactory().createBoolean(expr1->notEquals(*expr2.get(), executionContext));
}
@@ -754,7 +754,7 @@
const XObjectPtr expr2(executeMore(context, expr2Pos, executionContext));
assert(expr2.get() != 0);
- return executionContext.getXObjectFactory().createBoolean(*expr1.get() == *expr2.get());
+ return executionContext.getXObjectFactory().createBoolean(expr1->equals(*expr2.get(), executionContext));
}
@@ -775,7 +775,7 @@
const XObjectPtr expr2(executeMore(context, expr2Pos, executionContext));
assert(expr2.get() != 0);
- return executionContext.getXObjectFactory().createBoolean(*expr1.get() <= *expr2.get());
+ return executionContext.getXObjectFactory().createBoolean(expr1->lessThanOrEquals(*expr2.get(), executionContext));
}
@@ -796,7 +796,7 @@
const XObjectPtr expr2(executeMore(context, expr2Pos, executionContext));
assert(expr2.get() != 0);
- return executionContext.getXObjectFactory().createBoolean(*expr1.get() < *expr2.get());
+ return executionContext.getXObjectFactory().createBoolean(expr1->lessThan(*expr2.get(), executionContext));
}
@@ -817,7 +817,7 @@
const XObjectPtr expr2(executeMore(context, expr2Pos, executionContext));
assert(expr2.get() != 0);
- return executionContext.getXObjectFactory().createBoolean(*expr1.get() >= *expr2.get());
+ return executionContext.getXObjectFactory().createBoolean(expr1->greaterThanOrEquals(*expr2.get(), executionContext));
}
@@ -838,7 +838,7 @@
const XObjectPtr expr2(executeMore(context, expr2Pos, executionContext));
assert(expr2.get() != 0);
- return executionContext.getXObjectFactory().createBoolean(*expr1.get() > *expr2.get());
+ return executionContext.getXObjectFactory().createBoolean(expr1->greaterThan(*expr2.get(), executionContext));
}
1.32 +5 -57 xml-xalan/c/src/XPath/XPathExecutionContext.hpp
Index: XPathExecutionContext.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathExecutionContext.hpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- XPathExecutionContext.hpp 2000/12/21 04:44:27 1.31
+++ XPathExecutionContext.hpp 2001/01/03 19:32:40 1.32
@@ -197,44 +197,6 @@
isIgnorableWhitespace(const XalanText& node) const = 0;
/**
- * Retrieve namespace corresponding to a DOM node.
- *
- * @param n DOM node queried
- * @return namespace string corresponding to 'n'
- */
- virtual const XalanDOMString&
- getNamespaceOfNode(const XalanNode& n) const = 0;
-
- /**
- * Retrieve the name of the node, taking into
- * account the differences between the DOM and
- * XSLT data models.
- *
- * @param node DOM node whose name is returned
- * @return name of the node
- */
- virtual const XalanDOMString&
- getNameOfNode(const XalanNode& n) const = 0;
-
- /**
- * Returns the local name of the given node.
- *
- * @param n node queried
- * @return local name string corresponding to 'n'
- */
- virtual const XalanDOMString&
- getLocalNameOfNode(const XalanNode& n) const = 0;
-
- /**
- * Returns the parent of the given node.
- *
- * @param n DOM node queried
- * @return parent node for 'n'
- */
- virtual XalanNode*
- getParentOfNode(const XalanNode& n) const = 0;
-
- /**
* Determine if a node is after another node, in document order.
*
* @param node1 The first node
@@ -247,27 +209,13 @@
const XalanNode& node2) const = 0;
/**
- * Get node data recursively.
+ * Retrieve namespace corresponding to a DOM node
*
- * @param n DOM node queried
- * @param s string to which the node's data will be appended.
- */
- virtual void
- getNodeData(
- const XalanNode& n,
- XalanDOMString& s) const = 0;
-
- /**
- * Given a valid element id, return the corresponding element.
- *
- * @param id string representing ID
- * @param doc document to search
- * @return element for ID
+ * @param theNode DOM node whose namespace is queried
+ * @return namespace corresponding to 'theNode'
*/
- virtual XalanElement*
- getElementByID(
- const XalanDOMString& id,
- const XalanDocument& doc) const = 0;
+ virtual const XalanDOMString&
+ getNamespaceOfNode(const XalanNode& theNode) const = 0;
/**
* Retrieve node list for current context.
1.29 +5 -49 xml-xalan/c/src/XPath/XPathExecutionContextDefault.cpp
Index: XPathExecutionContextDefault.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathExecutionContextDefault.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- XPathExecutionContextDefault.cpp 2000/12/15 23:25:55 1.28
+++ XPathExecutionContextDefault.cpp 2001/01/03 19:32:41 1.29
@@ -185,38 +185,6 @@
-const XalanDOMString&
-XPathExecutionContextDefault::getNamespaceOfNode(const XalanNode& n) const
-{
- return m_xpathSupport.getNamespaceOfNode(n);
-}
-
-
-
-const XalanDOMString&
-XPathExecutionContextDefault::getNameOfNode(const XalanNode& n) const
-{
- return m_xpathSupport.getNameOfNode(n);
-}
-
-
-
-const XalanDOMString&
-XPathExecutionContextDefault::getLocalNameOfNode(const XalanNode& n) const
-{
- return m_xpathSupport.getLocalNameOfNode(n);
-}
-
-
-
-XalanNode*
-XPathExecutionContextDefault::getParentOfNode(const XalanNode& n) const
-{
- return m_xpathSupport.getParentOfNode(n);
-}
-
-
-
bool
XPathExecutionContextDefault::isNodeAfter(
const XalanNode& node1,
@@ -227,25 +195,13 @@
-void
-XPathExecutionContextDefault::getNodeData(
- const XalanNode& n,
- XalanDOMString& s) const
-{
- m_xpathSupport.getNodeData(n, s);
-}
-
-
-
-XalanElement*
-XPathExecutionContextDefault::getElementByID(
- const XalanDOMString& id,
- const XalanDocument& doc) const
+const XalanDOMString&
+XPathExecutionContextDefault::getNamespaceOfNode(const XalanNode& theNode) const
{
- return m_xpathSupport.getElementByID(id, doc);
+ return m_xpathSupport.getNamespaceOfNode(theNode);
}
-
-
+
+
const NodeRefListBase&
XPathExecutionContextDefault::getContextNodeList() const
1.29 +2 -21 xml-xalan/c/src/XPath/XPathExecutionContextDefault.hpp
Index: XPathExecutionContextDefault.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathExecutionContextDefault.hpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- XPathExecutionContextDefault.hpp 2000/12/15 23:25:55 1.28
+++ XPathExecutionContextDefault.hpp 2001/01/03 19:32:41 1.29
@@ -143,32 +143,13 @@
virtual bool
isIgnorableWhitespace(const XalanText& node) const;
- virtual const XalanDOMString&
- getNamespaceOfNode(const XalanNode& n) const;
-
- virtual const XalanDOMString&
- getNameOfNode(const XalanNode& n) const;
-
- virtual const XalanDOMString&
- getLocalNameOfNode(const XalanNode& n) const;
-
- virtual XalanNode*
- getParentOfNode(const XalanNode& n) const;
-
virtual bool
isNodeAfter(
const XalanNode& node1,
const XalanNode& node2) const;
- virtual void
- getNodeData(
- const XalanNode& n,
- XalanDOMString& s) const;
-
- virtual XalanElement*
- getElementByID(
- const XalanDOMString& id,
- const XalanDocument& doc) const;
+ virtual const XalanDOMString&
+ getNamespaceOfNode(const XalanNode& theNode) const;
virtual const NodeRefListBase&
getContextNodeList() const;
1.10 +6 -59 xml-xalan/c/src/XPath/XPathSupport.hpp
Index: XPathSupport.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathSupport.hpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- XPathSupport.hpp 2000/12/15 23:25:55 1.9
+++ XPathSupport.hpp 2001/01/03 19:32:41 1.10
@@ -113,56 +113,6 @@
const XalanElement& namespaceContext) const = 0;
/**
- * Returns the namespace of the given node.
- *
- * @param node DOM node whose namespace is returned
- * @return namespace of node
- */
- virtual const XalanDOMString&
- getNamespaceOfNode(const XalanNode& n) const = 0;
-
- /**
- * Retrieve the name of the node, taking into
- * account the differences between the DOM and
- * XSLT data models.
- *
- * @param node DOM node whose name is returned
- * @return name of the node
- */
- virtual const XalanDOMString&
- getNameOfNode(const XalanNode& n) const = 0;
-
- /**
- * Retrieve local name of node
- *
- * @param node DOM node whose name is returned
- * @return name of node without namespace
- */
- virtual const XalanDOMString&
- getLocalNameOfNode(const XalanNode& n) const = 0;
-
- /**
- * Get node data recursively.
- *
- * @param n DOM node queried
- * @param s string to which the node's data will be appended.
- */
- virtual void
- getNodeData(
- const XalanNode& n,
- XalanDOMString& s) const = 0;
-
- /**
- * Retrieve the parent of a node. This function has to be implemented,
- * because the DOM WG decided that attributes don't have parents.
- *
- * @param node child node
- * @return parent node
- */
- virtual XalanNode*
- getParentOfNode(const XalanNode& n) const = 0;
-
- /**
* Determine if a node is after another node, in document order.
*
* @param node1 The first node
@@ -175,16 +125,13 @@
const XalanNode& node2) const = 0;
/**
- * Given a valid element id, return the corresponding element.
- *
- * @param id string representing ID
- * @param doc document to search
- * @return element for ID
+ * Retrieve namespace corresponding to a DOM node
+ *
+ * @param theNode DOM node whose namespace is queried
+ * @return namespace corresponding to 'theNode'
*/
- virtual XalanElement*
- getElementByID(
- const XalanDOMString& id,
- const XalanDocument& doc) const = 0;
+ virtual const XalanDOMString&
+ getNamespaceOfNode(const XalanNode& theNode) const = 0;
/**
* Set whether or not the liaison attempts to expand namespaces. Used
1.13 +0 -44 xml-xalan/c/src/XPath/XPathSupportDefault.cpp
Index: XPathSupportDefault.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathSupportDefault.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- XPathSupportDefault.cpp 2000/12/15 23:25:56 1.12
+++ XPathSupportDefault.cpp 2001/01/03 19:32:42 1.13
@@ -125,56 +125,12 @@
-const XalanDOMString&
-XPathSupportDefault::getNameOfNode(const XalanNode& n) const
-{
- return DOMServices::getNameOfNode(n);
-}
-
-
-
-const XalanDOMString&
-XPathSupportDefault::getLocalNameOfNode(const XalanNode& n) const
-{
- return DOMServices::getLocalNameOfNode(n);
-}
-
-
-
-void
-XPathSupportDefault::getNodeData(
- const XalanNode& n,
- XalanDOMString& s) const
-{
- DOMServices::getNodeData(n, s);
-}
-
-
-
-XalanNode*
-XPathSupportDefault::getParentOfNode(const XalanNode& node) const
-{
- return DOMServices::getParentOfNode(node);
-}
-
-
-
bool
XPathSupportDefault::isNodeAfter(
const XalanNode& node1,
const XalanNode& node2) const
{
return DOMServices::isNodeAfter(node1, node2);
-}
-
-
-
-XalanElement*
-XPathSupportDefault::getElementByID(
- const XalanDOMString& id,
- const XalanDocument& doc) const
-{
- return doc.getElementById(id);
}
1.10 +2 -21 xml-xalan/c/src/XPath/XPathSupportDefault.hpp
Index: XPathSupportDefault.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathSupportDefault.hpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- XPathSupportDefault.hpp 2000/12/15 23:25:56 1.9
+++ XPathSupportDefault.hpp 2001/01/03 19:32:42 1.10
@@ -96,32 +96,13 @@
const XalanDOMString& prefix,
const XalanElement& namespaceContext) const;
- virtual const XalanDOMString&
- getNamespaceOfNode(const XalanNode& n) const;
-
- virtual const XalanDOMString&
- getNameOfNode(const XalanNode& n) const;
-
- virtual const XalanDOMString&
- getLocalNameOfNode(const XalanNode& n) const;
-
- virtual void
- getNodeData(
- const XalanNode& n,
- XalanDOMString& s) const;
-
- virtual XalanNode*
- getParentOfNode(const XalanNode& node) const;
-
virtual bool
isNodeAfter(
const XalanNode& node1,
const XalanNode& node2) const;
- virtual XalanElement*
- getElementByID(
- const XalanDOMString& id,
- const XalanDocument& doc) const;
+ virtual const XalanDOMString&
+ getNamespaceOfNode(const XalanNode& theNode) const;
virtual void
setProcessNamespaces(bool processNamespaces);
1.6 +5 -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.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ElemApplyImport.cpp 2000/11/30 20:34:06 1.5
+++ ElemApplyImport.cpp 2001/01/03 19:32:48 1.6
@@ -70,6 +70,10 @@
+#include <DOMSupport/DOMServices.hpp>
+
+
+
#include "Constants.hpp"
#include "StylesheetConstructionContext.hpp"
#include "StylesheetExecutionContext.hpp"
@@ -123,7 +127,7 @@
0,
0,
sourceTree,
- executionContext.getParentOfNode(*sourceNode),
+ DOMServices::getParentOfNode(*sourceNode),
sourceNode,
mode,
getXSLToken());
1.32 +8 -4 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.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- ElemNumber.cpp 2000/12/21 04:45:27 1.31
+++ ElemNumber.cpp 2001/01/03 19:32:48 1.32
@@ -73,6 +73,10 @@
+#include <DOMSupport/DOMServices.hpp>
+
+
+
#include <Include/XalanAutoPtr.hpp>
@@ -256,7 +260,7 @@
}
}
- contextCopy = executionContext.getParentOfNode(*contextCopy);
+ contextCopy = DOMServices::getParentOfNode(*contextCopy);
}
return contextCopy;
}
@@ -300,7 +304,7 @@
if(prevSibling == 0)
{
- contextCopy = executionContext.getParentOfNode(*contextCopy);
+ contextCopy = DOMServices::getParentOfNode(*contextCopy);
}
else
{
@@ -619,7 +623,7 @@
if(stopAtFirstFound)
break;
}
- node = executionContext.getParentOfNode(*node);
+ node = DOMServices::getParentOfNode(*node);
}
return ancestors;
} // end getMatchingAncestors method
@@ -897,7 +901,7 @@
}
else
{
- assert(digitsTable.size() > tables[k]);
+ assert(digitsTable.size() > DigitsTableVectorType::size_type(tables[k]));
// get the table
const XalanDOMCharVectorType& THEletters =
1.43 +2 -21 xml-xalan/c/src/XSLT/StylesheetExecutionContext.hpp
Index: StylesheetExecutionContext.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContext.hpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- StylesheetExecutionContext.hpp 2000/12/21 04:48:31 1.42
+++ StylesheetExecutionContext.hpp 2001/01/03 19:32:48 1.43
@@ -1377,32 +1377,13 @@
virtual bool
isIgnorableWhitespace(const XalanText& node) const = 0;
- virtual const XalanDOMString&
- getNamespaceOfNode(const XalanNode& n) const = 0;
-
- virtual const XalanDOMString&
- getNameOfNode(const XalanNode& n) const = 0;
-
- virtual const XalanDOMString&
- getLocalNameOfNode(const XalanNode& n) const = 0;
-
- virtual XalanNode*
- getParentOfNode(const XalanNode& n) const = 0;
-
virtual bool
isNodeAfter(
const XalanNode& node1,
const XalanNode& node2) const = 0;
- virtual void
- getNodeData(
- const XalanNode& n,
- XalanDOMString& s) const = 0;
-
- virtual XalanElement*
- getElementByID(
- const XalanDOMString& id,
- const XalanDocument& doc) const = 0;
+ virtual const XalanDOMString&
+ getNamespaceOfNode(const XalanNode& theNode) const = 0;
virtual const NodeRefListBase&
getContextNodeList() const = 0;
1.47 +5 -49 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.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- StylesheetExecutionContextDefault.cpp 2000/12/21 04:48:31 1.46
+++ StylesheetExecutionContextDefault.cpp 2001/01/03 19:32:49 1.47
@@ -1342,38 +1342,6 @@
-const XalanDOMString&
-StylesheetExecutionContextDefault::getNamespaceOfNode(const XalanNode& n) const
-{
- return m_xpathExecutionContextDefault.getNamespaceOfNode(n);
-}
-
-
-
-const XalanDOMString&
-StylesheetExecutionContextDefault::getNameOfNode(const XalanNode& n) const
-{
- return m_xpathExecutionContextDefault.getNameOfNode(n);
-}
-
-
-
-const XalanDOMString&
-StylesheetExecutionContextDefault::getLocalNameOfNode(const XalanNode& n) const
-{
- return m_xpathExecutionContextDefault.getLocalNameOfNode(n);
-}
-
-
-
-XalanNode*
-StylesheetExecutionContextDefault::getParentOfNode(const XalanNode& theNode) const
-{
- return m_xpathExecutionContextDefault.getParentOfNode(theNode);
-}
-
-
-
bool
StylesheetExecutionContextDefault::isNodeAfter(
const XalanNode& node1,
@@ -1384,25 +1352,13 @@
-void
-StylesheetExecutionContextDefault::getNodeData(
- const XalanNode& n,
- XalanDOMString& s) const
-{
- m_xpathExecutionContextDefault.getNodeData(n, s);
-}
-
-
-
-XalanElement*
-StylesheetExecutionContextDefault::getElementByID(
- const XalanDOMString& id,
- const XalanDocument& doc) const
+const XalanDOMString&
+StylesheetExecutionContextDefault::getNamespaceOfNode(const XalanNode& theNode) const
{
- return m_xpathExecutionContextDefault.getElementByID(id, doc);
+ return m_xpathExecutionContextDefault.getNamespaceOfNode(theNode);
}
-
-
+
+
const NodeRefListBase&
StylesheetExecutionContextDefault::getContextNodeList() const
1.43 +2 -21 xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.hpp
Index: StylesheetExecutionContextDefault.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.hpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- StylesheetExecutionContextDefault.hpp 2000/12/21 04:48:31 1.42
+++ StylesheetExecutionContextDefault.hpp 2001/01/03 19:32:49 1.43
@@ -595,32 +595,13 @@
virtual bool
isIgnorableWhitespace(const XalanText& node) const;
- virtual const XalanDOMString&
- getNamespaceOfNode(const XalanNode& n) const;
-
- virtual const XalanDOMString&
- getNameOfNode(const XalanNode& n) const;
-
- virtual const XalanDOMString&
- getLocalNameOfNode(const XalanNode& n) const;
-
- virtual XalanNode*
- getParentOfNode(const XalanNode& n) const;
-
virtual bool
isNodeAfter(
const XalanNode& node1,
const XalanNode& node2) const;
- virtual void
- getNodeData(
- const XalanNode& n,
- XalanDOMString& s) const;
-
- virtual XalanElement*
- getElementByID(
- const XalanDOMString& id,
- const XalanDocument& doc) const;
+ virtual const XalanDOMString&
+ getNamespaceOfNode(const XalanNode& theNode) const;
virtual const NodeRefListBase&
getContextNodeList() const;
1.78 +13 -29 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.77
retrieving revision 1.78
diff -u -r1.77 -r1.78
--- XSLTEngineImpl.cpp 2000/12/30 17:56:57 1.77
+++ XSLTEngineImpl.cpp 2001/01/03 19:32:49 1.78
@@ -535,18 +535,14 @@
XalanNode*
XSLTEngineImpl::getSourceTreeFromInput(const XSLTInputSource& inputSource)
{
- XalanNode* sourceTree = 0;
+ XalanNode* sourceTree = inputSource.getNode();
- XalanDOMString xmlIdentifier = 0 != inputSource.getSystemId() ?
- XalanDOMString(inputSource.getSystemId()) :
- StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("Input XML"));
-
- if(0 != inputSource.getNode())
- {
- sourceTree = inputSource.getNode();
- }
- else
+ if(0 == sourceTree)
{
+ const XalanDOMString xmlIdentifier = 0 != inputSource.getSystemId() ?
+ XalanDOMString(inputSource.getSystemId()) :
+ StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("Input XML"));
+
// In case we have a fragment identifier, go ahead and
// try to parse the XML here.
try
@@ -878,7 +874,7 @@
if(equals(ns, s_XSLNameSpaceURL))
{
const XalanDOMString& localName =
- m_xpathSupport.getLocalNameOfNode(node);
+ DOMServices::getLocalNameOfNode(node);
const ElementKeysMapType::const_iterator j =
s_elementKeys.find(localName);
@@ -891,7 +887,7 @@
else if(equals(ns, s_XSLT4JNameSpaceURL))
{
const XalanDOMString& localName =
- m_xpathSupport.getLocalNameOfNode(node);
+ DOMServices::getLocalNameOfNode(node);
const ElementKeysMapType::const_iterator j =
s_XSLT4JElementKeys.find(localName);
@@ -1988,7 +1984,7 @@
false);
}
- startElement(c_wstr(m_executionContext->getNameOfNode(node)));
+ startElement(c_wstr(DOMServices::getNameOfNode(node)));
}
break;
@@ -2016,7 +2012,7 @@
static_cast<const XalanAttr&>(node);
#endif
addResultAttribute(getPendingAttributesImpl(),
- m_executionContext->getNameOfNode(attr),
+ DOMServices::getNameOfNode(attr),
attr.getValue());
}
break;
@@ -2713,16 +2709,6 @@
-XalanElement*
-XSLTEngineImpl::getElementByID(
- const XalanDOMString& id,
- const XalanDocument& doc) const
-{
- return m_xpathSupport.getElementByID(id, doc);
-}
-
-
-
bool
XSLTEngineImpl::shouldStripSourceNode(
XPathExecutionContext& executionContext,
@@ -2748,19 +2734,17 @@
if(!theTextNode.isIgnorableWhitespace())
{
- const XalanDOMString& data = theTextNode.getData();
-
- if(0 == length(data))
+ if(0 == length(theTextNode.getData()))
{
return true;
}
- else if(!isXMLWhitespace(data))
+ else
{
return false;
}
}
- XalanNode* parent = m_xpathSupport.getParentOfNode(textNode);
+ XalanNode* parent = DOMServices::getParentOfNode(textNode);
while(0 != parent)
{
1.56 +0 -12 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.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- XSLTEngineImpl.hpp 2000/12/21 04:48:31 1.55
+++ XSLTEngineImpl.hpp 2001/01/03 19:32:50 1.56
@@ -963,18 +963,6 @@
XPathExecutionContext& executionContext);
/**
- * Given a valid element id, return the corresponding element.
- *
- * @param id string representing ID
- * @param doc document to search
- * @return element for ID
- */
- XalanElement*
- getElementByID(
- const XalanDOMString& id,
- const XalanDocument& doc) const;
-
- /**
* Copy an attribute to the created output element, executing attribute
* templates as need be, and processing the 'xsl:use' attribute.
*