ebnf-convert-002
Tests that cx:ebnf-convert accepts explicit type.
Test is expected to pass.
The pipeline
<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions"
xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0" name="main" version="3.0">
<p:import href="https://xmlcalabash.com/ext/library/ebnf-convert.xpl"/>
<p:output port="result" sequence="true"/>
<cx:ebnf-convert notation="ixml">
<p:with-input port="source">
<p:inline content-type="text/plain">
S: A | B | C.
A: "a".
B: "b".
C: ().
</p:inline>
</p:with-input>
</cx:ebnf-convert>
<p:wrap-sequence wrapper="wrapper"/>
</p:declare-step>
Result
<wrapper xmlns:t="http://xproc.org/ns/testsuite/3.0">/* converted on Thu Jun 19, 2025, 18:02 (UTC) by ixml-to-w3c v0.70 which is Copyright (c) 2011-2025 by Gunther Rademacher <grd@gmx.net> */
S ::= ( 'a' | 'b' )?</wrapper>
Schematron checks
<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron"
xmlns:t="http://xproc.org/ns/testsuite/3.0" queryBinding="xslt2">
<s:pattern>
<s:rule context="/">
<s:assert test="wrapper">The root is wrong.</s:assert>
<s:assert test="contains(wrapper, '::=')">Grammar is wrong.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 24 Feb 2025, Norm Tovey-Walsh
- Created test.