tags:

views:

237

answers:

3

I'm looking for an XSL lint tool which is actively maintained. The only one I can find is this one, but the last update was in 2000 (9 years old!). Any help would be great!

A: 

You should look for "XSL profiler" or "XSL debugger". There are dozens of these.

vartec
A: 

Yes, look at this one, published Dec. 2008:

http://lists.xml.org/archives/xml-dev/200812/msg00178.html

Dimitre Novatchev
+2  A: 

Phillip,

Creating a good lint for xlst is quite hard, because validity of xslt templates depends on the parser that is used. Each parser has it own extensions. For example java's xalan can be easily extended with custom xpath functions, which are obviously coded in java. Because of that any .net validator will fail to validate advance xalan's xslts.

So first of all you need to know what processor you are going to use. If you use java based processors I recommend to use Eclipse which can validate the templates on the fly.

I've tired two eclipse plugins, It is worth mentioning that both support debugging and xslt/xpath code completion:


Oxygen XML editor - a commercial (~$300) XML/XSLT editor/eclipse plugin. It can use the following engines: Xalan, Saxon, Xsltproc,

It is able to check:

  • correctness of xsl:template
  • correctness of name attribute of xsl:call-template
  • duplicated definition of xslt variables
  • validity of dtd's
  • validity of xslt header
  • validity of xml namespaces
  • validity of XPath
  • validity of xsl:value-of if an xml is associated to xslt
  • correctness of xsl:import for local and remote files (it support xml catalogs)

I must say that the plugin is really good but on the other hand it isn't open source.


XSLT Project - an open source plugin (it is part of Eclipse Web Tools Platform). It is quite young (started in September 2008), however it has very active community. Currently it supports only Xalan and JAXP.

It detects the following errors and warnings:

  • invalid xslt header
  • incorrect dtd
  • incorrect imports (it handle only relative imports, xml catalogs are planed for version 1.1)

The above list is definitely incomplete because lack of support for xml catalogs made this project unusable for me.

Piotr Czapla