Table of Contents                           SourceForge Logo

 

Introduction

xsldbg

ˇ         is a text based tool to debug stylesheets and it is similar to the Unix/Linux debugger gdb. It uses using the libxslt library by http://www.xmlsoft.org/XSLT

ˇ         is in a stable stage of development with functionality now frozen until the start of the next beta cycle. Comments about feature set provided are welcome.

ˇ         has GUI front end for Qt5 called qxsldbg

ˇ         has GUI front end for KDE, currently supported by a Kate plugin

ˇ         breakpoints can be set on XSLT script or XML data file

ˇ         setting breakpoint on import/included XSLT scripts is now supported

 

Todo

See also completed TODO'S

 

Requirements

See https://sourceforge.net/projects/xsldbg/files/xsldbg/

 

Limitations

 

Author

The primary author is Keith Isdale

The author for the riscos specific code is Justin Fletcher

The author some of the WIN32 code is Igor Zlatkovic

 

Licence

This tool is available under the GPL licence

     

Documentation

    xldbg usage and commands

 

Screen shots

Running xsldbg-mode under XEmacs in Linux and WIN32

Running the qxsldbg under KDE, it will look similar under MinGW32 or cygwin .

Running the kxsldbg plugin in kate.

 

Related web sites

    http://xsldbg.sourceforge.net/

    http://sourceforge.net/projects/xsldbg

    http://xsldbg.sourceforge.net/docs/qxsldbg/manual/, the qxsldbg manual

    http://xsldbg.sourceforge.net/docs/xsldbg/manual, the xsldbg manual

    http://homepage.ntlworld.com/justin.fletcher/XML/ (Homepage for author or risc os port of xsldbg)

    XSL documentation tool by Fabrice Desré

 

Email lists

   http://lists.sourceforge.net/lists/listinfo/xsldbg-announce



Installation

For installation instructions see the README in the downloaded source package.

Testing / running example

Example xsldbg session

     To test / try out xsldbg

         cd xsldbg/docs/en
 
         xsldbg --shell xsldoc.xsl xsldoc.xml
 
 
      And you should get the xsldbg prompt like
 
 
 
XSLDBG <VERSION>
 
Starting stylesheet
 
 
Breakpoint at file xsldoc.xsl : line 18
xsldbg) xsl:param >
 
 
You can now start entering commands at the "(xsldbg) .* >" prompt. In the example text in
green has been typed by the user 

 
 
      Breakpoint at file xsldoc.xsl : line 18
(xsldbg) xsl:param > templates
 template :"/" in file xsldoc.xsl : line 23
 template :"helpOnCommand" in file xsldoc.xsl : line 49
 template :"header" in file xsldoc.xsl : line 67
 template :"text()" in file xsldoc.xsl : line 79
 template :"para" in file xsldoc.xsl : line 83
 template :"list | usage" in file xsldoc.xsl : line 89
 template :"comment" in file xsldoc.xsl : line 99
 template :"cmd-summary" in file xsldoc.xsl : line 103
 template :"cmd" in file xsldoc.xsl : line 109
 
         Total of 9 templates found
         Total of 9 templates printed
(xsldbg) xsl:param > break /
Size of line list was 0 adding 24 entries
(xsldbg) xsl:param > break header
Size of line list was 24 adding 44 entries
(xsldbg) xsl:param > showbreak
 
 Breakpoint 1 enabled for template :"/" in file xsldoc.xsl : line 23
 Breakpoint 2 enabled for template :"header" in file xsldoc.xsl : line 67
 
         Total of 2 breakPoints present
(xsldbg) xsl:param > break -l xsldoc.xsl 44
(xsldbg) xsl:param > showbreak
 
 Breakpoint 1 enabled for template :"/" in file xsldoc.xsl : line 23
 Breakpoint 3 enabled in file xsldoc.xsl : line 44
 Breakpoint 2 enabled for template :"header" in file xsldoc.xsl : line 67
 
         Total of 3 breakPoints present
(xsldbg) xsl:param > continue
 
Reached template :"/"
Breakpoint 1 Breakpoint in file xsldoc.xsl : line 23
(xsldbg) xsl:template > continue
 
Reached template :"/"
Breakpoint 1 Breakpoint in file xsldoc.xsl : line 23
(xsldbg) text > continue
 
Reached template :"header"
Breakpoint 2 Breakpoint in file xsldoc.xsl : line 67
(xsldbg) xsl:template >exit
 


To print help just type "help" 
To exit xsldbg just type "exit" 
 
 
 

Example XEmacs session using xsldbg-mode

Open an XML file into a buffer, then press <META>-x followed by entering
"xsldbg-buffer" into the dialog xemacs provides. At the first prompt enter the file name of
stylesheet to use. At the prompt for "Parameters" enter any extra parameters that
you would normally provide to xsldbg via the command line

