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 2002/11/03 04:34:13 UTC
cvs commit: xml-xalan/c/src/XPath XPathFunctionTable.cpp
dbertoni 2002/11/02 19:34:13
Modified: c/src/XPath XPathFunctionTable.cpp
Log:
Added stub function for XSLT functions not implemented by XPath.
Revision Changes Path
1.24 +139 -44 xml-xalan/c/src/XPath/XPathFunctionTable.cpp
Index: XPathFunctionTable.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathFunctionTable.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- XPathFunctionTable.cpp 26 Sep 2002 04:03:21 -0000 1.23
+++ XPathFunctionTable.cpp 3 Nov 2002 03:34:13 -0000 1.24
@@ -97,6 +97,61 @@
+class FunctionNotImplemented : public Function
+{
+public:
+
+ FunctionNotImplemented(const XalanDOMChar* theName) :
+ m_name(theName)
+ {
+ }
+
+ /**
+ * Create a copy of the function object.
+ *
+ * @return pointer to the new object
+ */
+ virtual Function*
+ clone() const
+ {
+ return new FunctionNotImplemented(m_name);
+ }
+
+protected:
+
+ /**
+ * Get the error message to report when
+ * the function is called with the wrong
+ * number of arguments.
+ *
+ * @return function error message
+ */
+ virtual const XalanDOMString
+ getError() const
+ {
+ XalanDOMString theError;
+
+ theError.append("The function '");
+ theError.append(m_name);
+ theError.append("' is not implemented.");
+
+ return theError;
+ }
+
+private:
+
+ // Not implemented...
+ Function&
+ operator=(const Function&);
+
+ bool
+ operator==(const Function&) const;
+
+ const XalanDOMChar* const m_name;
+};
+
+
+
XPathFunctionTable::XPathFunctionTable(bool fCreateTable) :
m_functionTable(),
m_functionTableEnd(m_functionTable + (sizeof(m_functionTable) / sizeof(m_functionTable[0])) - 1)
@@ -275,112 +330,152 @@
try
{
InstallFunction(
- s_substringBefore,
- FunctionSubstringBefore());
+ s_id,
+ FunctionID());
+
+ InstallFunction(
+ s_key,
+ FunctionNotImplemented(s_key));
+
+ InstallFunction(
+ s_not,
+ FunctionNot());
+
+ InstallFunction(
+ s_sum,
+ FunctionSum());
+
+ InstallFunction(
+ s_lang,
+ FunctionLang());
InstallFunction(
s_last,
FunctionLast());
InstallFunction(
- s_position,
- FunctionPosition());
+ s_name,
+ FunctionName());
+
+ InstallFunction(
+ s_true,
+ FunctionTrue());
InstallFunction(
s_count,
FunctionCount());
InstallFunction(
- s_id,
- FunctionID());
+ s_false,
+ FunctionFalse());
InstallFunction(
- s_localName,
- FunctionLocalName());
+ s_floor,
+ FunctionFloor());
InstallFunction(
- s_namespaceUri,
- FunctionNamespaceURI());
+ s_round,
+ FunctionRound());
InstallFunction(
- s_name,
- FunctionName());
+ s_concat,
+ FunctionConcat());
+
+ InstallFunction(
+ s_number,
+ FunctionNumber());
InstallFunction(
s_string,
FunctionString());
InstallFunction(
- s_concat,
- FunctionConcat());
+ s_boolean,
+ FunctionBoolean());
InstallFunction(
- s_startsWith,
- FunctionStartsWith());
+ s_ceiling,
+ FunctionCeiling());
+
+ InstallFunction(
+ s_current,
+ FunctionNotImplemented(s_current));
InstallFunction(
s_contains,
FunctionContains());
InstallFunction(
- s_substringAfter,
- FunctionSubstringAfter());
+ s_document,
+ FunctionNotImplemented(s_document));
+
+ InstallFunction(
+ s_position,
+ FunctionPosition());
InstallFunction(
s_substring,
FunctionSubstring());
InstallFunction(
- s_stringLength,
- FunctionStringLength());
+ s_translate,
+ FunctionTranslate());
InstallFunction(
- s_normalizeSpace,
- FunctionNormalizeSpace());
+ s_localName,
+ FunctionLocalName());
InstallFunction(
- s_translate,
- FunctionTranslate());
+ s_generateId,
+ FunctionNotImplemented(s_generateId));
InstallFunction(
- s_boolean,
- FunctionBoolean());
+ s_startsWith,
+ FunctionStartsWith());
InstallFunction(
- s_not,
- FunctionNot());
+ s_formatNumber,
+ FunctionNotImplemented(s_formatNumber));
InstallFunction(
- s_true,
- FunctionTrue());
+ s_namespaceUri,
+ FunctionNamespaceURI());
InstallFunction(
- s_false,
- FunctionFalse());
+ s_stringLength,
+ FunctionStringLength());
InstallFunction(
- s_lang,
- FunctionLang());
+ s_normalizeSpace,
+ FunctionNormalizeSpace());
InstallFunction(
- s_number,
- FunctionNumber());
+ s_substringAfter,
+ FunctionSubstringAfter());
InstallFunction(
- s_sum,
- FunctionSum());
+ s_systemProperty,
+ FunctionNotImplemented(s_systemProperty));
InstallFunction(
- s_floor,
- FunctionFloor());
+ s_substringBefore,
+ FunctionSubstringBefore());
InstallFunction(
- s_ceiling,
- FunctionCeiling());
+ s_elementAvailable,
+ FunctionNotImplemented(s_elementAvailable));
InstallFunction(
- s_round,
- FunctionRound());
+ s_elementAvailable,
+ FunctionNotImplemented(s_elementAvailable));
+
+ InstallFunction(
+ s_functionAvailable,
+ FunctionNotImplemented(s_functionAvailable));
+
+ InstallFunction(
+ s_unparsedEntityUri,
+ FunctionNotImplemented(s_unparsedEntityUri));
#if 0
std::ofstream theSourceStream("\\foo.cpp");
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org