23 #ifdef WITH_XSLT_DEBUG 24 #define WITH_XSLT_DEBUG_EXTRA 25 #define WITH_XSLT_DEBUG_PROCESS 26 #define WITH_XSLT_DEBUG_VARIABLE 29 #define XSLT_GENERATE_HTML_DOCTYPE 30 #ifdef XSLT_GENERATE_HTML_DOCTYPE 43 # define FALSE (0 == 1) 44 # define TRUE (!FALSE) 47 #define IS_BLANK_NODE(n) \ 48 (((n)->type == XML_TEXT_NODE) && (xsltIsBlank((n)->content))) 158 if (ctxt->
varsNr <= limitNr)
166 }
while (ctxt->
varsNr != 0);
190 if (
param->level >= 0) {
320 static xmlXPathObjectPtr
323 xmlXPathObjectPtr
res;
324 xmlXPathContextPtr xpctxt;
327 int oldXPProximityPosition, oldXPContextSize, oldXPNsNr;
330 oldXPContextNode = xpctxt->node;
331 oldXPProximityPosition = xpctxt->proximityPosition;
332 oldXPContextSize = xpctxt->contextSize;
333 oldXPNsNr = xpctxt->nsNr;
334 oldXPNamespaces = xpctxt->namespaces;
337 #ifdef XSLT_REFACTORED 338 if (comp->inScopeNs !=
NULL) {
339 xpctxt->namespaces = comp->inScopeNs->list;
340 xpctxt->
nsNr = comp->inScopeNs->xpathNumber;
342 xpctxt->namespaces =
NULL;
346 xpctxt->namespaces = comp->
nsList;
347 xpctxt->nsNr = comp->
nsNr;
350 res = xmlXPathCompiledEval(comp->
comp, xpctxt);
352 xpctxt->node = oldXPContextNode;
353 xpctxt->proximityPosition = oldXPProximityPosition;
354 xpctxt->contextSize = oldXPContextSize;
355 xpctxt->nsNr = oldXPNsNr;
356 xpctxt->namespaces = oldXPNamespaces;
373 xmlXPathContextPtr xpctxt;
376 int oldXPProximityPosition, oldXPContextSize, oldXPNsNr;
379 oldXPContextNode = xpctxt->node;
380 oldXPProximityPosition = xpctxt->proximityPosition;
381 oldXPContextSize = xpctxt->contextSize;
382 oldXPNsNr = xpctxt->nsNr;
383 oldXPNamespaces = xpctxt->namespaces;
386 #ifdef XSLT_REFACTORED 387 if (comp->inScopeNs !=
NULL) {
388 xpctxt->namespaces = comp->inScopeNs->list;
389 xpctxt->
nsNr = comp->inScopeNs->xpathNumber;
391 xpctxt->namespaces =
NULL;
395 xpctxt->namespaces = comp->
nsList;
396 xpctxt->nsNr = comp->
nsNr;
399 res = xmlXPathCompiledEvalToBoolean(comp->
comp, xpctxt);
401 xpctxt->node = oldXPContextNode;
402 xpctxt->proximityPosition = oldXPProximityPosition;
403 xpctxt->contextSize = oldXPContextSize;
404 xpctxt->nsNr = oldXPNsNr;
405 xpctxt->namespaces = oldXPNamespaces;
478 "xsltTransformCacheCreate : malloc failed\n");
511 if (
cache->stackItems) {
546 "xsltNewTransformContext : malloc failed\n");
560 #ifdef WITH_XSLT_DEBUG 562 "Creating sub-dictionary from stylesheet for transformation\n");
572 "xsltNewTransformContext: out of memory\n");
587 "xsltNewTransformContext: out of memory\n");
606 cur->xpathCtxt = xmlXPathNewContext(doc);
609 "xsltNewTransformContext : xmlXPathNewContext failed\n");
615 if (xmlXPathContextSetCache(
cur->xpathCtxt, 1, -1, 0) == -1)
620 if (
style->extrasNr != 0) {
621 cur->extrasMax =
style->extrasNr + 20;
626 "xsltNewTransformContext: out of memory\n");
630 for (
i = 0;
i <
cur->extrasMax;
i++) {
643 cur->xpathCtxt->nsHash =
style->nsHash;
653 xmlXPathOrderDocElems(doc);
662 "xsltNewTransformContext : xsltNewDocument failed\n");
666 cur->document = docu;
673 cur->keyInitLevel = 0;
726 #ifdef WITH_XSLT_DEBUG 728 "freeing transformation dictionary\n");
792 "xsltCopyText: text allocation failed\n");
803 extra = minSize < 100 ? 100 : minSize;
814 if (newbuf ==
NULL) {
816 "xsltCopyText: text allocation failed\n");
851 const xmlChar *
string,
int noescape)
859 #ifdef WITH_XSLT_DEBUG_PROCESS 861 "xsltCopyTextString: copy text %s\n",
895 }
else if (noescape) {
927 "xsltCopyTextString: text copy failed\n");
957 #ifdef WITH_XSLT_DEBUG_PROCESS 960 "xsltCopyText: copy CDATA text %s\n",
964 "xsltCopyText: copy unescaped text %s\n",
968 "xsltCopyText: copy text %s\n",
1093 "xsltCopyText: text copy failed\n");
1099 "Internal error in xsltCopyText(): " 1100 "Failed to copy the string.\n");
1133 "Cannot add an attribute node to a non-element node.\n");
1139 "Attribute nodes must be added before " 1140 "any child nodes to an element.\n");
1152 "Namespace fixup error: Failed to acquire an in-scope " 1153 "namespace binding of the copied attribute '{%s}%s'.\n",
1187 if (txtNode ==
NULL)
1197 txtNode->content =
value;
1198 copy->children = txtNode;
1238 if (
attr->ns != origNs) {
1255 attr->children->content);
1256 }
else if (
attr->children !=
NULL) {
1314 "xsltShallowCopyElem: copy failed\n");
1364 "xsltShallowCopyElem: copy %s failed\n",
node->name);
1461 }
else if (
q !=
NULL) {
1498 "Namespace nodes must be added before " 1499 "any child nodes are added to an element.\n");
1527 }
else if ((
ns->
prefix[0] ==
'x') &&
1551 tmpns = tmpns->
next;
1552 }
while (tmpns !=
NULL);
1601 switch (
node->type) {
1609 #ifdef LIBXML_DOCB_ENABLED 1610 case XML_DOCB_DOCUMENT_NODE:
1651 "xsltCopyTree: Copying of '%s' failed.\n",
node->name);
1674 if ((topElemVisited == 0) &&
1689 nsList = xmlGetNsList(
node->doc,
node);
1690 if (nsList !=
NULL) {
1721 if (
node->ns == *curns) {
1729 }
while (*curns !=
NULL);
1770 if (topElemVisited == 0)
1778 node->children,
copy, isLRE, topElemVisited);
1782 "xsltCopyTree: Copying of '%s' failed.\n",
node->name);
1818 #ifdef WITH_XSLT_DEBUG_PARSING 1820 "applying xsl:fallback\n");
1864 int nbchild = 0, oldSize;
1865 int childno = 0, oldPos;
1872 switch (
node->type) {
1878 #ifdef WITH_XSLT_DEBUG_PROCESS 1880 "xsltDefaultProcessOneNode: copy CDATA %s\n",
1886 "xsltDefaultProcessOneNode: cdata copy failed\n");
1890 #ifdef WITH_XSLT_DEBUG_PROCESS 1893 "xsltDefaultProcessOneNode: copy empty text\n"));
1897 "xsltDefaultProcessOneNode: copy text %s\n",
1904 "xsltDefaultProcessOneNode: text copy failed\n");
1913 "xsltDefaultProcessOneNode: no text for attribute\n");
1915 #ifdef WITH_XSLT_DEBUG_PROCESS 1918 "xsltDefaultProcessOneNode: copy empty text\n"));
1921 "xsltDefaultProcessOneNode: copy text %s\n",
1928 "xsltDefaultProcessOneNode: text copy failed\n");
1940 switch (
cur->type) {
1953 cur->next->prev =
cur->prev;
1955 cur->prev->next =
cur->next;
1958 #ifdef WITH_XSLT_DEBUG_PROCESS 1960 "xsltDefaultProcessOneNode: skipping node type %d\n",
1966 if (
delete !=
NULL) {
1967 #ifdef WITH_XSLT_DEBUG_PROCESS 1969 "xsltDefaultProcessOneNode: removing ignorable blank node\n"));
1976 if (
delete !=
NULL) {
1977 #ifdef WITH_XSLT_DEBUG_PROCESS 1979 "xsltDefaultProcessOneNode: removing ignorable blank node\n"));
1993 oldPos = ctxt->
xpathCtxt->proximityPosition;
1997 switch (
cur->type) {
2002 ctxt->
xpathCtxt->proximityPosition = childno;
2008 #ifdef WITH_XSLT_DEBUG_PROCESS 2010 "xsltDefaultProcessOneNode: applying template for CDATA %s\n",
2019 #ifdef WITH_XSLT_DEBUG_PROCESS 2021 "xsltDefaultProcessOneNode: copy CDATA %s\n",
2027 "xsltDefaultProcessOneNode: cdata copy failed\n");
2034 #ifdef WITH_XSLT_DEBUG_PROCESS 2036 "xsltDefaultProcessOneNode: applying template for text %s\n",
2040 ctxt->
xpathCtxt->proximityPosition = childno;
2047 #ifdef WITH_XSLT_DEBUG_PROCESS 2050 "xsltDefaultProcessOneNode: copy empty text\n"));
2053 "xsltDefaultProcessOneNode: copy text %s\n",
2060 "xsltDefaultProcessOneNode: text copy failed\n");
2068 #ifdef WITH_XSLT_DEBUG_PROCESS 2071 "xsltDefaultProcessOneNode: template found for PI %s\n",
2075 "xsltDefaultProcessOneNode: template found for comment\n"));
2079 ctxt->
xpathCtxt->proximityPosition = childno;
2093 ctxt->
xpathCtxt->proximityPosition = oldPos;
2116 if (templ ==
NULL) {
2117 #ifdef WITH_XSLT_DEBUG_PROCESS 2120 "xsltProcessOneNode: no template found for /\n"));
2123 "xsltProcessOneNode: no template found for CDATA\n"));
2126 "xsltProcessOneNode: no template found for attribute %s\n",
2130 "xsltProcessOneNode: no template found for %s\n", contextNode->
name));
2133 oldNode = ctxt->
node;
2134 ctxt->
node = contextNode;
2136 ctxt->
node = oldNode;
2147 #ifdef WITH_XSLT_DEBUG_PROCESS 2149 "xsltProcessOneNode: applying template '%s' for attribute %s\n",
2162 #ifdef WITH_XSLT_DEBUG_PROCESS 2165 "xsltProcessOneNode: applying template '%s' for /\n",
2169 "xsltProcessOneNode: applying template '%s' for %s\n",
2179 #ifdef WITH_DEBUGGER 2204 debugedNode = templ->
elem;
2208 }
else if (ctxt->
inst) {
2210 debugedNode = ctxt->
inst;
2213 return(debugedNode);
2298 "xsltReleaseLocalRVTs: Unexpected RVT flag %p\n",
2324 xmlNodePtr oldInsert, oldInst, oldCurInst, oldContextNode;
2326 int level = 0, oldVarsNr;
2329 #ifdef XSLT_REFACTORED 2333 #ifdef WITH_DEBUGGER 2334 int addCallResult = 0;
2341 #ifdef WITH_DEBUGGER 2344 xsltDebuggerStartSequenceConstructor(ctxt, contextNode,
2345 list, templ, &addCallResult);
2346 if (debuggedNode ==
NULL)
2361 "xsltApplySequenceConstructor: A potential infinite template " 2362 "recursion was detected.\n" 2363 "You can adjust xsltMaxDepth (--maxdepth) in order to " 2364 "raise the maximum number of nested template calls and " 2365 "variables/params (currently set to %d).\n",
2373 oldLocalFragmentTop = ctxt->
localRVT;
2375 oldInst = oldCurInst = ctxt->
inst;
2376 oldContextNode = ctxt->
node;
2381 oldVarsNr = ctxt->
varsNr;
2390 "xsltApplySequenceConstructor: " 2391 "Operation limit exceeded\n");
2400 #ifdef WITH_DEBUGGER 2413 #ifdef WITH_XSLT_DEBUG_PROCESS 2415 "xsltApplySequenceConstructor: insert == NULL !\n"));
2420 #ifdef WITH_DEBUGGER 2425 #ifdef XSLT_REFACTORED 2450 "Internal error in xsltApplySequenceConstructor(): " 2451 "The element '%s' in the stylesheet has no compiled " 2452 "representation.\n",
2457 if (
info->type == XSLT_FUNC_LITERAL_RESULT_ELEMENT) {
2458 xsltStyleItemLRElementInfoPtr lrInfo =
2459 (xsltStyleItemLRElementInfoPtr)
info;
2464 #ifdef WITH_XSLT_DEBUG_PROCESS 2467 "xsltApplySequenceConstructor: copy literal result " 2468 "element '%s'\n",
cur->name));
2479 "Internal error in xsltApplySequenceConstructor(): " 2480 "Failed to copy literal result element '%s'.\n",
2493 if (lrInfo->effectiveNs !=
NULL) {
2494 xsltEffectiveNsPtr effNs = lrInfo->effectiveNs;
2497 while (effNs !=
NULL) {
2507 effNs = effNs->next;
2513 "Internal error in " 2514 "xsltApplySequenceConstructor(): " 2515 "Failed to copy a namespace " 2526 effNs = effNs->next;
2574 if (
cur->properties !=
NULL) {
2577 }
else if (IS_XSLT_ELEM_FAST(
cur)) {
2582 if (
info->type == XSLT_FUNC_UNKOWN_FORWARDS_COMPAT) {
2590 "The is no fallback behaviour defined for " 2591 "the unknown XSLT element '%s'.\n",
2594 ctxt->
insert = oldInsert;
2601 info->func(ctxt, contextNode,
cur,
2607 if (oldLocalFragmentTop != ctxt->
localRVT)
2610 ctxt->
insert = oldInsert;
2616 if (tmpvar != ctxt->
vars) {
2625 }
else if (
info->type == XSLT_FUNC_MESSAGE) {
2632 "Unexpected XSLT element '%s'.\n",
cur->name);
2661 #ifdef WITH_XSLT_DEBUG_PROCESS 2664 "xsltApplySequenceConstructor: unknown extension %s\n",
2670 "Unknown extension instruction '{%s}%s'.\n",
2671 cur->ns->href,
cur->name);
2673 ctxt->
insert = oldInsert;
2678 #ifdef WITH_XSLT_DEBUG_PROCESS 2680 "xsltApplySequenceConstructor: extension construct %s\n",
2702 if (oldLocalFragmentTop != ctxt->
localRVT)
2705 ctxt->
insert = oldInsert;
2715 #ifdef WITH_XSLT_DEBUG_PROCESS 2719 "xsltApplySequenceConstructor: copy unescaped text '%s'\n",
2724 "xsltApplySequenceConstructor: copy text '%s'\n",
2750 "xsltApplySequenceConstructor: %s was not compiled\n",
2753 ctxt->
insert = oldInsert;
2759 oldCurInst = ctxt->
inst;
2768 if (oldLocalFragmentTop != ctxt->
localRVT)
2771 ctxt->
insert = oldInsert;
2772 ctxt->
inst = oldCurInst;
2779 oldCurInst = ctxt->
inst;
2784 ctxt->
inst = oldCurInst;
2786 if (tmpvar != ctxt->
vars) {
2799 "Unexpected XSLT element '%s'.\n",
cur->name);
2810 #ifdef WITH_XSLT_DEBUG_PROCESS 2813 "xsltApplySequenceConstructor: copy CDATA text %s\n",
2817 "xsltApplySequenceConstructor: copy unescaped text %s\n",
2821 "xsltApplySequenceConstructor: copy text %s\n",
2831 oldCurInst = ctxt->
inst;
2842 if (
function ==
NULL) {
2846 #ifdef WITH_XSLT_DEBUG_PROCESS 2848 "xsltApplySequenceConstructor: unknown extension %s\n",
2866 ctxt->
insert = oldInsert;
2870 "xsltApplySequenceConstructor: failed to find extension %s\n",
2874 #ifdef WITH_XSLT_DEBUG_PROCESS 2876 "xsltApplySequenceConstructor: extension construct %s\n",
2894 function(ctxt, contextNode,
cur,
cur->psvi);
2898 if (oldLocalFragmentTop != ctxt->
localRVT)
2901 ctxt->
insert = oldInsert;
2904 ctxt->
inst = oldCurInst;
2907 #ifdef WITH_XSLT_DEBUG_PROCESS 2909 "xsltApplySequenceConstructor: copy node %s\n",
2912 oldCurInst = ctxt->
inst;
2922 if ((templ !=
NULL) && (oldInsert ==
insert) &&
2973 if (
cur->properties !=
NULL) {
2976 ctxt->
inst = oldCurInst;
3035 if (ctxt->
varsNr > oldVarsNr)
3038 ctxt->
node = oldContextNode;
3039 ctxt->
inst = oldInst;
3040 ctxt->
insert = oldInsert;
3044 #ifdef WITH_DEBUGGER 3074 int oldVarsBase = 0;
3078 #ifdef WITH_PROFILER 3082 #ifdef XSLT_REFACTORED 3083 xsltStyleItemParamPtr iparam;
3088 #ifdef WITH_DEBUGGER 3089 int addCallResult = 0;
3094 if (templ ==
NULL) {
3096 "xsltApplyXSLTTemplate: Bad arguments; @templ is mandatory.\n");
3100 #ifdef WITH_DEBUGGER 3102 if (xsltDebuggerStartSequenceConstructor(ctxt, contextNode,
3103 list, templ, &addCallResult) ==
NULL)
3115 "xsltApplyXSLTTemplate: A potential infinite template recursion " 3117 "You can adjust maxTemplateVars (--maxvars) in order to " 3118 "raise the maximum number of variables/params (currently set to %d).\n",
3125 oldUserFragmentTop = ctxt->
tmpRVT;
3134 ctxt->
node = contextNode;
3136 #ifdef WITH_PROFILER 3141 profCallgraphAdd(templ, ctxt->
templ);
3150 #ifdef WITH_XSLT_DEBUG_PROCESS 3153 "applying xsl:template '%s'\n", templ->
name));
3166 (
cur->name[0] !=
'p') ||
3176 #ifdef XSLT_REFACTORED 3177 iparam = (xsltStyleItemParamPtr)
cur->psvi;
3192 tmpParam = withParams;
3194 if ((tmpParam->
name == (iparam->
name)) &&
3203 tmpParam = tmpParam->
next;
3204 }
while (tmpParam !=
NULL);
3209 if (tmpParam ==
NULL) {
3240 while (curdoc !=
NULL) {
3246 ctxt->
tmpRVT = oldUserFragmentTop;
3253 #ifdef WITH_PROFILER 3258 child = profPop(ctxt);
3270 templ->
time += spent;
3276 #ifdef WITH_DEBUGGER 3331 int oldVarsNr = ctxt->
varsNr;
3368 #ifdef XSLT_REFACTORED 3369 xsltStyleItemDocumentPtr comp = (xsltStyleItemDocumentPtr) castedComp;
3380 const char *oldOutputFile;
3388 int redirect_write_append = 0;
3401 #ifdef WITH_XSLT_DEBUG_EXTRA 3403 "Found saxon:output extension\n");
3414 #ifdef WITH_XSLT_DEBUG_EXTRA 3416 "Found xalan:write extension\n");
3423 xmlXPathCompExprPtr
cmp;
3434 xmlXPathFreeCompExpr(
cmp);
3460 "xsltDocumentElem: href/URI-Reference not found\n");
3472 if (escURL !=
NULL) {
3480 "xsltDocumentElem: URL computation failed for %s\n",
3494 "xsltDocumentElem: write rights for %s denied\n",
3503 oldOutput = ctxt->
output;
3504 oldInsert = ctxt->
insert;
3505 oldType = ctxt->
type;
3511 "xsltDocumentElem: out of memory\n");
3525 style->version = prop;
3533 style->encoding = prop;
3551 }
else if (URI ==
NULL) {
3555 style->method = prop;
3558 "invalid value for method: %s\n", prop);
3562 style->method = prop;
3568 "doctype-system",
NULL);
3572 style->doctypeSystem = prop;
3576 "doctype-public",
NULL);
3580 style->doctypePublic = prop;
3583 (
const xmlChar *)
"standalone",
3587 style->standalone = 1;
3589 style->standalone = 0;
3592 "invalid value for standalone: %s\n",
3609 "invalid value for indent: %s\n", prop);
3617 "omit-xml-declaration",
3621 style->omitXmlDeclaration = 1;
3623 style->omitXmlDeclaration = 0;
3626 "invalid value for omit-xml-declaration: %s\n",
3635 "cdata-section-elements",
3637 if (elements !=
NULL) {
3656 #ifdef WITH_XSLT_DEBUG_PARSING 3658 "add cdata section output element %s\n",
3685 if (((doctypePublic !=
NULL) || (doctypeSystem !=
NULL)))
3686 res = htmlNewDoc(doctypeSystem, doctypePublic);
3689 #ifdef XSLT_GENERATE_HTML_DOCTYPE 3693 res = htmlNewDocNoDtD(doctypeSystem, doctypePublic);
3701 "xsltDocumentElem: unsupported method xhtml\n");
3703 res = htmlNewDocNoDtD(doctypeSystem, doctypePublic);
3715 #ifdef WITH_XSLT_DEBUG 3717 "reusing transformation dict for output\n");
3721 "xsltDocumentElem: unsupported method (%s)\n",
3732 #ifdef WITH_XSLT_DEBUG 3734 "reusing transformation dict for output\n");
3753 if (doctype ==
NULL)
3754 doctype =
root->name;
3765 while ((tmp !=
NULL) && (tmp !=
root)) {
3775 if (((doctypePublic !=
NULL) || (doctypeSystem !=
NULL))) {
3779 #ifdef XSLT_GENERATE_HTML_DOCTYPE 3783 if (((doctypePublic !=
NULL) || (doctypeSystem !=
NULL)))
3796 if (((doctypePublic !=
NULL) || (doctypeSystem !=
NULL)))
3816 style->omitXmlDeclaration = 1;
3817 redirect_write_append = 1;
3819 style->omitXmlDeclaration = 0;
3823 if (redirect_write_append) {
3838 "xsltDocumentElem: unable to save to %s\n",
3840 #ifdef WITH_XSLT_DEBUG_EXTRA 3848 ctxt->
output = oldOutput;
3849 ctxt->
insert = oldInsert;
3850 ctxt->
type = oldType;
3884 "xsl:sort : compilation failed\n");
3888 "xsl:sort : improper use this should not be reached\n");
3904 #ifdef XSLT_REFACTORED 3905 xsltStyleItemCopyPtr comp = (xsltStyleItemCopyPtr) castedComp;
3911 oldInsert = ctxt->
insert;
3913 switch (
node->type) {
3921 #ifdef WITH_XSLT_DEBUG_PROCESS 3924 "xsltCopy: CDATA text %s\n",
node->content));
3927 "xsltCopy: text %s\n",
node->content));
3943 #ifdef WITH_XSLT_DEBUG_PROCESS 3945 "xsltCopy: node %s\n",
node->name));
3954 #ifdef WITH_XSLT_DEBUG_PROCESS 3956 "xsltCopy: attribute %s\n",
node->name));
3968 #ifdef WITH_XSLT_DEBUG_PROCESS 3970 "xsltCopy: PI %s\n",
node->name));
3977 #ifdef WITH_XSLT_DEBUG_PROCESS 3979 "xsltCopy: comment\n"));
3985 #ifdef WITH_XSLT_DEBUG_PROCESS 3987 "xsltCopy: namespace declaration\n"));
3997 switch (
node->type) {
4007 ctxt->
insert = oldInsert;
4030 "xsl:text content problem\n");
4035 #ifdef WITH_XSLT_DEBUG_PARSING 4037 "Disable escaping: %s\n",
text->content);
4059 #ifdef XSLT_REFACTORED 4060 xsltStyleItemElementPtr comp = (xsltStyleItemElementPtr) castedComp;
4082 oldInsert = ctxt->
insert;
4090 "xsl:element: The attribute 'name' is missing.\n");
4093 if (xmlValidateQName(prop, 0)) {
4095 "xsl:element: The effective name '%s' is not a " 4096 "valid QName.\n", prop);
4105 #ifdef XSLT_REFACTORED 4106 prefix = comp->nsPrefix;
4123 "xsl:element : creation of %s failed\n",
name);
4129 "xsl:element : xsltAddChild failed\n");
4142 if (comp->
ns[0] != 0)
4157 if ((tmpNsName !=
NULL) && (tmpNsName[0] != 0))
4164 "xsl:attribute: Namespace http://www.w3.org/2000/xmlns/ " 4188 if (prefix !=
NULL) {
4190 "xsl:element: The QName '%s:%s' has no " 4191 "namespace binding in scope in the stylesheet; " 4192 "this is an error, since the namespace was not " 4193 "specified by the instruction itself.\n", prefix,
name);
4201 if (nsName !=
NULL) {
4213 }
else if ((
copy->parent !=
NULL) &&
4236 if (attrSets !=
NULL) {
4250 ctxt->
insert = oldInsert;
4278 "xsl:comment : '--' or ending '-' not allowed in comment\n");
4282 #ifdef WITH_XSLT_DEBUG_PROCESS 4285 "xsltComment: empty\n"));
4288 "xsltComment: content %s\n",
value));
4311 #ifdef XSLT_REFACTORED 4312 xsltStyleItemPIPtr comp = (xsltStyleItemPIPtr) castedComp;
4330 "xsl:processing-instruction : name is missing\n");
4342 "xsl:processing-instruction: '?>' not allowed within PI content\n");
4345 #ifdef WITH_XSLT_DEBUG_PROCESS 4348 "xsltProcessingInstruction: %s empty\n",
name));
4351 "xsltProcessingInstruction: %s content %s\n",
name,
value));
4377 #ifdef XSLT_REFACTORED 4378 xsltStyleItemCopyOfPtr comp = (xsltStyleItemCopyOfPtr) castedComp;
4390 "xsl:copy-of : compilation failed\n");
4412 #ifdef WITH_XSLT_DEBUG_PROCESS 4414 "xsltCopyOf: select %s\n", comp->
select));
4423 if (
res->type == XPATH_NODESET) {
4428 #ifdef WITH_XSLT_DEBUG_PROCESS 4430 "xsltCopyOf: result is a node set\n"));
4439 for (
i = 0;
i <
list->nodeNr;
i++) {
4456 }
else if (
res->type == XPATH_XSLT_TREE) {
4463 #ifdef WITH_XSLT_DEBUG_PROCESS 4465 "xsltCopyOf: result is a result tree fragment\n"));
4473 list->nodeTab[0]->children, ctxt->
insert, 0, 0);
4483 "Internal error in xsltCopyOf(): " 4484 "failed to cast an XPath object to string.\n");
4487 if (
value[0] != 0) {
4495 #ifdef WITH_XSLT_DEBUG_PROCESS 4497 "xsltCopyOf: result %s\n",
res->stringval));
4506 xmlXPathFreeObject(
res);
4522 #ifdef XSLT_REFACTORED 4523 xsltStyleItemValueOfPtr comp = (xsltStyleItemValueOfPtr) castedComp;
4535 "Internal error in xsltValueOf(): " 4536 "The XSLT 'value-of' instruction was not compiled.\n");
4540 #ifdef WITH_XSLT_DEBUG_PROCESS 4542 "xsltValueOf: select %s\n", comp->
select));
4554 "Internal error in xsltValueOf(): " 4555 "failed to cast an XPath object to string.\n");
4559 if (
value[0] != 0) {
4564 "XPath evaluation returned no result.\n");
4569 #ifdef WITH_XSLT_DEBUG_PROCESS 4572 "xsltValueOf: result '%s'\n",
value));
4580 xmlXPathFreeObject(
res);
4596 #ifdef XSLT_REFACTORED 4597 xsltStyleItemNumberPtr comp = (xsltStyleItemNumberPtr) castedComp;
4601 xmlXPathContextPtr xpctxt;
4607 "xsl:number : compilation failed\n");
4618 oldXPNsNr = xpctxt->nsNr;
4619 oldXPNamespaces = xpctxt->namespaces;
4621 #ifdef XSLT_REFACTORED 4622 if (comp->inScopeNs !=
NULL) {
4623 xpctxt->namespaces = comp->inScopeNs->list;
4624 xpctxt->
nsNr = comp->inScopeNs->xpathNumber;
4626 xpctxt->namespaces =
NULL;
4630 xpctxt->namespaces = comp->
nsList;
4631 xpctxt->nsNr = comp->
nsNr;
4636 xpctxt->nsNr = oldXPNsNr;
4637 xpctxt->namespaces = oldXPNamespaces;
4656 if ((ctxt ==
NULL) || (inst ==
NULL))
4661 "Internal error in xsltApplyImports(): " 4662 "The XSLT 'apply-imports' instruction was not compiled.\n");
4679 "It is an error to call 'apply-imports' " 4680 "when there's no current template rule.\n");
4689 if (templ !=
NULL) {
4722 #ifdef XSLT_REFACTORED 4723 xsltStyleItemCallTemplatePtr comp =
4724 (xsltStyleItemCallTemplatePtr) castedComp;
4734 "The XSLT 'call-template' instruction was not compiled.\n");
4746 "The called template '{%s}%s' was not found.\n",
4750 "The called template '%s' was not found.\n",
4757 #ifdef WITH_XSLT_DEBUG_PROCESS 4760 "call-template: name %s\n", comp->
name));
4769 #ifdef WITH_DEBUGGER 4783 param->next = withParams;
4788 "xsl:call-template: misplaced xsl:%s\n",
cur->name);
4792 "xsl:call-template: misplaced %s element\n",
cur->name);
4802 if (withParams !=
NULL)
4805 #ifdef WITH_XSLT_DEBUG_PROCESS 4808 "call-template returned: name %s\n", comp->
name));
4825 #ifdef XSLT_REFACTORED 4826 xsltStyleItemApplyTemplatesPtr comp =
4827 (xsltStyleItemApplyTemplatesPtr) castedComp;
4833 xmlNodeSetPtr
list =
NULL, oldList;
4835 int oldXPProximityPosition, oldXPContextSize;
4836 const xmlChar *oldMode, *oldModeURI;
4839 xmlXPathContextPtr xpctxt;
4843 "xsl:apply-templates : compilation failed\n");
4849 #ifdef WITH_XSLT_DEBUG_PROCESS 4852 "xsltApplyTemplates: node: '%s'\n",
node->name));
4859 oldContextNode = ctxt->
node;
4860 oldMode = ctxt->
mode;
4870 oldXPContextSize = xpctxt->contextSize;
4871 oldXPProximityPosition = xpctxt->proximityPosition;
4872 oldXPDoc = xpctxt->
doc;
4885 "xsl:apply-templates : compilation failed\n");
4888 #ifdef WITH_XSLT_DEBUG_PROCESS 4890 "xsltApplyTemplates: select %s\n", comp->
select));
4896 if (
res->type == XPATH_NODESET) {
4901 "The 'select' expression did not evaluate to a " 4904 xmlXPathFreeObject(
res);
4907 xmlXPathFreeObject(
res);
4914 "Failed to evaluate the 'select' expression.\n");
4919 #ifdef WITH_XSLT_DEBUG_PROCESS 4921 "xsltApplyTemplates: select didn't evaluate to a node list\n"));
4941 if ((ctxt->
nbKeys > 0) &&
4942 (
list->nodeNr != 0) &&
4951 effectiveDocInfo =
list->nodeTab[0]->doc->_private;
4958 list = xmlXPathNodeSetCreate(
NULL);
4966 switch (
cur->type) {
4974 if (
cur->parent->ns !=
NULL) {
4978 cur->parent->ns->href);
4983 cur->parent->ns->href);
5003 xmlXPathNodeSetAddUnique(
list,
cur);
5009 cur->next->prev =
cur->prev;
5011 cur->prev->next =
cur->next;
5016 #ifdef WITH_XSLT_DEBUG_PROCESS 5018 "xsltApplyTemplates: skipping cur type %d\n",
5024 if (delNode !=
NULL) {
5025 #ifdef WITH_XSLT_DEBUG_PROCESS 5027 "xsltApplyTemplates: removing ignorable blank cur\n"));
5036 #ifdef WITH_XSLT_DEBUG_PROCESS 5039 "xsltApplyTemplates: list of %d nodes\n",
list->nodeNr));
5063 #ifdef WITH_DEBUGGER 5078 param->next = withParams;
5088 sorts[nbsorts++] =
cur;
5092 #ifdef WITH_DEBUGGER 5109 param->next = withParams;