You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by au...@locus.apache.org on 2000/11/07 17:37:48 UTC
cvs commit: xml-xalan/c/src/XPath FunctionLocalName.cpp FunctionLocalName.hpp
auriemma 00/11/07 08:37:43
Modified: c/src/XPath FunctionLocalName.cpp FunctionLocalName.hpp
Log:
Merged string class changes from hpp to cpp.
Revision Changes Path
1.2 +32 -15 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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- FunctionLocalName.cpp 2000/11/06 19:49:15 1.1
+++ FunctionLocalName.cpp 2000/11/07 16:37:38 1.2
@@ -78,18 +78,21 @@
{
assert(arg1 != 0);
+ XObject* theResult = 0;
+
const NodeRefListBase& theNodeList = arg1->nodeset();
- if (theNodeList.getLength() > 0)
- {
- context = theNodeList.item(0);
+ if (theNodeList.getLength() == 0)
+ {
+ theResult = executionContext.getXObjectFactory().createString(XalanDOMString());
+
}
else
{
- context = 0;
+ theResult = getLocalName(executionContext, *theNodeList.item(0));
}
- return execute(executionContext, context);
+ return theResult;
}
@@ -99,7 +102,7 @@
XPathExecutionContext& executionContext,
XalanNode* context)
{
- XalanDOMString theData;
+ XObject* theResult = 0;
if (context == 0)
{
@@ -107,17 +110,31 @@
}
else
{
- const XalanNode::NodeType theType = context->getNodeType();
-
- if(theType == XalanNode::ATTRIBUTE_NODE ||
- theType == XalanNode::ELEMENT_NODE ||
- theType == XalanNode::PROCESSING_INSTRUCTION_NODE)
- {
- theData = executionContext.getLocalNameOfNode(*context);
- }
+ theResult = getLocalName(executionContext, *context);
}
+
+ return theResult;
+}
+
+
- return executionContext.getXObjectFactory().createString(theData);
+XObject*
+FunctionLocalName::getLocalName(
+ XPathExecutionContext& executionContext,
+ const XalanNode& node)
+{
+ const XalanNode::NodeType theType = node.getNodeType();
+
+ if(theType == XalanNode::ATTRIBUTE_NODE ||
+ theType == XalanNode::ELEMENT_NODE ||
+ theType == XalanNode::PROCESSING_INSTRUCTION_NODE)
+ {
+ return executionContext.getXObjectFactory().createString(executionContext.getLocalNameOfNode(node));
+ }
+ else
+ {
+ return executionContext.getXObjectFactory().createString(XalanDOMString());
+ }
}
1.11 +5 -0 xml-xalan/c/src/XPath/FunctionLocalName.hpp
Index: FunctionLocalName.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionLocalName.hpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- FunctionLocalName.hpp 2000/11/06 19:27:54 1.10
+++ FunctionLocalName.hpp 2000/11/07 16:37:39 1.11
@@ -115,6 +115,11 @@
private:
+ XObject*
+ getLocalName(
+ XPathExecutionContext& executionContext,
+ const XalanNode& node);
+
const XalanDOMString
getError() const;