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 2003/11/05 23:18:42 UTC
cvs commit: xml-xalan/c/src/xalanc/XSLT ElemForEach.cpp StylesheetExecutionContext.hpp StylesheetExecutionContextDefault.cpp StylesheetExecutionContextDefault.hpp XSLTEngineImpl.cpp
dbertoni 2003/11/05 14:18:42
Modified: c/src/xalanc/XSLT ElemForEach.cpp
StylesheetExecutionContext.hpp
StylesheetExecutionContextDefault.cpp
StylesheetExecutionContextDefault.hpp
XSLTEngineImpl.cpp
Log:
Cleaned up obsolete code that used exceptions to handle indexes in patterns. push and pop the context node list to an internal stack for better stack management.
Revision Changes Path
1.5 +3 -3 xml-xalan/c/src/xalanc/XSLT/ElemForEach.cpp
Index: ElemForEach.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/ElemForEach.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ElemForEach.cpp 11 Aug 2003 20:31:29 -0000 1.4
+++ ElemForEach.cpp 5 Nov 2003 22:18:42 -0000 1.5
@@ -468,7 +468,7 @@
else
{
typedef StylesheetExecutionContext::SetAndRestoreCurrentStackFrameIndex SetAndRestoreCurrentStackFrameIndex;
- typedef StylesheetExecutionContext::ContextNodeListSetAndRestore ContextNodeListSetAndRestore;
+ typedef StylesheetExecutionContext::ContextNodeListPushAndPop ContextNodeListPushAndPop;
typedef StylesheetExecutionContext::BorrowReturnMutableNodeRefList BorrowReturnMutableNodeRefList;
BorrowReturnMutableNodeRefList sortedSourceNodes(executionContext);
@@ -480,7 +480,7 @@
executionContext,
selectStackFrameIndex);
- ContextNodeListSetAndRestore theContextNodeListSetAndRestore(
+ ContextNodeListPushAndPop theContextNodeListPushAndPop(
executionContext,
*sourceNodes);
@@ -514,7 +514,7 @@
}
// Create an object to set and restore the context node list...
- const StylesheetExecutionContext::ContextNodeListSetAndRestore theContextNodeListSetAndRestore(
+ const StylesheetExecutionContext::ContextNodeListPushAndPop theContextNodeLisPushAndPop(
executionContext,
sourceNodes);
1.9 +6 -9 xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContext.hpp
Index: StylesheetExecutionContext.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContext.hpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- StylesheetExecutionContext.hpp 11 Aug 2003 20:31:29 -0000 1.8
+++ StylesheetExecutionContext.hpp 5 Nov 2003 22:18:42 -0000 1.9
@@ -1802,11 +1802,14 @@
const XalanNode& node1,
const XalanNode& node2) const = 0;
- virtual const NodeRefListBase&
- getContextNodeList() const = 0;
+ virtual void
+ pushContextNodeList(const NodeRefListBase& theList) = 0;
virtual void
- setContextNodeList(const NodeRefListBase& theList) = 0;
+ popContextNodeList() = 0;
+
+ virtual const NodeRefListBase&
+ getContextNodeList() const = 0;
virtual size_type
getContextNodeListLength() const = 0;
@@ -1928,12 +1931,6 @@
virtual bool
shouldStripSourceNode(const XalanNode& node) = 0;
-
- virtual bool
- getThrowFoundIndex() const = 0;
-
- virtual void
- setThrowFoundIndex(bool fThrow) = 0;
virtual XalanDocument*
getSourceDocument(const XalanDOMString& theURI) const = 0;
1.11 +13 -21 xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContextDefault.cpp
Index: StylesheetExecutionContextDefault.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContextDefault.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- StylesheetExecutionContextDefault.cpp 26 Oct 2003 01:17:39 -0000 1.10
+++ StylesheetExecutionContextDefault.cpp 5 Nov 2003 22:18:42 -0000 1.11
@@ -1726,18 +1726,26 @@
-const NodeRefListBase&
-StylesheetExecutionContextDefault::getContextNodeList() const
+void
+StylesheetExecutionContextDefault::pushContextNodeList(const NodeRefListBase& theContextNodeList)
{
- return m_xpathExecutionContextDefault.getContextNodeList();
+ m_xpathExecutionContextDefault.pushContextNodeList(theContextNodeList);
}
void
-StylesheetExecutionContextDefault::setContextNodeList(const NodeRefListBase& theContextNodeList)
+StylesheetExecutionContextDefault::popContextNodeList()
+{
+ m_xpathExecutionContextDefault.popContextNodeList();
+}
+
+
+
+const NodeRefListBase&
+StylesheetExecutionContextDefault::getContextNodeList() const
{
- m_xpathExecutionContextDefault.setContextNodeList(theContextNodeList);
+ return m_xpathExecutionContextDefault.getContextNodeList();
}
@@ -2012,22 +2020,6 @@
{
return m_xsltProcessor->shouldStripSourceNode(*this, node);
}
-}
-
-
-
-bool
-StylesheetExecutionContextDefault::getThrowFoundIndex() const
-{
- return m_xpathExecutionContextDefault.getThrowFoundIndex();
-}
-
-
-
-void
-StylesheetExecutionContextDefault::setThrowFoundIndex(bool fThrow)
-{
- m_xpathExecutionContextDefault.setThrowFoundIndex(fThrow);
}
1.9 +6 -9 xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContextDefault.hpp
Index: StylesheetExecutionContextDefault.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContextDefault.hpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- StylesheetExecutionContextDefault.hpp 26 Oct 2003 00:50:30 -0000 1.8
+++ StylesheetExecutionContextDefault.hpp 5 Nov 2003 22:18:42 -0000 1.9
@@ -830,11 +830,14 @@
const XalanNode& node1,
const XalanNode& node2) const;
- virtual const NodeRefListBase&
- getContextNodeList() const;
+ virtual void
+ pushContextNodeList(const NodeRefListBase& theList);
virtual void
- setContextNodeList(const NodeRefListBase& theList);
+ popContextNodeList();
+
+ virtual const NodeRefListBase&
+ getContextNodeList() const;
virtual size_type
getContextNodeListLength() const;
@@ -925,12 +928,6 @@
virtual bool
shouldStripSourceNode(const XalanNode& node);
-
- virtual bool
- getThrowFoundIndex() const;
-
- virtual void
- setThrowFoundIndex(bool fThrow);
virtual XalanDocument*
getSourceDocument(const XalanDOMString& theURI) const;
1.10 +0 -8 xml-xalan/c/src/xalanc/XSLT/XSLTEngineImpl.cpp
Index: XSLTEngineImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/XSLTEngineImpl.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- XSLTEngineImpl.cpp 26 Oct 2003 00:50:30 -0000 1.9
+++ XSLTEngineImpl.cpp 5 Nov 2003 22:18:42 -0000 1.10
@@ -757,14 +757,10 @@
if(nl.getLength() == 0)
{
- NodeRefList theEmptyList;
-
ds = XALAN_STATIC_UCODE_STRING("//*[@id='");
ds += fragID;
ds += XALAN_STATIC_UCODE_STRING("']");
- theExecutionContext.setContextNodeList(theEmptyList);
-
const XObjectPtr xobj(evalXPathStr(ds, theExecutionContext));
assert(xobj.null() == false);
@@ -776,8 +772,6 @@
ds += fragID;
ds += XALAN_STATIC_UCODE_STRING("']");
- theExecutionContext.setContextNodeList(theEmptyList);
-
const XObjectPtr xobj(evalXPathStr(ds, theExecutionContext));
assert(xobj.null() == false);
@@ -786,8 +780,6 @@
if(nl.getLength() == 0)
{
// Well, hell, maybe it's an XPath...
- theExecutionContext.setContextNodeList(theEmptyList);
-
const XObjectPtr xobj(evalXPathStr(fragID, theExecutionContext));
assert(xobj.null() == false);
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org