19#define WITH_XSLT_DEBUG_PARSING
31#define XSLT_ELEMENT_CATEGORY_XSLT 0
32#define XSLT_ELEMENT_CATEGORY_EXTENSION 1
33#define XSLT_ELEMENT_CATEGORY_LRE 2
52const xmlChar *xsltXSLTTextMarker = (
const xmlChar *)
"XSLT Text Element";
58const xmlChar *xsltXSLTAttrMarker = (
const xmlChar *)
"LRE XSLT Attr";
62#ifdef XSLT_LOCALE_WINAPI
69#ifndef LIBXML_DEBUG_ENABLED
79#define IS_BLANK(c) (((c) == 0x20) || ((c) == 0x09) || ((c) == 0xA) || \
85#define IS_BLANK_NODE(n) \
86 (((n)->type == XML_TEXT_NODE) && (xsltIsBlank((n)->content)))
105 "The XSLT-element '%s' is not allowed at this position.\n",
109 "The element '%s' is not allowed at this position.\n",
114#ifdef XSLT_REFACTORED
131 if (
style->exclPrefixMax == 0) {
132 style->exclPrefixMax = 4;
133 style->exclPrefixTab =
135 sizeof(
style->exclPrefixTab[0]));
142 for (
i = 0;
i <
style->exclPrefixNr;
i++) {
146 if (
style->exclPrefixNr >=
style->exclPrefixMax) {
147 style->exclPrefixMax *= 2;
148 style->exclPrefixTab =
150 style->exclPrefixMax *
151 sizeof(
style->exclPrefixTab[0]));
159 return (
style->exclPrefixNr++);
174 if (
style->exclPrefixNr <= 0)
176 style->exclPrefixNr--;
177 if (
style->exclPrefixNr > 0)
182 style->exclPrefixTab[
style->exclPrefixNr] = 0;
204#ifdef XSLT_LOCALE_WINAPI
218#ifdef XSLT_LOCALE_WINAPI
220 xsltLocaleMutex =
NULL;
254 static const xmlChar permille[4] = {0xe2, 0x80, 0xb0, 0};
317 while (iter !=
NULL) {
339 return style->decimalFormat;
370 return style->decimalFormat;
400 "xsltNewTemplate : malloc failed\n");
416 if (
template ==
NULL)
448 while (
template !=
NULL) {
450 template =
template->next;
455#ifdef XSLT_REFACTORED
458xsltFreeNsAliasList(xsltNsAliasPtr
item)
470#ifdef XSLT_REFACTORED_XSLT_NSCOMP
472xsltFreeNamespaceMap(xsltNsMapPtr
item)
485xsltNewNamespaceMapItem(xsltCompilerCtxtPtr cctxt,
498 "Internal error: (xsltNewNamespaceMapItem) "
499 "memory allocation failed.\n");
505 ret->origNsName =
ns->href;
509 if (cctxt->psData->nsMap !=
NULL)
510 ret->next = cctxt->psData->nsMap;
511 cctxt->psData->nsMap =
ret;
524xsltCompilerVarInfoFree(xsltCompilerCtxtPtr cctxt)
526 xsltVarInfoPtr ivar = cctxt->ivars, ivartmp;
541xsltCompilationCtxtFree(xsltCompilerCtxtPtr cctxt)
545#ifdef WITH_XSLT_DEBUG_PARSING
547 "Freeing compilation context\n");
549 "### Max inodes: %d\n", cctxt->maxNodeInfos);
551 "### Max LREs : %d\n", cctxt->maxLREs);
556 if (cctxt->inodeList !=
NULL) {
557 xsltCompilerNodeInfoPtr tmp,
cur = cctxt->inodeList;
564 if (cctxt->tmpList !=
NULL)
565 xsltPointerListFree(cctxt->tmpList);
566 if (cctxt->nsAliases !=
NULL)
567 xsltFreeNsAliasList(cctxt->nsAliases);
570 xsltCompilerVarInfoFree(cctxt);
583static xsltCompilerCtxtPtr
585 xsltCompilerCtxtPtr
ret;
587 ret = (xsltCompilerCtxtPtr)
xmlMalloc(
sizeof(xsltCompilerCtxt));
590 "xsltCompilerCreate: allocation of compiler "
591 "context failed.\n");
594 memset(
ret, 0,
sizeof(xsltCompilerCtxt));
596 ret->errSeverity = XSLT_ERROR_SEVERITY_ERROR;
597 ret->tmpList = xsltPointerListCreate(20);
605 xsltCompilationCtxtFree(
ret);
610xsltLREEffectiveNsNodesFree(xsltEffectiveNsPtr
first)
612 xsltEffectiveNsPtr tmp;
622xsltFreePrincipalStylesheetData(xsltPrincipalStylesheetDataPtr
data)
627 if (
data->inScopeNamespaces !=
NULL) {
629 xsltNsListContainerPtr nsi;
630 xsltPointerListPtr
list =
631 (xsltPointerListPtr)
data->inScopeNamespaces;
637 nsi = (xsltNsListContainerPtr)
list->items[
i];
642 xsltPointerListFree(
list);
646 if (
data->exclResultNamespaces !=
NULL) {
648 xsltPointerListPtr
list = (xsltPointerListPtr)
649 data->exclResultNamespaces;
652 xsltPointerListFree((xsltPointerListPtr)
list->items[
i]);
654 xsltPointerListFree(
list);
658 if (
data->extElemNamespaces !=
NULL) {
659 xsltPointerListPtr
list = (xsltPointerListPtr)
660 data->extElemNamespaces;
664 xsltPointerListFree((xsltPointerListPtr)
list->items[
i]);
666 xsltPointerListFree(
list);
669 if (
data->effectiveNs) {
670 xsltLREEffectiveNsNodesFree(
data->effectiveNs);
673#ifdef XSLT_REFACTORED_XSLT_NSCOMP
674 xsltFreeNamespaceMap(
data->nsMap);
679static xsltPrincipalStylesheetDataPtr
680xsltNewPrincipalStylesheetData(
void)
682 xsltPrincipalStylesheetDataPtr
ret;
684 ret = (xsltPrincipalStylesheetDataPtr)
685 xmlMalloc(
sizeof(xsltPrincipalStylesheetData));
688 "xsltNewPrincipalStylesheetData: memory allocation failed.\n");
691 memset(
ret, 0,
sizeof(xsltPrincipalStylesheetData));
696 ret->inScopeNamespaces = xsltPointerListCreate(-1);
697 if (
ret->inScopeNamespaces ==
NULL)
702 ret->exclResultNamespaces = xsltPointerListCreate(-1);
703 if (
ret->exclResultNamespaces ==
NULL)
708 ret->extElemNamespaces = xsltPointerListCreate(-1);
709 if (
ret->extElemNamespaces ==
NULL)
736 "xsltNewStylesheet : malloc failed\n");
742 ret->omitXmlDeclaration = -1;
743 ret->standalone = -1;
748 ret->exclPrefixNr = 0;
749 ret->exclPrefixMax = 0;
753 ret->internalized = 1;
754 ret->literal_result = 0;
755 ret->forwards_compatible = 0;
757#ifdef WITH_XSLT_DEBUG
759 "creating dictionary for stylesheet\n");
765 ret->xpathCtxt = xmlXPathNewContext(
NULL);
768 "xsltNewStylesheet: xmlXPathNewContext failed\n");
771 if (xmlXPathContextSetCache(
ret->xpathCtxt, 1, -1, 0) == -1)
811 return(
style->extrasNr++);
835 "xsltAllocateExtraCtxt: out of memory\n");
852 "xsltAllocateExtraCtxt: out of memory\n");
856 for (
i = ctxt->
extrasNr;i < ctxt->extrasMax;
i++) {
901 if ((doc ==
NULL) || (rootElem ==
NULL) ||
903 (doc != rootElem->
doc))
955#ifdef XSLT_REFACTORED
962#ifdef XSLT_REFACTORED_XSLT_NSCOMP
967 XSLT_HAS_INTERNAL_NSMAP(
style))
969 xsltRestoreDocumentNamespaces(XSLT_GET_INTERNAL_NSMAP(
style),
1029#ifdef XSLT_REFACTORED
1035 if (
style->principalData) {
1036 xsltFreePrincipalStylesheetData(
style->principalData);
1049#ifdef WITH_XSLT_DEBUG
1051 "freeing dictionary from stylesheet\n");
1056 xmlXPathFreeContext(
style->xpathCtxt);
1068#ifdef XSLT_REFACTORED
1114 for (
i = 0;
i <
style->exclPrefixNr;
i++) {
1124 "xsltGetInheritedNsList : out of memory!\n");
1132 for (
i = 0;
i < nbns;
i++) {
1133 if ((
cur->prefix ==
ret[
i]->prefix) ||
1138 if (nbns >= maxns) {
1146 "xsltGetInheritedNsList : realloc failed!\n");
1160#ifdef WITH_XSLT_DEBUG_PARSING
1162 "template has %d inherited namespaces\n", nbns);
1164 template->inheritedNsNr = nbns;
1165 template->inheritedNs =
ret;
1195 style->version = prop;
1202 style->encoding = prop;
1225 }
else if (URI ==
NULL) {
1229 style->method = prop;
1232 "invalid value for method: %s\n", prop);
1237 style->method = prop;
1246 style->doctypeSystem = prop;
1253 style->doctypePublic = prop;
1259 style->standalone = 1;
1261 style->standalone = 0;
1264 "invalid value for standalone: %s\n", prop);
1278 "invalid value for indent: %s\n", prop);
1287 style->omitXmlDeclaration = 1;
1289 style->omitXmlDeclaration = 0;
1292 "invalid value for omit-xml-declaration: %s\n",
1301 if (elements !=
NULL) {
1318#ifdef WITH_XSLT_DEBUG_PARSING
1320 "add cdata section output element %s\n",
1325 "Attribute 'cdata-section-elements': The value "
1326 "'%s' is not a valid QName.\n",
element);
1342 "Attribute 'cdata-section-elements': "
1343 "Not a valid QName.\n");
1374 if (
style->mediaType)
1376 style->mediaType = prop;
1414 if (xmlValidateQName(prop, 0) != 0) {
1416 "xsl:decimal-format: Invalid QName '%s'.\n", prop);
1432 "xsltParseStylestyleDecimalFormat: %s already exists\n", prop);
1440 "xsltParseStylestyleDecimalFormat: failed creating new decimal-format\n");
1446 for (iter =
style->decimalFormat; iter->
next; iter = iter->
next)
1455 format->decimalPoint = prop;
1473 format->minusSign = prop;
1497 format->zeroDigit = prop;
1509 format->patternSeparator = prop;
1534 if (elements ==
NULL) {
1536 "xsltParseStylesheetPreserveSpace: missing elements attribute\n");
1555#ifdef WITH_XSLT_DEBUG_PARSING
1557 "add preserved space element %s\n",
element);
1560 style->stripAll = -1;
1582#ifdef XSLT_REFACTORED
1610 (
const xmlChar *)
"extension-element-prefixes",
NULL);
1621 while (*prefix != 0) {
1622 while (
IS_BLANK(*prefix)) prefix++;
1637 "xsl:extension-element-prefix : undefined namespace %s\n",
1641#ifdef WITH_XSLT_DEBUG_PARSING
1643 "add extension prefix %s\n", prefix);
1673 if (elements ==
NULL) {
1675 "xsltParseStylesheetStripSpace: missing elements attribute\n");
1694#ifdef WITH_XSLT_DEBUG_PARSING
1696 "add stripped space element %s\n",
element);
1699 style->stripAll = 1;
1721#ifdef XSLT_REFACTORED
1747 (
const xmlChar *)
"exclude-result-prefixes",
NULL);
1757 while (*prefix != 0) {
1758 while (
IS_BLANK(*prefix)) prefix++;
1773 "xsl:exclude-result-prefixes : undefined namespace %s\n",
1778#ifdef WITH_XSLT_DEBUG_PARSING
1780 "exclude result prefix %s\n", prefix);
1794#ifdef XSLT_REFACTORED
1812 return (doc->
oldNs);
1818 "xsltTreeEnsureXMLDecl: Failed to allocate "
1819 "the XML namespace.\n");
1827#ifdef LIBXML_NAMESPACE_DICT
1867 ns = xsltTreeEnsureXMLDecl(doc);
1876 }
else if (prefix ==
NULL) {
1880 if ((
ns->
prefix[0] == prefix[0]) &&
1903xsltLREBuildEffectiveNs(xsltCompilerCtxtPtr cctxt,
1907 xsltNsAliasPtr
alias;
1911 if ((cctxt->nsAliases ==
NULL) || (! cctxt->hasNsAliases))
1914 alias = cctxt->nsAliases;
1931 if (
elem->doc ==
alias->docOfTargetNs) {
1947 alias->targetNs->prefix);
1966 ns = xsltTreeAcquireStoredNs(
elem->doc,
1967 alias->targetNs->href,
1968 alias->targetNs->prefix);
1972 "Internal error in "
1973 "xsltLREBuildEffectiveNs(): "
1974 "failed to acquire a stored "
1975 "ns-declaration.\n");
1976 cctxt->style->errors++;
2004 alias = cctxt->nsAliases;
2018 if (
elem->doc ==
alias->docOfTargetNs) {
2022 alias->targetNs->prefix);
2026 ns = xsltTreeAcquireStoredNs(
elem->doc,
2027 alias->targetNs->href,
2028 alias->targetNs->prefix);
2032 "Internal error in "
2033 "xsltLREBuildEffectiveNs(): "
2034 "failed to acquire a stored "
2035 "ns-declaration.\n");
2036 cctxt->style->errors++;
2074xsltLREBuildEffectiveNsNodes(xsltCompilerCtxtPtr cctxt,
2075 xsltStyleItemLRElementInfoPtr
item,
2080 xsltEffectiveNsPtr effNs, lastEffNs =
NULL;
2081 int i,
j, holdByElem;
2082 xsltPointerListPtr extElemNs = cctxt->inode->extElemNs;
2083 xsltPointerListPtr exclResultNs = cctxt->inode->exclResultNs;
2092 extElemNs = cctxt->inode->extElemNs;
2093 exclResultNs = cctxt->inode->exclResultNs;
2095 for (
i = 0;
i <
item->inScopeNs->totalNumber;
i++) {
2096 ns =
item->inScopeNs->list[
i];
2128 if (cctxt->hasNsAliases) {
2129 xsltNsAliasPtr
alias;
2133 alias = cctxt->nsAliases;
2145 goto add_effective_ns;
2150 alias = cctxt->nsAliases;
2171 for (
j = 0;
j < exclResultNs->number;
j++)
2179 for (
j = 0;
j < extElemNs->number;
j++)
2188 if (isLRE && (
elem->nsDef !=
NULL)) {
2190 tmpns =
elem->nsDef;
2196 tmpns = tmpns->
next;
2197 }
while (tmpns !=
NULL);
2205 effNs = (xsltEffectiveNsPtr)
xmlMalloc(
sizeof(xsltEffectiveNs));
2206 if (effNs ==
NULL) {
2208 "Internal error in xsltLREBuildEffectiveNs(): "
2209 "failed to allocate memory.\n");
2210 cctxt->style->errors++;
2213 if (cctxt->psData->effectiveNs ==
NULL) {
2214 cctxt->psData->effectiveNs = effNs;
2215 effNs->nextInStore =
NULL;
2217 effNs->nextInStore = cctxt->psData->effectiveNs;
2218 cctxt->psData->effectiveNs = effNs;
2223 effNs->nsName =
ns->href;
2224 effNs->holdByElem = holdByElem;
2226 if (lastEffNs ==
NULL)
2227 item->effectiveNs = effNs;
2229 lastEffNs->next = effNs;
2247xsltLREInfoCreate(xsltCompilerCtxtPtr cctxt,
2251 xsltStyleItemLRElementInfoPtr
item;
2253 if ((cctxt ==
NULL) || (cctxt->inode ==
NULL))
2256 item = (xsltStyleItemLRElementInfoPtr)
2257 xmlMalloc(
sizeof(xsltStyleItemLRElementInfo));
2260 "Internal error in xsltLREInfoCreate(): "
2261 "memory allocation failed.\n");
2262 cctxt->style->errors++;
2265 memset(
item, 0,
sizeof(xsltStyleItemLRElementInfo));
2266 item->type = XSLT_FUNC_LITERAL_RESULT_ELEMENT;
2270 item->next = cctxt->style->preComps;
2276 item->inScopeNs = cctxt->inode->inScopeNs;
2279 xsltLREBuildEffectiveNsNodes(cctxt,
item,
elem, isLRE);
2281 cctxt->inode->litResElemInfo =
item;
2282 cctxt->inode->nsChanged = 0;
2295static xsltVarInfoPtr
2296xsltCompilerVarInfoPush(xsltCompilerCtxtPtr cctxt,
2301 xsltVarInfoPtr ivar;
2303 if ((cctxt->ivar !=
NULL) && (cctxt->ivar->next !=
NULL)) {
2304 ivar = cctxt->ivar->next;
2305 }
else if ((cctxt->ivar ==
NULL) && (cctxt->ivars !=
NULL)) {
2306 ivar = cctxt->ivars;
2308 ivar = (xsltVarInfoPtr)
xmlMalloc(
sizeof(xsltVarInfo));
2311 "xsltParseInScopeVarPush: xmlMalloc() failed!\n");
2312 cctxt->style->errors++;
2316 if (cctxt->ivars ==
NULL) {
2317 cctxt->ivars = ivar;
2320 cctxt->ivar->
next = ivar;
2321 ivar->prev = cctxt->ivar;
2326 ivar->depth = cctxt->depth;
2328 ivar->nsName = nsName;
2340xsltCompilerVarInfoPop(xsltCompilerCtxtPtr cctxt)
2343 while ((cctxt->ivar !=
NULL) &&
2344 (cctxt->ivar->depth > cctxt->depth))
2346 cctxt->ivar = cctxt->ivar->prev;
2361static xsltCompilerNodeInfoPtr
2364 xsltCompilerNodeInfoPtr
inode, iprev;
2366 if ((cctxt->inode !=
NULL) && (cctxt->inode->next !=
NULL)) {
2367 inode = cctxt->inode->next;
2368 }
else if ((cctxt->inode ==
NULL) && (cctxt->inodeList !=
NULL)) {
2369 inode = cctxt->inodeList;
2374 inode = (xsltCompilerNodeInfoPtr)
2375 xmlMalloc(
sizeof(xsltCompilerNodeInfo));
2378 "xsltCompilerNodePush: malloc failed.\n");
2382 if (cctxt->inodeList ==
NULL)
2383 cctxt->inodeList =
inode;
2385 cctxt->inodeLast->next =
inode;
2386 inode->prev = cctxt->inodeLast;
2388 cctxt->inodeLast =
inode;
2389 cctxt->maxNodeInfos++;
2390 if (cctxt->inode ==
NULL) {
2391 cctxt->inode =
inode;
2396 xsltLREInfoCreate(cctxt,
NULL, 0);
2400 cctxt->inode =
inode;
2407 inode->depth = cctxt->depth;
2409 inode->category = XSLT_ELEMENT_CATEGORY_XSLT;
2412 inode->curChildType = 0;
2413 inode->extContentHandled = 0;
2417 iprev =
inode->prev;
2424 inode->inScopeNs = iprev->inScopeNs;
2428 inode->litResElemInfo = iprev->litResElemInfo;
2429 inode->nsChanged = iprev->nsChanged;
2433 inode->exclResultNs = iprev->exclResultNs;
2437 inode->extElemNs = iprev->extElemNs;
2441 inode->preserveWhitespace = iprev->preserveWhitespace;
2445 inode->forwardsCompat = iprev->forwardsCompat;
2450 inode->preserveWhitespace = 0;
2451 inode->forwardsCompat = 0;
2468 if (cctxt->inode ==
NULL) {
2470 "xsltCompilerNodePop: Top-node mismatch.\n");
2477 if (cctxt->inode->node !=
node) {
2479 "xsltCompilerNodePop: Node mismatch.\n");
2482 if (cctxt->inode->depth != cctxt->depth) {
2484 "xsltCompilerNodePop: Depth mismatch.\n");
2491 if ((cctxt->ivar) && (cctxt->ivar->depth > cctxt->depth))
2492 xsltCompilerVarInfoPop(cctxt);
2494 cctxt->inode = cctxt->inode->prev;
2495 if (cctxt->inode !=
NULL)
2496 cctxt->inode->curChildType = 0;
2508 nsName =
node->ns->href;
2518 if (cctxt->inode->node) {
2520 infname = cctxt->inode->node->
name;
2521 if (cctxt->inode->node->ns !=
NULL)
2522 infnsName = cctxt->inode->node->ns->href;
2534 "xsltCompilerNodePop: Given : '%s' URI '%s'\n",
2537 "xsltCompilerNodePop: Expected: '%s' URI '%s'\n",
2538 infname, infnsName);
2552static xsltNsListContainerPtr
2553xsltCompilerBuildInScopeNsList(xsltCompilerCtxtPtr cctxt,
xmlNodePtr node)
2555 xsltNsListContainerPtr nsi =
NULL;
2570 nsi = (xsltNsListContainerPtr)
2574 "xsltCompilerBuildInScopeNsList: "
2575 "malloc failed!\n");
2578 memset(nsi, 0,
sizeof(xsltNsListContainer));
2581 if (nsi->list ==
NULL) {
2583 "xsltCompilerBuildInScopeNsList: "
2584 "malloc failed!\n");
2587 nsi->list[0] =
NULL;
2592 for (
i = 0;
i < nsi->totalNumber;
i++) {
2593 if ((
ns->
prefix == nsi->list[
i]->prefix) ||
2597 if (
i >= nsi->totalNumber) {
2598 if (nsi->totalNumber +1 >= maxns) {
2603 if (nsi->list ==
NULL) {
2605 "xsltCompilerBuildInScopeNsList: "
2606 "realloc failed!\n");
2610 nsi->list[nsi->totalNumber++] =
ns;
2611 nsi->list[nsi->totalNumber] =
NULL;
2624 nsi->xpathNumber = nsi->totalNumber;
2625 for (
i = 0;
i < nsi->totalNumber;
i++) {
2626 if (nsi->list[
i]->prefix ==
NULL) {
2628 nsi->list[
i] = nsi->list[nsi->totalNumber-1];
2629 nsi->list[nsi->totalNumber-1] =
ns;
2637 if (xsltPointerListAddSize(
2638 (xsltPointerListPtr)cctxt->psData->inScopeNamespaces,
2639 (
void *) nsi, 5) == -1)
2644 "xsltCompilerBuildInScopeNsList: failed to add ns-info.\n");
2650 if (cctxt->inode !=
NULL)
2651 cctxt->inode->nsChanged = 1;
2658 cctxt->style->errors++;
2663xsltParseNsPrefixList(xsltCompilerCtxtPtr cctxt,
2664 xsltPointerListPtr
list,
2695 if ((
cur[0] ==
'#') &&
2707 "No namespace binding in scope for prefix '%s'.\n",
cur);
2714 cctxt->style->errors++;
2716#ifdef WITH_XSLT_DEBUG_PARSING
2718 "resolved prefix '%s'\n",
cur);
2723 if (xsltPointerListAddSize(
list,
2725 ns->href, -1), 5) == -1)
2738 cctxt->style->errors++;
2753static xsltPointerListPtr
2754xsltCompilerUtilsCreateMergedList(xsltPointerListPtr
first,
2755 xsltPointerListPtr second)
2757 xsltPointerListPtr
ret;
2765 num += second->number;
2768 ret = xsltPointerListCreate(
num);
2776 first->number *
sizeof(
void *));
2777 if ((second !=
NULL) && (second->number != 0))
2779 second->number *
sizeof(
void *));
2780 }
else if ((second !=
NULL) && (second->number != 0))
2781 memcpy(
ret->items, (
void *) second->items,
2782 second->number *
sizeof(
void *));
2797static xsltPointerListPtr
2798xsltParseExclResultPrefixes(xsltCompilerCtxtPtr cctxt,
xmlNodePtr node,
2799 xsltPointerListPtr def,
2809 if (instrCategory == XSLT_ELEMENT_CATEGORY_XSLT)
2817 if (
attr && (instrCategory == XSLT_ELEMENT_CATEGORY_LRE)) {
2821 attr->psvi = (
void *) xsltXSLTAttrMarker;
2829 "Attribute 'exclude-result-prefixes': Invalid value.\n");
2830 cctxt->style->errors++;
2834 if (xsltParseNsPrefixList(cctxt, cctxt->tmpList,
node,
2837 if (cctxt->tmpList->number == 0)
2842 list = xsltCompilerUtilsCreateMergedList(def, cctxt->tmpList);
2848 if (xsltPointerListAddSize(
2849 cctxt->psData->exclResultNamespaces,
list, 5) == -1)
2851 xsltPointerListFree(
list);
2858 if (cctxt->inode !=
NULL)
2859 cctxt->inode->nsChanged = 1;
2878static xsltPointerListPtr
2879xsltParseExtElemPrefixes(xsltCompilerCtxtPtr cctxt,
xmlNodePtr node,
2880 xsltPointerListPtr def,
2891 if (instrCategory == XSLT_ELEMENT_CATEGORY_XSLT)
2899 if (
attr && (instrCategory == XSLT_ELEMENT_CATEGORY_LRE)) {
2903 attr->psvi = (
void *) xsltXSLTAttrMarker;
2911 "Attribute 'extension-element-prefixes': Invalid value.\n");
2912 cctxt->style->errors++;
2917 if (xsltParseNsPrefixList(cctxt, cctxt->tmpList,
node,
2921 if (cctxt->tmpList->number == 0)
2926 for (
i = 0;
i < cctxt->tmpList->number;
i++)
2932 list = xsltCompilerUtilsCreateMergedList(def, cctxt->tmpList);
2938 if (xsltPointerListAddSize(
2939 cctxt->psData->extElemNamespaces,
list, 5) == -1)
2941 xsltPointerListFree(
list);
2948 if (cctxt->inode !=
NULL)
2949 cctxt->inode->nsChanged = 1;
2971xsltParseAttrXSLTVersion(xsltCompilerCtxtPtr cctxt,
xmlNodePtr node,
2980 if (instrCategory == XSLT_ELEMENT_CATEGORY_XSLT)
2988 attr->psvi = (
void *) xsltXSLTAttrMarker;
2995 "Attribute 'version': Invalid value.\n");
2996 cctxt->style->errors++;
3001 cctxt->inode->forwardsCompat = 1;
3009 if (! cctxt->hasForwardsCompat) {
3010 cctxt->hasForwardsCompat = 1;
3011 cctxt->errSeverity = XSLT_ERROR_SEVERITY_WARNING;
3013 "Warning: the attribute xsl:version specifies a value "
3014 "different from '1.0'. Switching to forwards-compatible "
3015 "mode. Only features of XSLT 1.0 are supported by this "
3017 cctxt->style->warnings++;
3018 cctxt->errSeverity = XSLT_ERROR_SEVERITY_ERROR;
3021 cctxt->inode->forwardsCompat = 0;
3024 if (
attr && (instrCategory == XSLT_ELEMENT_CATEGORY_LRE)) {
3028 attr->psvi = (
void *) xsltXSLTAttrMarker;
3034xsltParsePreprocessStylesheetTree(xsltCompilerCtxtPtr cctxt,
xmlNodePtr node)
3039 int internalize = 0, findSpaceAttr;
3040 int xsltStylesheetElemDepth;
3044 int strictWhitespace, inXSLText = 0;
3045#ifdef XSLT_REFACTORED_XSLT_NSCOMP
3046 xsltNsMapPtr nsMapItem;
3049 if ((cctxt ==
NULL) || (cctxt->style ==
NULL) ||
3057 style = cctxt->style;
3061 style->internalized = 0;
3069 if (! cctxt->simplified)
3070 xsltStylesheetElemDepth = cctxt->depth +1;
3072 xsltStylesheetElemDepth = 0;
3075 cctxt->inode->preserveWhitespace = 0;
3077 cctxt->inode->preserveWhitespace = 1;
3082 strictWhitespace = (cctxt->strict != 0) ? 1 : 0;
3084 nsNameXSLT = xsltConstNamespaceNameXSLT;
3089 if (deleteNode !=
NULL) {
3091#ifdef WITH_XSLT_DEBUG_BLANKS
3093 "xsltParsePreprocessStylesheetTree: removing node\n");
3106 xsltCompilerNodePush(cctxt,
cur);
3111 cctxt->inode->stripWhitespace = 0;
3116#ifdef XSLT_REFACTORED_XSLT_NSCOMP
3117 if (
cur->ns->href != nsNameXSLT) {
3118 nsMapItem = xsltNewNamespaceMapItem(cctxt,
3120 if (nsMapItem ==
NULL)
3122 cur->ns->href = nsNameXSLT;
3127 goto process_attributes;
3156 if ((
name[0] ==
't') && (
name[1] ==
'e') &&
3157 (
name[2] ==
'x') && (
name[3] ==
't') &&
3165 cur->psvi = (
void *) xsltXSLTTextMarker;
3172 cctxt->inode->preserveWhitespace = 1;
3179 cctxt->inode->stripWhitespace = 1;
3186 cctxt->inode->stripWhitespace = 1;
3189 if (xsltStylesheetElemDepth == cctxt->depth) {
3193 cctxt->inode->stripWhitespace = 1;
3206 if (((*
name ==
'p') || (*
name ==
's')) &&
3223 }
while (
cur->prev);
3235 if (
cur->properties !=
NULL) {
3240#ifdef XSLT_REFACTORED_XSLT_NSCOMP
3241 if ((
attr->ns) && (
attr->ns->href != nsNameXSLT) &&
3244 nsMapItem = xsltNewNamespaceMapItem(cctxt,
3246 if (nsMapItem ==
NULL)
3248 attr->ns->href = nsNameXSLT;
3257 txt =
attr->children;
3275 if ((findSpaceAttr != 0) &&
3280 (
attr->ns->prefix[0] ==
'x') &&
3281 (
attr->ns->prefix[1] ==
'm') &&
3282 (
attr->ns->prefix[2] ==
'l') &&
3283 (
attr->ns->prefix[3] == 0))
3289 cctxt->inode->preserveWhitespace = 1;
3291 cctxt->inode->preserveWhitespace = 0;
3295 "Attribute xml:space: Invalid value.\n");
3296 cctxt->style->warnings++;
3337 if ((strictWhitespace != 0) || (inXSLText != 0)) {
3341 if (textNode ==
NULL)
3357 if (textNode ==
NULL)
3379 "Invalid type of node for the XSLT data model.\n");
3380 cctxt->style->errors++;
3395 (((cctxt->inode->stripWhitespace) ||
3396 (! cctxt->inode->preserveWhitespace)) &&
3400 if (textNode !=
cur) {
3404 deleteNode = textNode;
3438 xsltCompilerNodePop(cctxt,
cur);
3450 if (deleteNode !=
NULL) {
3451#ifdef WITH_XSLT_DEBUG_PARSING
3453 "xsltParsePreprocessStylesheetTree: removing node\n");
3466#ifdef XSLT_REFACTORED
3472 int internalize = 0;
3481 style->internalized = 0;
3497 if (deleteNode !=
NULL) {
3498#ifdef WITH_XSLT_DEBUG_BLANKS
3500 "xsltPreprocessStylesheet: removing ignorable blank node\n");
3511 if ((internalize) && (
cur->properties !=
NULL)) {
3516 txt =
attr->children;
3541 for (;exclPrefixes > 0;exclPrefixes--)
3549 if ((
cur->nsDef !=
NULL) && (
style->exclPrefixNr > 0)) {
3559 for (
i = 0;
i <
style->exclPrefixNr;
i++) {
3562 style->exclPrefixTab[
i]))) {
3569 cur->nsDef =
ns->next;
3571 prev->next =
ns->next;
3589 if (exclPrefixes > 0) {
3591 for (;exclPrefixes > 0;exclPrefixes--)
3600 }
else if ((
cur->content !=
NULL) && (internalize) &&
3625 (styleelem !=
NULL) && (
cur->parent == styleelem) &&
3629 }
else if (
cur->children !=
NULL) {
3654 if (deleteNode !=
NULL) {
3655#ifdef WITH_XSLT_DEBUG_PARSING
3657 "xsltPreprocessStylesheet: removing ignorable blank node\n");
3702 "xsltGatherNamespaces: failed to create hash table\n");
3710 "Namespaces prefix %s used for multiple namespaces\n",
ns->
prefix);
3712 }
else if (URI ==
NULL) {
3714 (
void *)
ns->href,
NULL);
3716#ifdef WITH_XSLT_DEBUG_PARSING
3718 "Added namespace: %s mapped to %s\n",
ns->
prefix,
ns->href);
3756#ifdef XSLT_REFACTORED
3759xsltGetXSLTElementTypeByNode(xsltCompilerCtxtPtr cctxt,
3766 if (
node->name[0] ==
'a') {
3776 }
else if (
node->name[0] ==
'c') {
3788 }
else if (
node->name[0] ==
'd') {
3794 }
else if (
node->name[0] ==
'e') {
3798 }
else if (
node->name[0] ==
'f') {
3802 return(XSLT_FUNC_FALLBACK);
3804 }
else if (*(
node->name) ==
'i') {
3812 }
else if (*(
node->name) ==
'k') {
3816 }
else if (*(
node->name) ==
'm') {
3818 return(XSLT_FUNC_MESSAGE);
3820 }
else if (*(
node->name) ==
'n') {
3826 }
else if (*(
node->name) ==
'o') {
3828 return(XSLT_FUNC_OTHERWISE);
3832 }
else if (*(
node->name) ==
'p') {
3840 }
else if (*(
node->name) ==
's') {
3848 }
else if (
node->name[0] ==
't') {
3856 }
else if (*(
node->name) ==
'v') {
3862 }
else if (*(
node->name) ==
'w') {
3891 if (! (IS_XSLT_ELEM_FAST(
elem)))
3896 if (cctxt->inode->category == XSLT_ELEMENT_CATEGORY_EXTENSION) {
3897 cctxt->inode->extContentHandled = 1;
3900 xsltCompilerNodePush(cctxt,
elem);
3905 if (cctxt->inode->prev->curChildType != 0)
3906 cctxt->inode->type = cctxt->inode->prev->curChildType;
3908 cctxt->inode->type = xsltGetXSLTElementTypeByNode(cctxt,
elem);
3913 cctxt->inode->inScopeNs =
3914 xsltCompilerBuildInScopeNsList(cctxt,
elem);
3929 switch (cctxt->inode->type) {
3935 goto apply_templates;
3938 goto sequence_constructor;
3947 goto sequence_constructor;
3950 goto sequence_constructor;
3956 goto sequence_constructor;
3959 goto sequence_constructor;
3960 case XSLT_FUNC_FALLBACK:
3962 goto sequence_constructor;
3968 goto sequence_constructor;
3969 case XSLT_FUNC_OTHERWISE:
3971 goto sequence_constructor;
3972 case XSLT_FUNC_MESSAGE:
3974 goto sequence_constructor;
3983 xsltVarInfoPtr ivar = cctxt->ivar;
3987 ((xsltStyleItemParamPtr)
elem->psvi)->name) &&
3989 ((xsltStyleItemParamPtr)
elem->psvi)->ns))
3993 "Redefinition of variable or parameter '%s'.\n",
3995 cctxt->style->errors++;
3999 }
while (ivar !=
NULL);
4002 goto sequence_constructor;
4005 goto sequence_constructor;
4020 xsltVarInfoPtr ivar = cctxt->ivar;
4024 ((xsltStyleItemVariablePtr)
elem->psvi)->name) &&
4026 ((xsltStyleItemVariablePtr)
elem->psvi)->ns))
4030 "Redefinition of variable or parameter '%s'.\n",
4032 cctxt->style->errors++;
4036 }
while (ivar !=
NULL);
4039 goto sequence_constructor;
4042 goto sequence_constructor;
4045 goto sequence_constructor;
4047#ifdef WITH_XSLT_DEBUG_PARSING
4049 "xsltParseXSLTNode: Unhandled XSLT element '%s'.\n",
4053 "xsltParseXSLTNode: Internal error; "
4054 "unhandled XSLT element '%s'.\n",
elem->name);
4055 cctxt->style->errors++;
4065 if (IS_XSLT_ELEM_FAST(
child)) {
4068 xsltParseAnyXSLTElem(cctxt,
child);
4071 xsltParseAnyXSLTElem(cctxt,
child);
4088 if (IS_XSLT_ELEM_FAST(
child)) {
4091 type = xsltGetXSLTElementTypeByNode(cctxt,
child);
4094 xsltParseAnyXSLTElem(cctxt,
child);
4114 "The XSLT 'text' element must have only character "
4115 "data as content.\n");
4134 "This XSLT element must have no content.\n");
4135 cctxt->style->errors++;
4153 int nbWhen = 0, nbOtherwise = 0,
err = 0;
4156 if (IS_XSLT_ELEM_FAST(
child)) {
4159 type = xsltGetXSLTElementTypeByNode(cctxt,
child);
4168 xsltParseAnyXSLTElem(cctxt,
child);
4169 }
else if (
type == XSLT_FUNC_OTHERWISE) {
4177 "The XSLT 'choose' element must not contain "
4178 "more than one XSLT 'otherwise' element.\n");
4179 cctxt->style->errors++;
4184 cctxt->inode->curChildType = XSLT_FUNC_OTHERWISE;
4185 xsltParseAnyXSLTElem(cctxt,
child);
4197 if ((!
err) && (! nbWhen)) {
4199 "The XSLT element 'choose' must contain at least one "
4200 "XSLT element 'when'.\n");
4201 cctxt->style->errors++;
4222 IS_XSLT_ELEM_FAST(
child))
4224 if (xsltGetXSLTElementTypeByNode(cctxt,
child) ==
4228 xsltParseAnyXSLTElem(cctxt,
child);
4239 xsltParseSequenceConstructor(cctxt,
child);
4243sequence_constructor:
4248 xsltParseSequenceConstructor(cctxt,
elem->children);
4259 (((xsltStyleBasicItemVariablePtr)
elem->psvi)->name))
4261 xsltCompilerVarInfoPush(cctxt,
elem,
4262 ((xsltStyleBasicItemVariablePtr)
elem->psvi)->name,
4263 ((xsltStyleBasicItemVariablePtr)
elem->psvi)->ns);
4269 xsltCompilerNodePop(cctxt,
elem);
4273 xsltCompilerNodePop(cctxt,
elem);
4287static xsltStyleItemUknownPtr
4288xsltForwardsCompatUnkownItemCreate(xsltCompilerCtxtPtr cctxt)
4290 xsltStyleItemUknownPtr
item;
4292 item = (xsltStyleItemUknownPtr)
xmlMalloc(
sizeof(xsltStyleItemUknown));
4295 "Internal error in xsltForwardsCompatUnkownItemCreate(): "
4296 "Failed to allocate memory.\n");
4297 cctxt->style->errors++;
4300 memset(
item, 0,
sizeof(xsltStyleItemUknown));
4301 item->type = XSLT_FUNC_UNKOWN_FORWARDS_COMPAT;
4305 item->next = cctxt->style->preComps;
4325xsltParseUnknownXSLTElem(xsltCompilerCtxtPtr cctxt,
4334 if (cctxt->inode->category == XSLT_ELEMENT_CATEGORY_EXTENSION) {
4335 cctxt->inode->extContentHandled = 1;
4337 if (cctxt->inode->forwardsCompat == 0) {
4342 "Unknown XSLT element '%s'.\n",
node->name);
4343 cctxt->style->errors++;
4356 if (cctxt->unknownItem ==
NULL) {
4360 cctxt->unknownItem = xsltForwardsCompatUnkownItemCreate(cctxt);
4361 if (cctxt->unknownItem ==
NULL) {
4366 node->psvi = cctxt->unknownItem;
4372 xsltCompilerNodePush(cctxt,
node);
4377 cctxt->inode->inScopeNs =
4378 xsltCompilerBuildInScopeNsList(cctxt,
node);
4384 IS_XSLT_ELEM_FAST(
child) &&
4387 cctxt->inode->curChildType = XSLT_FUNC_FALLBACK;
4388 xsltParseAnyXSLTElem(cctxt,
child);
4393 xsltCompilerNodePop(cctxt,
node);
4408xsltParseSequenceConstructor(xsltCompilerCtxtPtr cctxt,
xmlNodePtr cur)
4413 if (cctxt ==
NULL) {
4415 "xsltParseSequenceConstructor: Bad arguments\n");
4416 cctxt->style->errors++;
4422 if (cctxt->inode->category == XSLT_ELEMENT_CATEGORY_EXTENSION) {
4423 cctxt->inode->extContentHandled = 1;
4455 if (deleteNode !=
NULL) {
4456#ifdef WITH_XSLT_DEBUG_BLANKS
4458 "xsltParseSequenceConstructor: removing xsl:text element\n");
4466 if (
cur->psvi == xsltXSLTTextMarker) {
4481 tmp =
cur->children;
4495 xmlAddPrevSibling(
cur, tmp);
4499 "Element 'xsl:text': Invalid type "
4500 "of node found in content.\n");
4501 cctxt->style->errors++;
4504 if (
cur->properties) {
4516 BAD_CAST "disable-output-escaping"))
4532 }
else if ((
attr->children ==
NULL) ||
4533 (
attr->children->content ==
NULL) ||
4539 "Attribute 'disable-output-escaping': "
4540 "Invalid value. Expected is "
4541 "'yes' or 'no'.\n");
4542 cctxt->style->errors++;
4549 }
else if (IS_XSLT_ELEM_FAST(
cur)) {
4559 type = xsltGetXSLTElementTypeByNode(cctxt,
cur);
4571 case XSLT_FUNC_FALLBACK:
4574 case XSLT_FUNC_MESSAGE:
4583 cctxt->inode->curChildType =
type;
4584 xsltParseAnyXSLTElem(cctxt,
cur);
4587 xsltParseUnknownXSLTElem(cctxt,
cur);
4596 xsltCompilerNodePush(cctxt,
cur);
4601 cctxt->inode->inScopeNs =
4602 xsltCompilerBuildInScopeNsList(cctxt,
cur);
4630 if (
cur->properties)
4631 cctxt->inode->extElemNs =
4632 xsltParseExtElemPrefixes(cctxt,
4633 cur, cctxt->inode->extElemNs,
4634 XSLT_ELEMENT_CATEGORY_LRE);
4639 (cctxt->inode->extElemNs !=
NULL) &&
4647 cctxt->inode->category = XSLT_ELEMENT_CATEGORY_EXTENSION;
4648 cctxt->inode->extContentHandled = 0;
4655 "Internal error in xsltParseSequenceConstructor(): "
4656 "Occupied PSVI field.\n");
4657 cctxt->style->errors++;
4661 cur->psvi = (
void *)
4699 if ((
cur->children !=
NULL) &&
4700 (cctxt->inode->extContentHandled == 0))
4706 xsltParseSequenceConstructor(cctxt,
cur->children);
4719 cctxt->inode->category = XSLT_ELEMENT_CATEGORY_LRE;
4720 if (
cur->properties !=
NULL) {
4725 cctxt->inode->exclResultNs =
4726 xsltParseExclResultPrefixes(cctxt,
cur,
4727 cctxt->inode->exclResultNs,
4728 XSLT_ELEMENT_CATEGORY_LRE);
4732 xsltParseAttrXSLTVersion(cctxt,
cur,
4733 XSLT_ELEMENT_CATEGORY_LRE);
4744 if ((
attr->psvi != xsltXSLTAttrMarker) &&
4745 IS_XSLT_ATTR_FAST(
attr))
4752 "Unknown XSLT attribute '%s'.\n",
4754 cctxt->style->errors++;
4759 attr->psvi = (
void *) xsltXSLTAttrMarker;
4768 if (cctxt->inode->nsChanged)
4769 xsltLREInfoCreate(cctxt,
cur, 1);
4770 cur->psvi = cctxt->inode->litResElemInfo;
4774 if (cctxt->hasNsAliases)
4775 xsltLREBuildEffectiveNs(cctxt,
cur);
4779 if (
cur->properties) {
4792 xsltParseSequenceConstructor(cctxt,
cur->children);
4798 xsltCompilerNodePop(cctxt,
cur);
4803 if (deleteNode !=
NULL) {
4804#ifdef WITH_XSLT_DEBUG_BLANKS
4806 "xsltParseSequenceConstructor: removing xsl:text element\n");
4837 if (XSLT_CCTXT(
style)->
inode->category == XSLT_ELEMENT_CATEGORY_EXTENSION) {
4838 XSLT_CCTXT(
style)->inode->extContentHandled = 1;
4850 IS_XSLT_ELEM_FAST(
child) &&
4854 xsltParseAnyXSLTElem(XSLT_CCTXT(
style),
child);
4862 xsltParseSequenceConstructor(XSLT_CCTXT(
style),
child);
4892 if (
delete !=
NULL) {
4893#ifdef WITH_XSLT_DEBUG_BLANKS
4895 "xsltParseTemplateContent: removing text\n");
4918 (
const xmlChar *)
"disable-output-escaping",
4921#ifdef WITH_XSLT_DEBUG_PARSING
4923 "Disable escaping: %s\n",
text->content);
4930 "xsl:text: disable-output-escaping allows only yes or no\n");
4945 "xsltParseTemplateContent: xslt:text content problem\n");
4960 if ((
style->internalized) &&
4972 if (tmp !=
text->content) {
5006 style->defaultAlias);
5008 if (
cur->properties !=
NULL) {
5046 if (
delete !=
NULL) {
5047#ifdef WITH_XSLT_DEBUG_PARSING
5049 "xsltParseTemplateContent: removing text\n");
5074 "xsltParseTemplateContent: ignoring misplaced param element\n");
5127#ifdef WITH_XSLT_DEBUG_PARSING
5129 "xsltParseStylesheetKey: name %s\n",
name);
5133 "xsl:key : error missing name\n");
5141 "xsl:key : error missing match\n");
5149 "xsl:key : error missing use\n");
5167 if (nameURI !=
NULL)
5175#ifdef XSLT_REFACTORED
5190xsltParseXSLTTemplate(xsltCompilerCtxtPtr cctxt,
xmlNodePtr templNode) {
5195 if ((cctxt ==
NULL) || (templNode ==
NULL) ||
5206 xsltCompilerNodePush(cctxt, templNode);
5208 cctxt->inode->inScopeNs =
5209 xsltCompilerBuildInScopeNsList(cctxt, templNode);
5211 templ->
next = cctxt->style->templates;
5212 cctxt->style->templates = templ;
5213 templ->
style = cctxt->style;
5230 cctxt->style->errors++;
5236 if (xmlValidateNCName(templ->
mode, 0)) {
5238 "xsl:template: Attribute 'mode': The local part '%s' "
5239 "of the value is not a valid NCName.\n", templ->
name);
5240 cctxt->style->errors++;
5243 if (modeURI !=
NULL)
5245#ifdef WITH_XSLT_DEBUG_PARSING
5247 "xsltParseXSLTTemplate: mode %s\n", templ->
mode);
5255 templ->
match = prop;
5281 cctxt->style->errors++;
5287 if (xmlValidateNCName(templ->
name, 0)) {
5289 "xsl:template: Attribute 'name': The local part '%s' of "
5290 "the value is not a valid NCName.\n", templ->
name);
5291 cctxt->style->errors++;
5294 if (nameURI !=
NULL)
5296 curTempl = templ->
next;
5297 while (curTempl !=
NULL) {
5304 "xsl:template: error duplicate name '%s'\n", templ->
name);
5305 cctxt->style->errors++;
5308 curTempl = curTempl->
next;
5330 templ->
elem = templNode;
5335 xsltCompilerNodePop(cctxt, templNode);
5401#ifdef WITH_XSLT_DEBUG_PARSING
5403 "xsltParseStylesheetTemplate: mode %s\n",
mode);
5433 if (xmlValidateNCName(prop,0)) {
5435 "xsl:template : error invalid name '%s'\n", prop);
5454 ret->elem =
template;
5455 ret->content =
template->children;
5464#ifdef XSLT_REFACTORED
5473static xsltStyleItemIncludePtr
5474xsltCompileXSLTIncludeElem(xsltCompilerCtxtPtr cctxt,
xmlNodePtr node) {
5475 xsltStyleItemIncludePtr
item;
5481 item = (xsltStyleItemIncludePtr)
xmlMalloc(
sizeof(xsltStyleItemInclude));
5484 "xsltIncludeComp : malloc failed\n");
5485 cctxt->style->errors++;
5488 memset(
item, 0,
sizeof(xsltStyleItemInclude));
5492 item->type = XSLT_FUNC_INCLUDE;
5494 item->next = cctxt->style->preComps;
5504xsltParseFindTopLevelElem(xsltCompilerCtxtPtr cctxt,
5508 int breakOnOtherElem,
5518 if ((*(
cur->name) == *
name) &&
5526 if (breakOnOtherElem)
5536xsltParseTopLevelXSLTElem(xsltCompilerCtxtPtr cctxt,
5551 xsltCompilerNodePush(cctxt,
node);
5553 cctxt->inode->inScopeNs =
5554 xsltCompilerBuildInScopeNsList(cctxt,
node);
5555 cctxt->inode->type =
type;
5558 case XSLT_FUNC_INCLUDE:
5562 if (xsltCompileXSLTIncludeElem(cctxt,
node) ==
NULL)
5567 oldIsInclude = cctxt->isInclude;
5568 cctxt->isInclude = 1;
5571 cctxt->style->errors++;
5573 cctxt->isInclude = oldIsInclude;
5584 case XSLT_FUNC_ATTRSET:
5589 "Internal error: (xsltParseTopLevelXSLTElem) "
5590 "Cannot handle this top-level declaration.\n");
5591 cctxt->style->errors++;
5596 xsltCompilerNodePop(cctxt,
node);
5633xsltParseXSLTStylesheetElemCore(xsltCompilerCtxtPtr cctxt,
xmlNodePtr node)
5635#ifdef WITH_XSLT_DEBUG_PARSING
5645 style = cctxt->style;
5661 include = ((xsltStyleItemIncludePtr)
node->psvi)->include;
5683 xsltCompilerNodePush(cctxt,
node);
5684 cctxt->inode->isRoot = 1;
5685 cctxt->inode->nsChanged = 0;
5689 cctxt->inode->litResElemInfo = cctxt->inodeList->litResElemInfo;
5698 cctxt->inode->inScopeNs =
5699 xsltCompilerBuildInScopeNsList(cctxt,
node);
5710 if (xsltParseAttrXSLTVersion(cctxt,
node,
5711 XSLT_ELEMENT_CATEGORY_XSLT) == 0)
5721#ifdef XSLT_REFACTORED_MANDATORY_VERSION
5724 "The attribute 'version' is missing.\n");
5725 cctxt->style->errors++;
5729 "xsl:version is missing: document may not be a stylesheet\n");
5730 cctxt->style->warnings++;
5742 cctxt->inode->extElemNs =
5743 xsltParseExtElemPrefixes(cctxt,
node,
NULL,
5744 XSLT_ELEMENT_CATEGORY_XSLT);
5748 cctxt->inode->exclResultNs =
5749 xsltParseExclResultPrefixes(cctxt,
node,
NULL,
5750 XSLT_ELEMENT_CATEGORY_XSLT);
5754 if (cctxt->inode->nsChanged)
5755 xsltLREInfoCreate(cctxt,
node, 0);
5782 "Misplaced text node (content: '%s').\n",
5796 while ((
cur !=
NULL) && xsltParseFindTopLevelElem(cctxt,
cur,
5807 xsltParseFindTopLevelElem(cctxt,
cur,
5818 xsltParseFindTopLevelElem(cctxt,
cur,
5835 "Unexpected top-level element in no namespace.\n");
5843 if (IS_XSLT_ELEM_FAST(
cur)) {
5849 "Misplaced xsl:import element.\n");
5859#ifdef WITH_XSLT_DEBUG_PARSING
5867 xsltParseXSLTTemplate(cctxt,
cur);
5874 xsltParseXSLTStylesheetElemCore(cctxt,
cur);
5878 "(xsltParseXSLTStylesheetElemCore) "
5879 "The xsl:include element was not compiled.\n");
5898 xsltParseTopLevelXSLTElem(cctxt,
cur,
5903 if (cctxt->inode->forwardsCompat) {
5916 "Forwards-compatible mode: Ignoring unknown XSLT "
5917 "element '%s'.\n",
cur->name);
5921 "Unknown XSLT element '%s'.\n",
cur->name);
5938 if (function !=
NULL)
5940#ifdef WITH_XSLT_DEBUG_PARSING
5942 "xsltParseXSLTStylesheetElemCore : User-defined "
5943 "data element '%s'.\n",
cur->name);
5952#ifdef WITH_XSLT_DEBUG_PARSING
5954 "### END of parsing top-level elements of doc '%s'.\n",
5958#ifdef XSLT_REFACTORED
5960 "### Max inodes: %d\n", cctxt->maxNodeInfos);
5962 "### Max LREs : %d\n", cctxt->maxLREs);
5966 xsltCompilerNodePop(cctxt,
node);
5993xsltParseXSLTStylesheetElem(xsltCompilerCtxtPtr cctxt,
xmlNodePtr node)
6016 xsltParseFindTopLevelElem(cctxt,
cur,
6020 cctxt->style->errors++;
6032 xsltParseFindTopLevelElem(cctxt,
cur,
6035 xsltParseTopLevelXSLTElem(cctxt,
cur, XSLT_FUNC_INCLUDE);
6045 xsltParseFindTopLevelElem(cctxt,
cur,
6052 if (cctxt->isInclude) {
6062 xsltParseXSLTStylesheetElemCore(cctxt,
node);
6081#ifdef WITH_XSLT_DEBUG_PARSING
6091 "xsl:version is missing: document may not be a stylesheet\n");
6097 "xsl:version: only 1.1 features are supported\n");
6099 style->forwards_compatible = 1;
6134 "misplaced text node: '%s'\n",
cur->content);
6142 "Found a top-level element %s with null namespace URI\n",
6153 if (function !=
NULL)
6156#ifdef WITH_XSLT_DEBUG_PARSING
6158 "xsltParseStylesheetTop : found foreign element %s\n",
6166 "xsltParseStylesheetTop: ignoring misplaced import element\n");
6188#ifdef WITH_XSLT_DEBUG_PARSING
6197 "xsltParseStylesheetTop: unknown %s element\n",
6204#ifdef WITH_XSLT_DEBUG_PARSING
6212#ifdef XSLT_REFACTORED
6224xsltParseSimplifiedStylesheetTree(xsltCompilerCtxtPtr cctxt,
6233 if (xsltParseAttrXSLTVersion(cctxt,
node, 0) == XSLT_ELEMENT_CATEGORY_LRE)
6240 "The attribute 'xsl:version' is missing; cannot identify "
6241 "this document as an XSLT stylesheet document.\n");
6242 cctxt->style->errors++;
6246#ifdef WITH_XSLT_DEBUG_PARSING
6248 "xsltParseSimplifiedStylesheetTree: document is stylesheet\n");
6255 if (templ ==
NULL) {
6258 templ->
next = cctxt->style->templates;
6259 cctxt->style->templates = templ;
6265 xsltCompilerNodePush(cctxt, (
xmlNodePtr) doc);
6273 cctxt->inode->inScopeNs =
6274 xsltCompilerBuildInScopeNsList(cctxt,
node);
6278 xsltParseSequenceConstructor(cctxt,
node);
6279 xsltCompilerNodePop(cctxt, (
xmlNodePtr) doc);
6284 cctxt->style->literal_result = 1;
6288#ifdef XSLT_REFACTORED_XSLT_NSCOMP
6299xsltRestoreDocumentNamespaces(xsltNsMapPtr
ns,
xmlDocPtr doc)
6308 if ((
ns->doc == doc) && (
ns->ns !=
NULL)) {
6309 ns->ns->href =
ns->origNsName;
6335 xsltCompilerCtxtPtr cctxt;
6337 int oldIsSimplifiedStylesheet;
6344 cctxt = XSLT_CCTXT(
style);
6349 "xsltParseStylesheetProcess : empty stylesheet\n");
6352 oldIsSimplifiedStylesheet = cctxt->simplified;
6357#ifdef WITH_XSLT_DEBUG_PARSING
6359 "xsltParseStylesheetProcess : found stylesheet\n");
6361 cctxt->simplified = 0;
6362 style->literal_result = 0;
6364 cctxt->simplified = 1;
6365 style->literal_result = 1;
6372 if (!
style->nopreproc)
6373 xsltParsePreprocessStylesheetTree(cctxt,
cur);
6377 if (
style->literal_result == 0) {
6378 if (xsltParseXSLTStylesheetElem(cctxt,
cur) != 0)
6381 if (xsltParseSimplifiedStylesheetTree(cctxt, doc,
cur) != 0)
6385 cctxt->simplified = oldIsSimplifiedStylesheet;
6424 "xsltParseStylesheetProcess : empty stylesheet\n");
6431#ifdef WITH_XSLT_DEBUG_PARSING
6433 "xsltParseStylesheetProcess : found stylesheet\n");
6435 ret->literal_result = 0;
6441 ret->literal_result = 1;
6443 if (!
ret->nopreproc) {
6446 if (
ret->literal_result == 0) {
6458 "xsltParseStylesheetProcess : document is not a stylesheet\n");
6462#ifdef WITH_XSLT_DEBUG_PARSING
6464 "xsltParseStylesheetProcess : document is stylesheet\n");
6470 "xsl:version: only 1.1 features are supported\n");
6471 ret->forwards_compatible = 1;
6480 if (
template ==
NULL) {
6483 template->next =
ret->templates;
6484 ret->templates =
template;
6494 ret->literal_result = 1;
6522 if (retStyle ==
NULL)
6553#ifdef WITH_XSLT_DEBUG
6555 "reusing dictionary from %s for stylesheet\n",
6567#ifdef XSLT_REFACTORED
6569 xsltCompilerCtxtPtr cctxt;
6573 xsltPrincipalStylesheetDataPtr principalData;
6577 principalData = xsltNewPrincipalStylesheetData();
6578 if (principalData ==
NULL) {
6581 style->principalData = principalData;
6589 cctxt = xsltCompilationCtxtCreate(
style);
6590 if (cctxt ==
NULL) {
6593 style->compCtxt = (
void *) cctxt;
6594 cctxt->style =
style;
6595 cctxt->dict =
style->dict;
6596 cctxt->psData = principalData;
6601 xsltCompilerNodePush(cctxt, (
xmlNodePtr) doc);
6606 cctxt =
style->parent->compCtxt;
6607 style->compCtxt = cctxt;
6613 oldCurSheet = cctxt->style;
6614 cctxt->style =
style;
6619 cctxt->style = oldCurSheet;
6624 xsltCompilerNodePop(cctxt, (
xmlNodePtr) doc);
6634#ifdef XSLT_REFACTORED_XSLT_NSCOMP
6635 if (
style->errors != 0) {
6639 if (cctxt->psData->nsMap)
6640 xsltRestoreDocumentNamespaces(cctxt->psData->nsMap, doc);
6645 xsltCompilationCtxtFree(
style->compCtxt);
6661 if (
style->errors != 0) {
6721#ifdef WITH_XSLT_DEBUG_PARSING
6723 "xsltParseStylesheetFile : parse %s\n",
filename);
6737 "xsltParseStylesheetFile: read rights for %s denied\n",
6747 "xsltParseStylesheetFile : cannot parse %s\n",
filename);
6766#define SKIP(val) cur += (val)
6767#define NXT(val) cur[(val)]
6768#define SKIP_BLANKS \
6769 while (IS_BLANK(CUR)) NEXT
6770#define NEXT ((*cur) ? cur++ : cur)
6797 if ((
CUR ==
't') && (
NXT(1) ==
'y') && (
NXT(2) ==
'p') &&
6804 if ((
CUR !=
'\'') && (
CUR !=
'"'))
6809 while ((
CUR != 0) && (
CUR != tmp))
6824 }
else if ((
CUR ==
'h') && (
NXT(1) ==
'r') && (
NXT(2) ==
'e') &&
6831 if ((
CUR !=
'\'') && (
CUR !=
'"'))
6836 while ((
CUR != 0) && (
CUR != tmp))
6902#ifdef WITH_XSLT_DEBUG_PARSING
6904 "xsltLoadStylesheetPI : found PI href=%s\n", href);
6909 "xml-stylesheet : href %s is not valid\n", href);
6919#ifdef WITH_XSLT_DEBUG_PARSING
6921 "xsltLoadStylesheetPI : Reference to ID %s\n", href);
6929 "xml-stylesheet : no ID %s found\n", URI->
fragment);
6935#ifdef WITH_XSLT_DEBUG
6937 "creating new document from %s for embedded stylesheet\n",
6944 subtree =
ID->parent;
6953#ifdef WITH_XSLT_DEBUG
6955 "reusing dictionary from %s for embedded stylesheet\n",
6962#ifdef WITH_XSLT_DEBUG
6964 "set base URI for embedded stylesheet as %s\n",
6994#ifdef WITH_XSLT_DEBUG_PARSING
6996 "xsltLoadStylesheetPI : fetching %s\n", URL);
7001#ifdef WITH_XSLT_DEBUG_PARSING
7003 "xsltLoadStylesheetPI : fetching %s\n", href);
int xsltCheckExtURI(xsltStylesheetPtr style, const xmlChar *URI)
int xsltCheckExtPrefix(xsltStylesheetPtr style, const xmlChar *URI)
xsltElemPreCompPtr xsltPreComputeExtModuleElement(xsltStylesheetPtr style, xmlNodePtr inst)
void xsltShutdownExts(xsltStylesheetPtr style)
void xsltInitGlobals(void)
void xsltFreeExts(xsltStylesheetPtr style)
int xsltRegisterExtPrefix(xsltStylesheetPtr style, const xmlChar *prefix, const xmlChar *URI)
xsltTopLevelFunction xsltExtModuleTopLevelLookup(const xmlChar *name, const xmlChar *URI)
_STLP_BEGIN_NAMESPACE _STLP_INLINE_LOOP _Function for_each(_InputIter __first, _InputIter __last, _Function __f)
_STLP_INLINE_LOOP _STLP_STD::pair< _InputIter1, _InputIter2 > mismatch(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2)
void xsltFreeAVTList(void *avt)
void xsltCompileAttr(xsltStylesheetPtr style, xmlAttrPtr attr)
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
void xsltResolveStylesheetAttributeSet(xsltStylesheetPtr style)
void xsltParseStylesheetAttributeSet(xsltStylesheetPtr style, xmlNodePtr cur)
void xsltFreeAttributeSetsHashes(xsltStylesheetPtr style)
int xsltAddTemplate(xsltStylesheetPtr style, xsltTemplatePtr cur, const xmlChar *mode, const xmlChar *modeURI)
void xsltFreeTemplateHashes(xsltStylesheetPtr style)
void xsltFreeStylePreComps(xsltStylesheetPtr style)
void xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr inst)
const xmlChar * xsltExtMarker
xsltSecurityPrefsPtr xsltGetDefaultSecurityPrefs(void)
int xsltCheckRead(xsltSecurityPrefsPtr sec, xsltTransformContextPtr ctxt, const xmlChar *URL)
void xsltFreeStyleDocuments(xsltStylesheetPtr style)
xsltDocLoaderFunc xsltDocDefaultLoader
void(* xsltTopLevelFunction)(xsltStylesheetPtr style, xmlNodePtr inst)
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble GLdouble top
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
int xsltParseStylesheetImport(xsltStylesheetPtr style, xmlNodePtr cur)
int xsltParseStylesheetInclude(xsltStylesheetPtr style, xmlNodePtr cur)
xsltStylesheetPtr xsltNextImport(xsltStylesheetPtr cur)
int xsltAddKey(xsltStylesheetPtr style, const xmlChar *name, const xmlChar *nameURI, const xmlChar *match, const xmlChar *use, xmlNodePtr inst)
void xsltFreeKeys(xsltStylesheetPtr style)
#define memcpy(s1, s2, n)
static float(__cdecl *square_half_float)(float x
void xsltFreeNamespaceAliasHashes(xsltStylesheetPtr style)
void xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
XMLPUBVAR const xmlChar xmlStringTextNoenc[]
XMLPUBVAR const xmlChar xmlStringText[]
static unsigned __int64 next
XMLPUBFUN const xmlChar *XMLCALL xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len)
XMLPUBFUN int XMLCALL xmlDictOwns(xmlDictPtr dict, const xmlChar *str)
XMLPUBFUN xmlDictPtr XMLCALL xmlDictCreate(void)
XMLPUBFUN void XMLCALL xmlDictFree(xmlDictPtr dict)
XMLPUBFUN int XMLCALL xmlDictReference(xmlDictPtr dict)
XMLPUBVAR xmlMallocFunc xmlMalloc
XMLPUBVAR xmlFreeFunc xmlFree
XMLPUBVAR void * xmlGenericErrorContext
XMLPUBVAR xmlReallocFunc xmlRealloc
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
XMLPUBFUN int XMLCALL xmlHashAddEntry2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, void *userdata)
XMLPUBFUN void XMLCALL xmlHashFree(xmlHashTablePtr table, xmlHashDeallocator f)
XMLPUBFUN void *XMLCALL xmlHashLookup(xmlHashTablePtr table, const xmlChar *name)
XMLPUBFUN xmlHashTablePtr XMLCALL xmlHashCreate(int size)
XMLPUBFUN int XMLCALL xmlHashUpdateEntry(xmlHashTablePtr table, const xmlChar *name, void *userdata, xmlHashDeallocator f)
XMLPUBFUN xmlNodePtr XMLCALL xmlAddChild(xmlNodePtr parent, xmlNodePtr cur)
XMLPUBFUN xmlNodePtr XMLCALL xmlDocGetRootElement(const xmlDoc *doc)
XMLPUBFUN void XMLCALL xmlFreeDoc(xmlDocPtr cur)
XMLPUBFUN xmlNsPtr XMLCALL xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace)
XMLPUBFUN int XMLCALL xmlNodeGetSpacePreserve(const xmlNode *cur)
XMLPUBFUN void XMLCALL xmlNodeAddContent(xmlNodePtr cur, const xmlChar *content)
XMLPUBFUN xmlDocPtr XMLCALL xmlNewDoc(const xmlChar *version)
XMLPUBFUN xmlChar *XMLCALL xmlGetNsProp(const xmlNode *node, const xmlChar *name, const xmlChar *nameSpace)
XMLPUBFUN void XMLCALL xmlUnlinkNode(xmlNodePtr cur)
XMLPUBFUN xmlNsPtr XMLCALL xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar *href)
XMLPUBFUN xmlChar *XMLCALL xmlNodeGetBase(const xmlDoc *doc, const xmlNode *cur)
#define XML_XML_NAMESPACE
XMLPUBFUN void XMLCALL xmlNodeSetContent(xmlNodePtr cur, const xmlChar *content)
XMLPUBFUN xmlAttrPtr XMLCALL xmlHasNsProp(const xmlNode *node, const xmlChar *name, const xmlChar *nameSpace)
XMLPUBFUN void XMLCALL xmlFreeNode(xmlNodePtr cur)
XMLPUBFUN xmlNsPtr XMLCALL xmlNewNs(xmlNodePtr node, const xmlChar *href, const xmlChar *prefix)
#define XML_LOCAL_NAMESPACE
XMLPUBFUN xmlNodePtr XMLCALL xmlDocCopyNode(xmlNodePtr node, xmlDocPtr doc, int recursive)
struct _xmlNode * children
struct _xmlNode * children
xsltDecimalFormatPtr decimalFormat
struct _xsltTemplate * next
struct _xsltStylesheet * style
xsltRuntimeExtraPtr extras
XMLPUBFUN void XMLCALL xmlFreeRMutex(xmlRMutexPtr tok)
XMLPUBFUN xmlRMutexPtr XMLCALL xmlNewRMutex(void)
XMLPUBFUN xmlURIPtr XMLCALL xmlParseURI(const char *str)
XMLPUBFUN void XMLCALL xmlFreeURI(xmlURIPtr uri)
XMLPUBFUN xmlChar *XMLCALL xmlBuildURI(const xmlChar *URI, const xmlChar *base)
XMLPUBFUN xmlAttrPtr XMLCALL xmlGetID(xmlDocPtr doc, const xmlChar *ID)
void xsltParseGlobalVariable(xsltStylesheetPtr style, xmlNodePtr cur)
void xsltParseGlobalParam(xsltStylesheetPtr style, xmlNodePtr cur)
void xsltFreeStackElemList(xsltStackElemPtr elem)
XMLPUBFUN xmlChar *XMLCALL xmlStrndup(const xmlChar *cur, int len)
XMLPUBFUN int XMLCALL xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN xmlChar *XMLCALL xmlStrdup(const xmlChar *cur)
XMLPUBFUN int XMLCALL xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
@ XSLT_FUNC_APPLYTEMPLATES
xsltElemPreComp * xsltElemPreCompPtr
#define XSLT_PAT_NO_PRIORITY
xsltStylesheet * xsltStylesheetPtr
xsltRuntimeExtra * xsltRuntimeExtraPtr
xsltTemplate * xsltTemplatePtr
xsltStylesheetPtr xsltNewStylesheet(void)
xsltStylesheetPtr xsltParseStylesheetProcess(xsltStylesheetPtr ret, xmlDocPtr doc)
static xsltStylesheetPtr xsltNewStylesheetInternal(xsltStylesheetPtr parent)
int xsltAllocateExtraCtxt(xsltTransformContextPtr ctxt)
static void xsltParseStylesheetStripSpace(xsltStylesheetPtr style, xmlNodePtr cur)
const int xsltLibxsltVersion
xsltStylesheetPtr xsltLoadStylesheetPI(xmlDocPtr doc)
static void xsltParseStylesheetKey(xsltStylesheetPtr style, xmlNodePtr key)
const char * xsltEngineVersion
static xmlChar * exclPrefixPop(xsltStylesheetPtr style)
static void xsltFreeTemplateList(xsltTemplatePtr template)
static int xsltGetInheritedNsList(xsltStylesheetPtr style, xsltTemplatePtr template, xmlNodePtr node)
static void xsltFreeDecimalFormat(xsltDecimalFormatPtr self)
xsltStylesheetPtr xsltParseStylesheetFile(const xmlChar *filename)
int xsltIsBlank(xmlChar *str)
void xsltFreeStylesheet(xsltStylesheetPtr style)
void xsltParseStylesheetOutput(xsltStylesheetPtr style, xmlNodePtr cur)
static void xsltParseStylesheetTop(xsltStylesheetPtr style, xmlNodePtr top)
const int xsltLibxmlVersion
void xsltParseTemplateContent(xsltStylesheetPtr style, xmlNodePtr templ)
static void xsltFreeTemplate(xsltTemplatePtr template)
xsltDecimalFormatPtr xsltDecimalFormatGetByQName(xsltStylesheetPtr style, const xmlChar *nsUri, const xmlChar *name)
static void xsltParseStylesheetPreserveSpace(xsltStylesheetPtr style, xmlNodePtr cur)
static void xsltParseStylesheetDecimalFormat(xsltStylesheetPtr style, xmlNodePtr cur)
int xsltParseStylesheetUser(xsltStylesheetPtr style, xmlDocPtr doc)
xsltStylesheetPtr xsltParseStylesheetDoc(xmlDocPtr doc)
static void xsltPreprocessStylesheet(xsltStylesheetPtr style, xmlNodePtr cur)
static void xsltFreeStylesheetList(xsltStylesheetPtr style)
static void xsltGatherNamespaces(xsltStylesheetPtr style)
int xsltAllocateExtra(xsltStylesheetPtr style)
double xmlXPathStringEvalNumber(const xmlChar *str)
xsltStylesheetPtr xsltParseStylesheetImportedDoc(xmlDocPtr doc, xsltStylesheetPtr parentStyle)
static int xsltParseStylesheetExcludePrefix(xsltStylesheetPtr style, xmlNodePtr cur, int isXsltElem)
xsltDecimalFormatPtr xsltDecimalFormatGetByName(xsltStylesheetPtr style, xmlChar *name)
static void xsltFreeDecimalFormatList(xsltStylesheetPtr self)
static xsltDecimalFormatPtr xsltNewDecimalFormat(const xmlChar *nsUri, xmlChar *name)
static int xsltCleanupStylesheetTree(xmlDocPtr doc ATTRIBUTE_UNUSED, xmlNodePtr rootElem ATTRIBUTE_UNUSED)
static void xsltParseStylesheetExtPrefix(xsltStylesheetPtr style, xmlNodePtr cur, int isXsltElem)
static xmlChar * xsltParseStylesheetPI(const xmlChar *value)
static xsltTemplatePtr xsltNewTemplate(void)
static int exclPrefixPush(xsltStylesheetPtr style, xmlChar *value)
static void xsltParseStylesheetTemplate(xsltStylesheetPtr style, xmlNodePtr template)
static void xsltParseContentError(xsltStylesheetPtr style, xmlNodePtr node)
#define XSLT_PARSE_OPTIONS
#define LIBXSLT_VERSION_EXTRA
#define LIBXSLT_VERSION_STRING
const xmlChar * xsltGetQNameURI(xmlNodePtr node, xmlChar **name)
void xsltTransformError(xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node, const char *msg,...)
xmlGenericErrorFunc xsltGenericError
xmlGenericErrorFunc xsltGenericDebug
void * xsltGenericDebugContext
void * xsltGenericErrorContext
#define IS_XSLT_NAME(n, val)