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 2004/12/30 05:24:37 UTC
cvs commit: xml-xalan/c/samples/XPathWrapper XPathWrapper.cpp
dbertoni 2004/12/29 20:24:37
Modified: c/samples/XPathWrapper XPathWrapper.cpp
Log:
Fixes for GCC 3.4.
Revision Changes Path
1.28 +33 -16 xml-xalan/c/samples/XPathWrapper/XPathWrapper.cpp
Index: XPathWrapper.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/samples/XPathWrapper/XPathWrapper.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- XPathWrapper.cpp 12 Nov 2004 04:02:39 -0000 1.27
+++ XPathWrapper.cpp 30 Dec 2004 04:24:37 -0000 1.28
@@ -81,7 +81,7 @@
{
public:
- typedef XPathWrapper::CharVectorTypeVectorType CharVectorTypeVectorType;
+ typedef XPathWrapper::CharVectorTypeVectorType CharVectorTypeVectorType;
void
evaluate(
@@ -100,6 +100,8 @@
// Just hoist everything...
XALAN_CPP_NAMESPACE_USE
+ typedef XPathConstructionContext::GetAndReleaseCachedString GetAndReleaseCachedString;
+
// Initialize the XPath subsystem...
XPathInit theInit;
@@ -147,15 +149,25 @@
// first get the context nodeset
XPath* const contextXPath = theXPathFactory.create();
- theXPathProcessor.initXPath(*contextXPath,
- theXPathConstructionContext,
- XalanDOMString(context),
- ElementPrefixResolverProxy(rootElem, theEnvSupport, theDOMSupport));
+ const ElementPrefixResolverProxy thePrefixResolver(rootElem, theEnvSupport, theDOMSupport);
+
+ const GetAndReleaseCachedString theGuard(theXPathConstructionContext);
+
+ XalanDOMString& theString = theGuard.get();
+
+ theString = context;
+
+ theXPathProcessor.initXPath(
+ *contextXPath,
+ theXPathConstructionContext,
+ theString,
+ thePrefixResolver);
XObjectPtr xObj =
- contextXPath->execute(rootElem,
- ElementPrefixResolverProxy(rootElem, theEnvSupport, theDOMSupport),
- theExecutionContext);
+ contextXPath->execute(
+ rootElem,
+ thePrefixResolver,
+ theExecutionContext);
const NodeRefListBase& contextNodeList = xObj->nodeset();
@@ -187,14 +199,19 @@
// and now get the result of the primary xpath expression
XPath* const xpath = theXPathFactory.create();
- theXPathProcessor.initXPath(*xpath,
- theXPathConstructionContext,
- TranscodeFromLocalCodePage(expr),
- ElementPrefixResolverProxy(rootElem, theEnvSupport, theDOMSupport));
-
- xObj = xpath->execute(contextNodeList.item(0),
- ElementPrefixResolverProxy(rootElem, theEnvSupport, theDOMSupport),
- theExecutionContext);
+
+ theString = expr;
+
+ theXPathProcessor.initXPath(
+ *xpath,
+ theXPathConstructionContext,
+ theString,
+ thePrefixResolver);
+
+ xObj = xpath->execute(
+ contextNodeList.item(0),
+ thePrefixResolver,
+ theExecutionContext);
// now encode the results. For all types but nodelist, we'll just convert it to a string
// but, for nodelist, we'll convert each node to a string and return a list of them
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org