tr:epubcheck-idpf epubcheck

epubcheck-idpf/xpl/epubcheck.xpl

Import URI: http://transpect.io/epubcheck-idpf/xpl/epubcheck.xpl

tr:epubcheck

Description

An implementation of epubcheck to provide it's results as Schematron SVRL.

Usage

Provide the path to the EPUB file with the option epubfile-path.

Output Ports

NameDocumentationConnections

result

Output port: result

Provides the result of the epubcheck as Schematron SVRL file

Options

NameDocumentationDefault

epubfile-path

Option: epubfile-path

Expects the path to the EPUB file.

epubcheck-version

Option: epubcheck-version

If you want to use another epubcheck version as shipped within this repository, provide the name of the version. Currently 4.0.1 and 3.0.1 are available.

'4.0.1'

svrl-srcpath

Option: svrl-srcpath

XPath location of the Schematron SVRL error message. This affects also where the error message is rendered in the HTML report.

'BC_orphans'

debug

Option: debug

Used to switch debug mode on or off. Pass 'yes' to enable debug mode.

'yes'

debug-dir-uri

Option: debug-dir-uri

Expects a file URI of the directory that should be used to store debug information.

'debug'

status-dir-uri

Option: status-dir-uri

This variable expects an URI. The file (see option above) is saved to this URI.

'status'

Subpipeline

StepInputsOutputsOptions

p:variable epubcheck-path

concat('http://transpect.io/epubcheck-idpf/', ($epubcheck-version[normalize-space()], '4.0.1')[1],'/bin/epubcheck.jar')

tr:simple-progress-msg msg-epubcheck-start

source
msgs

 <c:messages>
   <c:message xml:lang="en">Starting EPUB check</c:message>
   <c:message xml:lang="de">Beginne EPUB-Prüfung</c:message>
 </c:messages>

result

file = 'epubcheck-start.txt'

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

cx:message d240e138

source

result on msg-epubcheck-start

result

message = '[info] epubcheck path: ', $epubcheck-path

tr:file-uri jar-file

source

result on d240e138

catalog

p:documenthttp://this.transpect.io/xmlcatalog/catalog.xml

resolver

p:documenthttp://transpect.io/xslt-util/xslt-based-catalog-resolver/xsl/resolve-uri-by-catalog.xsl

result

filename = $epubcheck-path

tr:file-uri epub-file

source

result on jar-file

catalog

p:documenthttp://this.transpect.io/xmlcatalog/catalog.xml

resolver

p:documenthttp://transpect.io/xslt-util/xslt-based-catalog-resolver/xsl/resolve-uri-by-catalog.xsl

result

filename = $epubfile-path

p:group do-check

p:variable jar

result on jar-file

/*/@os-path

p:variable epub

result on epub-file

/*/@os-path

p:exec execute-epubcheck

source

p:empty

result

result-is-xml = 'false'

errors-is-xml = 'false'

wrap-error-lines = 'true'

wrap-result-lines = 'true'

command = 'java'

args = concat('-jar ', $jar, ' ', $epub)

p:sink d240e194

source

result on execute-epubcheck

p:wrap-sequence d240e196

source

errors on execute-epubcheck

result

wrapper = 'document'

wrapper-prefix = 'cx'

wrapper-namespace = 'http://xmlcalabash.com/ns/extensions'

p:add-attribute d240e205

source

result on d240e196

result

match = '/cx:document'

attribute-name = 'epubcheck-path'

attribute-value = $epubcheck-path

p:add-attribute d240e210

source

result on d240e205

result

match = '/cx:document'

attribute-name = 'epubfile-path'

attribute-value = $epub

tr:store-debug d240e215

source

result on d240e210

result

pipeline-step = 'epubcheck/epubcheck.out'

active = $debug

base-uri = $debug-dir-uri

p:xslt convert-epubcheck-output

source

result on d240e215

stylesheet

p:document../xsl/epubcheck.xsl

result

tr:store-debug d240e232

source

result on convert-epubcheck-output

result

pipeline-step = 'epubcheck/epubcheck.svrl'

active = $debug

base-uri = $debug-dir-uri

tr:simple-progress-msg d240e239

source
msgs

 <c:messages>
   <c:message xml:lang="en">EPUB check finished</c:message>
   <c:message xml:lang="de">EPUB-Prüfung beendet</c:message>
 </c:messages>

result

file = 'epubcheck-start.txt'

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