Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any XSL Lint tools?

Tags:

lint

xslt

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!

like image 272
Phillip B Oldham Avatar asked Mar 13 '09 15:03

Phillip B Oldham


2 Answers

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.

like image 144
Piotr Czapla Avatar answered Sep 19 '22 11:09

Piotr Czapla


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

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

like image 28
Dimitre Novatchev Avatar answered Sep 17 '22 11:09

Dimitre Novatchev