15#define WITH_XSLT_DEBUG_KEYS
44 "xsltNewKeyDef : malloc failed\n");
67 xmlXPathFreeCompExpr(keyd->
comp);
69 xmlXPathFreeCompExpr(keyd->
usecomp);
94 while (keyd !=
NULL) {
117 "xsltNewKeyTable : malloc failed\n");
131 xmlXPathFreeNodeSet((xmlNodeSetPtr) payload);
164 while (keyt !=
NULL) {
237 }
else if (
cur[
end] ==
'[') {
239 }
else if (
cur[
end] ==
']') {
273#ifdef WITH_XSLT_DEBUG_KEYS
275 "Add key %s, match %s, use %s\n",
name,
match, use);
282 key->nsList = xmlGetNsList(inst->
doc, inst);
303 "xsl:key : 'match' pattern is malformed: %s",
313 "xsl:key : 'match' pattern is empty\n");
338 "xsl:key : 'match' pattern is empty\n");
342#ifdef WITH_XSLT_DEBUG_KEYS
344 " resulting pattern %s\n",
pattern);
354#ifdef XML_XPATH_NOVAR
361 "xsl:key : 'match' pattern compilation failed '%s'\n",
365#ifdef XML_XPATH_NOVAR
372 "xsl:key : 'use' expression compilation failed '%s'\n",
427#ifdef WITH_XSLT_DEBUG_KEYS
495 (nameURI !=
NULL)) &&
509#ifdef WITH_XSLT_DEBUG_KEYS
511 "xsltInitDocKeyTable: did not found %s\n",
name));
514 "Failed to find key definition for %s\n",
name);
609 xmlXPathObjectPtr matchRes =
NULL, useRes =
NULL;
615 int oldXPPos, oldXPSize;
620 xmlXPathContextPtr xpctxt;
633#ifdef WITH_XSLT_DEBUG_KEYS
636 "xsltInitCtxtKey: key definition of %s is recursive\n",
640 "Key definition for %s is recursive\n", keyDef->
name);
651 oldInst = ctxt->
inst;
653 oldContextNode = ctxt->
node;
655 oldXPNode = xpctxt->node;
656 oldXPDoc = xpctxt->
doc;
657 oldXPPos = xpctxt->proximityPosition;
658 oldXPSize = xpctxt->contextSize;
659 oldXPNsNr = xpctxt->nsNr;
660 oldXPNamespaces = xpctxt->namespaces;
672 xpctxt->namespaces = keyDef->
nsList;
673 xpctxt->nsNr = keyDef->
nsNr;
679 matchRes = xmlXPathCompiledEval(keyDef->
comp, xpctxt);
680 if (matchRes ==
NULL) {
682#ifdef WITH_XSLT_DEBUG_KEYS
684 "xsltInitCtxtKey: %s evaluation failed\n", keyDef->
match));
687 "Failed to evaluate the 'match' expression.\n");
691 if (matchRes->type == XPATH_NODESET) {
692 matchList = matchRes->nodesetval;
694#ifdef WITH_XSLT_DEBUG_KEYS
695 if (matchList !=
NULL)
697 "xsltInitCtxtKey: %s evaluates to %d nodes\n",
698 keyDef->
match, matchList->nodeNr));
704#ifdef WITH_XSLT_DEBUG_KEYS
706 "xsltInitCtxtKey: %s is not a node set\n", keyDef->
match));
709 "The 'match' expression did not evaluate to a node set.\n");
714 if ((matchList ==
NULL) || (matchList->nodeNr <= 0))
748 xpctxt->contextSize = 1;
749 xpctxt->proximityPosition = 1;
751 for (
i = 0;
i < matchList->nodeNr;
i++) {
752 cur = matchList->nodeTab[
i];
765 xmlXPathFreeObject(useRes);
766 useRes = xmlXPathCompiledEval(keyDef->
usecomp, xpctxt);
767 if (useRes ==
NULL) {
769 "Failed to evaluate the 'use' expression.\n");
773 if (useRes->type == XPATH_NODESET) {
774 if ((useRes->nodesetval !=
NULL) &&
775 (useRes->nodesetval->nodeNr != 0))
777 len = useRes->nodesetval->nodeNr;
778 str = xmlXPathCastNodeToString(useRes->nodesetval->nodeTab[0]);
784 if (useRes->type == XPATH_STRING) {
788 str = useRes->stringval;
789 useRes->stringval =
NULL;
791 str = xmlXPathCastToString(useRes);
802#ifdef WITH_XSLT_DEBUG_KEYS
804 "xsl:key : node associated to ('%s', '%s')\n", keyDef->
name,
str));
844 str = xmlXPathCastNodeToString(useRes->nodesetval->nodeTab[
k]);
854 xpctxt->node = oldXPNode;
855 xpctxt->
doc = oldXPDoc;
856 xpctxt->nsNr = oldXPNsNr;
857 xpctxt->namespaces = oldXPNamespaces;
858 xpctxt->proximityPosition = oldXPPos;
859 xpctxt->contextSize = oldXPSize;
861 ctxt->
node = oldContextNode;
863 ctxt->
inst = oldInst;
868 xmlXPathFreeObject(useRes);
869 if (matchRes !=
NULL)
870 xmlXPathFreeObject(matchRes);
888 if ((ctxt ==
NULL) || (idoc ==
NULL))
895#ifdef WITH_XSLT_DEBUG_KEYS
906 keyDef = keyDef->
next;
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
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
xsltStylesheetPtr xsltNextImport(xsltStylesheetPtr cur)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
int xsltAddKey(xsltStylesheetPtr style, const xmlChar *name, const xmlChar *nameURI, const xmlChar *match, const xmlChar *use, xmlNodePtr inst)
static int skipString(const xmlChar *cur, int end)
int xsltInitCtxtKey(xsltTransformContextPtr ctxt, xsltDocumentPtr idoc, xsltKeyDefPtr keyDef)
static void xsltFreeKeyDefList(xsltKeyDefPtr keyd)
static xsltKeyDefPtr xsltNewKeyDef(const xmlChar *name, const xmlChar *nameURI)
static xsltKeyTablePtr xsltNewKeyTable(const xmlChar *name, const xmlChar *nameURI)
static void xsltFreeNodeSetEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED)
void xsltInitCtxtKeys(xsltTransformContextPtr ctxt, xsltDocumentPtr idoc)
static int xsltInitDocKeyTable(xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *nameURI)
static void xsltFreeKeyTableList(xsltKeyTablePtr keyt)
static int skipPredicate(const xmlChar *cur, int end)
static void xsltFreeKeyDef(xsltKeyDefPtr keyd)
void xsltFreeKeys(xsltStylesheetPtr style)
int xsltInitAllDocKeys(xsltTransformContextPtr ctxt)
static void xsltFreeKeyTable(xsltKeyTablePtr keyt)
void xsltFreeDocumentKeys(xsltDocumentPtr idoc)
xmlNodeSetPtr xsltGetKey(xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *nameURI, const xmlChar *value)
struct task_struct * current
XMLPUBVAR xmlMallocFunc xmlMalloc
XMLPUBVAR xmlFreeFunc xmlFree
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 xmlHashAddEntry(xmlHashTablePtr table, const xmlChar *name, void *userdata)
struct _xsltKeyDef * next
xmlXPathCompExprPtr usecomp
struct _xsltKeyTable * next
xmlXPathContextPtr xpathCtxt
XMLPUBFUN xmlChar *XMLCALL xmlStrcat(xmlChar *cur, const xmlChar *add)
XMLPUBFUN xmlChar *XMLCALL xmlStrncat(xmlChar *cur, const xmlChar *add, int len)
XMLPUBFUN xmlChar *XMLCALL xmlStrdup(const xmlChar *cur)
XMLPUBFUN int XMLCALL xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
xsltKeyDef * xsltKeyDefPtr
xsltKeyTable * xsltKeyTablePtr
void xsltTransformError(xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node, const char *msg,...)
xmlXPathCompExprPtr xsltXPathCompileFlags(xsltStylesheetPtr style, const xmlChar *str, int flags)
xmlXPathCompExprPtr xsltXPathCompile(xsltStylesheetPtr style, const xmlChar *str)
xmlGenericErrorFunc xsltGenericDebug
void * xsltGenericDebugContext
#define IS_XSLT_REAL_NODE(n)
#define XSLT_TRACE(ctxt, code, call)