auriemma 00/11/27 08:35:28
Modified: c/samples/ExternalFunction ExternalFunction.cpp
Log:
Fixed extention function added directly to XPath.
Revision Changes Path
1.11 +9 -13 xml-xalan/c/samples/ExternalFunction/ExternalFunction.cpp
Index: ExternalFunction.cpp
===================================================================
RCS file:
/home/cvs/xml-xalan/c/samples/ExternalFunction/ExternalFunction.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ExternalFunction.cpp 2000/11/27 15:23:16 1.10
+++ ExternalFunction.cpp 2000/11/27 16:35:28 1.11
@@ -72,7 +72,7 @@
executionContext.error("The square-root() function
takes one argument!", context);
}
- assert(args[0].null() == true);
+ assert(args[0].null() == false);
return
executionContext.getXObjectFactory().createNumber(sqrt(args[0]->num()));
}
@@ -132,7 +132,7 @@
executionContext.error("The cube() function takes one
argument!", context);
}
- assert(args[0].null() == true);
+ assert(args[0].null() == false);
return
executionContext.getXObjectFactory().createNumber(pow(args[0]->num(), 3));
}
@@ -172,25 +172,21 @@
/**
* Execute an XPath function object. The function must return a valid
- * object.
+ * object. Called if function has no parameters.
*
* @param executionContext executing context
- * @param context current context node
- * @param opPos current op position
- * @param args vector of pointers to XObject arguments
+ * @param context current context node
* @return pointer to the result XObject
*/
virtual XObjectPtr
execute(
XPathExecutionContext&
executionContext,
- XalanNode*
context,
- int
/* opPos */,
- const XObjectArgVectorType& args)
+ XalanNode*
context)
{
- if (args.size() != 0)
- {
- executionContext.error("The asctime() function takes no
arguments!", context);
- }
+ //if (args.size() != 0)
+ //{
+ // executionContext.error("The asctime() function takes no
arguments!", context);
+ //}
time_t theTime;