So I downloaded the schematron zip file that you referred to in the
build.xml file, and set up the following shell script:
#!/bin/bash
gestalt ../../sch/iso_schematron_skeleton.xsl ../../sch/xslt-std.sch
| gestalt stdin: $1
I get the following test results:
./xsltlint.sh basic_if1.xsl
Warning: XSLT 1.0 stylesheet is being run on an XSLT 2.0 processor.
<?xml version="1.0" encoding="UTF-8"?>unbalanced brackets
./xsltlint.sh basic_if2.xsl
Warning: XSLT 1.0 stylesheet is being run on an XSLT 2.0 processor.
<?xml version="1.0" encoding="UTF-8"?>empty test attribute
./xsltlint.sh basic_stylesheet_1.xsl
Warning: XSLT 1.0 stylesheet is being run on an XSLT 2.0 processor.
<?xml version="1.0" encoding="UTF-8"?>
./xsltlint.sh basic_template_el1.xsl
Warning: XSLT 1.0 stylesheet is being run on an XSLT 2.0 processor.
<?xml version="1.0" encoding="UTF-8"?>unbalanced brackets
./xsltlint.sh basic_template_el2.xsl
Warning: XSLT 1.0 stylesheet is being run on an XSLT 2.0 processor.
<?xml version="1.0" encoding="UTF-8"?>
./xsltlint.sh basic_template_el3.xsl
Warning: XSLT 1.0 stylesheet is being run on an XSLT 2.0 processor.
<?xml version="1.0" encoding="UTF-8"?>empty match attribute
./xsltlint.sh basic_template_el.xsl
Warning: XSLT 1.0 stylesheet is being run on an XSLT 2.0 processor.
<?xml version="1.0" encoding="UTF-8"?>unbalanced brackets
./xsltlint.sh basic_version_att1.xsl
Warning: XSLT 1.0 stylesheet is being run on an XSLT 2.0 processor.
<?xml version="1.0" encoding="UTF-8"?>There are only XSLT version 1.0 or 2.0.
./xsltlint.sh basic_version_att2.xsl
Warning: XSLT 1.0 stylesheet is being run on an XSLT 2.0 processor.
<?xml version="1.0" encoding="UTF-8"?>All XSLT files should have a
single version attribute.
There are only XSLT version 1.0 or 2.0.
Are these the expected results? I am a little worried that there are
no messages from some of the tests - but I guess you meant to test
correct examples too.
I'm far more worried by the warnings - isn't this supposed to be
Schematron for XSLT 2.0?
I can understand ;)
> So I downloaded the schematron zip file that you referred to in the
> build.xml file, and set up the following shell script:
u mean sch/xslt-std.sch file
yes at first glance they look correct results ... I didn't have time
to 'close the unit test circle', nor write a lot of lint rules ... the
existing rules are more for illustrating the concept.
I plan to use svrl output, which 'out of the box' gives me much of I
would need as a result tree from which to render something pretty and
informative
here is what I get as reference in svrl;
<fileset date="2008/02/03">
<file name="basic_version_att2.xsl">
<svrl:schematron-output xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sch="http://www.ascc.net/xml/schematron"
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
title="XSLT Lint"
schemaVersion="">
<svrl:ns-prefix-in-attribute-values
uri="http://www.w3.org/1999/XSL/Transform" prefix="xsl"/>
<svrl:active-pattern/>
<svrl:fired-rule context="xsl:stylesheet"/>
<svrl:failed-assert test="count(@version) = 1"
location="/*:stylesheet[namespace-uri()='http://www.w3.org/1999/XSL/Transform'][1]">
<svrl:text>need to define 1 xsl version attribute</svrl:text>
</svrl:failed-assert>
<svrl:failed-assert test="@version = '1.0' or @version='2.0'"
location="/*:stylesheet[namespace-uri()='http://www.w3.org/1999/XSL/Transform'][1]">
<svrl:text>There are only XSLT version 1.0 or 2.0.</svrl:text>
</svrl:failed-assert>
<svrl:active-pattern/>
<svrl:fired-rule context="*[@match]"/>
<svrl:fired-rule context="*[@match]"/>
<svrl:fired-rule context="*[@match]"/>
<svrl:fired-rule context="*[@match]"/>
<svrl:active-pattern/>
<svrl:fired-rule context="*[@select]"/>
<svrl:fired-rule context="*[@select]"/>
<svrl:fired-rule context="*[@select]"/>
<svrl:fired-rule context="*[@select]"/>
<svrl:fired-rule context="*[@select]"/>
<svrl:fired-rule context="*[@select]"/>
<svrl:fired-rule context="*[@select]"/>
<svrl:fired-rule context="*[@select]"/>
<svrl:active-pattern/>
<svrl:active-pattern/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
</svrl:schematron-output>
</file>
<file name="basic_if1.xsl">
<svrl:schematron-output xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sch="http://www.ascc.net/xml/schematron"
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
title="XSLT Lint"
schemaVersion="">
<svrl:ns-prefix-in-attribute-values
uri="http://www.w3.org/1999/XSL/Transform" prefix="xsl"/>
<svrl:active-pattern/>
<svrl:fired-rule context="xsl:stylesheet"/>
<svrl:active-pattern/>
<svrl:fired-rule context="*[@match]"/>
<svrl:active-pattern/>
<svrl:active-pattern/>
<svrl:fired-rule context="*[@test]"/>
<svrl:failed-assert test="count(tokenize(@test,'\[')) - 1 =
count(tokenize(@test,'\]')) - 1"
location="/*:stylesheet[namespace-uri()='http://www.w3.org/1999/XSL/Transform'][1]/*:template[namespace-uri()='http://www.w3.org/1999/XSL/Transform'][1]/*:if[namespace-uri()='http://www.w3.org/1999/XSL/Transform'][1]">
<svrl:text>unbalanced brackets</svrl:text>
</svrl:failed-assert>
<svrl:active-pattern/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
</svrl:schematron-output>
</file>
<file name="basic_template_el1.xsl">
<svrl:schematron-output xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sch="http://www.ascc.net/xml/schematron"
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
title="XSLT Lint"
schemaVersion="">
<svrl:ns-prefix-in-attribute-values
uri="http://www.w3.org/1999/XSL/Transform" prefix="xsl"/>
<svrl:active-pattern/>
<svrl:fired-rule context="xsl:stylesheet"/>
<svrl:active-pattern/>
<svrl:fired-rule context="*[@match]"/>
<svrl:failed-assert test="count(tokenize(@match,'\[')) - 1 =
count(tokenize(@match,'\]')) - 1"
location="/*:stylesheet[namespace-uri()='http://www.w3.org/1999/XSL/Transform'][1]/*:template[namespace-uri()='http://www.w3.org/1999/XSL/Transform'][1]">
<svrl:text>unbalanced brackets</svrl:text>
</svrl:failed-assert>
<svrl:active-pattern/>
<svrl:active-pattern/>
<svrl:active-pattern/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
</svrl:schematron-output>
</file>
<file name="basic_version_att1.xsl">
<svrl:schematron-output xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sch="http://www.ascc.net/xml/schematron"
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
title="XSLT Lint"
schemaVersion="">
<svrl:ns-prefix-in-attribute-values
uri="http://www.w3.org/1999/XSL/Transform" prefix="xsl"/>
<svrl:active-pattern/>
<svrl:fired-rule context="xsl:stylesheet"/>
<svrl:failed-assert test="@version = '1.0' or @version='2.0'"
location="/*:stylesheet[namespace-uri()='http://www.w3.org/1999/XSL/Transform'][1]">
<svrl:text>There are only XSLT version 1.0 or 2.0.</svrl:text>
</svrl:failed-assert>
<svrl:active-pattern/>
<svrl:fired-rule context="*[@match]"/>
<svrl:fired-rule context="*[@match]"/>
<svrl:fired-rule context="*[@match]"/>
<svrl:fired-rule context="*[@match]"/>
<svrl:active-pattern/>
<svrl:fired-rule context="*[@select]"/>
<svrl:fired-rule context="*[@select]"/>
<svrl:fired-rule context="*[@select]"/>
<svrl:fired-rule context="*[@select]"/>
<svrl:fired-rule context="*[@select]"/>
<svrl:fired-rule context="*[@select]"/>
<svrl:fired-rule context="*[@select]"/>
<svrl:fired-rule context="*[@select]"/>
<svrl:active-pattern/>
<svrl:active-pattern/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
</svrl:schematron-output>
</file>
<file name="basic_stylesheet_1.xsl">
<svrl:schematron-output xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sch="http://www.ascc.net/xml/schematron"
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
title="XSLT Lint"
schemaVersion="">
<svrl:ns-prefix-in-attribute-values
uri="http://www.w3.org/1999/XSL/Transform" prefix="xsl"/>
<svrl:active-pattern/>
<svrl:active-pattern/>
<svrl:active-pattern/>
<svrl:active-pattern/>
<svrl:active-pattern/>
<svrl:fired-rule context="*"/>
</svrl:schematron-output>
</file>
<file name="basic_template_el.xsl">
<svrl:schematron-output xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sch="http://www.ascc.net/xml/schematron"
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
title="XSLT Lint"
schemaVersion="">
<svrl:ns-prefix-in-attribute-values
uri="http://www.w3.org/1999/XSL/Transform" prefix="xsl"/>
<svrl:active-pattern/>
<svrl:fired-rule context="xsl:stylesheet"/>
<svrl:active-pattern/>
<svrl:fired-rule context="*[@match]"/>
<svrl:active-pattern/>
<svrl:active-pattern/>
<svrl:active-pattern/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
</svrl:schematron-output>
</file>
<file name="basic_template_el3.xsl">
<svrl:schematron-output xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sch="http://www.ascc.net/xml/schematron"
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
title="XSLT Lint"
schemaVersion="">
<svrl:ns-prefix-in-attribute-values
uri="http://www.w3.org/1999/XSL/Transform" prefix="xsl"/>
<svrl:active-pattern/>
<svrl:fired-rule context="xsl:stylesheet"/>
<svrl:active-pattern/>
<svrl:fired-rule context="*[@match]"/>
<svrl:successful-report test="@match=''"
location="/*:stylesheet[namespace-uri()='http://www.w3.org/1999/XSL/Transform'][1]/*:template[namespace-uri()='http://www.w3.org/1999/XSL/Transform'][1]">
<svrl:text>empty match attribute</svrl:text>
</svrl:successful-report>
<svrl:active-pattern/>
<svrl:active-pattern/>
<svrl:active-pattern/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
</svrl:schematron-output>
</file>
<file name="basic_if2.xsl">
<svrl:schematron-output xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sch="http://www.ascc.net/xml/schematron"
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
title="XSLT Lint"
schemaVersion="">
<svrl:ns-prefix-in-attribute-values
uri="http://www.w3.org/1999/XSL/Transform" prefix="xsl"/>
<svrl:active-pattern/>
<svrl:fired-rule context="xsl:stylesheet"/>
<svrl:active-pattern/>
<svrl:fired-rule context="*[@match]"/>
<svrl:active-pattern/>
<svrl:active-pattern/>
<svrl:fired-rule context="*[@test]"/>
<svrl:successful-report test="@test=''"
location="/*:stylesheet[namespace-uri()='http://www.w3.org/1999/XSL/Transform'][1]/*:template[namespace-uri()='http://www.w3.org/1999/XSL/Transform'][1]/*:if[namespace-uri()='http://www.w3.org/1999/XSL/Transform'][1]">
<svrl:text>empty test attribute</svrl:text>
</svrl:successful-report>
<svrl:active-pattern/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
</svrl:schematron-output>
</file>
<file name="basic_template_el2.xsl">
<svrl:schematron-output xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sch="http://www.ascc.net/xml/schematron"
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
title="XSLT Lint"
schemaVersion="">
<svrl:ns-prefix-in-attribute-values
uri="http://www.w3.org/1999/XSL/Transform" prefix="xsl"/>
<svrl:active-pattern/>
<svrl:fired-rule context="xsl:stylesheet"/>
<svrl:active-pattern/>
<svrl:fired-rule context="*[@match]"/>
<svrl:failed-assert test="count(tokenize(@match,'\[')) - 1 =
count(tokenize(@match,'\]')) - 1"
location="/*:stylesheet[namespace-uri()='http://www.w3.org/1999/XSL/Transform'][1]/*:template[namespace-uri()='http://www.w3.org/1999/XSL/Transform'][1]">
<svrl:text>unbalanced brackets</svrl:text>
</svrl:failed-assert>
<svrl:active-pattern/>
<svrl:active-pattern/>
<svrl:active-pattern/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
</svrl:schematron-output>
</file>
</fileset>
> I'm far more worried by the warnings - isn't this supposed to be
> Schematron for XSLT 2.0?
warnings are related to schematron default implementation, not
anything we are doing with debugxslt ... I have received a lot of
strange warnings at odd times as well, at some point will post bugs
back to RJ.
cheers, Jim Fuller