14#define WITH_XSLT_DEBUG_ATTRIBUTES
16#define WITH_XSLT_DEBUG_ATTRIBUTES
26#define IS_BLANK(c) (((c) == 0x20) || ((c) == 0x09) || ((c) == 0xA) || \
29#define IS_BLANK_NODE(n) \
30 (((n)->type == XML_TEXT_NODE) && (xsltIsBlank((n)->content)))
32#define ATTRSET_UNRESOLVED 0
33#define ATTRSET_RESOLVING 1
34#define ATTRSET_RESOLVED 2
99 "xsltNewAttrElem : malloc failed\n");
180 "xsltNewUseAttrSet : malloc failed\n");
184 cur->ncname = ncname;
238 if ((
cur->ncname == ncname) && (
cur->ns ==
ns))
264 "xsltNewAttrSet : malloc failed\n");
301 while (old !=
NULL) {
311 if ((curComp->
name == oldComp->
name) &&
312 (curComp->
ns == oldComp->
ns)) {
362 "xsl:attribute-set : name is missing\n");
368 if (xmlValidateQName(
value, 0)) {
370 "xsl:attribute-set : The name '%s' is not a valid QName.\n",
380 if (prefix !=
NULL) {
384 "xsl:attribute-set : No namespace found for QName '%s:%s'\n",
393#ifdef WITH_XSLT_DEBUG_ATTRIBUTES
395 "creating attribute set table\n");
424 "xsl:attribute-set : unexpected child %s\n",
428 "xsl:attribute-set : child of unexpected type\n");
431 "xsl:attribute-set : unexpected child xsl:%s\n",
434#ifdef WITH_XSLT_DEBUG_ATTRIBUTES
436 "add attribute to list %s\n", ncname);
440#ifdef XSLT_REFACTORED
441 xsltParseSequenceConstructor(XSLT_CCTXT(
style),
449 "xsl:attribute-set : internal error, attribute %s not "
450 "compiled\n",
child->name);
465 const xmlChar *curval, *endval;
467 while (*curval != 0) {
472 while ((*endval != 0) && (!
IS_BLANK(*endval))) endval++;
479#ifdef WITH_XSLT_DEBUG_ATTRIBUTES
481 "xsl:attribute-set : %s adds use %s\n", ncname, curval);
484 if (xmlValidateQName(curval, 0)) {
486 "xsl:attribute-set : The name '%s' in "
487 "use-attribute-sets is not a valid QName.\n", curval);
494 if (prefix2 !=
NULL) {
498 "xsl:attribute-set : No namespace found for QName "
499 "'%s:%s' in use-attribute-sets\n",
516#ifdef WITH_XSLT_DEBUG_ATTRIBUTES
518 "updated attribute list %s\n", ncname);
538 while (use !=
NULL) {
544 if (
cur->attributeSets) {
587 "xsl:attribute-set : use-attribute-sets recursion detected"
595 "xsl:attribute-set : use-attribute-sets maximum recursion "
596 "depth exceeded on %s\n",
name);
608 if (
cur->attributeSets !=
NULL) {
612#ifdef WITH_XSLT_DEBUG_ATTRIBUTES
614 "xsl:attribute-set : merging import for %s\n",
name);
650 if (
style != topStyle) {
657 "xsl:attribute-set : internal error, can't move imported "
658 " attribute set %s\n",
name);
674#ifdef WITH_XSLT_DEBUG_ATTRIBUTES
676 "Resolving attribute sets references\n");
681 if (
cur->attributeSets !=
NULL) {
683#ifdef WITH_XSLT_DEBUG_ATTRIBUTES
685 "creating attribute set table\n");
721#ifdef XSLT_REFACTORED
722 xsltStyleItemAttributePtr comp =
723 (xsltStyleItemAttributePtr) castedComp;
734 if ((ctxt ==
NULL) || (contextNode ==
NULL) || (inst ==
NULL) ||
759 "Internal error in xsltAttribute(): "
760 "The XSLT 'attribute' instruction was not compiled.\n");
777 targetElem = ctxt->
insert;
797 "xsl:attribute: Cannot add attributes to an "
798 "element if children have been already added "
799 "to the element.\n");
813 if (comp->name ==
NULL) {
819 "xsl:attribute: The attribute 'name' is missing.\n");
822 if (xmlValidateQName(prop, 0)) {
824 "xsl:attribute: The effective name '%s' is not a "
825 "valid QName.\n", prop);
834 "xsl:attribute: The effective name 'xmlns' is not allowed.\n");
845#ifdef XSLT_REFACTORED
846 prefix = comp->nsPrefix;
863 if (comp->ns !=
NULL) {
867 if (comp->ns[0] != 0)
885 if ((tmpNsName !=
NULL) && (tmpNsName[0] != 0))
892 "xsl:attribute: Namespace http://www.w3.org/2000/xmlns/ "
901 }
else if (prefix !=
NULL) {
916 "xsl:attribute: The QName '%s:%s' has no "
917 "namespace binding in scope in the stylesheet; "
918 "this is an error, since the namespace was not "
919 "specified by the instruction itself.\n", prefix,
name);
940 if (nsName !=
NULL) {
944 ns = xsltTreeAcquireStoredNs(some doc, nsName, prefix);
949 if (nsName !=
NULL) {
974 "Namespace fixup error: Failed to acquire an in-scope "
975 "namespace binding for the generated attribute '{%s}%s'.\n",
1010 if (copyTxt ==
NULL)
1029 if (copyTxt ==
NULL)
1032 attr->children =
attr->last = copyTxt;
1092 const xmlChar *curstr, *endstr;
1096 if (attrSets ==
NULL) {
1105 attrSets = ((
xmlAttrPtr) inst)->children->content;
1108 if (attrSets ==
NULL) {
1120 while (*curstr != 0) {
1126 while ((*endstr != 0) && (!
IS_BLANK(*endstr)))
1133#ifdef WITH_XSLT_DEBUG_ATTRIBUTES
1135 "apply attribute set %s\n", curstr);
1138 if (xmlValidateQName(curstr, 0)) {
1140 "The name '%s' in use-attribute-sets is not a valid "
1141 "QName.\n", curstr);
1146 if (prefix !=
NULL) {
1150 "use-attribute-set : No namespace found for QName "
1151 "'%s:%s'\n", prefix, ncname);
static void xsltFreeAttrElem(xsltAttrElemPtr attr)
static xsltAttrElemPtr xsltAddAttrElemList(xsltAttrElemPtr list, xmlNodePtr attr)
#define ATTRSET_RESOLVING
void xsltResolveStylesheetAttributeSet(xsltStylesheetPtr style)
static void xsltFreeUseAttrSet(xsltUseAttrSetPtr use)
static void xsltFreeAttrElemList(xsltAttrElemPtr list)
xsltAttrSet * xsltAttrSetPtr
static xsltUseAttrSetPtr xsltAddUseAttrSetList(xsltUseAttrSetPtr list, const xmlChar *ncname, const xmlChar *ns)
static void xsltFreeAttrSet(xsltAttrSetPtr set)
void xsltParseStylesheetAttributeSet(xsltStylesheetPtr style, xmlNodePtr cur)
static void xsltFreeAttributeSetsEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED)
static xsltUseAttrSetPtr xsltNewUseAttrSet(const xmlChar *ncname, const xmlChar *ns)
static xsltAttrSetPtr xsltNewAttrSet()
xsltUseAttrSet * xsltUseAttrSetPtr
void xsltApplyAttributeSet(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, const xmlChar *attrSets)
static void xsltResolveUseAttrSets(xsltAttrSetPtr set, xsltStylesheetPtr topStyle, int depth)
static void xsltResolveSASCallback(void *payload, void *data, const xmlChar *name, const xmlChar *ns, ATTRIBUTE_UNUSED const xmlChar *ignored)
static void xsltResolveAttrSet(xsltAttrSetPtr set, xsltStylesheetPtr topStyle, xsltStylesheetPtr style, const xmlChar *name, const xmlChar *ns, int depth)
static void xsltFreeUseAttrSetList(xsltUseAttrSetPtr list)
static void xsltMergeAttrSets(xsltAttrSetPtr set, xsltAttrSetPtr other)
void xsltAttribute(xsltTransformContextPtr ctxt, xmlNodePtr contextNode, xmlNodePtr inst, xsltElemPreCompPtr castedComp)
static xsltAttrElemPtr xsltNewAttrElem(xmlNodePtr attr)
xsltAttrSetContext * xsltAttrSetContextPtr
void xsltFreeAttributeSetsHashes(xsltStylesheetPtr style)
xsltAttrElem * xsltAttrElemPtr
void xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr inst)
GLint GLint GLsizei GLsizei GLsizei depth
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
xsltStylesheetPtr xsltNextImport(xsltStylesheetPtr cur)
xmlNsPtr xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode, const xmlChar *nsName, const xmlChar *nsPrefix, xmlNodePtr target)
XMLPUBVAR const xmlChar xmlStringTextNoenc[]
static unsigned __int64 next
XMLPUBFUN const xmlChar *XMLCALL xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len)
XMLPUBVAR xmlMallocFunc xmlMalloc
XMLPUBVAR xmlFreeFunc xmlFree
XMLPUBFUN int XMLCALL xmlHashAddEntry2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, void *userdata)
XMLPUBFUN void XMLCALL xmlHashFree(xmlHashTablePtr table, xmlHashDeallocator f)
XMLPUBFUN int XMLCALL xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, xmlHashDeallocator f)
XMLPUBFUN xmlHashTablePtr XMLCALL xmlHashCreate(int size)
XMLPUBFUN void XMLCALL xmlHashScanFull(xmlHashTablePtr table, xmlHashScannerFull f, void *data)
XMLPUBFUN void *XMLCALL xmlHashLookup2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2)
XMLPUBFUN xmlNsPtr XMLCALL xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace)
XMLPUBFUN xmlChar *XMLCALL xmlGetNsProp(const xmlNode *node, const xmlChar *name, const xmlChar *nameSpace)
XMLPUBFUN xmlNodePtr XMLCALL xmlNewText(const xmlChar *content)
#define XML_XML_NAMESPACE
struct _xmlNode * children
struct _xsltAttrElem * next
xsltStylesheetPtr topStyle
xsltUseAttrSetPtr useAttrSets
xmlHashTablePtr attributeSets
struct _xsltUseAttrSet * next
xmlChar * xsltEvalAttrValueTemplate(xsltTransformContextPtr ctxt, xmlNodePtr inst, const xmlChar *name, const xmlChar *ns)
xmlChar * xsltEvalTemplateString(xsltTransformContextPtr ctxt, xmlNodePtr contextNode, xmlNodePtr inst)
XMLPUBFUN xmlIDPtr XMLCALL xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr)
XMLPUBFUN int XMLCALL xmlIsID(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr)
XMLPUBFUN xmlChar *XMLCALL xmlStrdup(const xmlChar *cur)
XMLPUBFUN int XMLCALL xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
xsltStylePreComp * xsltStylePreCompPtr
void xsltParseTemplateContent(xsltStylesheetPtr style, xmlNodePtr templ)
void xsltTransformError(xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node, const char *msg,...)
xmlGenericErrorFunc xsltGenericError
xmlGenericErrorFunc xsltGenericDebug
void * xsltGenericDebugContext
void * xsltGenericErrorContext
const xmlChar * xsltSplitQName(xmlDictPtr dict, const xmlChar *name, const xmlChar **prefix)
#define IS_XSLT_NAME(n, val)