# Command Reference

## Addparam

Add a libxslt parameter ; equivalent to providing --param <QNAME>:<XPATH> via command line.

## Addparam usage

addparam <QNAME> <XPATH> (The <XPATH> must not contain any spaces nor double quotation marks.)
addparam <QNAME> "<XPATH>" (Must not contain double quotation marks in <XPATH>)

## Addwatch

Add an expression to be watched. See showwatch for display watch values

Shortcut name: watch

## Addwatch usage

addwatch <XPATH>

## Base

Print the base for this node

## Base usage

base

## Break

Break at a template, at a location in a stylesheet or xml file loaded by xsldbg, or at the current node. New for xsldbg 3.1.4: When in gdb compatabilty mode orpaned breakpoints can be set at a specific file and line number and be resolved to an active later on.

Shortcut name: b

xsldbg will try to guess the complete URL given a

file name without a path specified.
a file name in the same directory as the "top" stylesheet loaded
a file name relative to the current working directory of xsldbg

Ie if you have loaded a stylesheet file of ../en/xsldoc.xsl you can do this

break -l xsldoc.xsl 26

This command will match a partial or complete QNAME template and or mode name provided. Eg "template" will ma/tch any QNAME with a local part of "template"

Any name spaces in the provided QNAME will be expanded as specified by the names spaces defined in the XSL SOURCE file. eg "xsl:test1" will be expanded to "http://www.w3.org/199/XSL/Transform:test1"

A requested breakpoint may need to be resolved to its associated URL and line number. This is done automaticly after the first template has been seen by xsldbg. Breakpoints are re-validated shortly after the start of each run.

Automatic breakpoint validation is used when gdb mode is enabled - the default behaviour of xsldbg

## Break usage

break -l <FILENAME> <LINENO> (To set breakpoint at specified file, line number)
break -l <URI> <LINENO> (To set breakpoint at specified URI, line number)
break <TEMPLATE_NAME> (To break at named or matched template.)
break <TEMPLATE_NAME> <MODE_NAME> (To break at named template with given mode.)>
break "" <MODE_NAME> (To break at any template that has a given mode name)
break * (To break at any template found.)
break \* (To break at the "*" template. Other name that include '*' will not be treated specialy.)
break (To break point at current node. Yes that includes xml data nodes!)

## Bye

Exit processing stylesheet as soon as possible.

## Bye usage

bye

## Cat

Print the result of a xpath expression on relative current node.

## Cat usage

Usage : cat <XPATH> (To view a variable or parameter)
Usage : cat $<QNAME>

## Cd

Change to the path specified by a xpath.

## Cd usage

<< = preceding-sibling::node()
>> = following-sibling::node()
<- = ancestor::node()
-> = decendant::node()

## Chdir

Change the working directory

## Chdir usage

chdir <PATH> (A relative or absolute path for operating system)

## Continue

Continue running stylesheet, stopping at any break points found.

Shortcut name: c

## Contine usage

continue

## Data

Switch to displaying the current node in xml data. Or change xml data used

## Data usage

data (Switch to the current document node.)
data <DATA> (To change to a new xml data file. A leading "~" is replaced by the $HOME environment variable value. Will need to use "run" command to process it)

## Delete

Delete a template breakpoint

Shortcut name: d

## Delete usage

delete (To delete breakpoint at current node)
delete <BREAKPOINT_ID> (To delete breakpoint at specified break point number)
delete -l <FILENAME> <LINENO> (Delete at specifed file, line number)
delete -l <URI> <LINENO> (Delete at specifed URI, line number)
delete <TEMMPLATENAME> (To delete break point at named template.)
delete * (To delete all break points.)

## Delparam

Delete a libxslt parameter

## Delparam usage

delparam (Delete all parameters present)
delparam <PARAM_ID>

## Delwatch

Delete a watch expression or remove all watch expressions as displayed by "showwatch." command

## Delwatch usage

delwatch <WATCHID> (Delete a watch expression with given ID)
delwatch * (Delete all watch expressions)

## Dir

Print list of nodes in a similary way to the dir shell command.

## Dir usage

dir

## Disable

Disable a breakpoint

## Disable usage

