tr:check-styles check-styles

htmlreports/xpl/check-styles.xpl

Import URI: http://transpect.io/htmlreports/xpl/check-styles.xpl

Input Ports

NameDocumentationConnections

source

html-in

parameters

Output Ports

NameDocumentationConnections

result

doc-and-template-styles

report

schema

htmlreport

Please note that the HTML report will not reflect the differentiated styles. It will only do so if the report is rendered by a subsequent step. This is because the svrl in the output will be patched after the tr:validate-with-schematron step.

Options

NameDocumentationDefault

debug

'no'

debug-dir-uri

'debug'

status-dir-uri

resolve-uri('status')

active

'true'

cssa

Name of the CSSa file with the style definitions (for load-cascaded).

'styles/simple-template.cssa.xml'

differentiate-by-style

This option will create a distinct error class for each missing style name. In order to use this option, you need to create a <span class="style-name"> in your schematron rule in your adaption’s styles.sch.xml, like this:


    <rule context="*[count($template-style-names) gt count($default-style-names)][@role][not(self::dbk:keywordset or self::dbk:keyword or self::dbk:tab)]">
      <let name="base-role" value="replace(@role, '(_-_|[~˜]).+$', '')" />
      <assert test="($base-role = $template-style-names) or (some $i in $template-style-regexes satisfies (matches(@role, $i)))" role="warning" id="sch_styles_undefined" diagnostics="sch_styles_undefined_de">
        <span class="srcpath"><xsl:value-of select="concat($base-dir, (@srcpath, ancestor::*[@srcpath][1]/@srcpath, .//@srcpath)[1])"/></span>
        Style '<span class="style-name"><xsl:value-of select="$base-role"/></span>' not found in allowed templates catalog 
        '<value-of select="string-join(tokenize(base-uri($template-styles[1]), '/')[position() ge last() - 4],'/')"/>'.</assert>
    </rule>

'false'

Subpipeline

StepInputsOutputsOptions

tr:simple-progress-msg start-msg

source

source parameters on check-styles

msgs

 <c:messages>
   <c:message xml:lang="en">Starting Schematron check of used styles against list of permissible styles (look for 'styles' messages in the report)</c:message>
   <c:message xml:lang="de">Beginne Schematron-Prüfung der verwendeten Formatvorlagen gegen Positivliste (entspr. Meldungen tauchen unter der Rubrik 'styles' auf)</c:message>
 </c:messages>

result

file = 'check-styles-start.txt'

status-dir-uri = $status-dir-uri

tr:load-cascaded template-styles

paths

parameters on check-styles

result

filename = $cssa

debug = $debug

debug-dir-uri = $debug-dir-uri

p:wrap-sequence doc-and-template-styles

source

source on check-styles

result on template-styles

result

wrapper = 'tr:doc-and-template-styles'

tr:store-debug d155e100

source

result on doc-and-template-styles

result

pipeline-step = 'styles/doc-and-template-styles'

active = $debug

base-uri = $debug-dir-uri

tr:validate-with-schematron sch

html-in

html-in on check-styles

parameters

parameters on check-styles

result

active = $active

debug = $debug

debug-dir-uri = $debug-dir-uri

status-dir-uri = $status-dir-uri

p:sink d155e133

source

result on sch

p:split-sequence d155e134

tr:validate-with-schematron may produce multiple reports. We know that we put in only one document, so we only select the first report.

source

report on sch

matched

initial-only = 'true'

test = 'true()'

p:choose potentially-differentiate-by-style

$differentiate-by-style = 'true'

p:xslt add-style-names-to-error-codes

source

matched on d155e134

parameters

p:empty

stylesheet

 <xsl:stylesheet version="2.0">
   <xsl:template match="* | @*">
     <xsl:copy>
       <xsl:apply-templates select="@*, node()"/>
     </xsl:copy>
   </xsl:template>
   <xsl:template match="svrl:failed-assert/@id[. = 'sch_styles_undefined']">
     <xsl:attribute name="{name()}" select="../svrl:text/s:span[@class = 'style-name']"/>
   </xsl:template>
 </xsl:stylesheet>

result

p:otherwise

p:identity d155e179

source

matched on d155e134

result

tr:simple-progress-msg success-msg

source
msgs

 <c:messages>
   <c:message xml:lang="en">Successfully finished style checks</c:message>
   <c:message xml:lang="de">Formatvorlagenprüfung erfolgreich abgeschlossen</c:message>
 </c:messages>

result

file = 'check-styles-success.txt'

status-dir-uri = $status-dir-uri

p:sink d155e201

source

result on success-msg