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/08 19:30:06 UTC
cvs commit: xml-xalan/c/src/XSLT ElemAttribute.cpp ElemElement.cpp ElemLiteralResult.cpp FunctionGenerateID.cpp StylesheetExecutionContext.hpp StylesheetExecutionContextDefault.cpp StylesheetExecutionContextDefault.hpp StylesheetHandler.cpp TraceListenerDefault.cpp XSLTEngineImpl.cpp XSLTEngineImpl.hpp
dbertoni 01/01/08 10:30:05
Modified: c/src/XSLT ElemAttribute.cpp ElemElement.cpp
ElemLiteralResult.cpp FunctionGenerateID.cpp
StylesheetExecutionContext.hpp
StylesheetExecutionContextDefault.cpp
StylesheetExecutionContextDefault.hpp
StylesheetHandler.cpp TraceListenerDefault.cpp
XSLTEngineImpl.cpp XSLTEngineImpl.hpp
Log:
XPathSupport and XPathSupportDefault have been removed. Removed support for Xerces' DOMString.
Revision Changes Path
1.13 +1 -12 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.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ElemAttribute.cpp 2000/12/21 04:48:30 1.12
+++ ElemAttribute.cpp 2001/01/08 18:29:48 1.13
@@ -197,16 +197,12 @@
if(isEmpty(prefix) == false)
{
-#if defined(XALAN_USE_XERCES_DOMSTRING)
- assign(attrName, prefix + DOMServices::s_XMLNamespaceSeparatorString + attrName);
-#else
reserve(
attrName,
length(attrName) + DOMServices::s_XMLNamespaceSeparatorStringLength + length(prefix) + 1);
insert(attrName, 0, DOMServices::s_XMLNamespaceSeparatorString);
insert(attrName, 0, prefix);
-#endif
}
else
{
@@ -214,9 +210,6 @@
executionContext.getUniqueNamespaceValue(newPrefix);
-#if defined(XALAN_USE_XERCES_DOMSTRING)
- const XalanDOMString nsDecl = DOMServices::s_XMLNamespaceWithSeparator + newPrefix;
-#else
StylesheetExecutionContext::GetAndReleaseCachedString nsDecl(executionContext);
reserve(nsDecl, DOMServices::s_XMLNamespaceWithSeparatorLength + length(newPrefix) + 1);
@@ -224,20 +217,16 @@
assign(nsDecl, DOMServices::s_XMLNamespaceWithSeparator);
append(nsDecl, newPrefix);
-#endif
+
executionContext.addResultAttribute(nsDecl, attrNameSpace);
// $$$ ToDo: Move these blocks (and those in ElemElement.cpp) into a common set of functions...
-#if defined(XALAN_USE_XERCES_DOMSTRING)
- assign(attrName, newPrefix + DOMServices::s_XMLNamespaceSeparatorString + attrName);
-#else
reserve(
attrName,
length(attrName) + DOMServices::s_XMLNamespaceSeparatorStringLength + length(newPrefix) + 1);
insert(attrName, 0, DOMServices::s_XMLNamespaceSeparatorString);
insert(attrName, 0, newPrefix);
-#endif
}
}
}
1.13 +0 -8 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.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ElemElement.cpp 2000/12/21 04:48:30 1.12
+++ ElemElement.cpp 2001/01/08 18:29:50 1.13
@@ -226,16 +226,12 @@
if(isEmpty(prefix) == false)
{
-#if defined(XALAN_USE_XERCES_DOMSTRING)
- elemName = prefix + DOMServices::s_XMLNamespaceSeparatorString + elemName;
-#else
reserve(
elemName,
length(elemName) + DOMServices::s_XMLNamespaceSeparatorStringLength + length(prefix) + 1);
insert(elemName, 0, DOMServices::s_XMLNamespaceSeparatorString);
insert(elemName, 0, prefix);
-#endif
}
else
{
@@ -253,16 +249,12 @@
executionContext.addResultAttribute(nsDecl, elemNameSpace);
-#if defined(XALAN_USE_XERCES_DOMSTRING)
- assign(elemName, newPrefix + DOMServices::s_XMLNamespaceSeparatorString + elemName);
-#else
reserve(
elemName,
length(elemName) + DOMServices::s_XMLNamespaceSeparatorStringLength + length(newPrefix) + 1);
insert(elemName, 0, DOMServices::s_XMLNamespaceSeparatorString);
insert(elemName, 0, newPrefix);
-#endif
}
}
}
1.26 +0 -2 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.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- ElemLiteralResult.cpp 2000/12/04 20:48:30 1.25
+++ ElemLiteralResult.cpp 2001/01/08 18:29:51 1.26
@@ -245,8 +245,6 @@
StylesheetExecutionContext::GetAndReleaseCachedString theGuard2(executionContext);
- XalanDOMString& theStringedValue = theGuard2.get();
-
avt->evaluate(theStringedValue, sourceNode, *this, executionContext);
if (isEmpty(thePrefix) == true ||
1.14 +0 -7 xml-xalan/c/src/XSLT/FunctionGenerateID.cpp
Index: FunctionGenerateID.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionGenerateID.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- FunctionGenerateID.cpp 2000/12/21 04:48:30 1.13
+++ FunctionGenerateID.cpp 2001/01/08 18:29:51 1.14
@@ -131,18 +131,11 @@
{
XPathExecutionContext::GetAndReleaseCachedString theID(executionContext);
-#if defined(XALAN_USE_XERCES_DOMSTRING)
- getSuffix(context, theID);
- assert(length(theID) != 0);
-
- return executionContext.getXObjectFactory().createString(m_prefix + theID);
-#else
theID.get() = m_prefix;
getSuffix(context, theID);
return executionContext.getXObjectFactory().createString(theID);
-#endif
}
}
1.44 +0 -9 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.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- StylesheetExecutionContext.hpp 2001/01/03 19:32:48 1.43
+++ StylesheetExecutionContext.hpp 2001/01/08 18:29:52 1.44
@@ -1375,16 +1375,10 @@
createNodeSet(XalanNode& theNode) = 0;
virtual bool
- isIgnorableWhitespace(const XalanText& node) const = 0;
-
- virtual bool
isNodeAfter(
const XalanNode& node1,
const XalanNode& node2) const = 0;
- virtual const XalanDOMString&
- getNamespaceOfNode(const XalanNode& theNode) const = 0;
-
virtual const NodeRefListBase&
getContextNodeList() const = 0;
@@ -1441,9 +1435,6 @@
virtual bool
releaseCachedString(XalanDOMString& theString) = 0;
-
- virtual bool
- getProcessNamespaces() const = 0;
virtual void
getNodeSetByKey(
1.48 +2 -26 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.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- StylesheetExecutionContextDefault.cpp 2001/01/03 19:32:49 1.47
+++ StylesheetExecutionContextDefault.cpp 2001/01/08 18:29:52 1.48
@@ -114,14 +114,14 @@
StylesheetExecutionContextDefault::StylesheetExecutionContextDefault(
XSLTEngineImpl& xsltProcessor,
XPathEnvSupport& theXPathEnvSupport,
- XPathSupport& theXPathSupport,
+ DOMSupport& theDOMSupport,
XObjectFactory& theXObjectFactory,
XalanNode* theCurrentNode,
const NodeRefListBase* theContextNodeList,
const PrefixResolver* thePrefixResolver) :
StylesheetExecutionContext(),
m_xpathExecutionContextDefault(theXPathEnvSupport,
- theXPathSupport,
+ theDOMSupport,
theXObjectFactory,
theCurrentNode,
theContextNodeList,
@@ -1335,14 +1335,6 @@
bool
-StylesheetExecutionContextDefault::isIgnorableWhitespace(const XalanText& node) const
-{
- return m_xpathExecutionContextDefault.isIgnorableWhitespace(node);
-}
-
-
-
-bool
StylesheetExecutionContextDefault::isNodeAfter(
const XalanNode& node1,
const XalanNode& node2) const
@@ -1352,14 +1344,6 @@
-const XalanDOMString&
-StylesheetExecutionContextDefault::getNamespaceOfNode(const XalanNode& theNode) const
-{
- return m_xpathExecutionContextDefault.getNamespaceOfNode(theNode);
-}
-
-
-
const NodeRefListBase&
StylesheetExecutionContextDefault::getContextNodeList() const
{
@@ -1497,14 +1481,6 @@
StylesheetExecutionContextDefault::releaseCachedString(XalanDOMString& theString)
{
return m_xpathExecutionContextDefault.releaseCachedString(theString);
-}
-
-
-
-bool
-StylesheetExecutionContextDefault::getProcessNamespaces() const
-{
- return m_xpathExecutionContextDefault.getProcessNamespaces();
}
1.44 +12 -11 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.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- StylesheetExecutionContextDefault.hpp 2001/01/03 19:32:49 1.43
+++ StylesheetExecutionContextDefault.hpp 2001/01/08 18:29:53 1.44
@@ -85,7 +85,6 @@
class XPathProcessor;
-class XPathSupport;
class XObjectFactory;
class XSLTEngineImpl;
@@ -125,10 +124,21 @@
typedef Stylesheet::KeyTablesTableType KeyTablesTableType;
typedef VariablesStack::ParamsVectorType ParamsVectorType;
+
+ /**
+ * Construct a StylesheetExecutionContextDefault object
+ *
+ * @param theXPathEnvSupport XPath environment support class instance
+ * @param theDOMSupport DOMSupport class instance
+ * @param theXobjectFactory factory class instance for XObjects
+ * @param theCurrentNode current node in the source tree
+ * @param theContextNodeList node list for current context
+ * @param thePrefixResolver pointer to prefix resolver to use
+ */
StylesheetExecutionContextDefault(
XSLTEngineImpl& xsltProcessor,
XPathEnvSupport& theXPathEnvSupport,
- XPathSupport& theXPathSupport,
+ DOMSupport& theDOMSupport,
XObjectFactory& theXObjectFactory,
XalanNode* theCurrentNode = 0,
const NodeRefListBase* theContextNodeList = 0,
@@ -593,16 +603,10 @@
createNodeSet(XalanNode& theNode);
virtual bool
- isIgnorableWhitespace(const XalanText& node) const;
-
- virtual bool
isNodeAfter(
const XalanNode& node1,
const XalanNode& node2) const;
- virtual const XalanDOMString&
- getNamespaceOfNode(const XalanNode& theNode) const;
-
virtual const NodeRefListBase&
getContextNodeList() const;
@@ -659,9 +663,6 @@
virtual bool
releaseCachedString(XalanDOMString& theString);
-
- virtual bool
- getProcessNamespaces() const;
virtual void
getNodeSetByKey(
1.51 +2 -2 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.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- StylesheetHandler.cpp 2001/01/03 15:18:25 1.50
+++ StylesheetHandler.cpp 2001/01/08 18:29:54 1.51
@@ -1604,7 +1604,7 @@
m_namespaces(),
m_namespacesHandler()
{
- m_handler.m_accumulateText.clear();
+ clear(m_handler.m_accumulateText);
m_handler.m_elemStack.clear();
m_handler.m_pTemplate = 0;
m_handler.m_lastPopped = 0;
@@ -1633,7 +1633,7 @@
m_handler.m_elemStack.end(),
DeleteFunctor<ElemTemplateElement>());
- m_handler.m_accumulateText.clear();
+ clear(m_handler.m_accumulateText);
m_handler.m_elemStack = m_elemStack;
m_handler.m_elemStackParentedElements = m_elemStackParentedElements;
m_handler.m_pTemplate = m_pTemplate;
1.7 +1 -1 xml-xalan/c/src/XSLT/TraceListenerDefault.cpp
Index: TraceListenerDefault.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/TraceListenerDefault.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- TraceListenerDefault.cpp 2000/11/02 01:46:28 1.6
+++ TraceListenerDefault.cpp 2001/01/08 18:29:54 1.7
@@ -128,7 +128,7 @@
static_cast<const ElemTextLiteral&>(ev.m_styleNode);
#endif
- m_printWriter.println(c_wstr(etl.getText()), etl.getText().size());
+ m_printWriter.println(&*etl.getText().begin(), etl.getText().size());
}
break;
1.79 +19 -39 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.78
retrieving revision 1.79
diff -u -r1.78 -r1.79
--- XSLTEngineImpl.cpp 2001/01/03 19:32:49 1.78
+++ XSLTEngineImpl.cpp 2001/01/08 18:29:55 1.79
@@ -93,6 +93,7 @@
#include <DOMSupport/DOMServices.hpp>
+#include <DOMSupport/DOMSupport.hpp>
@@ -117,8 +118,6 @@
#include <XPath/XPathExecutionContextDefault.hpp>
#include <XPath/XPathFactory.hpp>
#include <XPath/XPathProcessorImpl.hpp>
-#include <XPath/XPathSupport.hpp>
-#include <XPath/XPathSupportDefault.hpp>
#include <XPath/XResultTreeFrag.hpp>
@@ -154,7 +153,6 @@
XSLTEngineImpl::XSLTEngineImpl(
XMLParserLiaison& parserLiaison,
- XPathSupport& xpathSupport,
XPathEnvSupport& xpathEnvSupport,
DOMSupport& domSupport,
XObjectFactory& xobjectFactory,
@@ -183,7 +181,6 @@
m_uniqueNSValue(0),
m_topLevelParams(),
m_parserLiaison(parserLiaison),
- m_xpathSupport(xpathSupport),
m_xpathEnvSupport(xpathEnvSupport),
m_domSupport(domSupport),
m_executionContext(0),
@@ -209,10 +206,10 @@
m_outputContextStack.pushContext();
- m_xpathSupport.reset();
m_xpathEnvSupport.reset();
m_xpathFactory.reset();
m_xobjectFactory.reset();
+ m_domSupport.reset();
m_resultNamespacesStack.clear();
}
@@ -628,7 +625,7 @@
XalanDOMString stringHolder;
- const XalanDOMString localXSLURLString = clone(trim(xslURLString));
+ const XalanDOMString localXSLURLString = trim(xslURLString);
const unsigned int fragIndex = indexOf(localXSLURLString, XalanUnicode::charNumberSign);
@@ -691,13 +688,10 @@
assert(nsNode != 0);
- XPathEnvSupportDefault theXPathEnvSupportDefault;
- XPathSupportDefault theXPathSupportDefault(m_domSupport);
+ ElementPrefixResolverProxy theProxy(nsNode, m_xpathEnvSupport, m_domSupport);
- ElementPrefixResolverProxy theProxy(nsNode, theXPathEnvSupportDefault, theXPathSupportDefault);
-
- XPathExecutionContextDefault theExecutionContext(theXPathEnvSupportDefault,
- theXPathSupportDefault,
+ XPathExecutionContextDefault theExecutionContext(m_xpathEnvSupport,
+ m_domSupport,
m_xobjectFactory,
&fragBase,
0,
@@ -868,8 +862,7 @@
if(XalanNode::ELEMENT_NODE != node.getNodeType()) return tok;
- const XalanDOMString ns =
- m_xpathSupport.getNamespaceOfNode(node);
+ const XalanDOMString& ns = node.getNamespaceURI();
if(equals(ns, s_XSLNameSpaceURL))
{
@@ -1475,26 +1468,11 @@
addResultNamespaceDecl(p, value);
}
-
- attList.removeAttribute(c_wstr(aname));
-
- if (length(value) > 0)
- {
- attList.addAttribute(
- c_wstr(aname),
- c_wstr(Constants::ATTRTYPE_CDATA),
- c_wstr(value));
- }
- else
- {
- const XalanDOMChar theDummy = 0;
- attList.addAttribute(
- c_wstr(aname),
- c_wstr(Constants::ATTRTYPE_CDATA),
- &theDummy);
- }
-
+ attList.addAttribute(
+ c_wstr(aname),
+ c_wstr(Constants::ATTRTYPE_CDATA),
+ c_wstr(value));
}
@@ -2401,7 +2379,7 @@
{
ElementPrefixResolverProxy theProxy(&prefixResolver,
m_xpathEnvSupport,
- m_xpathSupport);
+ m_domSupport);
return evalXPathStr(str, contextNode, theProxy, executionContext);
}
@@ -2734,11 +2712,13 @@
if(!theTextNode.isIgnorableWhitespace())
{
- if(0 == length(theTextNode.getData()))
+ const XalanDOMString& data = theTextNode.getData();
+
+ if(0 == length(data))
{
return true;
}
- else
+ else if(!isXMLWhitespace(data))
{
return false;
}
@@ -2760,7 +2740,7 @@
double highPreserveScore = XPath::s_MatchScoreNone;
double highStripScore = XPath::s_MatchScoreNone;
- ElementPrefixResolverProxy theProxy(parentElem, m_xpathEnvSupport, m_xpathSupport);
+ ElementPrefixResolverProxy theProxy(parentElem, m_xpathEnvSupport, m_domSupport);
{
// $$$ ToDo: All of this should be moved into a member of
@@ -2932,7 +2912,7 @@
const XalanDOMString& theName,
const XalanDOMString& expression)
{
- const QNameByValue qname(theName, 0, m_xpathEnvSupport, m_xpathSupport);
+ const QNameByValue qname(theName, 0, m_xpathEnvSupport, m_domSupport);
m_topLevelParams.push_back(ParamVectorType::value_type(qname, expression));
}
@@ -2944,7 +2924,7 @@
const XalanDOMString& theName,
XObjectPtr theValue)
{
- const QNameByValue qname(theName, 0, m_xpathEnvSupport, m_xpathSupport);
+ const QNameByValue qname(theName, 0, m_xpathEnvSupport, m_domSupport);
m_topLevelParams.push_back(ParamVectorType::value_type(qname, theValue));
}
1.57 +2 -17 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.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- XSLTEngineImpl.hpp 2001/01/03 19:32:50 1.56
+++ XSLTEngineImpl.hpp 2001/01/08 18:29:56 1.57
@@ -132,7 +132,6 @@
class XPathEnvSupport;
class XPathFactory;
class XPathProcessor;
-class XPathSupport;
class XSLTResultTarget;
@@ -189,14 +188,13 @@
*
* @param XMLParserLiaison liaison to an object that can help with a
* specific parser implementation
- * @param xpathSupport $$$
- * @param xpathEnvSupport $$$
+ * @param xpathEnvSupport An XPathEnvSupport instance
+ * @param domSupport A DOMSupport instance for the DOM being used
* @param xobjectFactory object responsible for XObject objects
* @param xpathFactory object responsible for XPath objects
*/
XSLTEngineImpl(
XMLParserLiaison& parserLiaison,
- XPathSupport& xpathSupport,
XPathEnvSupport& xpathEnvSupport,
DOMSupport& domSupport,
XObjectFactory& xobjectFactory,
@@ -1011,17 +1009,6 @@
reset();
/**
- * Retrieve the XPath support object
- *
- * @return XPath support object
- */
- XPathSupport&
- getXPathSupport()
- {
- return m_xpathSupport;
- }
-
- /**
* Retrieve the XPath environment support object
*
* @return XPath environment support object
@@ -1674,8 +1661,6 @@
private:
XMLParserLiaison& m_parserLiaison;
-
- XPathSupport& m_xpathSupport;
XPathEnvSupport& m_xpathEnvSupport;