#include "imports.h"
#include "transform.h"
+#ifdef WITH_DEBUGGER
+#include "../breakpoint/breakpoint.h"
+#endif
#ifdef WITH_XSLT_DEBUG
#define WITH_XSLT_DEBUG_ATTRIBUTES
#endif
"xsl:attribute : node already has children\n");
return;
}
+
+#ifdef WITH_DEBUGGER
+ /* --- break point code --- */
+ if (xslDebugStatus != DEBUG_NONE) {
+ xslHandleDebugger(inst, node, NULL, ctxt);
+ }
+#endif
+
if (comp->name == NULL) {
prop = xsltEvalAttrValueTemplate(ctxt, inst, (const xmlChar *)"name",
XSLT_NAMESPACE);
}
style = ctxt->style;
+#ifdef WITH_DEBUGGER
+ /* --- break point code --- */
+ if (style && (xslDebugStatus != DEBUG_NONE)) {
+ values = xmlHashLookup2(style->attributeSets, ncname, prefix);
+ if (values)
+ xslHandleDebugger(values->attr->parent, node, NULL, ctxt);
+ }
+#endif
while (style != NULL) {
values = xmlHashLookup2(style->attributeSets, ncname, prefix);
while (values != NULL) {
int maxStep;
xmlNsPtr *nsList; /* the namespaces in scope */
int nsNr; /* the number of namespaces in scope */
- xsltStepOp steps[20]; /* ops for computation */
+ xsltStepOp steps[40]; /* ops for computation */
};
typedef struct _xsltParserContext xsltParserContext;
return(NULL);
}
memset(cur, 0, sizeof(xsltCompMatch));
- cur->maxStep = 20;
+ cur->maxStep = 40;
cur->nsNr = 0;
cur->nsList = NULL;
return(cur);
static int
xsltCompMatchAdd(xsltCompMatchPtr comp, xsltOp op, xmlChar *value,
xmlChar *value2) {
- if (comp->nbStep >= 20) {
+ if (comp->nbStep >= 40) {
xsltPrintErrorContext(NULL, NULL, NULL); /* TODO */
xsltGenericError(xsltGenericErrorContext,
"xsltCompMatchAdd: overflow\n");
}
}
-#ifdef WITH_DEBUGGER
-
-/* make it eaier to reuse the code for handling checking of debug
- status and breaking to debugger if needed */
/**
* xslHandleDebugger:
* to the xslDebugBreak function
*/
void
-xslHandleDebugger(xmlNodePtr cur, xmlNodePtr node,
- xsltTemplatePtr templ, xsltTransformContextPtr ctxt)
+xslHandleDebugger(xmlNodePtr cur ATTRIBUTE_UNUSED, xmlNodePtr node ATTRIBUTE_UNUSED,
+ xsltTemplatePtr templ ATTRIBUTE_UNUSED, xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED)
{
- xslSetActiveBreakPoint(0);
-
- switch (xslDebugStatus) {
-
- /* A temparary stopping point */
- case DEBUG_STOP:
- xslDebugStatus = DEBUG_CONT;
- /* only allow breakpoints at xml elements */
- if (xmlGetLineNo(cur) != -1)
- xslDebugBreak(cur, node, templ, ctxt);
- break;
-
- case DEBUG_STEP:
- /* only allow breakpoints at xml elements */
- if (xmlGetLineNo(cur) != -1)
- xslDebugBreak(cur, node, templ, ctxt);
- break;
-
- case DEBUG_CONT:
- {
- int breakPoint = xslIsBreakPointNode(cur);
-
- if (breakPoint) {
- if (xslIsBreakPointEnabled(breakPoint) == 1) {
- xslSetActiveBreakPoint(breakPoint);
- xslDebugBreak(cur, node, templ, ctxt);
- }
- } else {
- breakPoint = xslIsBreakPointNode(node);
- if (xslIsBreakPointEnabled(breakPoint) == 1) {
- xslSetActiveBreakPoint(breakPoint);
- xslDebugBreak(cur, node, templ, ctxt);
- }
- }
- }
- break;
- }
}
-#else
-void
-xslHandleDebugger(xmlNodePtr cur, xmlNodePtr node,
- xsltTemplatePtr templ, xsltTransformContextPtr ctxt)
-{
-}
-#endif
-
/**
* xsltApplyOneTemplate:
if (templ)
xslHandleDebugger(templ->elem, node, templ, ctxt);
- else
- xslHandleDebugger(list, node, templ, ctxt);
-
+ else if (list)
+ xslHandleDebugger(list, node, templ, ctxt);
+ else if (ctxt->inst)
+ xslHandleDebugger(ctxt->inst, node, templ, ctxt);
}
/* -- end --- */
#endif