Static variables/option 038

Tests that two sibling steps can declare a static variable with the same name.

Test ab-static-option-var-038.xml is expected to pass.

The pipeline


        <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="main" version="3.0">
            <p:output port="result"/>

            <p:declare-step type="dummy:test1">
                <p:output port="result"/>
                <p:variable static="true" name="static-variable" select="13"/>

                <p:identity>
                    <p:with-input>
                        <doc1 xmlns="">{$static-variable}</doc1>
                    </p:with-input>
                </p:identity>
            </p:declare-step>

            <p:declare-step type="dummy:test2">
                <p:output port="result"/>
                <p:variable static="true" name="static-variable" select="14"/>

                <p:identity>
                    <p:with-input>
                        <doc2 xmlns="">{$static-variable}</doc2>
                    </p:with-input>
                </p:identity>
            </p:declare-step>

            <dummy:test1 xmlns:dummy="http://dummy" name="one"/>
            <dummy:test2 xmlns:dummy="http://dummy" name="two"/>

            <p:wrap-sequence wrapper="result">
                <p:with-input pipe="@one @two"/>
            </p:wrap-sequence>
        </p:declare-step>
    
MorganaXProc passing XML Calabash failing

Schematron validation


        <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron">
            <s:ns prefix="c" uri="http://www.w3.org/ns/xproc-step"/>

            <s:pattern>
                <s:rule context="/">
                    <s:assert test="result">The pipeline root is not “result”.</s:assert>
                    <s:assert test="result/doc1/text()='13'">Text child of doc1 is not
                        '13'.</s:assert>
                    <s:assert test="result/doc2/text()='14'">Text child of doc1 is not
                        '14'.</s:assert>
                </s:rule>
            </s:pattern>
        </s:schema>
    

Revision history

13 Oct 2018, Achim Berndzen

Initial test