disable (To disable breakpoint at current node)
disable <BREAKPOINT_ID> (To disable breakpoint at specified break point number
disable -l <FILENAME> <LINENO> (Disable breakpoint at specifed file, line number)
disable -l <URI> <LINENO> (Disable breakpoint at specifed URI, line number)

## Du

Print a summary of child nodes in a tree format.

## Du usage

du

## Dump

Dump the gory details of this node

## Dump usage

dump

## Enable

Enable or disable a breakpoint (Toggle enable/disable/)

Shortcut name: e

## Enable usage

enable (To enable/disable breakpoint at current node)
enable <BREAKPOINT_ID> (To enable/disable breakpoint at specified break point number
enable -l <FILENAME> <LINENO> (Enable/disable breakpoint at specifed file, line number)
enable -l <URI> <LINENO> (Enable/disable breakpoint at specifed URI, line number)

## Entities

Print list of external General Parsed entities used data file (document)

Shortcut name : ent

## Entities usage

entities

## Exit

Exit processing stylesheet as soon as possible.

## Exit usage

exit

## Frame

Print the stack frame at a given depth

Shortcut name: f

## Frame usage

frame <FRAME_DEPTH> (Depth is a number from 0 to the current depth of call stack)

## Free

Free stylesheet and data (Disabled see run)

## Free usage

free

## Globals

Print a list of global stylesheet variables or parameters. Print the value of a global variable

## Globals usage

globals (Print list of all globaly available variables)
globals -f (Print list of all globaly available variables and thier values)
globals <QNAME> (Print the value of variable specified)

## Help

Display help on command or overiew

Shortcut name: h

## Help usage

help (Show overview of product)
help <COMMAND> (Show help about a command)

## Load

Load the xsldbg's options and user preferences from disk

## Load usage

load

## Locals

Print a list of local stylesheet variables or parameters. Print the value of a local variable

## Locals usage

locals (Print list of all locally available variables)
locals -f (Print list of all locally available variables and thier values)
locals <QNAME> (Print the value of variable specified)

## Ls

List nodes in a brief format

## Ls usage

ls

## Next

Skip over an xsl:call-template or xsl:apply-templates. This command has the same effect of entering the commands "step" and then "up"

Shortcut name: n

## Next usage

next (proceed to next sibling instruction)

## Options

Print the values for xsldbg's option

## Options usage

options

## Output

Specify a local, writable file to be used for output of results

Shortcut name : o

## Output usage

output <FILENAME> (A local writable file name. Which can have a "~" prefix on *nix and CYGWIN platforms. Or environment variables under RISC OS)
output <URI> (The <URI> must only use the "file://" protocol. This is then converted to a file name suitable for the operating system)
output - ( Send to standard output. Must only be used when using xsldbg's command line prompt )

## Public

Print the value that a public ID maps via the current catalog

Shortcut name : pub

## Public usage

public "<PublicID>"

## Pwd

Print the current working directory.

## Pwd usage

pwd

## Quit

Exit processing stylesheet as soon as possible.

Shortcut name: q

## Quit usage

quit

## Run

Restart the stylesheet.

Shortcut name: r

## Run usage

run

## Save

Save the xsldbg's options and user preferences to disk

## Save usage

save

## Search

Search a dataBase of all information gathered from stylesheets loaded

All output files are stored in, value of the "searchresultspath" option if set, or the same directory as the provided stylesheet. searchresults.xml is normally transformed by search.xsl, but will be transformed using searchhtml.xsl if the "prefrehtml" option is set.

When the search command is issued a xml file (searchresults.xml) will be created. You can then process this file with your own stylesheet to present data in a other ways. If "preferhtml" option is not set then searchresult.txt is printed to display.

Depending on the amount of data collected it might take a while to complete this command.

## Search usage

search <XPATH> (See what xpath can be used see search.dtd. The deafault <XPATH> is '//search/*' )
search -sort <XPATH> (Tell search.xsl to sort the result before outputing it)

## Set

Set the value of a variable

## Set usage

set <VARIABLE_NAME> <XPATH>

## Setoption

Set an option for execution of stylesheet

You will need to use run command to active changes

## Setoption usage

setoption <OPTION_NAME> <INTEGER_VALUE>
Where <OPTION_NAME> can be either

debug (If <INTEGER_VALUE> is true dump the tree of the result instead)
catalogs (If <INTEGER_VALUE> is true use the catalogs from $SGML_CATALOG_FILES or SGML$CatalogFiles for risc operating system)
html (If <INTEGER_VALUE> is true the input document is an HTML file)
docbook (If <INTEGER_VALUE> is true and docbook is still supported by libxml the input document is SGML docbook)
xinclude (If <INTEGER_VALUE> is true do XInclude processing on document intput)
preferhtml (If <INTEGER_VALUE> is true the prefer html output for search results. : See search command)
autoencode (If <INTEGER_VALUE> is true try to use the encoding from the stylesheet)
utf8input (If <INTEGER_VALUE> is true All input from user is in UTF-8.This is normaly used when xsldbg is running as a thread)
gdb (Run in gdb compatability mode)

For a value of 1 this means

Print lots more messages. Increase the frequency of printing "Breapoint at ..."
At most GDB_LINES_TO_PRINT lines will be printed when evalating expressions, followed by a "...". See options.h to change this value, the default is three lines of text
Both local and globals will be printed when the "locals" command is issued
When printing expresssions with cat/print. The evaluated value will be prefixed by "= " < EXPRESSION >

For a value of 2 this means

Print messages needed by KDbg as well as the output state above (when value is 1)

nonet (If <INTEGER_VALUE> is true refuse to fetch DTDs or entities over network)
novalid (If <INTEGER_VALUE> is true skip the DTD loading phase)
repeat (If <INTEGER_VALUE> is true run the transformation 20 times)
profile (If <INTEGER_VALUE> is true dump profiling informations)
timing (If <INTEGER_VALUE> is true display the time used)
noout (If <INTEGER_VALUE> is true do not dump the result)

Where value is true if it is NOT equal to zero
Where value is false if it IS equal to zero
stdout Print all error messages to stdout. Normally error messages go to stderr.
setoption <OPTION_NAME> "<STRING_VALUE>" (Must not contain double quotation marks in <STRING_VALUE>)
setoption <OPTION_NAME> <STRING_VALUE> (Must not contain any spaces, nor double quotation marks in <STRING_VALUE>)
Where <OPTION_NAME> can be either

data (Data file's URI)
source (Source file's URI)
output (Output file's SystemID )
docspath (Path to use when looking for documentation)
catalognames (The names of the catalogs to use when the catalogs option is set. Value will be lost if set before setting catalogs option)
encoding (What encoding to use for standard output)
searchresultspath What path is to be used when storing the results of searching. If this is not set then xsldbg will use the path of the stylesheet

## Shell

Execute shell command

## Shell usage

shell <TEXT> (<TEXT> is the text to be passed to operating system for execution)

## Showbreak

To display list of template break points.

Shortcut name: show

If a mode exists on a template breakpoint then it will be appended to the end of template name for breakpoint. An example of the output is :

Breakpoint 3 enabled for template :"*" in file test1.xsl : line 105
Breakpoint 2 enabled for template :"* testMode" in file test1.xsl : line 109
Breakpoint 1 enabled for template :"* http://www.w3.org/1999/XSL/Transform:testMode" in file test1.xsl : line 113
Total of 3 breakpoints present

## Showbreak usage

showbreak

## Showparam

Print the libxslt parameters present

## Showparam usage

showparam

## Showwatch

Show the current expression being watched

Shortcut name: watches

## Showwatch usage

showwatch (Show the currently selected watches and thier values)
showwatch 1 (Enable the automatic printing of watch expressions. This is used by default.)
showwatch 0 (Disable the automatic printing of watch expressions.)

## Source

Switch to displaying the current node in stylesheet. Or change stylesheet used

## Source usage

source (Switch to the current node in stylesheet.)
source <SOURCE> (To change to a new source file. A leading "~" is replaced by the $HOME environment variable value. Will need to use "run" command to execute it)

## Step

Step until next stylesheet instruction.

Shortcut name: s

## Step usage

step

## Stepdown

Step down to a newer "call frame".

Shortcut name: down

## Stepdown usage

stepdown (step down one frame)
stepdown <NUMBER_OF_FRAMES> (step down specified number of frames)

## Stepup

Step up to a older "call frame".

Shortcut name: up

This is not an accurate command, xsldbg will stop as close as it can.

## Stepup usage

stepup (step up one frame)
stepup <NUMBER_OF_FRAMES> (step up specified number of frames)

## Stylesheets

Print out a list of stylesheets loaded

Shortcut name: style

## Stylesheets usage

stylesheets

## System

Print the value that a system file maps via the current catalog

Shortcut name : sys

## System usage

system "<SystemID>"

## Templates

Print a list of available templates. Search for a template

Shortcut name: t

## Templates usage

templates
templates <TEMPLATE> (Print details of template named <TEMPLATE> if it can be found)

## Trace

Trace one execution of the stylesheet printing the file and lines of intermediate steps

## Trace usage

trace

## Tty

Open a terminal. Set the level of tty redirection.

## Tty usage

tty <DEVICE_PATH> (Where <DEVICE_PATH> is a valid terminal on the operating system. Just tries to open the terminal
tty <TTY_LEVEL> (Set the level of tty redirection, where <TTY_LEVEL> is a valid level of input/output to use)

Where level is
0 = Default input/output
1 = Terminal output of results of transformation, tracing and walking (Default state when tty device has been opened. Not fully implemented yet.)
2 = Full redirection to terminal (Not implemented yet.)
All other integer values are assumed to mean level 0

## Validate

Validate the output file generated by stylesheet (Disabled)

## Validate usage

validate

## Walk

Walk through code using a range of speeds

## Walk usage

walk <SPEED> (Use Ctrl-c to stop execution, <SPEED> is a value between 0 and 9. Where 0 means stop, 1 is very fast, 9 is very slow)

## Where

Print a trace of templates calls (frame stack) and print the working directory.

Shortcut name: w

## Where usage

where

## Write

To be completed

## Write usage

write