33#define WITH_XSLT_DEBUG_KEYS
62 "xsltNewKeyDef : malloc failed\n");
85 xmlXPathFreeCompExpr(keyd->
comp);
87 xmlXPathFreeCompExpr(keyd->
usecomp);
112 while (keyd !=
NULL) {
135 "xsltNewKeyTable : malloc failed\n");
149 xmlXPathFreeNodeSet((xmlNodeSetPtr) payload);
182 while (keyt !=
NULL) {
255 }
else if (
cur[
end] ==
'[') {
257 }
else if (
cur[
end] ==
']') {
283 const xmlChar *use, xmlNodePtr inst) {
291#ifdef WITH_XSLT_DEBUG_KEYS
293 "Add key %s, match %s, use %s\n",
name,
match, use);
302 key->nsList = xmlGetNsList(inst->doc, inst);
323 "xsl:key : 'match' pattern is malformed: %s",
333 "xsl:key : 'match' pattern is empty\n");
358 "xsl:key : 'match' pattern is empty\n");
362#ifdef WITH_XSLT_DEBUG_KEYS
364 " resulting pattern %s\n",
pattern);
374#ifdef XML_XPATH_NOVAR
381 "xsl:key : 'match' pattern compilation failed '%s'\n",
385#ifdef XML_XPATH_NOVAR
392 "xsl:key : 'use' expression compilation failed '%s'\n",
447#ifdef WITH_XSLT_DEBUG_KEYS
515 (nameURI !=
NULL)) &&
529#ifdef WITH_XSLT_DEBUG_KEYS
531 "xsltInitDocKeyTable: did not found %s\n",
name));
534 "Failed to find key definition for %s\n",
name);
629 xmlXPathObjectPtr matchRes =
NULL, useRes =
NULL;
632 xmlNodePtr oldInst,
cur;
633 xmlNodePtr oldContextNode;
635 int oldXPPos, oldXPSize;
636 xmlNodePtr oldXPNode;
639 xmlNsPtr *oldXPNamespaces;
640 xmlXPathContextPtr xpctxt;
653#ifdef WITH_XSLT_DEBUG_KEYS
656 "xsltInitCtxtKey: key definition of %s is recursive\n",
660 "Key definition for %s is recursive\n", keyDef->
name);
671 oldInst = ctxt->
inst;
673 oldContextNode = ctxt->
node;
675 oldXPNode = xpctxt->node;
676 oldXPDoc = xpctxt->doc;
677 oldXPPos = xpctxt->proximityPosition;
678 oldXPSize = xpctxt->contextSize;
679 oldXPNsNr = xpctxt->nsNr;
680 oldXPNamespaces = xpctxt->namespaces;
686 ctxt->
node = (xmlNodePtr) idoc->
doc;
689 xpctxt->doc = idoc->
doc;
690 xpctxt->node = (xmlNodePtr) idoc->
doc;
692 xpctxt->namespaces = keyDef->
nsList;
693 xpctxt->nsNr = keyDef->
nsNr;
699 matchRes = xmlXPathCompiledEval(keyDef->
comp, xpctxt);
700 if (matchRes ==
NULL) {
702#ifdef WITH_XSLT_DEBUG_KEYS
704 "xsltInitCtxtKey: %s evaluation failed\n", keyDef->
match));
707 "Failed to evaluate the 'match' expression.\n");
711 if (matchRes->type == XPATH_NODESET) {
712 matchList = matchRes->nodesetval;
714#ifdef WITH_XSLT_DEBUG_KEYS
715 if (matchList !=
NULL)
717 "xsltInitCtxtKey: %s evaluates to %d nodes\n",
718 keyDef->
match, matchList->nodeNr));
724#ifdef WITH_XSLT_DEBUG_KEYS
726 "xsltInitCtxtKey: %s is not a node set\n", keyDef->
match));
729 "The 'match' expression did not evaluate to a node set.\n");
734 if ((matchList ==
NULL) || (matchList->nodeNr <= 0))
768 xpctxt->contextSize = 1;
769 xpctxt->proximityPosition = 1;
771 for (
i = 0;
i < matchList->nodeNr;
i++) {
772 cur = matchList->nodeTab[
i];
785 xmlXPathFreeObject(useRes);
786 useRes = xmlXPathCompiledEval(keyDef->
usecomp, xpctxt);
787 if (useRes ==
NULL) {
789 "Failed to evaluate the 'use' expression.\n");
793 if (useRes->type == XPATH_NODESET) {
794 if ((useRes->nodesetval !=
NULL) &&
795 (useRes->nodesetval->nodeNr != 0))
797 len = useRes->nodesetval->nodeNr;
798 str = xmlXPathCastNodeToString(useRes->nodesetval->nodeTab[0]);
804 if (useRes->type == XPATH_STRING) {
808 str = useRes->stringval;
809 useRes->stringval =
NULL;
811 str = xmlXPathCastToString(useRes);
822#ifdef WITH_XSLT_DEBUG_KEYS
824 "xsl:key : node associated to ('%s', '%s')\n", keyDef->
name,
str));
850 str = xmlXPathCastNodeToString(useRes->nodesetval->nodeTab[
k]);
860 xpctxt->node = oldXPNode;
861 xpctxt->doc = oldXPDoc;
862 xpctxt->nsNr = oldXPNsNr;
863 xpctxt->namespaces = oldXPNamespaces;
864 xpctxt->proximityPosition = oldXPPos;
865 xpctxt->contextSize = oldXPSize;
867 ctxt->
node = oldContextNode;
869 ctxt->
inst = oldInst;
874 xmlXPathFreeObject(useRes);
875 if (matchRes !=
NULL)
876 xmlXPathFreeObject(matchRes);
894 if ((ctxt ==
NULL) || (idoc ==
NULL))
901#ifdef WITH_XSLT_DEBUG_KEYS
912 keyDef = keyDef->
next;
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
int WINAPIV fprintf(FILE *file, const char *format,...)
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)
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
void xmlHashFree(xmlHashTablePtr hash, xmlHashDeallocator dealloc)
void * xmlHashLookup(xmlHashTablePtr hash, const xmlChar *key)
int xmlHashAddEntry(xmlHashTablePtr hash, const xmlChar *key, void *payload)
xmlHashTablePtr xmlHashCreate(int size)
struct _xsltKeyDef * next
xmlXPathCompExprPtr usecomp
struct _xsltKeyTable * next
xmlXPathContextPtr xpathCtxt
XMLPUBFUN xmlChar * xmlStrncat(xmlChar *cur, const xmlChar *add, int len)
XMLPUBFUN xmlChar * xmlStrcat(xmlChar *cur, const xmlChar *add)
XMLPUBFUN int xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN xmlChar * xmlStrdup(const xmlChar *cur)
xsltKeyDef * xsltKeyDefPtr
xsltKeyTable * xsltKeyTablePtr
void xsltTransformError(xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node, const char *msg,...)
xmlXPathCompExprPtr xsltXPathCompileFlags(xsltStylesheetPtr style, const xmlChar *str, int flags)
int xsltSetSourceNodeFlags(xsltTransformContextPtr ctxt, xmlNodePtr node, 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)