innovimax / xslt-quality

XML utilities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XSLT Quality

This repo is about testing your XSLT quality. It contains a main schematron to be applied to your XSLT :

  • checkXSLTstyle.sch : it doesn't contains any rules, it's only a wrapper to extends rules of each modules :

    • xsl-quality.sch : an iso-schematron implementation of Mukul Gandhi XSL QUALITY xslt
    • xsl-common.sch : common schematron rules for good XSLT practice

You may use the main schematron wrapper or only the module you wish.

Using XSLT schematron with oXygen 19+

OXygen v19 has a default schematron which is automaticaly applied to any edited XSLT, aiming at checking code quality :

[INSTALL.DIR]\Oxygen XML Developer 19\frameworks\xslt\sch\xsltCustomRules.sch

You can customize this schematron by adding :

<sch:extends href="[path.local.du.clone]/xslt-quality/src/main/sch/checkXSLTstyle.sch"/>

In this way, both xsltCustomRules.sch and checkXSLTstyle.sch will be applied to your XSLT.

Later this repo will be available on Maven Central, you should be able to load checkXSLTstyle.sch and xsl-quality.sch from a jar distribution with a catalog.xml (using "artefactId:/" as protocol and/or using the cp protocol by cmarchand

TODO

<xsl:template match="/">
  <xsl:apply-template>
</xsl:template>
  • Using <xsl:value-of> where <xsl:sequence> is enough
  • Writing :
    • indent with spaces
    • No break line inside templates
    • Space around operators ( =, +, > etc)

About

XML utilities


Languages

Language:XSLT 100.0%