<oXygen/> User Guide

Working with Debugger

This section explains the working process for using Debugger perspective.

Getting Started

Oxygen provides two perspectives, Editor and Debugger. Oxygen starts by default in the Editor perspective. Switching between Editor and Debugger perspectives is easy and can be done at any time during a working session even when no files have been opened. To start Debugger perspective click the button .

Unlike Editor perspective, Debugger perspective requires that at least one document (XML) and one stylesheet (XSL) is open before the debug functionality and features become of any use. These files can be opened while in Editor perspective, before switching to Debugger perspective, or directly from within the Debugger perspective. This enables opening and closing of both file types at any stage in a working session. Switch back to Editor perspective by clicking the Editor button .

When switching from Editor perspective to Debugging perspective, already open files are sorted by extension into the Source document view (XML) and Stylesheet document view (XSL) panes.

The Debug Process

The debug procedure below (see Typical Debug Process), assumes Oxygen is already in Debugger perspective with at least one document (XML) and stylesheet (XSL) already open. At the least, this number of documents is required in order to proceed with any debug process. To get started with XSLT debugging some samples have been provided. They can be found in the samples/debugger directory of your Oxygen installation.

While a debug process is running, it is advised that the process is stopped before attempting to edit source documents or stylesheets. Editing during an active debug process will result in inaccurate information being displayed in the Information View. The process must also be stopped in order to switch to Editor perspective.

During the process, transformation is taking place, as a result whenever the transformation engine reaches a node from a file not already open, that file will be opened into its respective pane and the node will be highlighted. This is most likely to happen in the cases of XML entity files or XSL imported/included files.

Errors encountered during debugging are reported on Oxygen results panel.

At the end of debugging process, only content from the following views is preserved (all other views are cleared):

Procedure 6.1. Typical Debug Process

  1. From Source document view (XML) select a source document.

  2. From Stylesheet document view (XSL) select a stylesheet document.

  3. From the Control Toolbar use the XML source selector control to select a source document.

  4. From the Control Toolbar use the XSL stylesheet selector control to select a stylesheet.

  5. From the Control Toolbar use the XSLT engine selector control to select one of the available processing engines.

  6. Configure the XSLT parameters. Once set, these parameters, are preserved between debugging sessions.

  7. Start the debugging using active control buttons (see Control view for description of control functions).

Understanding Information Views

Detailed information about debugger status is provided using views.

Context node view

The context node is a source node corresponding to the XSL expression being evaluated. It is also called the context of execution. The context node implicitly changes as the processor hits various steps (at the point where XPath expressions are evaluated). This node has the same value as evaluating '.' (dot) XPath expression on XPath watch view.

Figure 6.3. The Context node view

The Context node view

Table 6.1. Context node details

ColumnDescription
NameName of source (XML) node.
Attributes/ValueAttributes or value of the XML node. If attributes exists, these are shown under the form of attributeName="attributeValue", otherwise the text content of the node is shown.

XPath watch view

Shows XPath expressions to be evaluated during debugging. Expressions are evaluated dynamically as the processor changes its source context.

Figure 6.4. The XPath watch view

The XPath watch view

Table 6.2. XWatch details

ColumnDescription
ExpressionXPath expression to be evaluated (should be XPath 1.0 compliant).
ValueResult of XPath expression evaluation. Value has a type (see Possible Values in the section Variables view). For Node Set the number of nodes in the set is shown in parenthesis.
[Important]Remarks
  • Expressions having reference to variable names are not evaluated. In case of an XPath error, you get an Error line.

  • The expression list is not deleted at the end of transformation (it is preserved during sessions).

  • To insert a new expression click the last line on the expression column and enter it. Press enter on cell to commit.

  • To delete an expression click on its Expression column and delete its content. Press enter on cell to commit.

  • If the expression result type is a Node Set you can click on it (Value column) and you will see on the right side its value. (see Node set view).

Breakpoints view

Lists of all breakpoints set on documents. Once you set a breakpoint you get a line for it in this list. Breakpoints can be set on both XML and XSL documents.

Figure 6.5. The Breakpoints view

The Breakpoints view

Table 6.3. Breakpoints details

ColumnDescription
ResourceResource file where the breakpoint is set. Entire path of resource file is available as tooltip.
LineLine number inside resource where the breakpoint is set.
[Important]Valid Breakpoint
  • Not all set breakpoints are valid ones. For example if the breakpoint is set on one empty or commented line or the line is not reached by the processor (no template to match it, line containing only an end tag), that breakpoint is invalid.

  • The contextual menu on table has "Remove" and "Go to" options.

  • Clicking a record highlights the breakpoint line into the document.

Messages view

<xsl:message> instructions are one way to signal special situations encountered during transformation as well as a raw way of doing the debugging. This view shows all <xsl:message> calls executed by the XSLT processor during transformation.

Figure 6.6. The Messages view

The Messages view

Table 6.4. Messages details

