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)
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) {
320static 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");
605 cur->xpathCtxt = xmlXPathNewContext(doc);
608 "xsltNewTransformContext : xmlXPathNewContext failed\n");
614 if (xmlXPathContextSetCache(
cur->xpathCtxt, 1, -1, 0) == -1)
619 if (
style->extrasNr != 0) {
620 cur->extrasMax =
style->extrasNr + 20;
625 "xsltNewTransformContext: out of memory\n");
629 for (
i = 0;
i <
cur->extrasMax;
i++) {
642 cur->xpathCtxt->nsHash =
style->nsHash;
652 xmlXPathOrderDocElems(doc);
661 "xsltNewTransformContext : xsltNewDocument failed\n");
665 cur->document = docu;
672 cur->keyInitLevel = 0;
725#ifdef WITH_XSLT_DEBUG
727 "freeing transformation dictionary\n");
791 "xsltCopyText: text allocation failed\n");
802 extra = minSize < 100 ? 100 : minSize;
813 if (newbuf ==
NULL) {
815 "xsltCopyText: text allocation failed\n");
850 const xmlChar *
string,
int noescape)
858#ifdef WITH_XSLT_DEBUG_PROCESS
860 "xsltCopyTextString: copy text %s\n",
894 }
else if (noescape) {
926 "xsltCopyTextString: text copy failed\n");
956#ifdef WITH_XSLT_DEBUG_PROCESS
959 "xsltCopyText: copy CDATA text %s\n",
963 "xsltCopyText: copy unescaped text %s\n",
967 "xsltCopyText: copy text %s\n",
1092 "xsltCopyText: text copy failed\n");
1098 "Internal error in xsltCopyText(): "
1099 "Failed to copy the string.\n");
1132 "Cannot add an attribute node to a non-element node.\n");
1138 "Attribute nodes must be added before "
1139 "any child nodes to an element.\n");
1151 "Namespace fixup error: Failed to acquire an in-scope "
1152 "namespace binding of the copied attribute '{%s}%s'.\n",
1186 if (txtNode ==
NULL)
1196 txtNode->content =
value;
1197 copy->children = txtNode;
1237 if (
attr->ns != origNs) {
1254 attr->children->content);
1255 }
else if (
attr->children !=
NULL) {
1313 "xsltShallowCopyElem: copy failed\n");
1363 "xsltShallowCopyElem: copy %s failed\n",
node->name);
1460 }
else if (
q !=
NULL) {
1497 "Namespace nodes must be added before "
1498 "any child nodes are added to an element.\n");
1526 }
else if ((
ns->
prefix[0] ==
'x') &&
1550 tmpns = tmpns->
next;
1551 }
while (tmpns !=
NULL);
1600 switch (
node->type) {
1608#ifdef LIBXML_DOCB_ENABLED
1650 "xsltCopyTree: Copying of '%s' failed.\n",
node->name);
1673 if ((topElemVisited == 0) &&
1688 nsList = xmlGetNsList(
node->doc,
node);
1689 if (nsList !=
NULL) {
1720 if (
node->ns == *curns) {
1728 }
while (*curns !=
NULL);
1769 if (topElemVisited == 0)
1777 node->children,
copy, isLRE, topElemVisited);
1781 "xsltCopyTree: Copying of '%s' failed.\n",
node->name);
1817#ifdef WITH_XSLT_DEBUG_PARSING
1819 "applying xsl:fallback\n");
1863 int nbchild = 0, oldSize;
1864 int childno = 0, oldPos;
1871 switch (
node->type) {
1877#ifdef WITH_XSLT_DEBUG_PROCESS
1879 "xsltDefaultProcessOneNode: copy CDATA %s\n",
1885 "xsltDefaultProcessOneNode: cdata copy failed\n");
1889#ifdef WITH_XSLT_DEBUG_PROCESS
1892 "xsltDefaultProcessOneNode: copy empty text\n"));
1896 "xsltDefaultProcessOneNode: copy text %s\n",
1903 "xsltDefaultProcessOneNode: text copy failed\n");
1912 "xsltDefaultProcessOneNode: no text for attribute\n");
1914#ifdef WITH_XSLT_DEBUG_PROCESS
1917 "xsltDefaultProcessOneNode: copy empty text\n"));
1920 "xsltDefaultProcessOneNode: copy text %s\n",
1927 "xsltDefaultProcessOneNode: text copy failed\n");
1951 oldPos = ctxt->
xpathCtxt->proximityPosition;
1955 switch (
cur->type) {
1960 ctxt->
xpathCtxt->proximityPosition = childno;
1966#ifdef WITH_XSLT_DEBUG_PROCESS
1968 "xsltDefaultProcessOneNode: applying template for CDATA %s\n",
1977#ifdef WITH_XSLT_DEBUG_PROCESS
1979 "xsltDefaultProcessOneNode: copy CDATA %s\n",
1985 "xsltDefaultProcessOneNode: cdata copy failed\n");
1992#ifdef WITH_XSLT_DEBUG_PROCESS
1994 "xsltDefaultProcessOneNode: applying template for text %s\n",
1998 ctxt->
xpathCtxt->proximityPosition = childno;
2005#ifdef WITH_XSLT_DEBUG_PROCESS
2008 "xsltDefaultProcessOneNode: copy empty text\n"));
2011 "xsltDefaultProcessOneNode: copy text %s\n",
2018 "xsltDefaultProcessOneNode: text copy failed\n");
2026#ifdef WITH_XSLT_DEBUG_PROCESS
2029 "xsltDefaultProcessOneNode: template found for PI %s\n",
2033 "xsltDefaultProcessOneNode: template found for comment\n"));
2037 ctxt->
xpathCtxt->proximityPosition = childno;
2051 ctxt->
xpathCtxt->proximityPosition = oldPos;
2074 if (templ ==
NULL) {
2075#ifdef WITH_XSLT_DEBUG_PROCESS
2078 "xsltProcessOneNode: no template found for /\n"));
2081 "xsltProcessOneNode: no template found for CDATA\n"));
2084 "xsltProcessOneNode: no template found for attribute %s\n",
2088 "xsltProcessOneNode: no template found for %s\n", contextNode->
name));
2091 oldNode = ctxt->
node;
2092 ctxt->
node = contextNode;
2094 ctxt->
node = oldNode;
2105#ifdef WITH_XSLT_DEBUG_PROCESS
2107 "xsltProcessOneNode: applying template '%s' for attribute %s\n",
2120#ifdef WITH_XSLT_DEBUG_PROCESS
2123 "xsltProcessOneNode: applying template '%s' for /\n",
2127 "xsltProcessOneNode: applying template '%s' for %s\n",
2162 debugedNode = templ->
elem;
2166 }
else if (ctxt->
inst) {
2168 debugedNode = ctxt->
inst;
2171 return(debugedNode);
2256 "xsltReleaseLocalRVTs: Unexpected RVT flag %p\n",
2282 xmlNodePtr oldInsert, oldInst, oldCurInst, oldContextNode;
2284 int level = 0, oldVarsNr;
2287#ifdef XSLT_REFACTORED
2292 int addCallResult = 0;
2302 xsltDebuggerStartSequenceConstructor(ctxt, contextNode,
2303 list, templ, &addCallResult);
2304 if (debuggedNode ==
NULL)
2319 "xsltApplySequenceConstructor: A potential infinite template "
2320 "recursion was detected.\n"
2321 "You can adjust xsltMaxDepth (--maxdepth) in order to "
2322 "raise the maximum number of nested template calls and "
2323 "variables/params (currently set to %d).\n",
2331 oldLocalFragmentTop = ctxt->
localRVT;
2333 oldInst = oldCurInst = ctxt->
inst;
2334 oldContextNode = ctxt->
node;
2339 oldVarsNr = ctxt->
varsNr;
2348 "xsltApplySequenceConstructor: "
2349 "Operation limit exceeded\n");
2371#ifdef WITH_XSLT_DEBUG_PROCESS
2373 "xsltApplySequenceConstructor: insert == NULL !\n"));
2383#ifdef XSLT_REFACTORED
2408 "Internal error in xsltApplySequenceConstructor(): "
2409 "The element '%s' in the stylesheet has no compiled "
2410 "representation.\n",
2415 if (
info->type == XSLT_FUNC_LITERAL_RESULT_ELEMENT) {
2416 xsltStyleItemLRElementInfoPtr lrInfo =
2417 (xsltStyleItemLRElementInfoPtr)
info;
2422#ifdef WITH_XSLT_DEBUG_PROCESS
2425 "xsltApplySequenceConstructor: copy literal result "
2426 "element '%s'\n",
cur->name));
2437 "Internal error in xsltApplySequenceConstructor(): "
2438 "Failed to copy literal result element '%s'.\n",
2451 if (lrInfo->effectiveNs !=
NULL) {
2452 xsltEffectiveNsPtr effNs = lrInfo->effectiveNs;
2455 while (effNs !=
NULL) {
2465 effNs = effNs->next;
2471 "Internal error in "
2472 "xsltApplySequenceConstructor(): "
2473 "Failed to copy a namespace "
2484 effNs = effNs->next;
2532 if (
cur->properties !=
NULL) {
2535 }
else if (IS_XSLT_ELEM_FAST(
cur)) {
2540 if (
info->type == XSLT_FUNC_UNKOWN_FORWARDS_COMPAT) {
2548 "The is no fallback behaviour defined for "
2549 "the unknown XSLT element '%s'.\n",
2552 ctxt->
insert = oldInsert;
2559 info->func(ctxt, contextNode,
cur,
2565 if (oldLocalFragmentTop != ctxt->
localRVT)
2568 ctxt->
insert = oldInsert;
2574 if (tmpvar != ctxt->
vars) {
2583 }
else if (
info->type == XSLT_FUNC_MESSAGE) {
2590 "Unexpected XSLT element '%s'.\n",
cur->name);
2619#ifdef WITH_XSLT_DEBUG_PROCESS
2622 "xsltApplySequenceConstructor: unknown extension %s\n",
2628 "Unknown extension instruction '{%s}%s'.\n",
2629 cur->ns->href,
cur->name);
2631 ctxt->
insert = oldInsert;
2636#ifdef WITH_XSLT_DEBUG_PROCESS
2638 "xsltApplySequenceConstructor: extension construct %s\n",
2660 if (oldLocalFragmentTop != ctxt->
localRVT)
2663 ctxt->
insert = oldInsert;
2673#ifdef WITH_XSLT_DEBUG_PROCESS
2677 "xsltApplySequenceConstructor: copy unescaped text '%s'\n",
2682 "xsltApplySequenceConstructor: copy text '%s'\n",
2708 "xsltApplySequenceConstructor: %s was not compiled\n",
2711 ctxt->
insert = oldInsert;
2717 oldCurInst = ctxt->
inst;
2726 if (oldLocalFragmentTop != ctxt->
localRVT)
2729 ctxt->
insert = oldInsert;
2730 ctxt->
inst = oldCurInst;
2737 oldCurInst = ctxt->
inst;
2742 ctxt->
inst = oldCurInst;
2744 if (tmpvar != ctxt->
vars) {
2757 "Unexpected XSLT element '%s'.\n",
cur->name);
2768#ifdef WITH_XSLT_DEBUG_PROCESS
2771 "xsltApplySequenceConstructor: copy CDATA text %s\n",
2775 "xsltApplySequenceConstructor: copy unescaped text %s\n",
2779 "xsltApplySequenceConstructor: copy text %s\n",
2789 oldCurInst = ctxt->
inst;
2800 if (function ==
NULL) {
2804#ifdef WITH_XSLT_DEBUG_PROCESS
2806 "xsltApplySequenceConstructor: unknown extension %s\n",
2824 ctxt->
insert = oldInsert;
2828 "xsltApplySequenceConstructor: failed to find extension %s\n",
2832#ifdef WITH_XSLT_DEBUG_PROCESS
2834 "xsltApplySequenceConstructor: extension construct %s\n",
2852 function(ctxt, contextNode,
cur,
cur->psvi);
2856 if (oldLocalFragmentTop != ctxt->
localRVT)
2859 ctxt->
insert = oldInsert;
2862 ctxt->
inst = oldCurInst;
2865#ifdef WITH_XSLT_DEBUG_PROCESS
2867 "xsltApplySequenceConstructor: copy node %s\n",
2870 oldCurInst = ctxt->
inst;
2880 if ((templ !=
NULL) && (oldInsert ==
insert) &&
2931 if (
cur->properties !=
NULL) {
2934 ctxt->
inst = oldCurInst;
2993 if (ctxt->
varsNr > oldVarsNr)
2996 ctxt->
node = oldContextNode;
2997 ctxt->
inst = oldInst;
2998 ctxt->
insert = oldInsert;
3032 int oldVarsBase = 0;
3040#ifdef XSLT_REFACTORED
3041 xsltStyleItemParamPtr iparam;
3047 int addCallResult = 0;
3052 if (templ ==
NULL) {
3054 "xsltApplyXSLTTemplate: Bad arguments; @templ is mandatory.\n");
3060 if (xsltDebuggerStartSequenceConstructor(ctxt, contextNode,
3061 list, templ, &addCallResult) ==
NULL)
3073 "xsltApplyXSLTTemplate: A potential infinite template recursion "
3075 "You can adjust maxTemplateVars (--maxvars) in order to "
3076 "raise the maximum number of variables/params (currently set to %d).\n",
3083 oldUserFragmentTop = ctxt->
tmpRVT;
3092 ctxt->
node = contextNode;
3099 profCallgraphAdd(templ, ctxt->
templ);
3108#ifdef WITH_XSLT_DEBUG_PROCESS
3111 "applying xsl:template '%s'\n", templ->
name));
3124 (
cur->name[0] !=
'p') ||
3134#ifdef XSLT_REFACTORED
3135 iparam = (xsltStyleItemParamPtr)
cur->psvi;
3150 tmpParam = withParams;
3152 if ((tmpParam->
name == (iparam->name)) &&
3153 (tmpParam->
nameURI == (iparam->ns)))
3161 tmpParam = tmpParam->
next;
3162 }
while (tmpParam !=
NULL);
3167 if (tmpParam ==
NULL) {
3198 while (curdoc !=
NULL) {
3204 ctxt->
tmpRVT = oldUserFragmentTop;
3216 child = profPop(ctxt);
3228 templ->
time += spent;
3289 int oldVarsNr = ctxt->
varsNr;
3326#ifdef XSLT_REFACTORED
3327 xsltStyleItemDocumentPtr comp = (xsltStyleItemDocumentPtr) castedComp;
3338 const char *oldOutputFile;
3346 int redirect_write_append = 0;
3351 if (comp->filename ==
NULL) {
3359#ifdef WITH_XSLT_DEBUG_EXTRA
3361 "Found saxon:output extension\n");
3372#ifdef WITH_XSLT_DEBUG_EXTRA
3374 "Found xalan:write extension\n");
3381 xmlXPathCompExprPtr
cmp;
3392 xmlXPathFreeCompExpr(
cmp);
3418 "xsltDocumentElem: href/URI-Reference not found\n");
3430 if (escURL !=
NULL) {
3438 "xsltDocumentElem: URL computation failed for %s\n",
3452 "xsltDocumentElem: write rights for %s denied\n",
3461 oldOutput = ctxt->
output;
3462 oldInsert = ctxt->
insert;
3463 oldType = ctxt->
type;
3469 "xsltDocumentElem: out of memory\n");
3483 style->version = prop;
3491 style->encoding = prop;
3509 }
else if (URI ==
NULL) {
3513 style->method = prop;
3516 "invalid value for method: %s\n", prop);
3520 style->method = prop;
3526 "doctype-system",
NULL);
3530 style->doctypeSystem = prop;
3534 "doctype-public",
NULL);
3538 style->doctypePublic = prop;
3541 (
const xmlChar *)
"standalone",
3545 style->standalone = 1;
3547 style->standalone = 0;
3550 "invalid value for standalone: %s\n",
3567 "invalid value for indent: %s\n", prop);
3575 "omit-xml-declaration",
3579 style->omitXmlDeclaration = 1;
3581 style->omitXmlDeclaration = 0;
3584 "invalid value for omit-xml-declaration: %s\n",
3593 "cdata-section-elements",
3595 if (elements !=
NULL) {
3616#ifdef WITH_XSLT_DEBUG_PARSING
3618 "add cdata section output element %s\n",
3645 if (((doctypePublic !=
NULL) || (doctypeSystem !=
NULL)))
3646 res = htmlNewDoc(doctypeSystem, doctypePublic);
3649#ifdef XSLT_GENERATE_HTML_DOCTYPE
3653 res = htmlNewDocNoDtD(doctypeSystem, doctypePublic);
3661 "xsltDocumentElem: unsupported method xhtml\n");
3663 res = htmlNewDocNoDtD(doctypeSystem, doctypePublic);
3675#ifdef WITH_XSLT_DEBUG
3677 "reusing transformation dict for output\n");
3681 "xsltDocumentElem: unsupported method (%s)\n",
3692#ifdef WITH_XSLT_DEBUG
3694 "reusing transformation dict for output\n");
3713 if (doctype ==
NULL)
3714 doctype =
root->name;
3725 while ((tmp !=
NULL) && (tmp !=
root)) {
3735 if (((doctypePublic !=
NULL) || (doctypeSystem !=
NULL))) {
3739#ifdef XSLT_GENERATE_HTML_DOCTYPE
3743 if (((doctypePublic !=
NULL) || (doctypeSystem !=
NULL)))
3756 if (((doctypePublic !=
NULL) || (doctypeSystem !=
NULL)))
3776 style->omitXmlDeclaration = 1;
3777 redirect_write_append = 1;
3779 style->omitXmlDeclaration = 0;
3783 if (redirect_write_append) {
3798 "xsltDocumentElem: unable to save to %s\n",
3800#ifdef WITH_XSLT_DEBUG_EXTRA
3808 ctxt->
output = oldOutput;
3809 ctxt->
insert = oldInsert;
3810 ctxt->
type = oldType;
3844 "xsl:sort : compilation failed\n");
3848 "xsl:sort : improper use this should not be reached\n");
3864#ifdef XSLT_REFACTORED
3865 xsltStyleItemCopyPtr comp = (xsltStyleItemCopyPtr) castedComp;
3871 oldInsert = ctxt->
insert;
3873 switch (
node->type) {
3881#ifdef WITH_XSLT_DEBUG_PROCESS
3884 "xsltCopy: CDATA text %s\n",
node->content));
3887 "xsltCopy: text %s\n",
node->content));
3903#ifdef WITH_XSLT_DEBUG_PROCESS
3905 "xsltCopy: node %s\n",
node->name));
3909 if (comp->use !=
NULL) {
3914#ifdef WITH_XSLT_DEBUG_PROCESS
3916 "xsltCopy: attribute %s\n",
node->name));
3928#ifdef WITH_XSLT_DEBUG_PROCESS
3930 "xsltCopy: PI %s\n",
node->name));
3937#ifdef WITH_XSLT_DEBUG_PROCESS
3939 "xsltCopy: comment\n"));
3945#ifdef WITH_XSLT_DEBUG_PROCESS
3947 "xsltCopy: namespace declaration\n"));
3957 switch (
node->type) {
3967 ctxt->
insert = oldInsert;
3990 "xsl:text content problem\n");
3995#ifdef WITH_XSLT_DEBUG_PARSING
3997 "Disable escaping: %s\n",
text->content);
4019#ifdef XSLT_REFACTORED
4020 xsltStyleItemElementPtr comp = (xsltStyleItemElementPtr) castedComp;
4036 if (!comp->has_name)
4042 oldInsert = ctxt->
insert;
4044 if (comp->name ==
NULL) {
4050 "xsl:element: The attribute 'name' is missing.\n");
4053 if (xmlValidateQName(prop, 0)) {
4055 "xsl:element: The effective name '%s' is not a "
4056 "valid QName.\n", prop);
4065#ifdef XSLT_REFACTORED
4066 prefix = comp->nsPrefix;
4083 "xsl:element : creation of %s failed\n",
name);
4089 "xsl:element : xsltAddChild failed\n");
4098 if (comp->ns !=
NULL) {
4102 if (comp->ns[0] != 0)
4117 if ((tmpNsName !=
NULL) && (tmpNsName[0] != 0))
4124 "xsl:attribute: Namespace http://www.w3.org/2000/xmlns/ "
4148 if (prefix !=
NULL) {
4150 "xsl:element: The QName '%s:%s' has no "
4151 "namespace binding in scope in the stylesheet; "
4152 "this is an error, since the namespace was not "
4153 "specified by the instruction itself.\n", prefix,
name);
4161 if (nsName !=
NULL) {
4173 }
else if ((
copy->parent !=
NULL) &&
4185 if (comp->has_use) {
4186 if (comp->use !=
NULL) {
4196 if (attrSets !=
NULL) {
4210 ctxt->
insert = oldInsert;
4238 "xsl:comment : '--' or ending '-' not allowed in comment\n");
4242#ifdef WITH_XSLT_DEBUG_PROCESS
4245 "xsltComment: empty\n"));
4248 "xsltComment: content %s\n",
value));
4271#ifdef XSLT_REFACTORED
4272 xsltStyleItemPIPtr comp = (xsltStyleItemPIPtr) castedComp;
4283 if (comp->has_name == 0)
4285 if (comp->name ==
NULL) {
4290 "xsl:processing-instruction : name is missing\n");
4302 "xsl:processing-instruction: '?>' not allowed within PI content\n");
4305#ifdef WITH_XSLT_DEBUG_PROCESS
4308 "xsltProcessingInstruction: %s empty\n",
name));
4311 "xsltProcessingInstruction: %s content %s\n",
name,
value));
4337#ifdef XSLT_REFACTORED
4338 xsltStyleItemCopyOfPtr comp = (xsltStyleItemCopyOfPtr) castedComp;
4348 if ((comp ==
NULL) || (comp->select ==
NULL) || (comp->comp ==
NULL)) {
4350 "xsl:copy-of : compilation failed\n");
4372#ifdef WITH_XSLT_DEBUG_PROCESS
4374 "xsltCopyOf: select %s\n", comp->select));
4383 if (
res->type == XPATH_NODESET) {
4388#ifdef WITH_XSLT_DEBUG_PROCESS
4390 "xsltCopyOf: result is a node set\n"));
4399 for (
i = 0;
i <
list->nodeNr;
i++) {
4416 }
else if (
res->type == XPATH_XSLT_TREE) {
4423#ifdef WITH_XSLT_DEBUG_PROCESS
4425 "xsltCopyOf: result is a result tree fragment\n"));
4433 list->nodeTab[0]->children, ctxt->
insert, 0, 0);
4443 "Internal error in xsltCopyOf(): "
4444 "failed to cast an XPath object to string.\n");
4447 if (
value[0] != 0) {
4455#ifdef WITH_XSLT_DEBUG_PROCESS
4457 "xsltCopyOf: result %s\n",
res->stringval));
4466 xmlXPathFreeObject(
res);
4482#ifdef XSLT_REFACTORED
4483 xsltStyleItemValueOfPtr comp = (xsltStyleItemValueOfPtr) castedComp;
4493 if ((comp ==
NULL) || (comp->select ==
NULL) || (comp->comp ==
NULL)) {
4495 "Internal error in xsltValueOf(): "
4496 "The XSLT 'value-of' instruction was not compiled.\n");
4500#ifdef WITH_XSLT_DEBUG_PROCESS
4502 "xsltValueOf: select %s\n", comp->select));
4514 "Internal error in xsltValueOf(): "
4515 "failed to cast an XPath object to string.\n");
4519 if (
value[0] != 0) {
4524 "XPath evaluation returned no result.\n");
4529#ifdef WITH_XSLT_DEBUG_PROCESS
4532 "xsltValueOf: result '%s'\n",
value));
4540 xmlXPathFreeObject(
res);
4556#ifdef XSLT_REFACTORED
4557 xsltStyleItemNumberPtr comp = (xsltStyleItemNumberPtr) castedComp;
4561 xmlXPathContextPtr xpctxt;
4567 "xsl:number : compilation failed\n");
4574 comp->numdata.doc = inst->
doc;
4575 comp->numdata.node = inst;
4578 oldXPNsNr = xpctxt->nsNr;
4579 oldXPNamespaces = xpctxt->namespaces;
4581#ifdef XSLT_REFACTORED
4582 if (comp->inScopeNs !=
NULL) {
4583 xpctxt->namespaces = comp->inScopeNs->list;
4584 xpctxt->nsNr = comp->inScopeNs->xpathNumber;
4586 xpctxt->namespaces =
NULL;
4590 xpctxt->namespaces = comp->nsList;
4591 xpctxt->nsNr = comp->nsNr;
4596 xpctxt->nsNr = oldXPNsNr;
4597 xpctxt->namespaces = oldXPNamespaces;
4616 if ((ctxt ==
NULL) || (inst ==
NULL))
4621 "Internal error in xsltApplyImports(): "
4622 "The XSLT 'apply-imports' instruction was not compiled.\n");
4639 "It is an error to call 'apply-imports' "
4640 "when there's no current template rule.\n");
4649 if (templ !=
NULL) {
4682#ifdef XSLT_REFACTORED
4683 xsltStyleItemCallTemplatePtr comp =
4684 (xsltStyleItemCallTemplatePtr) castedComp;
4694 "The XSLT 'call-template' instruction was not compiled.\n");
4701 if (comp->templ ==
NULL) {
4703 if (comp->templ ==
NULL) {
4704 if (comp->ns !=
NULL) {
4706 "The called template '{%s}%s' was not found.\n",
4707 comp->
ns, comp->name);
4710 "The called template '%s' was not found.\n",
4717#ifdef WITH_XSLT_DEBUG_PROCESS
4718 if ((comp !=
NULL) && (comp->name !=
NULL))
4720 "call-template: name %s\n", comp->name));
4743 param->next = withParams;
4748 "xsl:call-template: misplaced xsl:%s\n",
cur->name);
4752 "xsl:call-template: misplaced %s element\n",
cur->name);
4762 if (withParams !=
NULL)
4765#ifdef WITH_XSLT_DEBUG_PROCESS
4766 if ((comp !=
NULL) && (comp->name !=
NULL))
4768 "call-template returned: name %s\n", comp->name));
4785#ifdef XSLT_REFACTORED
4786 xsltStyleItemApplyTemplatesPtr comp =
4787 (xsltStyleItemApplyTemplatesPtr) castedComp;
4793 xmlNodeSetPtr
list =
NULL, oldList;
4795 int oldXPProximityPosition, oldXPContextSize;
4796 const xmlChar *oldMode, *oldModeURI;
4799 xmlXPathContextPtr xpctxt;
4803 "xsl:apply-templates : compilation failed\n");
4809#ifdef WITH_XSLT_DEBUG_PROCESS