openSUSE / suse-xsl

DocBook XSL Stylesheets for SUSE branding
Other
11 stars 10 forks source link

Run marginal syntax check on XSLT..? #327

Closed ghost closed 7 years ago

ghost commented 7 years ago

Stuff like https://github.com/openSUSE/suse-xsl/commit/f4ae4a3 should be easy to prevent if we just ran

xmllint --noent --xpath '//*[local-name(.) = "apply-templates"]/*[local-name(.) = "param"]|//*[local-name(.) = "call-template"]/*[local-name(.) = "param"]' */*.xsl 2> /dev/null

on every commit, e.g. via Travis.

tomschr commented 7 years ago

This is an idea. However, why not go the full route?

Norman Walsh released a RNG file for XSLT 1.0, 2.0, and 3.0 (see https://github.com/ndw/xslt-relax-ng). We could use his files to "validate" our stylesheets with jing.

I use the following line to "validate" it:

for xslt in suse2013/xhtml/*.xsl; do echo ">> $xslt"; jing -c xslt10.rnc $xslt; done > out-html.txt 2>&1

However, I get some stack traces.

tomschr commented 7 years ago

Ok, this seems solved by #342.