ColumnDescription
MessageMessage content.
TerminateSignals if processor will terminate the transformation or not once it encounter it (true/false respectively)
ResourceResource file where <xsl:message> instruction is defined. The complete path of the resource is available as tooltip.
[Important]Remarks
  • Clicking a record from the table highlights the <xsl:message> declaration line.

Stack view

Shows the current execution stack of both source and style nodes. During transformation two stacks are managed: one of source nodes being processed and the other for stylesheet nodes being processed. Oxygen shows both node types into one common stack. The source (XML) nodes are preceded by a red color icon while stylesheet nodes are preceded by a green color icon. The advantage of this approach is that you can always see the source scope on which a stylesheet instruction is executed (the last red color node on the stack). The stack is oriented upside down.

Figure 6.7. The Stack view

The Stack view

Table 6.5. Stack details

ColumnDescription
# Order number, represents the depth of the node (0 is the stack base).
XML/XSL NodeNode from source or stylesheet document currently being processed. One particular stack node is the document root, noted as #document.
AttributesAttributes of the node (list of id="value" pairs).
ResourceResource file where the node is located. Entire path is available as tooltip.
[Important]Remarks
  • Clicking a record from the stack highlights that node location inside resource.

  • Using Saxon, the stylesheet elements are qualified with XSL proxy, while on Xalan you only see their names. (example <xsl:template> on Saxon and template on Xalan).

  • Only Saxon processor shows element attributes.

  • Xalan processor shows the "built-in" rules.

Trace history view

Usually the XSLT processors signal the following events during transformation:

  • entering a source (XML) node.

  • leaving a source (XML) node.

  • entering a stylesheet (XSL) node.

  • leaving a stylesheet (XSL) node.

The trace history catches all these events, so you can see how the process evolved. The red icon lines denote source nodes while the green icon lines denote stylesheet nodes.

Figure 6.8. The Trace History View

The Trace History View

Table 6.6. Trace History details

ColumnDescription
DepthStarts from 0 and represents the level of overlapping for that node. This is similar with the # order number from stack at the moment the node was processed.
XML/XSL NodeRepresents the node from the processed source or stylesheet document. One particular node is the document root, noted as #document. Every node has an arrow in front of it representing what action was performed on it (entering or leaving).
AttributesAttributes of the node (list of id="value" pairs).
ResourceResource file where the node is located. Complete path to resource file is provided as tooltip.
[Important]Remarks
  • Clicking a record highlights that node location inside the resource.

  • Only Saxon processor shows element attributes.

  • Xalan processor shows the "built-in" rules.

Templates view

The <xsl:template> is the basic element for stylesheets transformation. This view shows all <xsl:template> instructions used by the transformation. By seeing the number of hits for each of the templates you get an idea of the stylesheet coverage by template rules with respect to the input source.

Figure 6.9. The Templates view

The Templates view

Table 6.7. Templates details

ColumnDescription
MatchMatch attribute of the <xsl:template>.
HitsNumber of hits for the <xsl:template>. Shows how many times the XSLT processor used this particular template.
PriorityTemplate priority as established by XSLT processor.
ModeMode attribute of the <xsl:template>.
NameName attribute of the <xsl:template>.
ResourceResource file where template is located. Complete path of resource file is available as tooltip.
[Important]Remarks
  • Clicking a record highlights that template definition inside resource.

  • Saxon only shows the applied templates having at least one hit from the processor. Xalan shows all defined templates, with or without hits.

  • The template list is sorted descending on the number of hits.

  • Xalan shows the "built-in" rules.

Node set view

This view is always used in relation with Variables view and XPath watch view views and shows a nodeset value. Once you click a variable having as value a nodeset or tree fragment or an XPath expression evaluated to a nodeset in the above views the node set view gets updated with the respective value.

Figure 6.10. The Node Set view

The Node Set view

Table 6.8. Node set details

ColumnDescription
NameName of source (XML) node.
Attributes/ValueAttributes or text content(Value) of the XML node. If attributes exist, these are shown under the form of attributeName="attributeValue", otherwise the text content of the node is shown.
[Important]Remarks
  • In case of longer values for Value/Attributes column content, the interface shows three suspension points (...) at the end. A more detailed value is available as tooltip.

  • Clicking a record highlights the location of that node into the source or stylesheet view.

Variables view

During transformation variables and parameters play an important role.

Oxygen uses the following icons to differentiate variables/parameters:

  • Global variable.

  • Local variable.

  • Global parameter.

  • Local parameter.

The values types of a variable are marked by icons explained below:

Possible Values

  • Boolean.

  • String.

  • Numeric.

  • Node set.

  • Tree fragment.

  • Object.

  • Any.

Figure 6.11. The Variables view

The Variables view

Table 6.9. Variables details

ColumnDescription
NameName of the variable/parameter.
ValueCurrent value for the variable/parameter.
[Important]Remarks
  • Clicking a record highlights the variable definition line.

  • Variable values could differ depending on the transformation engine used or stylesheet version set.

  • If the value of the variable is a node-set or a tree-fragment, clicking on it causes the Node set view to be shown with corresponding set of values.