xsltStackElemPtr withParams = NULL;
int oldXPProximityPosition, oldXPContextSize;
const xmlChar *oldMode, *oldModeURI;
- xmlDocPtr oldDoc;
+ xmlDocPtr oldXPDoc;
xsltDocumentPtr oldDocInfo;
xmlXPathContextPtr xpctxt;
oldMode = ctxt->mode;
oldModeURI = ctxt->modeURI;
oldDocInfo = ctxt->document;
- oldDoc = ctxt->tmpDoc;
oldList = ctxt->nodeList;
/*
*/
oldXPContextSize = xpctxt->contextSize;
oldXPProximityPosition = xpctxt->proximityPosition;
+ oldXPDoc = xpctxt->doc;
/*
* Set up contexts.
/*
* Restore context states.
*/
- xpctxt->doc = oldDoc;
+ xpctxt->doc = oldXPDoc;
xpctxt->contextSize = oldXPContextSize;
xpctxt->proximityPosition = oldXPProximityPosition;
-
- ctxt->tmpDoc = oldDoc;
+
ctxt->document = oldDocInfo;
ctxt->nodeList = oldList;
ctxt->node = oldContextNode;
int oldXPProximityPosition, oldXPContextSize;
xmlNodePtr oldContextNode;
xsltTemplatePtr oldCurTemplRule;
- xmlDocPtr oldSourceDoc;
+ xmlDocPtr oldXPDoc;
xsltDocumentPtr oldDocInfo;
xmlXPathContextPtr xpctxt;
* Save context states.
*/
oldDocInfo = ctxt->document;
- oldList = ctxt->nodeList;
- oldSourceDoc = ctxt->tmpDoc;
+ oldList = ctxt->nodeList;
oldContextNode = ctxt->node;
/*
* The "current template rule" is cleared for the instantiation of
oldCurTemplRule = ctxt->currentTemplateRule;
ctxt->currentTemplateRule = NULL;
+ oldXPDoc = xpctxt->doc;
oldXPProximityPosition = xpctxt->proximityPosition;
oldXPContextSize = xpctxt->contextSize;
/*
/*
* Restore old states.
*/
- ctxt->tmpDoc = oldSourceDoc;
ctxt->document = oldDocInfo;
ctxt->nodeList = oldList;
ctxt->node = oldContextNode;
ctxt->currentTemplateRule = oldCurTemplRule;
- xpctxt->doc = oldSourceDoc;
+ xpctxt->doc = oldXPDoc;
xpctxt->contextSize = oldXPContextSize;
xpctxt->proximityPosition = oldXPProximityPosition;
}
/*
* Evaluate global params and user-provided params.
*/
- ctxt->tmpDoc = doc;
ctxt->node = (xmlNodePtr) doc;
if (ctxt->globalVars == NULL)
ctxt->globalVars = xmlHashCreate(20);
xsltCountKeys(ctxt);
#endif
- ctxt->tmpDoc = doc;
ctxt->node = (xmlNodePtr) doc;
ctxt->output = res;
ctxt->insert = (xmlNodePtr) res;
int oldXPProximityPosition, oldXPContextSize, oldXPNsNr;
xmlNsPtr *oldXPNamespaces;
xmlXPathContextPtr xpctxt = ctxt->xpathCtxt;
- /*
- * SPEC XSLT 1.0:
- * "At top-level, the expression or template specifying the
- * variable value is evaluated with the same context as that used
- * to process the root node of the source document: the current
- * node is the root node of the source document and the current
- * node list is a list containing just the root node of the source
- * document."
- */
- xpctxt->doc = ctxt->tmpDoc;
+
/*
* Save context states.
*/
oldXPContextSize = xpctxt->contextSize;
oldXPNamespaces = xpctxt->namespaces;
oldXPNsNr = xpctxt->nsNr;
-
- xpctxt->node = ctxt->initialContextNode;
- xpctxt->doc = ctxt->initialContextDoc;
+
+ /*
+ * SPEC XSLT 1.0:
+ * "At top-level, the expression or template specifying the
+ * variable value is evaluated with the same context as that used
+ * to process the root node of the source document: the current
+ * node is the root node of the source document and the current
+ * node list is a list containing just the root node of the source
+ * document."
+ */
+ xpctxt->doc = ctxt->initialContextDoc;
+ xpctxt->node = ctxt->initialContextNode;
xpctxt->contextSize = 1;
xpctxt->proximityPosition = 1;
/*