Lines Matching defs:ctxt

58  * @ctxt:  a void * but the XSLT transformation context actually
68 xsltXPathFunctionLookup (xmlXPathContextPtr ctxt,
72 if ((ctxt == NULL) || (name == NULL) || (ns_uri == NULL))
82 ret = (xmlXPathFunction) xmlHashLookup2(ctxt->funcHash, name, ns_uri);
84 XML_CAST_FPTR(ret) = xmlHashLookup2(ctxt->funcHash, name, ns_uri);
105 xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
115 tctxt = xsltXPathGetTransformContext(ctxt);
117 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
119 valuePush(ctxt, xmlXPathNewNodeSet(NULL));
125 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
127 valuePush(ctxt, xmlXPathNewNodeSet(NULL));
150 valuePush(ctxt, xmlXPathNewNodeSet(NULL));
161 valuePush(ctxt,
170 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
196 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
202 valuePush(ctxt, object);
209 valuePush(ctxt, xmlXPathNewNodeSet(NULL));
214 * @ctxt: the XPath Parser context
221 xsltDocumentFunction(xmlXPathParserContextPtr ctxt, int nargs)
228 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
231 ctxt->error = XPATH_INVALID_ARITY;
234 if (ctxt->value == NULL) {
235 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
237 ctxt->error = XPATH_INVALID_TYPE;
242 if (ctxt->value->type != XPATH_NODESET) {
243 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
245 ctxt->error = XPATH_INVALID_TYPE;
249 obj2 = valuePop(ctxt);
252 if (ctxt->value->type == XPATH_NODESET) {
256 obj = valuePop(ctxt);
261 valuePush(ctxt,
263 xmlXPathStringFunction(ctxt, 1);
265 valuePush(ctxt, xmlXPathObjectCopy(obj2));
267 valuePush(ctxt,
271 xsltDocumentFunction(ctxt, 2);
272 newobj = valuePop(ctxt);
282 valuePush(ctxt, ret);
288 xmlXPathStringFunction(ctxt, 1);
289 if (ctxt->value->type != XPATH_STRING) {
290 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
292 ctxt->error = XPATH_INVALID_TYPE;
297 obj = valuePop(ctxt);
299 valuePush(ctxt, xmlXPathNewNodeSet(NULL));
315 tctxt = xsltXPathGetTransformContext(ctxt);
328 valuePush(ctxt, xmlXPathNewNodeSet(NULL));
330 xsltDocumentFunctionLoadDocument( ctxt, URI );
341 * @ctxt: the XPath Parser context
348 xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
358 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
360 ctxt->error = XPATH_INVALID_ARITY;
364 obj2 = valuePop(ctxt);
365 xmlXPathStringFunction(ctxt, 1);
367 (ctxt->value == NULL) || (ctxt->value->type != XPATH_STRING)) {
368 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
370 ctxt->error = XPATH_INVALID_TYPE;
375 obj1 = valuePop(ctxt);
385 valuePush(ctxt, xmlXPathObjectCopy(obj1));
386 valuePush(ctxt,
388 xmlXPathStringFunction(ctxt, 1);
389 xsltKeyFunction(ctxt, 2);
390 newobj = valuePop(ctxt);
396 valuePush(ctxt, ret);
412 keyURI = xmlXPathNsLookup(ctxt->context, prefix);
414 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
426 valuePush(ctxt, obj2);
427 xmlXPathStringFunction(ctxt, 1);
428 if ((ctxt->value == NULL) || (ctxt->value->type != XPATH_STRING)) {
429 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
431 ctxt->error = XPATH_INVALID_TYPE;
436 obj2 = valuePop(ctxt);
439 tctxt = xsltXPathGetTransformContext(ctxt);
442 if ((ctxt->context->doc != NULL) &&
443 (tctxt->document->doc != ctxt->context->doc)) {
450 if (xmlStrEqual((const xmlChar *)ctxt->context->doc->name,
455 if (ctxt->context->doc->_private == NULL) /* nope */
456 ctxt->context->doc->_private =
457 xsltNewDocument(tctxt, ctxt->context->doc);
458 tctxt->document = ctxt->context->doc->_private;
461 tctxt->document = xsltFindDocument(tctxt, ctxt->context->doc);
465 tctxt->xpathCtxt->doc = ctxt->context->doc;
471 valuePush(ctxt, xmlXPathWrapNodeSet(
486 * @ctxt: the XPath Parser context
493 xsltUnparsedEntityURIFunction(xmlXPathParserContextPtr ctxt, int nargs){
497 if ((nargs != 1) || (ctxt->value == NULL)) {
500 ctxt->error = XPATH_INVALID_ARITY;
503 obj = valuePop(ctxt);
510 valuePush(ctxt, xmlXPathNewString((const xmlChar *)""));
514 entity = xmlGetDocEntity(ctxt->context->doc, str);
516 valuePush(ctxt, xmlXPathNewString((const xmlChar *)""));
519 valuePush(ctxt, xmlXPathNewString(entity->URI));
521 valuePush(ctxt, xmlXPathNewString((const xmlChar *)""));
529 * @ctxt: the XPath Parser context
536 xsltFormatNumberFunction(xmlXPathParserContextPtr ctxt, int nargs)
546 tctxt = xsltXPathGetTransformContext(ctxt);
557 decimalObj = valuePop(ctxt);
567 formatObj = valuePop(ctxt);
569 numberObj = valuePop(ctxt);
580 valuePush(ctxt, xmlXPathNewString(result));
592 * @ctxt: the XPath Parser context
599 xsltGenerateIdFunction(xmlXPathParserContextPtr ctxt, int nargs){
605 cur = ctxt->context->node;
611 if ((ctxt->value == NULL) || (ctxt->value->type != XPATH_NODESET)) {
612 ctxt->error = XPATH_INVALID_TYPE;
613 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
617 obj = valuePop(ctxt);
621 valuePush(ctxt, xmlXPathNewCString(""));
632 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
634 ctxt->error = XPATH_INVALID_ARITY;
644 valuePush(ctxt, xmlXPathNewString(str));
649 * @ctxt: the XPath Parser context
656 xsltSystemPropertyFunction(xmlXPathParserContextPtr ctxt, int nargs){
662 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
664 ctxt->error = XPATH_INVALID_ARITY;
667 if ((ctxt->value == NULL) || (ctxt->value->type != XPATH_STRING)) {
668 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
670 ctxt->error = XPATH_INVALID_TYPE;
673 obj = valuePop(ctxt);
675 valuePush(ctxt, xmlXPathNewString((const xmlChar *)""));
681 nsURI = xmlXPathNsLookup(ctxt->context, prefix);
683 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
694 tctxt = xsltXPathGetTransformContext(ctxt);
707 valuePush(ctxt, xmlXPathNewString(
711 valuePush(ctxt, xmlXPathNewString(
717 valuePush(ctxt, xmlXPathNewString(
722 valuePush(ctxt, xmlXPathNewString(
725 valuePush(ctxt, xmlXPathNewString(
728 valuePush(ctxt, xmlXPathNewString((const xmlChar *)""));
741 * @ctxt: the XPath Parser context
748 xsltElementAvailableFunction(xmlXPathParserContextPtr ctxt, int nargs){
755 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
757 ctxt->error = XPATH_INVALID_ARITY;
760 if ((ctxt->value == NULL) || (ctxt->value->type != XPATH_STRING)) {
761 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
763 ctxt->error = XPATH_INVALID_TYPE;
766 obj = valuePop(ctxt);
767 tctxt = xsltXPathGetTransformContext(ctxt);
769 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
772 valuePush(ctxt, xmlXPathNewBoolean(0));
785 nsURI = xmlXPathNsLookup(ctxt->context, prefix);
787 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
793 valuePush(ctxt, xmlXPathNewBoolean(1));
795 valuePush(ctxt, xmlXPathNewBoolean(0));
807 * @ctxt: the XPath Parser context
814 xsltFunctionAvailableFunction(xmlXPathParserContextPtr ctxt, int nargs){
820 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
822 ctxt->error = XPATH_INVALID_ARITY;
825 if ((ctxt->value == NULL) || (ctxt->value->type != XPATH_STRING)) {
826 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
828 ctxt->error = XPATH_INVALID_TYPE;
831 obj = valuePop(ctxt);
837 nsURI = xmlXPathNsLookup(ctxt->context, prefix);
839 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
844 if (xmlXPathFunctionLookupNS(ctxt->context, name, nsURI) != NULL) {
845 valuePush(ctxt, xmlXPathNewBoolean(1));
847 valuePush(ctxt, xmlXPathNewBoolean(0));
859 * @ctxt: the XPath Parser context
866 xsltCurrentFunction(xmlXPathParserContextPtr ctxt, int nargs){
870 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
872 ctxt->error = XPATH_INVALID_ARITY;
875 tctxt = xsltXPathGetTransformContext(ctxt);
877 xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
879 valuePush(ctxt, xmlXPathNewNodeSet(NULL));
881 valuePush(ctxt, xmlXPathNewNodeSet(tctxt->node)); /* current */
893 * @ctxt: the XPath context
898 xsltRegisterAllFunctions(xmlXPathContextPtr ctxt)
900 xmlXPathRegisterFunc(ctxt, (const xmlChar *) "current",
902 xmlXPathRegisterFunc(ctxt, (const xmlChar *) "document",
904 xmlXPathRegisterFunc(ctxt, (const xmlChar *) "key", xsltKeyFunction);
905 xmlXPathRegisterFunc(ctxt, (const xmlChar *) "unparsed-entity-uri",
907 xmlXPathRegisterFunc(ctxt, (const xmlChar *) "format-number",
909 xmlXPathRegisterFunc(ctxt, (const xmlChar *) "generate-id",
911 xmlXPathRegisterFunc(ctxt, (const xmlChar *) "system-property",
913 xmlXPathRegisterFunc(ctxt, (const xmlChar *) "element-available",
915 xmlXPathRegisterFunc(ctxt, (const xmlChar *) "function-available",