…or how we eliminated cx:depends-on="ndw"
Achim Berndzen, <xml-project /> (@xml_project)
Gerrit Imsieke (@gimsieke),
le-tex publishing services GmbH (@letexml)
Joint project of le-tex publishing services and <xml-project />
Is it possible to run the same real-world pipelines on two processors and produce the same results?
Is it possible to run the same real-world pipelines on two processors and produce the same results?
Pipeline users: | Freedom of choice |
---|---|
Pipeline authors: | Write once, use everywhere |
Technology decision makers: | No vendor lock-in, protection of investment |
XProc community: | Approval of the work done, hints at future tasks |
Start
complex pipeline system
Finish
Start
Finish
p:
pxp:
and pos:
(EXProc)cx:
(Calabash)Functionality | Technology |
---|---|
|
|
Methodology | |
|
docx2jats-demo
├── a9s
│ ├── common
│ │ ├── css
│ │ ├── epubtools
│ │ ├── evolve-hub
│ │ ├── hub2jats
│ │ ├── jats2html
│ │ ├── schematron
│ │ │ ├── evolve-hub
│ │ │ ├── flat
│ │ │ ├── jats
│ │ │ └── styles
│ │ ├── styles
│ │ ├── xpl
│ │ └── xsl
│ └── Imprint1
│ └── Journal1
│ ├── schematron
│ │ └── jats
│ └── styles
├── calabash
│ ├── distro
│ └── extensions
│ └── transpect
├── cascade
├── conf
├── css-tools
├── docx2hub
├── epubcheck-idpf
├── epubtools
├── evolve-hub
├── htmlreports
├── hub2html
├── hub2jats
├── jats2html
├── map-style-names
├── nlm-stylechecker
├── xmlcatalog
├── xproc-util
└── xslt-util
cx:eval
)<tr:xslt mode="hub:split-at-tab"/>
<tr:xslt mode="hub:preprocess-hierarchy"/>
<tr:xslt mode="hub:hierarchy"/>
<tr:xslt mode="hub:postprocess-hierarchy"/>
<hub:evolve-hub_lists-by-indent/>
<tr:xslt-mode mode="hub:clean-hub"/>
<tr:xslt mode="hub:split-at-tab"/>
<tr:xslt mode="hub:preprocess-hierarchy"/>
<tr:xslt mode="hub:hierarchy"/>
<tr:xslt mode="hub:postprocess-hierarchy"/>
<hub:evolve-hub_lists-by-style-name/>
<tr:xslt-mode mode="hub:clean-hub"/>
docx2jats-demo
├── a9s
│ ├── common
│ │ └── evolve-hub
│ │ ├── driver.xpl
│ │ └── driver.xsl
│ └── Imprint1
│ ├── evolve-hub
│ │ └── driver.xsl
│ └── Journal1
│ └── evolve-hub
│ ├── driver.xpl
│ └── driver.xsl
(see XML Amsterdam 2015 presentation)
<xproc-config xmlns="http://xmlcalabash.com/ns/configuration"
xmlns:tr="http://transpect.io">
<implementation type="tr:unzip" class-name="UnZip"/>
<implementation type="tr:validate-with-rng" class-name="LtxValidateWithRNG"/>
<implementation type="tr:image-identify" class-name="ImageIdentify"/>
<implementation type="tr:image-transform" class-name="ImageTransform"/>
</xproc-config>
<tr:image-identify name="ii">
<p:with-option name="href"
select="/epub-config/cover/@href"/>
</tr:image-identify>
<c:results name="narrow-cover.png">
<c:result name="mimetype" value="image/png"/>
<c:result name="formatdescription" value="PNG Portable Network Graphics"/>
<c:result name="formatdetails" value="Png"/>
<c:result name="width" value="219px"/>
<c:result name="height" value="131px"/>
<c:result name="density" value="90dpi"/>
<c:result name="colorspace" value="RGB"/>
<c:result name="transparency" value="true"/>
<c:result name="compressionalgorithm" value="PNG Filter"/>
</c:results>
Start
Finish
XMLCalabash | MorganaXProc | |
---|---|---|
Developed by: | Norman Walsh – Chair of W3C WG |
<xml-project /> – German start up |
Since: | 2008. Reference implementation for W3C recommendation | Publicly available since early 2014 |
Recent version: | 1.1.9 (more than 80 releases) | 0.95–10 (11th release – public beta) |
Test suite score: | 100% | 99.67% (Three tested optional features not implemented) |
Highlights: |
|
|
Licence: | GPL 2.0 | GPL 2.0 |
Status: | Gold standard | New kid on the block |
Start
Finish
For our concrete migration project:
The evaluation order of steps not connected to one another is implementation-dependent.
But, what if:
<nasp:log-in-to-a-web-service/>
<nasp:send-data-to-this-service/>
Solution: extension attribute 'depends-on'
Problem: | Solution: |
---|---|
Resource management | Add XML Catalog support to MorganaXProc |
Divergent interpretation on <p:store/> etc. | Adapt MorganaXProc to XML Calabash’s interpretation |
User defined steps in a secondary language | Rewrite steps for MorganaXProc |
Namespace declarations without proper URIs | Change pipelines by hand |
Missing primary result for <p:xslt/> | |
Divergent message and eval steps | XProc to the rescue |
Different EXproc lib import mechanism | |
Implementation specific attribute "depends-on" | |
Different behaviour in <pxf:mkdir/> | |
Different errors for "file://" in <p:http-request/> |
Basic idea:
Use XProc pipelines to ensure interoperability of XProc pipeline.
Two pipelines needed:
<p:declare-step type="iop:message">
<p:input port="source" sequence="true" />
<p:output port="result" sequence="true" />
<p:option name="message" required="true" />
<cx:message p:use-when=
"p:system-property('p:product-name') = 'XML Calabash'">
<p:with-option name="message" select="$message" />
</cx:message>
<mod:report p:use-when=
"p:system-property('p:product-name') = 'MorganaXProc'">
<p:with-option name="message" select="$message" />
</mod:report>
</p:declare-step>
Publicly available on github: https://github.com/xml-project
Is it possible to run the same real-world pipelines on two processors and produce the same results?
Pipeline users: | It is easy to make even complex pipelines interoperable. Just use our two pipelines. |
---|---|
Pipeline authors: |
|
Technology decision makers: | Do not worry about vendor-lockins or reusability of pipelines: XProc is a great tool! |
XProc community: | The Working Group did a really great job! |
But:
We are not completely finished with making XProc a fully useful and interoperable language.
Thank you!