00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one 00003 * or more contributor license agreements. See the NOTICE file 00004 * distributed with this work for additional information 00005 * regarding copyright ownership. The ASF licenses this file 00006 * to you under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 #if !defined(XALAN_XPATHCAPI_HEADER_GUARD_1357924680) 00019 #define XALAN_XPATHCAPI_HEADER_GUARD_1357924680 00020 00021 00022 00023 #if defined(_MSC_VER) 00024 00025 #if defined(XALAN_BUILD_DLL) 00026 00027 #define XALAN_XPATHCAPI_EXPORT __declspec(dllexport) 00028 #define XALAN_XPATHCAPI_EXPORT_FUNCTION(T) T __declspec(dllexport) 00029 00030 #else 00031 00032 #define XALAN_XPATHCAPI_EXPORT __declspec(dllimport) 00033 #define XALAN_XPATHCAPI_EXPORT_FUNCTION(T) T __declspec(dllimport) 00034 00035 #endif 00036 00037 #else 00038 00039 #define XALAN_XPATHCAPI_EXPORT 00040 #define XALAN_XPATHCAPI_EXPORT_FUNCTION(T) T 00041 00042 #endif 00043 00044 00045 00046 /** 00047 * This is a simple C interface for the class XPathEvaluator. It's 00048 * the user's responsibility to call XalanXPathAPIInitialize() before making 00049 * any other API calls, and to call XalanXPathAPITerminate() when finished 00050 * with the API. 00051 */ 00052 #if defined(__cplusplus) 00053 extern "C" 00054 { 00055 #endif 00056 00057 #define XALAN_XPATH_API_SUCCESS 0 00058 #define XALAN_XPATH_API_ERROR_ALREADY_INITIALIZED 1 00059 #define XALAN_XPATH_API_ERROR_ALREADY_TERMINATED 2 00060 #define XALAN_XPATH_API_ERROR_INITIALIZATION_FAILED 3 00061 #define XALAN_XPATH_API_ERROR_TERMINATION_FAILED 4 00062 #define XALAN_XPATH_API_ERROR_NOT_INITIALIZED 5 00063 #define XALAN_XPATH_API_ERROR_CANNOT_REINITIALIZE 6 00064 #define XALAN_XPATH_API_ERROR_INVALID_PARAMETER 7 00065 #define XALAN_XPATH_API_ERROR_INVALID_EXPRESSION 8 00066 #define XALAN_XPATH_API_ERROR_BAD_XML 9 00067 #define XALAN_XPATH_API_ERROR_UNSUPPORTED_ENCODING 10 00068 #define XALAN_XPATH_API_ERROR_TRANSCODING 11 00069 #define XALAN_XPATH_API_ERROR_INVALID_XPATH 12 00070 #define XALAN_XPATH_API_ERROR_UNKNOWN 13 00071 00072 00073 /** 00074 * Handle used to store the address of XalanTransformer instance. 00075 */ 00076 typedef void* XalanXPathEvaluatorHandle; 00077 00078 /** 00079 * Handle used to store the address of compiled XPath instance. 00080 */ 00081 typedef void* XalanXPathHandle; 00082 00083 00084 #if defined(OS390) 00085 #pragma export(XalanXPathAPIInitialize) 00086 #pragma export(XalanXPathAPITerminate) 00087 #pragma export(XalanCreateXPathEvaluator) 00088 #pragma export(XalanDestroyXPathEvaluator) 00089 #pragma export(XalanCreateXPath) 00090 #pragma export(XalanDestroyXPath) 00091 #pragma export(XalanEvaluateXPathAsBoolean) 00092 #pragma export(XalanEvaluateXPathExpressionAsBoolean) 00093 #endif 00094 00095 /** 00096 * Initialize Xerces and the XPath API. 00097 * 00098 * Should be called only once per process before making 00099 * any other API calls. 00100 * 00101 * @return 0 for success, or a non-zero error code upon failure 00102 */ 00103 XALAN_XPATHCAPI_EXPORT_FUNCTION(int) 00104 XalanXPathAPIInitialize(); 00105 00106 /** 00107 * Terminate Xerces and the XPath API. 00108 * 00109 * Should be called only once per process after deleting all 00110 * instances of XalanXPathEvaluator. Once a process has called 00111 * this function, it cannot use the API for the remaining 00112 * lifetime of the process. 00113 * 00114 * @return 0 for success, or a non-zero error code upon failure 00115 */ 00116 XALAN_XPATHCAPI_EXPORT_FUNCTION(int) 00117 XalanXPathAPITerminate(); 00118 00119 /** 00120 * Create a XalanXPathEvaluator instance. 00121 * 00122 * @param theXalanHandle A pointer to the handle for the new instance. 00123 * @return 0 for success, or a non-zero error code upon failure 00124 */ 00125 XALAN_XPATHCAPI_EXPORT_FUNCTION(int) 00126 XalanCreateXPathEvaluator(XalanXPathEvaluatorHandle* theHandle); 00127 00128 /** 00129 * Destroy a XalanXPathEvaluator instance. 00130 * 00131 * @param theXalanHandle The handle of the instance to destroy. 00132 * @return 0 for success, or a non-zero error code upon failure 00133 */ 00134 XALAN_XPATHCAPI_EXPORT_FUNCTION(int) 00135 XalanDestroyXPathEvaluator(XalanXPathEvaluatorHandle theXalanHandle); 00136 00137 /** 00138 * Creates a compiled XPath instance. 00139 * 00140 * @param theXalanHandle The handle of XalanXPathEvaluatorHandle instance. 00141 * @param theXPathExpression The expression to compile 00142 * @param theXPathExpressionEncoding The encoding of the expression. If NULL or an empty string, the local code page is assumed. 00143 * @param theXPathHandle A pointer to the handle for the new instance 00144 * @return 0 for success, or a non-zero error code upon failure 00145 */ 00146 XALAN_XPATHCAPI_EXPORT_FUNCTION(int) 00147 XalanCreateXPath( 00148 XalanXPathEvaluatorHandle theXalanHandle, 00149 const char* theXPathExpression, 00150 const char* theXPathExpressionEncoding, 00151 XalanXPathHandle* theXPathHandle); 00152 00153 /** 00154 * Destroys a compiled XPath instance. 00155 * 00156 * @param theXalanHandle The handle of XalanXPathEvaluatorHandle instance. 00157 * @param theXPathHandle The handle of XPath instance 00158 * @return 0 for success, or a non-zero error code upon failure 00159 */ 00160 XALAN_XPATHCAPI_EXPORT_FUNCTION(int) 00161 XalanDestroyXPath( 00162 XalanXPathEvaluatorHandle theXalanHandle, 00163 XalanXPathHandle theXPathHandle); 00164 00165 /** 00166 * Evaluates a compiled XPath instance. 00167 * 00168 * @param theXalanHandle The handle of XalanXPathEvaluatorHandle instance. 00169 * @param theXPathHandle The pointer to handle for instance 00170 * @param theXML The XML document to use for evaluating the XPath expression 00171 * @param theResult A pointer to an int to receive the result. 00172 * @return 0 for success, or a non-zero error code upon failure 00173 */ 00174 XALAN_XPATHCAPI_EXPORT_FUNCTION(int) 00175 XalanEvaluateXPathAsBoolean( 00176 XalanXPathEvaluatorHandle theXalanHandle, 00177 XalanXPathHandle theXPathHandle, 00178 const char* theXML, 00179 int* theResult); 00180 00181 /** 00182 * Evaluates an XPath expression 00183 * 00184 * @param theXalanHandle The handle of XalanXPathEvaluatorHandle instance. 00185 * @param theXPathExpression The expression to evaluate 00186 * @param theXPathExpressionEncoding The encoding of the expression. If NULL or an empty string, the local code page is assumed. 00187 * @param theXML The XML document to use for evaluating the XPath expression 00188 * @param theResult A pointer to an int to receive the result. 00189 * @return 0 for success, or a non-zero error code upon failure 00190 */ 00191 XALAN_XPATHCAPI_EXPORT_FUNCTION(int) 00192 XalanEvaluateXPathExpressionAsBoolean( 00193 XalanXPathEvaluatorHandle theXalanHandle, 00194 const char* theXPathExpression, 00195 const char* theXPathExpressionEncoding, 00196 const char* theXML, 00197 int* theResult); 00198 00199 #if defined(__cplusplus) 00200 } 00201 #endif 00202 00203 00204 00205 #endif
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11 |
|