AB p:invisible-xml 003
Tests p:invisible-xml (Example 3 from spec)
Test is expected to pass.
The pipeline
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0" version="3.0">
<p:output port="result"/>
<p:invisible-xml fail-on-error="false">
<p:with-input port="grammar">
<p:inline content-type="text/plain">
date: s?, day, s, month, (s, year)? .
-s: -" "+ .
day: digit, digit? .
-digit: "0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"; "8"; "9".
month: "January"; "February"; "March"; "April";
"May"; "June"; "July"; "August";
"September"; "October"; "November"; "December".
year: (digit, digit)?, digit, digit .
</p:inline>
</p:with-input>
<p:with-input port="source">
<p:inline content-type="text/plain">31 Mumble 2021</p:inline>
</p:with-input>
</p:invisible-xml>
</p:declare-step>
Result
<fail xmlns:ixml="http://invisiblexml.org/NS"
xmlns:t="http://xproc.org/ns/testsuite/3.0" ixml:state="failed">
<line>1</line>
<column>4</column>
<pos>4</pos>
<unexpected>M</unexpected>
<permitted>' ', 'A', 'D', 'F', 'J', 'M', 'N', 'O', 'S'</permitted>
<completions>
<completed rule="day" start="1" end="2">
<input>31</input>
</completed>
</completions>
<could-be-next>
<in rule="month">
<tokens>'A', 'D', 'F', 'J', 'M', 'N', 'O', 'S'</tokens>
</in>
</could-be-next>
<unfinished>
<open rule="date" start="1" end="3">
<input>31 </input>
</open>
</unfinished>
</fail>
Schematron checks
<s:schema xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://purl.oclc.org/dsdl/schematron" xmlns:t="http://xproc.org/ns/testsuite/3.0"
queryBinding="xslt2">
<s:ns uri="http://invisiblexml.org/NS" prefix="ixml"/>
<s:pattern>
<s:rule context="/">
<s:assert test="*/@ixml:state='failed'">The root element does not have attribute 'ixml:state' with value 'fail'.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 14 Sep 2024, Achim Berndzen
- Changed step's name to p:invisible-xml
- 25 Nov 2023, Achim Berndzen
- Initial check in.