48#define WITH_XSLT_DEBUG_PARSING
60#define XSLT_ELEMENT_CATEGORY_XSLT 0
61#define XSLT_ELEMENT_CATEGORY_EXTENSION 1
62#define XSLT_ELEMENT_CATEGORY_LRE 2
81const xmlChar *xsltXSLTTextMarker = (
const xmlChar *)
"XSLT Text Element";
87const xmlChar *xsltXSLTAttrMarker = (
const xmlChar *)
"LRE XSLT Attr";
91#ifdef XSLT_LOCALE_WINAPI
102#define IS_BLANK(c) (((c) == 0x20) || ((c) == 0x09) || ((c) == 0xA) || \
108#define IS_BLANK_NODE(n) \
109 (((n)->type == XML_TEXT_NODE) && (xsltIsBlank((n)->content)))
128 "The XSLT-element '%s' is not allowed at this position.\n",
132 "The element '%s' is not allowed at this position.\n",
137#ifdef XSLT_REFACTORED
155 for (
i = 0;
i <
style->exclPrefixNr;
i++) {
159 if (
style->exclPrefixNr >=
style->exclPrefixMax) {
161 size_t max =
style->exclPrefixMax ?
style->exclPrefixMax * 2 : 4;
164 max *
sizeof(
style->exclPrefixTab[0]));
169 style->exclPrefixTab = tmp;
174 return (
style->exclPrefixNr++);
189 if (
style->exclPrefixNr <= 0)
191 style->exclPrefixNr--;
192 if (
style->exclPrefixNr > 0)
197 style->exclPrefixTab[
style->exclPrefixNr] = 0;
219#ifdef XSLT_LOCALE_WINAPI
233#ifdef XSLT_LOCALE_WINAPI
235 xsltLocaleMutex =
NULL;
269 static const xmlChar permille[4] = {0xe2, 0x80, 0xb0, 0};
332 while (iter !=
NULL) {
354 return style->decimalFormat;
385 return style->decimalFormat;
415 "xsltNewTemplate : malloc failed\n");
431 if (
template ==
NULL)
463 while (
template !=
NULL) {
465 template =
template->next;
470#ifdef XSLT_REFACTORED
473xsltFreeNsAliasList(xsltNsAliasPtr
item)
485#ifdef XSLT_REFACTORED_XSLT_NSCOMP
487xsltFreeNamespaceMap(xsltNsMapPtr
item)
500xsltNewNamespaceMapItem(xsltCompilerCtxtPtr cctxt,
513 "Internal error: (xsltNewNamespaceMapItem) "
514 "memory allocation failed.\n");
520 ret->origNsName =
ns->href;
524 if (cctxt->psData->nsMap !=
NULL)
525 ret->next = cctxt->psData->nsMap;
526 cctxt->psData->nsMap =
ret;
539xsltCompilerVarInfoFree(xsltCompilerCtxtPtr cctxt)
541 xsltVarInfoPtr ivar = cctxt->ivars, ivartmp;
556xsltCompilationCtxtFree(xsltCompilerCtxtPtr cctxt)
560#ifdef WITH_XSLT_DEBUG_PARSING
562 "Freeing compilation context\n");
564 "### Max inodes: %d\n", cctxt->maxNodeInfos);
566 "### Max LREs : %d\n", cctxt->maxLREs);
571 if (cctxt->inodeList !=
NULL) {
572 xsltCompilerNodeInfoPtr tmp,
cur = cctxt->inodeList;
579 if (cctxt->tmpList !=
NULL)
580 xsltPointerListFree(cctxt->tmpList);
581 if (cctxt->nsAliases !=
NULL)
582 xsltFreeNsAliasList(cctxt->nsAliases);
585 xsltCompilerVarInfoFree(cctxt);
598static xsltCompilerCtxtPtr
600 xsltCompilerCtxtPtr
ret;
602 ret = (xsltCompilerCtxtPtr)
xmlMalloc(
sizeof(xsltCompilerCtxt));
605 "xsltCompilerCreate: allocation of compiler "
606 "context failed.\n");
609 memset(
ret, 0,
sizeof(xsltCompilerCtxt));
611 ret->errSeverity = XSLT_ERROR_SEVERITY_ERROR;
612 ret->tmpList = xsltPointerListCreate(20);
620 xsltCompilationCtxtFree(
ret);
625xsltLREEffectiveNsNodesFree(xsltEffectiveNsPtr
first)
627 xsltEffectiveNsPtr tmp;
637xsltFreePrincipalStylesheetData(xsltPrincipalStylesheetDataPtr
data)
642 if (
data->inScopeNamespaces !=
NULL) {
644 xsltNsListContainerPtr nsi;
645 xsltPointerListPtr
list =
646 (xsltPointerListPtr)
data->inScopeNamespaces;
652 nsi = (xsltNsListContainerPtr)
list->items[
i];
657 xsltPointerListFree(
list);
661 if (
data->exclResultNamespaces !=
NULL) {
663 xsltPointerListPtr
list = (xsltPointerListPtr)
664 data->exclResultNamespaces;
667 xsltPointerListFree((xsltPointerListPtr)
list->items[
i]);
669 xsltPointerListFree(
list);
673 if (
data->extElemNamespaces !=
NULL) {
674 xsltPointerListPtr
list = (xsltPointerListPtr)
675 data->extElemNamespaces;
679 xsltPointerListFree((xsltPointerListPtr)
list->items[
i]);
681 xsltPointerListFree(
list);
684 if (
data->effectiveNs) {
685 xsltLREEffectiveNsNodesFree(
data->effectiveNs);
688#ifdef XSLT_REFACTORED_XSLT_NSCOMP
689 xsltFreeNamespaceMap(
data->nsMap);
694static xsltPrincipalStylesheetDataPtr
695xsltNewPrincipalStylesheetData(
void)
697 xsltPrincipalStylesheetDataPtr
ret;
699 ret = (xsltPrincipalStylesheetDataPtr)
700 xmlMalloc(
sizeof(xsltPrincipalStylesheetData));
703 "xsltNewPrincipalStylesheetData: memory allocation failed.\n");
706 memset(
ret, 0,
sizeof(xsltPrincipalStylesheetData));
711 ret->inScopeNamespaces = xsltPointerListCreate(-1);
712 if (
ret->inScopeNamespaces ==
NULL)
717 ret->exclResultNamespaces = xsltPointerListCreate(-1);
718 if (
ret->exclResultNamespaces ==
NULL)
723 ret->extElemNamespaces = xsltPointerListCreate(-1);
724 if (
ret->extElemNamespaces ==
NULL)
751 "xsltNewStylesheet : malloc failed\n");
757 ret->omitXmlDeclaration = -1;
758 ret->standalone = -1;
763 ret->exclPrefixNr = 0;
764 ret->exclPrefixMax = 0;
768 ret->internalized = 1;
769 ret->literal_result = 0;
770 ret->forwards_compatible = 0;
772#ifdef WITH_XSLT_DEBUG
774 "creating dictionary for stylesheet\n");
780 ret->xpathCtxt = xmlXPathNewContext(
NULL);
783 "xsltNewStylesheet: xmlXPathNewContext failed\n");
786 if (xmlXPathContextSetCache(
ret->xpathCtxt, 1, -1, 0) == -1)
826 return(
style->extrasNr++);
850 "xsltAllocateExtraCtxt: out of memory\n");
867 "xsltAllocateExtraCtxt: out of memory\n");
871 for (
i = ctxt->
extrasNr;i < ctxt->extrasMax;
i++) {
916 if ((doc ==
NULL) || (rootElem ==
NULL) ||
917 (rootElem->type != XML_ELEMENT_NODE) ||
918 (doc != rootElem->doc))
931 if (
cur->type == XML_ELEMENT_NODE) {
970#ifdef XSLT_REFACTORED
976 xmlDocGetRootElement(
style->doc));
977#ifdef XSLT_REFACTORED_XSLT_NSCOMP
982 XSLT_HAS_INTERNAL_NSMAP(
style))
984 xsltRestoreDocumentNamespaces(XSLT_GET_INTERNAL_NSMAP(
style),
994 xmlDocGetRootElement(
style->doc));
1044#ifdef XSLT_REFACTORED
1050 if (
style->principalData) {
1051 xsltFreePrincipalStylesheetData(
style->principalData);
1061 xmlFreeDoc(
style->doc);
1064#ifdef WITH_XSLT_DEBUG
1066 "freeing dictionary from stylesheet\n");
1071 xmlXPathFreeContext(
style->xpathCtxt);
1083#ifdef XSLT_REFACTORED
1115 if (
node->type == XML_ELEMENT_NODE) {
1129 for (
i = 0;
i <
style->exclPrefixNr;
i++) {
1136 for (
i = 0;
i < nbns;
i++) {
1137 if ((
cur->prefix ==
ret[
i]->prefix) ||
1142 if (nbns >= maxns) {
1143 maxns = (maxns == 0) ? 10 : 2 * maxns;
1145 (maxns + 1) *
sizeof(xmlNsPtr));
1148 "xsltGetInheritedNsList : realloc failed!\n");
1164#ifdef WITH_XSLT_DEBUG_PARSING
1166 "template has %d inherited namespaces\n", nbns);
1168 template->inheritedNsNr = nbns;
1169 template->inheritedNs =
ret;
1199 style->version = prop;
1206 style->encoding = prop;
1229 }
else if (URI ==
NULL) {
1233 style->method = prop;
1236 "invalid value for method: %s\n", prop);
1241 style->method = prop;
1246 prop = xmlGetNsProp(
cur, (
const xmlChar *)
"doctype-system",
NULL);
1250 style->doctypeSystem = prop;
1253 prop = xmlGetNsProp(
cur, (
const xmlChar *)
"doctype-public",
NULL);
1257 style->doctypePublic = prop;
1263 style->standalone = 1;
1265 style->standalone = 0;
1268 "invalid value for standalone: %s\n", prop);
1282 "invalid value for indent: %s\n", prop);
1288 prop = xmlGetNsProp(
cur, (
const xmlChar *)
"omit-xml-declaration",
NULL);
1291 style->omitXmlDeclaration = 1;
1293 style->omitXmlDeclaration = 0;
1296 "invalid value for omit-xml-declaration: %s\n",
1303 elements = xmlGetNsProp(
cur, (
const xmlChar *)
"cdata-section-elements",
1305 if (elements !=
NULL) {
1324#ifdef WITH_XSLT_DEBUG_PARSING
1326 "add cdata section output element %s\n",
1331 "Attribute 'cdata-section-elements': The value "
1332 "'%s' is not a valid QName.\n",
element);
1348 "Attribute 'cdata-section-elements': "
1349 "Not a valid QName.\n");
1380 if (
style->mediaType)
1382 style->mediaType = prop;
1420 if (xmlValidateQName(prop, 0) != 0) {
1422 "xsl:decimal-format: Invalid QName '%s'.\n", prop);
1438 "xsltParseStylestyleDecimalFormat: %s already exists\n", prop);
1446 "xsltParseStylestyleDecimalFormat: failed creating new decimal-format\n");
1452 for (iter =
style->decimalFormat; iter->
next; iter = iter->
next)
1458 prop = xmlGetNsProp(
cur, (
const xmlChar *)
"decimal-separator",
NULL);
1461 format->decimalPoint = prop;
1464 prop = xmlGetNsProp(
cur, (
const xmlChar *)
"grouping-separator",
NULL);
1479 format->minusSign = prop;
1503 format->zeroDigit = prop;
1512 prop = xmlGetNsProp(
cur, (
const xmlChar *)
"pattern-separator",
NULL);
1515 format->patternSeparator = prop;
1540 if (elements ==
NULL) {
1542 "xsltParseStylesheetPreserveSpace: missing elements attribute\n");
1563#ifdef WITH_XSLT_DEBUG_PARSING
1565 "add preserved space element %s\n",
element);
1568 style->stripAll = -1;
1590#ifdef XSLT_REFACTORED
1618 (
const xmlChar *)
"extension-element-prefixes",
NULL);
1645 "xsl:extension-element-prefix : undefined namespace %s\n",
1649#ifdef WITH_XSLT_DEBUG_PARSING
1651 "add extension prefix %s\n",
prefix);
1686 if (elements ==
NULL) {
1688 "xsltParseStylesheetStripSpace: missing elements attribute\n");
1702#ifdef WITH_XSLT_DEBUG_PARSING
1704 "add stripped space element %s\n",
element);
1707 style->stripAll = 1;
1729#ifdef XSLT_REFACTORED
1755 (
const xmlChar *)
"exclude-result-prefixes",
NULL);
1781 "xsl:exclude-result-prefixes : undefined namespace %s\n",
1786#ifdef WITH_XSLT_DEBUG_PARSING
1788 "exclude result prefix %s\n",
prefix);
1802#ifdef XSLT_REFACTORED
1815xsltTreeEnsureXMLDecl(xmlDocPtr doc)
1819 if (doc->oldNs !=
NULL)
1820 return (doc->oldNs);
1826 "xsltTreeEnsureXMLDecl: Failed to allocate "
1827 "the XML namespace.\n");
1831 ns->type = XML_LOCAL_NAMESPACE;
1835#ifdef LIBXML_NAMESPACE_DICT
1864xsltTreeAcquireStoredNs(xmlDocPtr doc,
1872 if (doc->oldNs !=
NULL)
1875 ns = xsltTreeEnsureXMLDecl(doc);
1911xsltLREBuildEffectiveNs(xsltCompilerCtxtPtr cctxt,
1915 xsltNsAliasPtr
alias;
1919 if ((cctxt->nsAliases ==
NULL) || (! cctxt->hasNsAliases))
1922 alias = cctxt->nsAliases;
1939 if (
elem->doc ==
alias->docOfTargetNs) {
1955 alias->targetNs->prefix);
1974 ns = xsltTreeAcquireStoredNs(
elem->doc,
1975 alias->targetNs->href,
1976 alias->targetNs->prefix);
1980 "Internal error in "
1981 "xsltLREBuildEffectiveNs(): "
1982 "failed to acquire a stored "
1983 "ns-declaration.\n");
1984 cctxt->style->errors++;
2005 xmlAttrPtr
attr =
elem->properties;
2012 alias = cctxt->nsAliases;
2026 if (
elem->doc ==
alias->docOfTargetNs) {
2030 alias->targetNs->prefix);
2034 ns = xsltTreeAcquireStoredNs(
elem->doc,
2035 alias->targetNs->href,
2036 alias->targetNs->prefix);
2040 "Internal error in "
2041 "xsltLREBuildEffectiveNs(): "
2042 "failed to acquire a stored "
2043 "ns-declaration.\n");
2044 cctxt->style->errors++;
2082xsltLREBuildEffectiveNsNodes(xsltCompilerCtxtPtr cctxt,
2083 xsltStyleItemLRElementInfoPtr
item,
2088 xsltEffectiveNsPtr effNs, lastEffNs =
NULL;
2089 int i,
j, holdByElem;
2090 xsltPointerListPtr extElemNs = cctxt->inode->extElemNs;
2091 xsltPointerListPtr exclResultNs = cctxt->inode->exclResultNs;
2100 extElemNs = cctxt->inode->extElemNs;
2101 exclResultNs = cctxt->inode->exclResultNs;
2103 for (
i = 0;
i <
item->inScopeNs->totalNumber;
i++) {
2104 ns =
item->inScopeNs->list[
i];
2136 if (cctxt->hasNsAliases) {
2137 xsltNsAliasPtr
alias;
2141 alias = cctxt->nsAliases;
2153 goto add_effective_ns;
2158 alias = cctxt->nsAliases;
2179 for (
j = 0;
j < exclResultNs->number;
j++)
2187 for (
j = 0;
j < extElemNs->number;
j++)
2196 if (isLRE && (
elem->nsDef !=
NULL)) {
2198 tmpns =
elem->nsDef;
2204 tmpns = tmpns->next;
2205 }
while (tmpns !=
NULL);
2213 effNs = (xsltEffectiveNsPtr)
xmlMalloc(
sizeof(xsltEffectiveNs));
2214 if (effNs ==
NULL) {
2216 "Internal error in xsltLREBuildEffectiveNs(): "
2217 "failed to allocate memory.\n");
2218 cctxt->style->errors++;
2221 if (cctxt->psData->effectiveNs ==
NULL) {
2222 cctxt->psData->effectiveNs = effNs;
2223 effNs->nextInStore =
NULL;
2225 effNs->nextInStore = cctxt->psData->effectiveNs;
2226 cctxt->psData->effectiveNs = effNs;
2231 effNs->nsName =
ns->href;
2232 effNs->holdByElem = holdByElem;
2234 if (lastEffNs ==
NULL)
2235 item->effectiveNs = effNs;
2237 lastEffNs->next = effNs;
2255xsltLREInfoCreate(xsltCompilerCtxtPtr cctxt,
2259 xsltStyleItemLRElementInfoPtr
item;
2261 if ((cctxt ==
NULL) || (cctxt->inode ==
NULL))
2264 item = (xsltStyleItemLRElementInfoPtr)
2265 xmlMalloc(
sizeof(xsltStyleItemLRElementInfo));
2268 "Internal error in xsltLREInfoCreate(): "
2269 "memory allocation failed.\n");
2270 cctxt->style->errors++;
2273 memset(
item, 0,
sizeof(xsltStyleItemLRElementInfo));
2274 item->
type = XSLT_FUNC_LITERAL_RESULT_ELEMENT;
2278 item->next = cctxt->style->preComps;
2284 item->inScopeNs = cctxt->inode->inScopeNs;
2287 xsltLREBuildEffectiveNsNodes(cctxt,
item,
elem, isLRE);
2289 cctxt->inode->litResElemInfo =
item;
2290 cctxt->inode->nsChanged = 0;
2303static xsltVarInfoPtr
2304xsltCompilerVarInfoPush(xsltCompilerCtxtPtr cctxt,
2309 xsltVarInfoPtr ivar;
2311 if ((cctxt->ivar !=
NULL) && (cctxt->ivar->next !=
NULL)) {
2312 ivar = cctxt->ivar->next;
2313 }
else if ((cctxt->ivar ==
NULL) && (cctxt->ivars !=
NULL)) {
2314 ivar = cctxt->ivars;
2316 ivar = (xsltVarInfoPtr)
xmlMalloc(
sizeof(xsltVarInfo));
2319 "xsltParseInScopeVarPush: xmlMalloc() failed!\n");
2320 cctxt->style->errors++;
2324 if (cctxt->ivars ==
NULL) {
2325 cctxt->ivars = ivar;
2328 cctxt->ivar->
next = ivar;
2329 ivar->prev = cctxt->ivar;
2334 ivar->depth = cctxt->depth;
2336 ivar->nsName = nsName;
2348xsltCompilerVarInfoPop(xsltCompilerCtxtPtr cctxt)
2351 while ((cctxt->ivar !=
NULL) &&
2352 (cctxt->ivar->depth > cctxt->depth))
2354 cctxt->ivar = cctxt->ivar->prev;
2369static xsltCompilerNodeInfoPtr
2370xsltCompilerNodePush(xsltCompilerCtxtPtr cctxt, xmlNodePtr
node)
2372 xsltCompilerNodeInfoPtr
inode, iprev;
2374 if ((cctxt->inode !=
NULL) && (cctxt->inode->next !=
NULL)) {
2375 inode = cctxt->inode->next;
2376 }
else if ((cctxt->inode ==
NULL) && (cctxt->inodeList !=
NULL)) {
2377 inode = cctxt->inodeList;
2382 inode = (xsltCompilerNodeInfoPtr)
2383 xmlMalloc(
sizeof(xsltCompilerNodeInfo));
2386 "xsltCompilerNodePush: malloc failed.\n");
2390 if (cctxt->inodeList ==
NULL)
2391 cctxt->inodeList =
inode;
2393 cctxt->inodeLast->next =
inode;
2394 inode->prev = cctxt->inodeLast;
2396 cctxt->inodeLast =
inode;
2397 cctxt->maxNodeInfos++;
2398 if (cctxt->inode ==
NULL) {
2399 cctxt->inode =
inode;
2404 xsltLREInfoCreate(cctxt,
NULL, 0);
2408 cctxt->inode =
inode;
2415 inode->depth = cctxt->depth;
2417 inode->category = XSLT_ELEMENT_CATEGORY_XSLT;
2420 inode->curChildType = 0;
2421 inode->extContentHandled = 0;
2425 iprev =
inode->prev;
2432 inode->inScopeNs = iprev->inScopeNs;
2436 inode->litResElemInfo = iprev->litResElemInfo;
2437 inode->nsChanged = iprev->nsChanged;
2441 inode->exclResultNs = iprev->exclResultNs;
2445 inode->extElemNs = iprev->extElemNs;
2449 inode->preserveWhitespace = iprev->preserveWhitespace;
2453 inode->forwardsCompat = iprev->forwardsCompat;
2458 inode->preserveWhitespace = 0;
2459 inode->forwardsCompat = 0;
2474xsltCompilerNodePop(xsltCompilerCtxtPtr cctxt, xmlNodePtr
node)
2476 if (cctxt->inode ==
NULL) {
2478 "xsltCompilerNodePop: Top-node mismatch.\n");
2485 if (cctxt->inode->node !=
node) {
2487 "xsltCompilerNodePop: Node mismatch.\n");
2490 if (cctxt->inode->depth != cctxt->depth) {
2492 "xsltCompilerNodePop: Depth mismatch.\n");
2499 if ((cctxt->ivar) && (cctxt->ivar->depth > cctxt->depth))
2500 xsltCompilerVarInfoPop(cctxt);
2502 cctxt->inode = cctxt->inode->prev;
2503 if (cctxt->inode !=
NULL)
2504 cctxt->inode->curChildType = 0;
2513 if (
node->type == XML_ELEMENT_NODE) {
2516 nsName =
node->ns->href;
2526 if (cctxt->inode->node) {
2527 if (
node->type == XML_ELEMENT_NODE) {
2528 infname = cctxt->inode->node->
name;
2529 if (cctxt->inode->node->ns !=
NULL)
2530 infnsName = cctxt->inode->node->ns->href;
2542 "xsltCompilerNodePop: Given : '%s' URI '%s'\n",
2545 "xsltCompilerNodePop: Expected: '%s' URI '%s'\n",
2546 infname, infnsName);
2560static xsltNsListContainerPtr
2561xsltCompilerBuildInScopeNsList(xsltCompilerCtxtPtr cctxt, xmlNodePtr
node)
2563 xsltNsListContainerPtr nsi =
NULL;
2574 if (
node->type == XML_ELEMENT_NODE) {
2578 nsi = (xsltNsListContainerPtr)
2582 "xsltCompilerBuildInScopeNsList: "
2583 "malloc failed!\n");
2586 memset(nsi, 0,
sizeof(xsltNsListContainer));
2588 (xmlNsPtr *)
xmlMalloc(maxns *
sizeof(xmlNsPtr));
2589 if (nsi->list ==
NULL) {
2591 "xsltCompilerBuildInScopeNsList: "
2592 "malloc failed!\n");
2595 nsi->list[0] =
NULL;
2600 for (
i = 0;
i < nsi->totalNumber;
i++) {
2601 if ((
ns->
prefix == nsi->list[
i]->prefix) ||
2605 if (
i >= nsi->totalNumber) {
2606 if (nsi->totalNumber +1 >= maxns) {
2610 maxns *
sizeof(xmlNsPtr));
2611 if (nsi->list ==
NULL) {
2613 "xsltCompilerBuildInScopeNsList: "
2614 "realloc failed!\n");
2618 nsi->list[nsi->totalNumber++] =
ns;
2619 nsi->list[nsi->totalNumber] =
NULL;
2632 nsi->xpathNumber = nsi->totalNumber;
2633 for (
i = 0;
i < nsi->totalNumber;
i++) {
2634 if (nsi->list[
i]->prefix ==
NULL) {
2636 nsi->list[
i] = nsi->list[nsi->totalNumber-1];
2637 nsi->list[nsi->totalNumber-1] =
ns;
2645 if (xsltPointerListAddSize(
2646 (xsltPointerListPtr)cctxt->psData->inScopeNamespaces,
2647 (
void *) nsi, 5) == -1)
2652 "xsltCompilerBuildInScopeNsList: failed to add ns-info.\n");
2658 if (cctxt->inode !=
NULL)
2659 cctxt->inode->nsChanged = 1;
2666 cctxt->style->errors++;
2671xsltParseNsPrefixList(xsltCompilerCtxtPtr cctxt,
2672 xsltPointerListPtr
list,
2703 if ((
cur[0] ==
'#') &&
2705 ns = xmlSearchNs(cctxt->style->doc,
node,
NULL);
2707 ns = xmlSearchNs(cctxt->style->doc,
node,
cur);
2715 "No namespace binding in scope for prefix '%s'.\n",
cur);
2722 cctxt->style->errors++;
2724#ifdef WITH_XSLT_DEBUG_PARSING
2726 "resolved prefix '%s'\n",
cur);
2731 if (xsltPointerListAddSize(
list,
2733 ns->href, -1), 5) == -1)
2746 cctxt->style->errors++;
2761static xsltPointerListPtr
2762xsltCompilerUtilsCreateMergedList(xsltPointerListPtr
first,
2763 xsltPointerListPtr second)
2765 xsltPointerListPtr
ret;
2773 num += second->number;
2776 ret = xsltPointerListCreate(
num);
2784 first->number *
sizeof(
void *));
2785 if ((second !=
NULL) && (second->number != 0))
2787 second->number *
sizeof(
void *));
2788 }
else if ((second !=
NULL) && (second->number != 0))
2789 memcpy(
ret->items, (
void *) second->items,
2790 second->number *
sizeof(
void *));
2805static xsltPointerListPtr
2806xsltParseExclResultPrefixes(xsltCompilerCtxtPtr cctxt, xmlNodePtr
node,
2807 xsltPointerListPtr def,
2817 if (instrCategory == XSLT_ELEMENT_CATEGORY_XSLT)
2825 if (
attr && (instrCategory == XSLT_ELEMENT_CATEGORY_LRE)) {
2829 attr->psvi = (
void *) xsltXSLTAttrMarker;
2837 "Attribute 'exclude-result-prefixes': Invalid value.\n");
2838 cctxt->style->errors++;
2842 if (xsltParseNsPrefixList(cctxt, cctxt->tmpList,
node,
2845 if (cctxt->tmpList->number == 0)
2850 list = xsltCompilerUtilsCreateMergedList(def, cctxt->tmpList);
2856 if (xsltPointerListAddSize(
2857 cctxt->psData->exclResultNamespaces,
list, 5) == -1)
2859 xsltPointerListFree(
list);
2866 if (cctxt->inode !=
NULL)
2867 cctxt->inode->nsChanged = 1;
2886static xsltPointerListPtr
2887xsltParseExtElemPrefixes(xsltCompilerCtxtPtr cctxt, xmlNodePtr
node,
2888 xsltPointerListPtr def,
2899 if (instrCategory == XSLT_ELEMENT_CATEGORY_XSLT)
2907 if (
attr && (instrCategory == XSLT_ELEMENT_CATEGORY_LRE)) {
2911 attr->psvi = (
void *) xsltXSLTAttrMarker;
2919 "Attribute 'extension-element-prefixes': Invalid value.\n");
2920 cctxt->style->errors++;
2925 if (xsltParseNsPrefixList(cctxt, cctxt->tmpList,
node,
2929 if (cctxt->tmpList->number == 0)
2934 for (
i = 0;
i < cctxt->tmpList->number;
i++)
2940 list = xsltCompilerUtilsCreateMergedList(def, cctxt->tmpList);
2946 if (xsltPointerListAddSize(
2947 cctxt->psData->extElemNamespaces,
list, 5) == -1)
2949 xsltPointerListFree(
list);
2956 if (cctxt->inode !=
NULL)
2957 cctxt->inode->nsChanged = 1;
2979xsltParseAttrXSLTVersion(xsltCompilerCtxtPtr cctxt, xmlNodePtr
node,
2988 if (instrCategory == XSLT_ELEMENT_CATEGORY_XSLT)
2996 attr->psvi = (
void *) xsltXSLTAttrMarker;
3003 "Attribute 'version': Invalid value.\n");
3004 cctxt->style->errors++;
3009 cctxt->inode->forwardsCompat = 1;
3017 if (! cctxt->hasForwardsCompat) {
3018 cctxt->hasForwardsCompat = 1;
3019 cctxt->errSeverity = XSLT_ERROR_SEVERITY_WARNING;
3021 "Warning: the attribute xsl:version specifies a value "
3022 "different from '1.0'. Switching to forwards-compatible "
3023 "mode. Only features of XSLT 1.0 are supported by this "
3025 cctxt->style->warnings++;
3026 cctxt->errSeverity = XSLT_ERROR_SEVERITY_ERROR;
3029 cctxt->inode->forwardsCompat = 0;
3032 if (
attr && (instrCategory == XSLT_ELEMENT_CATEGORY_LRE)) {
3036 attr->psvi = (
void *) xsltXSLTAttrMarker;
3042xsltParsePreprocessStylesheetTree(xsltCompilerCtxtPtr cctxt, xmlNodePtr
node)
3044 xmlNodePtr deleteNode,
cur, txt, textNode =
NULL;
3047 int internalize = 0, findSpaceAttr;
3048 int xsltStylesheetElemDepth;
3052 int strictWhitespace, inXSLText = 0;
3053#ifdef XSLT_REFACTORED_XSLT_NSCOMP
3054 xsltNsMapPtr nsMapItem;
3057 if ((cctxt ==
NULL) || (cctxt->style ==
NULL) ||
3065 style = cctxt->style;
3069 style->internalized = 0;
3077 if (! cctxt->simplified)
3078 xsltStylesheetElemDepth = cctxt->depth +1;
3080 xsltStylesheetElemDepth = 0;
3082 if (xmlNodeGetSpacePreserve(
node) != 1)
3083 cctxt->inode->preserveWhitespace = 0;
3085 cctxt->inode->preserveWhitespace = 1;
3090 strictWhitespace = (cctxt->strict != 0) ? 1 : 0;
3092 nsNameXSLT = xsltConstNamespaceNameXSLT;
3097 if (deleteNode !=
NULL) {
3099#ifdef WITH_XSLT_DEBUG_BLANKS
3101 "xsltParsePreprocessStylesheetTree: removing node\n");
3103 xmlUnlinkNode(deleteNode);
3104 xmlFreeNode(deleteNode);
3107 if (
cur->type == XML_ELEMENT_NODE) {
3114 xsltCompilerNodePush(cctxt,
cur);
3119 cctxt->inode->stripWhitespace = 0;
3124#ifdef XSLT_REFACTORED_XSLT_NSCOMP
3125 if (
cur->ns->href != nsNameXSLT) {
3126 nsMapItem = xsltNewNamespaceMapItem(cctxt,
3128 if (nsMapItem ==
NULL)
3130 cur->ns->href = nsNameXSLT;
3135 goto process_attributes;
3164 if ((
name[0] ==
't') && (
name[1] ==
'e') &&
3165 (
name[2] ==
'x') && (
name[3] ==
't') &&
3173 cur->psvi = (
void *) xsltXSLTTextMarker;
3180 cctxt->inode->preserveWhitespace = 1;
3187 cctxt->inode->stripWhitespace = 1;
3194 cctxt->inode->stripWhitespace = 1;
3197 if (xsltStylesheetElemDepth == cctxt->depth) {
3201 cctxt->inode->stripWhitespace = 1;
3206 (
cur->prev->type == XML_TEXT_NODE))
3214 if (((*
name ==
'p') || (*
name ==
's')) &&
3231 }
while (
cur->prev);
3243 if (
cur->properties !=
NULL) {
3248#ifdef XSLT_REFACTORED_XSLT_NSCOMP
3249 if ((
attr->ns) && (
attr->ns->href != nsNameXSLT) &&
3252 nsMapItem = xsltNewNamespaceMapItem(cctxt,
3254 if (nsMapItem ==
NULL)
3256 attr->ns->href = nsNameXSLT;
3265 txt =
attr->children;
3270 if ((txt !=
NULL) && (txt->content !=
NULL) &&
3275 xmlNodeSetContent(txt,
NULL);
3276 txt->content =
value;
3283 if ((findSpaceAttr != 0) &&
3288 (
attr->ns->prefix[0] ==
'x') &&
3289 (
attr->ns->prefix[1] ==
'm') &&
3290 (
attr->ns->prefix[2] ==
'l') &&
3291 (
attr->ns->prefix[3] == 0))
3297 cctxt->inode->preserveWhitespace = 1;
3299 cctxt->inode->preserveWhitespace = 0;
3303 "Attribute xml:space: Invalid value.\n");
3304 cctxt->style->warnings++;
3321 }
else if ((
cur->type == XML_TEXT_NODE) ||
3322 (
cur->type == XML_CDATA_SECTION_NODE))
3344 cur->type = XML_TEXT_NODE;
3345 if ((strictWhitespace != 0) || (inXSLText != 0)) {
3349 if (textNode ==
NULL)
3353 xmlNodeAddContent(textNode,
cur->content);
3357 (
cur->next->type == XML_ELEMENT_NODE))
3365 if (textNode ==
NULL)
3369 }
else if ((
cur->type == XML_COMMENT_NODE) ||
3370 (
cur->type == XML_PI_NODE))
3377 (
cur->next->type == XML_ELEMENT_NODE))
3387 "Invalid type of node for the XSLT data model.\n");
3388 cctxt->style->errors++;
3394 value = textNode->content;
3403 (((cctxt->inode->stripWhitespace) ||
3404 (! cctxt->inode->preserveWhitespace)) &&
3408 if (textNode !=
cur) {
3409 xmlUnlinkNode(textNode);
3410 xmlFreeNode(textNode);
3412 deleteNode = textNode;
3420 if (textNode->type != XML_TEXT_NODE) {
3421 textNode->type = XML_TEXT_NODE;
3425 (textNode->content !=
NULL) &&
3432 textNode->content, -1);
3433 xmlNodeSetContent(textNode,
NULL);
3434 textNode->content =
value;
3445 if (
cur->type == XML_ELEMENT_NODE) {
3446 xsltCompilerNodePop(cctxt,
cur);
3458 if (deleteNode !=
NULL) {
3459#ifdef WITH_XSLT_DEBUG_PARSING
3461 "xsltParsePreprocessStylesheetTree: removing node\n");
3463 xmlUnlinkNode(deleteNode);
3464 xmlFreeNode(deleteNode);
3474#ifdef XSLT_REFACTORED
3479 xmlNodePtr deleteNode, styleelem;
3480 int internalize = 0;
3489 style->internalized = 0;
3505 if (deleteNode !=
NULL) {
3506#ifdef WITH_XSLT_DEBUG_BLANKS
3508 "xsltPreprocessStylesheet: removing ignorable blank node\n");
3510 xmlUnlinkNode(deleteNode);
3511 xmlFreeNode(deleteNode);
3514 if (
cur->type == XML_ELEMENT_NODE) {
3519 if ((internalize) && (
cur->properties !=
NULL)) {
3520 xmlAttrPtr
attr =
cur->properties;
3524 txt =
attr->children;
3525 if ((txt !=
NULL) && (txt->type == XML_TEXT_NODE) &&
3526 (txt->content !=
NULL) &&
3538 if (tmp != txt->content) {
3539 xmlNodeSetContent(txt,
NULL);
3549 for (;exclPrefixes > 0;exclPrefixes--)
3557 if ((
cur->nsDef !=
NULL) && (
style->exclPrefixNr > 0)) {
3562 root = xmlDocGetRootElement(
cur->doc);
3567 for (
i = 0;
i <
style->exclPrefixNr;
i++) {
3570 style->exclPrefixTab[
i]))) {
3577 cur->nsDef =
ns->next;
3579 prev->next =
ns->next;
3597 if (exclPrefixes > 0) {
3599 for (;exclPrefixes > 0;exclPrefixes--)
3603 }
else if (
cur->type == XML_TEXT_NODE) {
3605 if (xmlNodeGetSpacePreserve(
cur->parent) != 1) {
3608 }
else if ((
cur->content !=
NULL) && (internalize) &&
3621 }
else if ((
cur->type != XML_ELEMENT_NODE) &&
3622 (
cur->type != XML_CDATA_SECTION_NODE)) {
3632 if ((
cur->type == XML_ELEMENT_NODE) && (
cur->ns !=
NULL) &&
3633 (styleelem !=
NULL) && (
cur->parent == styleelem) &&
3637 }
else if (
cur->children !=
NULL) {
3652 if (
cur == (xmlNodePtr)
style->doc) {
3662 if (deleteNode !=
NULL) {
3663#ifdef WITH_XSLT_DEBUG_PARSING
3665 "xsltPreprocessStylesheet: removing ignorable blank node\n");
3667 xmlUnlinkNode(deleteNode);
3668 xmlFreeNode(deleteNode);
3700 cur = xmlDocGetRootElement(
style->doc);
3702 if (
cur->type == XML_ELEMENT_NODE) {
3703 xmlNsPtr
ns =
cur->nsDef;
3710 "xsltGatherNamespaces: failed to create hash table\n");
3718 "Namespaces prefix %s used for multiple namespaces\n",
ns->
prefix);
3720 }
else if (URI ==
NULL) {
3722 (
void *)
ns->href,
NULL);
3724#ifdef WITH_XSLT_DEBUG_PARSING
3726 "Added namespace: %s mapped to %s\n",
ns->
prefix,
ns->href);
3738 if (
cur->children->type != XML_ENTITY_DECL) {
3752 if (
cur == (xmlNodePtr)
style->doc) {
3764#ifdef XSLT_REFACTORED
3767xsltGetXSLTElementTypeByNode(xsltCompilerCtxtPtr cctxt,
3770 if ((
node ==
NULL) || (
node->type != XML_ELEMENT_NODE) ||
3774 if (
node->name[0] ==
'a') {
3784 }
else if (
node->name[0] ==
'c') {
3796 }
else if (
node->name[0] ==
'd') {
3802 }
else if (
node->name[0] ==
'e') {
3806 }
else if (
node->name[0] ==
'f') {
3810 return(XSLT_FUNC_FALLBACK);
3812 }
else if (*(
node->name) ==
'i') {
3820 }
else if (*(
node->name) ==
'k') {
3824 }
else if (*(
node->name) ==
'm') {
3826 return(XSLT_FUNC_MESSAGE);
3828 }
else if (*(
node->name) ==
'n') {
3834 }
else if (*(
node->name) ==
'o') {
3836 return(XSLT_FUNC_OTHERWISE);
3840 }
else if (*(
node->name) ==
'p') {
3848 }
else if (*(
node->name) ==
's') {
3856 }
else if (
node->name[0] ==
't') {
3864 }
else if (*(
node->name) ==
'v') {
3870 }
else if (*(
node->name) ==
'w') {
3891xsltParseAnyXSLTElem(xsltCompilerCtxtPtr cctxt, xmlNodePtr
elem)
3894 (
elem->type != XML_ELEMENT_NODE))
3899 if (! (IS_XSLT_ELEM_FAST(
elem)))
3904 if (cctxt->inode->category == XSLT_ELEMENT_CATEGORY_EXTENSION) {
3905 cctxt->inode->extContentHandled = 1;
3908 xsltCompilerNodePush(cctxt,
elem);
3913 if (cctxt->inode->prev->curChildType != 0)
3914 cctxt->inode->type = cctxt->inode->prev->curChildType;
3916 cctxt->inode->type = xsltGetXSLTElementTypeByNode(cctxt,
elem);
3921 cctxt->inode->inScopeNs =
3922 xsltCompilerBuildInScopeNsList(cctxt,
elem);
3937 switch (cctxt->inode->type) {
3943 goto apply_templates;
3946 goto sequence_constructor;
3955 goto sequence_constructor;
3958 goto sequence_constructor;
3964 goto sequence_constructor;
3967 goto sequence_constructor;
3968 case XSLT_FUNC_FALLBACK:
3970 goto sequence_constructor;
3976 goto sequence_constructor;
3977 case XSLT_FUNC_OTHERWISE:
3979 goto sequence_constructor;
3980 case XSLT_FUNC_MESSAGE:
3982 goto sequence_constructor;
3991 xsltVarInfoPtr ivar = cctxt->ivar;
3995 ((xsltStyleItemParamPtr)
elem->psvi)->name) &&
3997 ((xsltStyleItemParamPtr)
elem->psvi)->ns))
4001 "Redefinition of variable or parameter '%s'.\n",
4003 cctxt->style->errors++;
4007 }
while (ivar !=
NULL);
4010 goto sequence_constructor;
4013 goto sequence_constructor;
4028 xsltVarInfoPtr ivar = cctxt->ivar;
4032 ((xsltStyleItemVariablePtr)
elem->psvi)->name) &&
4034 ((xsltStyleItemVariablePtr)
elem->psvi)->ns))
4038 "Redefinition of variable or parameter '%s'.\n",
4040 cctxt->style->errors++;
4044 }
while (ivar !=
NULL);
4047 goto sequence_constructor;
4050 goto sequence_constructor;
4053 goto sequence_constructor;
4055#ifdef WITH_XSLT_DEBUG_PARSING
4057 "xsltParseXSLTNode: Unhandled XSLT element '%s'.\n",
4061 "xsltParseXSLTNode: Internal error; "
4062 "unhandled XSLT element '%s'.\n",
elem->name);
4063 cctxt->style->errors++;
4072 if (
child->type == XML_ELEMENT_NODE) {
4073 if (IS_XSLT_ELEM_FAST(
child)) {
4076 xsltParseAnyXSLTElem(cctxt,
child);
4079 xsltParseAnyXSLTElem(cctxt,
child);
4095 if (
child->type == XML_ELEMENT_NODE) {
4096 if (IS_XSLT_ELEM_FAST(
child)) {
4099 type = xsltGetXSLTElementTypeByNode(cctxt,
child);
4102 xsltParseAnyXSLTElem(cctxt,
child);
4118 if ((
child->type != XML_TEXT_NODE) &&
4119 (
child->type != XML_CDATA_SECTION_NODE))
4122 "The XSLT 'text' element must have only character "
4123 "data as content.\n");
4137 if (((
child->type != XML_TEXT_NODE) &&
4138 (
child->type != XML_CDATA_SECTION_NODE)) ||
4142 "This XSLT element must have no content.\n");
4143 cctxt->style->errors++;
4161 int nbWhen = 0, nbOtherwise = 0,
err = 0;
4163 if (
child->type == XML_ELEMENT_NODE) {
4164 if (IS_XSLT_ELEM_FAST(
child)) {
4167 type = xsltGetXSLTElementTypeByNode(cctxt,
child);
4176 xsltParseAnyXSLTElem(cctxt,
child);
4177 }
else if (
type == XSLT_FUNC_OTHERWISE) {
4185 "The XSLT 'choose' element must not contain "
4186 "more than one XSLT 'otherwise' element.\n");
4187 cctxt->style->errors++;
4192 cctxt->inode->curChildType = XSLT_FUNC_OTHERWISE;
4193 xsltParseAnyXSLTElem(cctxt,
child);
4205 if ((!
err) && (! nbWhen)) {
4207 "The XSLT element 'choose' must contain at least one "
4208 "XSLT element 'when'.\n");
4209 cctxt->style->errors++;
4229 if ((
child->type == XML_ELEMENT_NODE) &&
4230 IS_XSLT_ELEM_FAST(
child))
4232 if (xsltGetXSLTElementTypeByNode(cctxt,
child) ==
4236 xsltParseAnyXSLTElem(cctxt,
child);
4247 xsltParseSequenceConstructor(cctxt,
child);
4251sequence_constructor:
4256 xsltParseSequenceConstructor(cctxt,
elem->children);
4267 (((xsltStyleBasicItemVariablePtr)
elem->psvi)->name))
4269 xsltCompilerVarInfoPush(cctxt,
elem,
4270 ((xsltStyleBasicItemVariablePtr)
elem->psvi)->name,
4271 ((xsltStyleBasicItemVariablePtr)
elem->psvi)->ns);
4277 xsltCompilerNodePop(cctxt,
elem);
4281 xsltCompilerNodePop(cctxt,
elem);
4295static xsltStyleItemUknownPtr
4296xsltForwardsCompatUnkownItemCreate(xsltCompilerCtxtPtr cctxt)
4298 xsltStyleItemUknownPtr
item;
4300 item = (xsltStyleItemUknownPtr)
xmlMalloc(
sizeof(xsltStyleItemUknown));
4303 "Internal error in xsltForwardsCompatUnkownItemCreate(): "
4304 "Failed to allocate memory.\n");
4305 cctxt->style->errors++;
4308 memset(
item, 0,
sizeof(xsltStyleItemUknown));
4309 item->
type = XSLT_FUNC_UNKOWN_FORWARDS_COMPAT;
4313 item->next = cctxt->style->preComps;
4333xsltParseUnknownXSLTElem(xsltCompilerCtxtPtr cctxt,
4342 if (cctxt->inode->category == XSLT_ELEMENT_CATEGORY_EXTENSION) {
4343 cctxt->inode->extContentHandled = 1;
4345 if (cctxt->inode->forwardsCompat == 0) {
4350 "Unknown XSLT element '%s'.\n",
node->name);
4351 cctxt->style->errors++;
4364 if (cctxt->unknownItem ==
NULL) {
4368 cctxt->unknownItem = xsltForwardsCompatUnkownItemCreate(cctxt);
4369 if (cctxt->unknownItem ==
NULL) {
4374 node->psvi = cctxt->unknownItem;
4380 xsltCompilerNodePush(cctxt,
node);
4385 cctxt->inode->inScopeNs =
4386 xsltCompilerBuildInScopeNsList(cctxt,
node);
4391 if ((
child->type == XML_ELEMENT_NODE) &&
4392 IS_XSLT_ELEM_FAST(
child) &&
4395 cctxt->inode->curChildType = XSLT_FUNC_FALLBACK;
4396 xsltParseAnyXSLTElem(cctxt,
child);
4401 xsltCompilerNodePop(cctxt,
node);
4416xsltParseSequenceConstructor(xsltCompilerCtxtPtr cctxt, xmlNodePtr
cur)
4419 xmlNodePtr deleteNode =
NULL;
4421 if (cctxt ==
NULL) {
4423 "xsltParseSequenceConstructor: Bad arguments\n");
4424 cctxt->style->errors++;
4430 if (cctxt->inode->category == XSLT_ELEMENT_CATEGORY_EXTENSION) {
4431 cctxt->inode->extContentHandled = 1;
4433 if ((
cur ==
NULL) || (
cur->type == XML_NAMESPACE_DECL))
4463 cctxt->style->principal->opCount += 1;
4465 if (deleteNode !=
NULL) {
4466#ifdef WITH_XSLT_DEBUG_BLANKS
4468 "xsltParseSequenceConstructor: removing xsl:text element\n");
4470 xmlUnlinkNode(deleteNode);
4471 xmlFreeNode(deleteNode);
4474 if (
cur->type == XML_ELEMENT_NODE) {
4476 if (
cur->psvi == xsltXSLTTextMarker) {
4491 tmp =
cur->children;
4498 if ((tmp->type == XML_TEXT_NODE) ||
4499 (tmp->next ==
NULL))
4505 if (xmlAddPrevSibling(
cur, tmp) ==
NULL) {
4513 "Element 'xsl:text': Invalid type "
4514 "of node found in content.\n");
4515 cctxt->style->errors++;
4518 if (
cur->properties) {
4530 BAD_CAST "disable-output-escaping"))
4546 }
else if ((
attr->children ==
NULL) ||
4547 (
attr->children->content ==
NULL) ||
4553 "Attribute 'disable-output-escaping': "
4554 "Invalid value. Expected is "
4555 "'yes' or 'no'.\n");
4556 cctxt->style->errors++;
4563 }
else if (IS_XSLT_ELEM_FAST(
cur)) {
4573 type = xsltGetXSLTElementTypeByNode(cctxt,
cur);
4585 case XSLT_FUNC_FALLBACK:
4588 case XSLT_FUNC_MESSAGE:
4597 cctxt->inode->curChildType =
type;
4598 xsltParseAnyXSLTElem(cctxt,
cur);
4601 xsltParseUnknownXSLTElem(cctxt,
cur);
4610 xsltCompilerNodePush(cctxt,
cur);
4615 cctxt->inode->inScopeNs =
4616 xsltCompilerBuildInScopeNsList(cctxt,
cur);
4644 if (
cur->properties)
4645 cctxt->inode->extElemNs =
4646 xsltParseExtElemPrefixes(cctxt,
4647 cur, cctxt->inode->extElemNs,
4648 XSLT_ELEMENT_CATEGORY_LRE);
4653 (cctxt->inode->extElemNs !=
NULL) &&
4661 cctxt->inode->category = XSLT_ELEMENT_CATEGORY_EXTENSION;
4662 cctxt->inode->extContentHandled = 0;
4669 "Internal error in xsltParseSequenceConstructor(): "
4670 "Occupied PSVI field.\n");
4671 cctxt->style->errors++;
4675 cur->psvi = (
void *)
4713 if ((
cur->children !=
NULL) &&
4714 (cctxt->inode->extContentHandled == 0))
4720 xsltParseSequenceConstructor(cctxt,
cur->children);
4733 cctxt->inode->category = XSLT_ELEMENT_CATEGORY_LRE;
4734 if (
cur->properties !=
NULL) {
4735 xmlAttrPtr
attr =
cur->properties;
4739 cctxt->inode->exclResultNs =
4740 xsltParseExclResultPrefixes(cctxt,
cur,
4741 cctxt->inode->exclResultNs,
4742 XSLT_ELEMENT_CATEGORY_LRE);
4746 xsltParseAttrXSLTVersion(cctxt,
cur,
4747 XSLT_ELEMENT_CATEGORY_LRE);
4758 if ((
attr->psvi != xsltXSLTAttrMarker) &&
4759 IS_XSLT_ATTR_FAST(
attr))
4766 "Unknown XSLT attribute '%s'.\n",
4768 cctxt->style->errors++;
4773 attr->psvi = (
void *) xsltXSLTAttrMarker;
4782 if (cctxt->inode->nsChanged)
4783 xsltLREInfoCreate(cctxt,
cur, 1);
4784 cur->psvi = cctxt->inode->litResElemInfo;
4788 if (cctxt->hasNsAliases)
4789 xsltLREBuildEffectiveNs(cctxt,
cur);
4793 if (
cur->properties) {
4794 xmlAttrPtr
attr =
cur->properties;
4806 xsltParseSequenceConstructor(cctxt,
cur->children);
4812 xsltCompilerNodePop(cctxt,
cur);
4817 if (deleteNode !=
NULL) {
4818#ifdef WITH_XSLT_DEBUG_BLANKS
4820 "xsltParseSequenceConstructor: removing xsl:text element\n");
4822 xmlUnlinkNode(deleteNode);
4823 xmlFreeNode(deleteNode);
4845 (templ->type == XML_NAMESPACE_DECL))
4851 if (XSLT_CCTXT(
style)->
inode->category == XSLT_ELEMENT_CATEGORY_EXTENSION) {
4852 XSLT_CCTXT(
style)->inode->extContentHandled = 1;
4855 if (templ->children !=
NULL) {
4856 xmlNodePtr
child = templ->children;
4863 style->principal->opCount += 1;
4865 if ((
child->type == XML_ELEMENT_NODE) &&
4866 IS_XSLT_ELEM_FAST(
child) &&
4870 xsltParseAnyXSLTElem(XSLT_CCTXT(
style),
child);
4878 xsltParseSequenceConstructor(XSLT_CCTXT(
style),
child);
4895 xmlNodePtr
cur,
delete;
4898 (templ->type == XML_NAMESPACE_DECL))
return;
4905 cur = templ->children;
4908 style->principal->opCount += 1;
4910 if (
delete !=
NULL) {
4911#ifdef WITH_XSLT_DEBUG_BLANKS
4913 "xsltParseTemplateContent: removing text\n");
4915 xmlUnlinkNode(
delete);
4916 xmlFreeNode(
delete);
4935 prop = xmlGetNsProp(
cur,
4936 (
const xmlChar *)
"disable-output-escaping",
4939#ifdef WITH_XSLT_DEBUG_PARSING
4941 "Disable escaping: %s\n",
text->content);
4948 "xsl:text: disable-output-escaping allows only yes or no\n");
4956 if (
text->type == XML_COMMENT_NODE) {
4960 if ((
text->type != XML_TEXT_NODE) &&
4961 (
text->type != XML_CDATA_SECTION_NODE)) {
4963 "xsltParseTemplateContent: xslt:text content problem\n");
4967 if ((noesc) && (
text->type != XML_CDATA_SECTION_NODE))
4978 if ((
style->internalized) &&
4990 if (tmp !=
text->content) {
4998 xmlUnlinkNode(
text);
5020 else if (
cur->type == XML_ELEMENT_NODE)
5027 cur->ns = xmlSearchNsByHref(
cur->doc,
cur,
5028 style->defaultAlias);
5030 if (
cur->properties !=
NULL) {
5031 xmlAttrPtr
attr =
cur->properties;
5043 if (
cur->children->type != XML_ENTITY_DECL) {
5068 if (
delete !=
NULL) {
5069#ifdef WITH_XSLT_DEBUG_PARSING
5071 "xsltParseTemplateContent: removing text\n");
5073 xmlUnlinkNode(
delete);
5074 xmlFreeNode(
delete);
5081 cur = templ->children;
5096 "xsltParseTemplateContent: ignoring misplaced param element\n");
5099 xmlUnlinkNode(
param);
5149#ifdef WITH_XSLT_DEBUG_PARSING
5151 "xsltParseStylesheetKey: name %s\n",
name);
5155 "xsl:key : error missing name\n");
5163 "xsl:key : error missing match\n");
5171 "xsl:key : error missing use\n");
5189 if (nameURI !=
NULL)
5197#ifdef XSLT_REFACTORED
5212xsltParseXSLTTemplate(xsltCompilerCtxtPtr cctxt, xmlNodePtr templNode) {
5217 if ((cctxt ==
NULL) || (templNode ==
NULL) ||
5218 (templNode->type != XML_ELEMENT_NODE))
5228 xsltCompilerNodePush(cctxt, templNode);
5229 if (templNode->nsDef !=
NULL)
5230 cctxt->inode->inScopeNs =
5231 xsltCompilerBuildInScopeNsList(cctxt, templNode);
5233 templ->
next = cctxt->style->templates;
5234 cctxt->style->templates = templ;
5235 templ->
style = cctxt->style;
5240 prop = xmlGetNsProp(templNode, (
const xmlChar *)
"mode",
NULL);
5252 cctxt->style->errors++;
5258 if (xmlValidateNCName(templ->
mode, 0)) {
5260 "xsl:template: Attribute 'mode': The local part '%s' "
5261 "of the value is not a valid NCName.\n", templ->
name);
5262 cctxt->style->errors++;
5265 if (modeURI !=
NULL)
5267#ifdef WITH_XSLT_DEBUG_PARSING
5269 "xsltParseXSLTTemplate: mode %s\n", templ->
mode);
5275 prop = xmlGetNsProp(templNode, (
const xmlChar *)
"match",
NULL);
5277 templ->
match = prop;
5283 prop = xmlGetNsProp(templNode, (
const xmlChar *)
"priority",
NULL);
5285 priority = xmlXPathStringEvalNumber(prop);
5293 prop = xmlGetNsProp(templNode, (
const xmlChar *)
"name",
NULL);
5303 cctxt->style->errors++;
5309 if (xmlValidateNCName(templ->
name, 0)) {
5311 "xsl:template: Attribute 'name': The local part '%s' of "
5312 "the value is not a valid NCName.\n", templ->
name);
5313 cctxt->style->errors++;
5316 if (nameURI !=
NULL)
5318 curTempl = templ->
next;
5319 while (curTempl !=
NULL) {
5326 "xsl:template: error duplicate name '%s'\n", templ->
name);
5327 cctxt->style->errors++;
5330 curTempl = curTempl->
next;
5333 if (templNode->children !=
NULL) {
5352 templ->
elem = templNode;
5353 templ->
content = templNode->children;
5357 xsltCompilerNodePop(cctxt, templNode);
5380 (
template->type != XML_ELEMENT_NODE))
5383 if (
style->principal->opLimit > 0) {
5384 if (
style->principal->opCount >
style->principal->opLimit) {
5386 "XSLT parser operation limit exceeded\n");
5414 prop = xmlGetNsProp(
template, (
const xmlChar *)
"mode",
NULL);
5432#ifdef WITH_XSLT_DEBUG_PARSING
5434 "xsltParseStylesheetTemplate: mode %s\n",
mode);
5439 prop = xmlGetNsProp(
template, (
const xmlChar *)
"match",
NULL);
5445 prop = xmlGetNsProp(
template, (
const xmlChar *)
"priority",
NULL);
5447 priority = xmlXPathStringEvalNumber(prop);
5452 prop = xmlGetNsProp(
template, (
const xmlChar *)
"name",
NULL);
5464 if (xmlValidateNCName(prop,0)) {
5466 "xsl:template : error invalid name '%s'\n", prop);
5485 ret->elem =
template;
5486 ret->content =
template->children;
5495#ifdef XSLT_REFACTORED
5504static xsltStyleItemIncludePtr
5505xsltCompileXSLTIncludeElem(xsltCompilerCtxtPtr cctxt, xmlNodePtr
node) {
5506 xsltStyleItemIncludePtr
item;
5512 item = (xsltStyleItemIncludePtr)
xmlMalloc(
sizeof(xsltStyleItemInclude));
5515 "xsltIncludeComp : malloc failed\n");
5516 cctxt->style->errors++;
5519 memset(
item, 0,
sizeof(xsltStyleItemInclude));
5525 item->next = cctxt->style->preComps;
5532xsltParseFindTopLevelElem(xsltCompilerCtxtPtr cctxt,
5536 int breakOnOtherElem,
5537 xmlNodePtr *resultNode)
5544 if (
cur->type == XML_ELEMENT_NODE) {
5546 if ((*(
cur->name) == *
name) &&
5554 if (breakOnOtherElem)
5564xsltParseTopLevelXSLTElem(xsltCompilerCtxtPtr cctxt,
5579 xsltCompilerNodePush(cctxt,
node);
5581 cctxt->inode->inScopeNs =
5582 xsltCompilerBuildInScopeNsList(cctxt,
node);
5583 cctxt->inode->type =
type;
5586 case XSLT_FUNC_INCLUDE:
5590 if (xsltCompileXSLTIncludeElem(cctxt,
node) ==
NULL)
5595 oldIsInclude = cctxt->isInclude;
5596 cctxt->isInclude = 1;
5599 cctxt->style->errors++;
5601 cctxt->isInclude = oldIsInclude;
5612 case XSLT_FUNC_ATTRSET:
5617 "Internal error: (xsltParseTopLevelXSLTElem) "
5618 "Cannot handle this top-level declaration.\n");
5619 cctxt->style->errors++;
5624 xsltCompilerNodePop(cctxt,
node);
5631xsltParseRemoveWhitespace(xmlNodePtr
node)
5640 xmlUnlinkNode(delNode);
5641 xmlFreeNode(delNode);
5644 if (((
child->type == XML_TEXT_NODE) ||
5645 (
child->type == XML_CDATA_SECTION_NODE)) &&
5651 xmlUnlinkNode(delNode);
5652 xmlFreeNode(delNode);
5661xsltParseXSLTStylesheetElemCore(xsltCompilerCtxtPtr cctxt, xmlNodePtr
node)
5663#ifdef WITH_XSLT_DEBUG_PARSING
5670 (
node->type != XML_ELEMENT_NODE))
5673 style = cctxt->style;
5689 include = ((xsltStyleItemIncludePtr)
node->psvi)->include;
5711 xsltCompilerNodePush(cctxt,
node);
5712 cctxt->inode->isRoot = 1;
5713 cctxt->inode->nsChanged = 0;
5717 cctxt->inode->litResElemInfo = cctxt->inodeList->litResElemInfo;
5726 cctxt->inode->inScopeNs =
5727 xsltCompilerBuildInScopeNsList(cctxt,
node);
5738 if (xsltParseAttrXSLTVersion(cctxt,
node,
5739 XSLT_ELEMENT_CATEGORY_XSLT) == 0)
5749#ifdef XSLT_REFACTORED_MANDATORY_VERSION
5752 "The attribute 'version' is missing.\n");
5753 cctxt->style->errors++;
5757 "xsl:version is missing: document may not be a stylesheet\n");
5758 cctxt->style->warnings++;
5770 cctxt->inode->extElemNs =
5771 xsltParseExtElemPrefixes(cctxt,
node,
NULL,
5772 XSLT_ELEMENT_CATEGORY_XSLT);
5776 cctxt->inode->exclResultNs =
5777 xsltParseExclResultPrefixes(cctxt,
node,
NULL,
5778 XSLT_ELEMENT_CATEGORY_XSLT);
5782 if (cctxt->inode->nsChanged)
5783 xsltLREInfoCreate(cctxt,
node, 0);
5808 if (
cur->type == XML_TEXT_NODE) {
5810 "Misplaced text node (content: '%s').\n",
5813 }
else if (
cur->type != XML_ELEMENT_NODE) {
5824 while ((
cur !=
NULL) && xsltParseFindTopLevelElem(cctxt,
cur,
5835 xsltParseFindTopLevelElem(cctxt,
cur,
5846 xsltParseFindTopLevelElem(cctxt,
cur,
5860 if (
cur->type == XML_ELEMENT_NODE) {
5863 "Unexpected top-level element in no namespace.\n");
5871 if (IS_XSLT_ELEM_FAST(
cur)) {
5877 "Misplaced xsl:import element.\n");
5887#ifdef WITH_XSLT_DEBUG_PARSING
5895 xsltParseXSLTTemplate(cctxt,
cur);
5902 xsltParseXSLTStylesheetElemCore(cctxt,
cur);
5906 "(xsltParseXSLTStylesheetElemCore) "
5907 "The xsl:include element was not compiled.\n");
5926 xsltParseTopLevelXSLTElem(cctxt,
cur,
5931 if (cctxt->inode->forwardsCompat) {
5944 "Forwards-compatible mode: Ignoring unknown XSLT "
5945 "element '%s'.\n",
cur->name);
5949 "Unknown XSLT element '%s'.\n",
cur->name);
5966 if (function !=
NULL)
5968#ifdef WITH_XSLT_DEBUG_PARSING
5970 "xsltParseXSLTStylesheetElemCore : User-defined "
5971 "data element '%s'.\n",
cur->name);
5980#ifdef WITH_XSLT_DEBUG_PARSING
5982 "### END of parsing top-level elements of doc '%s'.\n",
5986#ifdef XSLT_REFACTORED
5988 "### Max inodes: %d\n", cctxt->maxNodeInfos);
5990 "### Max LREs : %d\n", cctxt->maxLREs);
5994 xsltCompilerNodePop(cctxt,
node);
6021xsltParseXSLTStylesheetElem(xsltCompilerCtxtPtr cctxt, xmlNodePtr
node)
6044 xsltParseFindTopLevelElem(cctxt,
cur,
6048 cctxt->style->errors++;
6060 xsltParseFindTopLevelElem(cctxt,
cur,
6063 xsltParseTopLevelXSLTElem(cctxt,
cur, XSLT_FUNC_INCLUDE);
6073 xsltParseFindTopLevelElem(cctxt,
cur,
6080 if (cctxt->isInclude) {
6090 xsltParseXSLTStylesheetElemCore(cctxt,
node);
6109#ifdef WITH_XSLT_DEBUG_PARSING
6113 if ((
top ==
NULL) || (
top->type != XML_ELEMENT_NODE))
6116 if (
style->principal->opLimit > 0) {
6117 if (
style->principal->opCount >
style->principal->opLimit) {
6119 "XSLT parser operation limit exceeded\n");
6128 "xsl:version is missing: document may not be a stylesheet\n");
6134 "xsl:version: only 1.1 features are supported\n");
6136 style->forwards_compatible = 1;
6148 style->principal->opCount += 1;
6166 style->principal->opCount += 1;
6172 if (
cur->type == XML_TEXT_NODE) {
6175 "misplaced text node: '%s'\n",
cur->content);
6181 if ((
cur->type == XML_ELEMENT_NODE) && (
cur->ns ==
NULL)) {
6183 "Found a top-level element %s with null namespace URI\n",
6194 if (function !=
NULL)
6197#ifdef WITH_XSLT_DEBUG_PARSING
6199 "xsltParseStylesheetTop : found foreign element %s\n",
6207 "xsltParseStylesheetTop: ignoring misplaced import element\n");
6229#ifdef WITH_XSLT_DEBUG_PARSING
6238 "xsltParseStylesheetTop: unknown %s element\n",
6245#ifdef WITH_XSLT_DEBUG_PARSING
6253#ifdef XSLT_REFACTORED
6265xsltParseSimplifiedStylesheetTree(xsltCompilerCtxtPtr cctxt,
6274 if (xsltParseAttrXSLTVersion(cctxt,
node, 0) == XSLT_ELEMENT_CATEGORY_LRE)
6281 "The attribute 'xsl:version' is missing; cannot identify "
6282 "this document as an XSLT stylesheet document.\n");
6283 cctxt->style->errors++;
6287#ifdef WITH_XSLT_DEBUG_PARSING
6289 "xsltParseSimplifiedStylesheetTree: document is stylesheet\n");
6296 if (templ ==
NULL) {
6299 templ->
next = cctxt->style->templates;
6300 cctxt->style->templates = templ;
6306 xsltCompilerNodePush(cctxt, (xmlNodePtr) doc);
6314 cctxt->inode->inScopeNs =
6315 xsltCompilerBuildInScopeNsList(cctxt,
node);
6319 xsltParseSequenceConstructor(cctxt,
node);
6320 xsltCompilerNodePop(cctxt, (xmlNodePtr) doc);
6322 templ->
elem = (xmlNodePtr) doc;
6325 cctxt->style->literal_result = 1;
6329#ifdef XSLT_REFACTORED_XSLT_NSCOMP
6340xsltRestoreDocumentNamespaces(xsltNsMapPtr
ns, xmlDocPtr doc)
6349 if ((
ns->doc == doc) && (
ns->ns !=
NULL)) {
6350 ns->ns->href =
ns->origNsName;
6376 xsltCompilerCtxtPtr cctxt;
6378 int oldIsSimplifiedStylesheet;
6385 cctxt = XSLT_CCTXT(
style);
6387 cur = xmlDocGetRootElement(doc);
6390 "xsltParseStylesheetProcess : empty stylesheet\n");
6393 oldIsSimplifiedStylesheet = cctxt->simplified;
6398#ifdef WITH_XSLT_DEBUG_PARSING
6400 "xsltParseStylesheetProcess : found stylesheet\n");
6402 cctxt->simplified = 0;
6403 style->literal_result = 0;
6405 cctxt->simplified = 1;
6406 style->literal_result = 1;
6413 if (!
style->nopreproc)
6414 xsltParsePreprocessStylesheetTree(cctxt,
cur);
6418 if (
style->literal_result == 0) {
6419 if (xsltParseXSLTStylesheetElem(cctxt,
cur) != 0)
6422 if (xsltParseSimplifiedStylesheetTree(cctxt, doc,
cur) != 0)
6426 cctxt->simplified = oldIsSimplifiedStylesheet;
6462 cur = xmlDocGetRootElement(doc);
6465 "xsltParseStylesheetProcess : empty stylesheet\n");
6472#ifdef WITH_XSLT_DEBUG_PARSING
6474 "xsltParseStylesheetProcess : found stylesheet\n");
6476 ret->literal_result = 0;
6482 ret->literal_result = 1;
6484 if (!
ret->nopreproc) {
6487 if (
ret->literal_result == 0) {
6499 "xsltParseStylesheetProcess : document is not a stylesheet\n");
6503#ifdef WITH_XSLT_DEBUG_PARSING
6505 "xsltParseStylesheetProcess : document is stylesheet\n");
6511 "xsl:version: only 1.1 features are supported\n");
6512 ret->forwards_compatible = 1;
6521 if (
template ==
NULL) {
6524 template->next =
ret->templates;
6525 ret->templates =
template;
6532 template->elem = (xmlNodePtr) doc;
6533 template->content = doc->children;
6535 ret->literal_result = 1;
6563 if (retStyle ==
NULL)
6591 if (doc->dict !=
NULL) {
6593 style->dict = doc->dict;
6594#ifdef WITH_XSLT_DEBUG
6596 "reusing dictionary from %s for stylesheet\n",
6608#ifdef XSLT_REFACTORED
6610 xsltCompilerCtxtPtr cctxt;
6614 xsltPrincipalStylesheetDataPtr principalData;
6618 principalData = xsltNewPrincipalStylesheetData();
6619 if (principalData ==
NULL) {
6622 style->principalData = principalData;
6630 cctxt = xsltCompilationCtxtCreate(
style);
6631 if (cctxt ==
NULL) {
6634 style->compCtxt = (
void *) cctxt;
6635 cctxt->style =
style;
6636 cctxt->dict =
style->dict;
6637 cctxt->psData = principalData;
6642 xsltCompilerNodePush(cctxt, (xmlNodePtr) doc);
6647 cctxt =
style->parent->compCtxt;
6648 style->compCtxt = cctxt;
6654 oldCurSheet = cctxt->style;
6655 cctxt->style =
style;
6660 cctxt->style = oldCurSheet;
6665 xsltCompilerNodePop(cctxt, (xmlNodePtr) doc);
6675#ifdef XSLT_REFACTORED_XSLT_NSCOMP
6676 if (
style->errors != 0) {
6680 if (cctxt->psData->nsMap)
6681 xsltRestoreDocumentNamespaces(cctxt->psData->nsMap, doc);
6686 xsltCompilationCtxtFree(
style->compCtxt);
6705 if (
style->errors != 0) {
6762#ifdef WITH_XSLT_DEBUG_PARSING
6764 "xsltParseStylesheetFile : parse %s\n",
filename);
6778 "xsltParseStylesheetFile: read rights for %s denied\n",
6788 "xsltParseStylesheetFile : cannot parse %s\n",
filename);
6807#define SKIP(val) cur += (val)
6808#define NXT(val) cur[(val)]
6809#define SKIP_BLANKS \
6810 while (IS_BLANK(CUR)) NEXT
6811#define NEXT ((*cur) ? cur++ : cur)
6838 if ((
CUR ==
't') && (
NXT(1) ==
'y') && (
NXT(2) ==
'p') &&
6845 if ((
CUR !=
'\'') && (
CUR !=
'"'))
6850 while ((
CUR != 0) && (
CUR != tmp))
6866 }
else if ((
CUR ==
'h') && (
NXT(1) ==
'r') && (
NXT(2) ==
'e') &&
6873 if ((
CUR !=
'\'') && (
CUR !=
'"'))
6878 while ((
CUR != 0) && (
CUR != tmp))
6929 child = doc->children;
6931 if ((
child->type == XML_PI_NODE) &&
6944#ifdef WITH_XSLT_DEBUG_PARSING
6946 "xsltLoadStylesheetPI : found PI href=%s\n", href);
6951 "xml-stylesheet : href %s is not valid\n", href);
6961#ifdef WITH_XSLT_DEBUG_PARSING
6963 "xsltLoadStylesheetPI : Reference to ID %s\n", href);
6971 "xml-stylesheet : no ID %s found\n", URI->
fragment);
6974 xmlNodePtr subtree, newtree;
6977#ifdef WITH_XSLT_DEBUG
6979 "creating new document from %s for embedded stylesheet\n",
6986 subtree =
ID->parent;
6987 fake = xmlNewDoc(
NULL);
6993 fake->dict = doc->dict;
6995#ifdef WITH_XSLT_DEBUG
6997 "reusing dictionary from %s for embedded stylesheet\n",
7001 newtree = xmlDocCopyNode(subtree, fake, 1);
7003 fake->URL = xmlNodeGetBase(doc, subtree->parent);
7004#ifdef WITH_XSLT_DEBUG
7006 "set base URI for embedded stylesheet as %s\n",
7014 while ((subtree = subtree->parent) != (xmlNodePtr)doc) {
7015 for (
ns = subtree->ns;
ns;
ns =
ns->next) {
7020 xmlAddChild((xmlNodePtr)fake, newtree);
7033 base = xmlNodeGetBase(doc, (xmlNodePtr) doc);
7036#ifdef WITH_XSLT_DEBUG_PARSING
7038 "xsltLoadStylesheetPI : fetching %s\n", URL);
7043#ifdef WITH_XSLT_DEBUG_PARSING
7045 "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)
void xsltFreeStylePreComps(xsltStylesheetPtr style)
void xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr inst)
const xmlChar * xsltExtMarker
_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)
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)
XMLPUBFUN void xmlFreeRMutex(xmlRMutexPtr tok)
XMLPUBFUN xmlRMutexPtr xmlNewRMutex(void)
#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
void xmlDictFree(xmlDictPtr dict)
int xmlDictOwns(xmlDictPtr dict, const xmlChar *str)
int xmlDictReference(xmlDictPtr dict)
xmlDictPtr xmlDictCreate(void)
const xmlChar * xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len)
void * xmlGenericErrorContext
xmlReallocFunc xmlRealloc
xmlGenericErrorFunc xmlGenericError
void xmlHashFree(xmlHashTablePtr hash, xmlHashDeallocator dealloc)
void * xmlHashLookup(xmlHashTablePtr hash, const xmlChar *key)
xmlHashTablePtr xmlHashCreate(int size)
int xmlHashUpdateEntry(xmlHashTablePtr hash, const xmlChar *key, void *payload, xmlHashDeallocator dealloc)
int xmlHashAddEntry2(xmlHashTablePtr hash, const xmlChar *key, const xmlChar *key2, void *payload)
xsltDecimalFormatPtr decimalFormat
struct _xsltTemplate * next
struct _xsltStylesheet * style
xsltRuntimeExtraPtr extras
Character const *const prefix
XMLPUBFUN xmlChar * xmlBuildURI(const xmlChar *URI, const xmlChar *base)
XMLPUBFUN void xmlFreeURI(xmlURIPtr uri)
XMLPUBFUN xmlURIPtr xmlParseURI(const char *str)
XMLPUBFUN xmlAttrPtr xmlGetID(xmlDocPtr doc, const xmlChar *ID)
void xsltParseGlobalVariable(xsltStylesheetPtr style, xmlNodePtr cur)
void xsltParseGlobalParam(xsltStylesheetPtr style, xmlNodePtr cur)
void xsltFreeStackElemList(xsltStackElemPtr elem)
XMLPUBFUN xmlChar * xmlStrndup(const xmlChar *cur, int len)
XMLPUBFUN int xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN int xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN xmlChar * xmlStrdup(const xmlChar *cur)
@ 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)
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)