After xsldbg-mode initializes you will have cursor highlighting the first line that xsldbg can debug. Use the right mouse button, the toolbar icon's or enter commands directly into xsldbg's command prompt. The right mouse button menu can be called up on text that is "highlighted" To set a breakpoint you can print the list of templates and then right mouse click on the template name listed that you want to stop at. Or move the cursor to where you want a breakpoint (The start of a node in the XSLT source or XML DATA) then click the "Stop at selected position" icon.

The "Stop at selected function" button at the moment operates exactly the same as the "Stop at selected position" icon.

 
 
 

Help system

 
       xsldbg is has built using xml/xslt. To help an overview of commands type
            help
       You can use "help" to get a more detailed information about a command eg
            help help
 
 

Version  notes

 

 See release notes associated with package. 

These issues are still current

1) Several of the File related commands are disabled for the moment.
 
2) When you do a cat on the style source the output is white space stripped so it will look different to
your original source files. This is NOT a "bug"! This is the default behaviour of the stylesheet processor of libxslt. This
tool is intended to be used by other programs which can handle formatting the output. 
 

FAQ

 

Libxslt doesn't compile

ˇ         Check http://xmlsoft.org/XSLT/ and mail.gnome.org/archives/xslt/ for current issues
ˇ         Ensure that libxslt was configured with at least 
     --with-debugger=yes
 

Where can I find a binary distribution for xsldbg

Sorry I am not able to do that at this time, as I'm not sure how to make a generic
binary that would not come back and haunt me. :-) A submission by someone who can do this would be
most welcome.
 
 

Where's the documentation

See the README in downloaded package for more information.
 

xsldbg compiles ok but doesn't run when used from command line/ does not start debugging

ˇ         Make sure that you set and exported the correct LD_LIBRARY_PATH
ˇ         Make sure that you've configure the correct libxml and libxslt prefix in libxslt, and xsldbg. 
ˇ         Make sure that you have a version of libxslt that has debugging support enabled this is done by default un *nix but it handled manually under other platforms 
 
 

Why do I get a message about Breakpoint @ text node

 
xsldbg tries to find a line number near the current node. But sometimes it is
unable to find a "parent" for the current node. This normally means the node is part of
the document preamble, a comment node or text node.
 
 

Why does xsldbg restart when I reload the configuration

 
This is unavoidable because of the way xsldbg interrupts libxslt execution.
 
 

Why is the text/html output when searching not better formmated

 
It is left up to the user to provide a stylsheet to replace
docs/en/searchhtml.xsl and docs/en/search.xsl. Contributions of better XSL for
search database formatting would be appreciated
 
 

How big is this this program

 
At last count there was over twenty thousand lines of text in xsldbg, some of this is automatically generated. This is about the same size as the libxslt directory in the libxslt distribution.
 
 

 Why do I get a strange prompt

 
If the prompt looks like:

    (xsldbg) xsldbg_default_node >

For some reason xsldbg could not load or use the specified stylesheet or xml data file.

Try using the "source" or "data" commands and then "run".


 

Feedback

For problems with this project or web site please use the bug tracking system provided by Source Forge

 

Download

See sourceforge file downloads
 

Completed Todo's

 
ˇ         validate the breakpoint API is complete :Done!
ˇ         Update xsldbg when debugger support is built into libxslt. Done! libxslt only contains the code needed to call xsldbg. No further review by libxslt@gnome.org needed but may be done :-)
ˇ         add the ability to validate file and line number
ˇ         Redo configure and build scripts : Done! 
ˇ         Track down all sources of the crashes :-( : Done! 
 
ˇ         Complete line break points : Done!
ˇ         Update documentation : Done! 
ˇ         Work on a patch for the xemacs module xslt-process to support debugging from within xemacs : Done! (modified gdb.el)
ˇ         Create new functions to handle lists that are implemented as arrays. Done! 
ˇ         Break points to a specific line in the stylesheet are yet made stable : Done! 
ˇ         The debugger suffers from crashes "segmentation faults" which is being looked into : Fixed 
ˇ         The configure/build scripts need to be redone because they expect KDE to be installed : Done! 
ˇ         Confirmed that only the basic XSL/XSLT commands work. Which means that it may not stop where expected. Done!
ˇ         Can only handle a fixed number of breakpoints. Fixed!
ˇ         Does not handle a large number of variables/templates well. Fixed!
ˇ         Does not allow libxslt parameters to be passed at xsldbg command prompt. Done! 
ˇ         Redo implemention of src/dbgbreakpoint.c to use hash tables not a fixed array of breakpoints  Done!Add new search functions  Done!
ˇ         Add ability to change variables  Done!
ˇ         Only simple simple XSL commands are supported as yet.: Fixed!. But yet to verify that all commands work as expected
ˇ         Allow xsldbg's configuration to be loaded/saved . Done!



http://xsldbg.sourceforge.net/   :  Helping understand stylesheets
 


Last updated 23rd September 2018