OLD | NEW |
1 #define IN_LIBEXSLT | 1 #define IN_LIBEXSLT |
2 #include "libexslt/libexslt.h" | 2 #include "libexslt/libexslt.h" |
3 | 3 |
4 #if defined(WIN32) && !defined (__CYGWIN__) && (!__MINGW32__) | 4 #if defined(WIN32) && !defined (__CYGWIN__) && (!__MINGW32__) |
5 #include <win32config.h> | 5 #include <win32config.h> |
6 #else | 6 #else |
7 #include "config.h" | 7 #include "config.h" |
8 #endif | 8 #endif |
9 | 9 |
10 #include <libxml/tree.h> | 10 #include <libxml/tree.h> |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 if (nargs != 1) { | 173 if (nargs != 1) { |
174 xmlXPathSetArityError(ctxt); | 174 xmlXPathSetArityError(ctxt); |
175 return; | 175 return; |
176 } | 176 } |
177 | 177 |
178 exsltSaxonExpressionFunction(ctxt, 1); | 178 exsltSaxonExpressionFunction(ctxt, 1); |
179 exsltSaxonEvalFunction(ctxt, 1); | 179 exsltSaxonEvalFunction(ctxt, 1); |
180 } | 180 } |
181 | 181 |
182 /** | 182 /** |
| 183 * exsltSaxonSystemIdFunction: |
| 184 * @ctxt: an XPath parser context |
| 185 * @nargs: number of arguments |
| 186 * |
| 187 * Implements the SAXON systemId() function |
| 188 * string saxon:systemId () |
| 189 * This function returns the system ID of the document being styled. |
| 190 */ |
| 191 static void |
| 192 exsltSaxonSystemIdFunction(xmlXPathParserContextPtr ctxt, int nargs) |
| 193 { |
| 194 if (ctxt == NULL) |
| 195 return; |
| 196 if (nargs != 0) { |
| 197 xmlXPathSetArityError(ctxt); |
| 198 return; |
| 199 } |
| 200 |
| 201 if ((ctxt->context) && (ctxt->context->doc) && |
| 202 (ctxt->context->doc->URL)) |
| 203 valuePush(ctxt, xmlXPathNewString(ctxt->context->doc->URL)); |
| 204 else |
| 205 valuePush(ctxt, xmlXPathNewString(BAD_CAST "")); |
| 206 } |
| 207 |
| 208 /** |
183 * exsltSaxonLineNumberFunction: | 209 * exsltSaxonLineNumberFunction: |
184 * @ctxt: an XPath parser context | 210 * @ctxt: an XPath parser context |
185 * @nargs: number of arguments | 211 * @nargs: number of arguments |
186 * | 212 * |
187 * Implements the SAXON line-number() function | 213 * Implements the SAXON line-number() function |
188 * integer saxon:line-number() | 214 * integer saxon:line-number() |
189 * | 215 * |
190 * This returns the line number of the context node in the source document | 216 * This returns the line number of the context node in the source document |
191 * within the entity that contains it. There are no arguments. If line numbers | 217 * within the entity that contains it. There are no arguments. If line numbers |
192 * are not maintained for the current document, the function returns -1. (To | 218 * are not maintained for the current document, the function returns -1. (To |
193 * ensure that line numbers are maintained, use the -l option on the command | 219 * ensure that line numbers are maintained, use the -l option on the command |
194 * line) | 220 * line) |
195 * | 221 * |
196 * The extension has been extended to have the following form: | 222 * The extension has been extended to have the following form: |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 exsltSaxonExpressionFunction); | 283 exsltSaxonExpressionFunction); |
258 xsltRegisterExtModuleFunction((const xmlChar *) "eval", | 284 xsltRegisterExtModuleFunction((const xmlChar *) "eval", |
259 SAXON_NAMESPACE, | 285 SAXON_NAMESPACE, |
260 exsltSaxonEvalFunction); | 286 exsltSaxonEvalFunction); |
261 xsltRegisterExtModuleFunction((const xmlChar *) "evaluate", | 287 xsltRegisterExtModuleFunction((const xmlChar *) "evaluate", |
262 SAXON_NAMESPACE, | 288 SAXON_NAMESPACE, |
263 exsltSaxonEvaluateFunction); | 289 exsltSaxonEvaluateFunction); |
264 xsltRegisterExtModuleFunction ((const xmlChar *) "line-number", | 290 xsltRegisterExtModuleFunction ((const xmlChar *) "line-number", |
265 SAXON_NAMESPACE, | 291 SAXON_NAMESPACE, |
266 exsltSaxonLineNumberFunction); | 292 exsltSaxonLineNumberFunction); |
| 293 xsltRegisterExtModuleFunction ((const xmlChar *) "systemId", |
| 294 SAXON_NAMESPACE, |
| 295 exsltSaxonSystemIdFunction); |
267 } | 296 } |
OLD | NEW |