Use Case 5.32 Pipeline

Rather than make a very complicated example, this one just
demonstrates how you'd start with a p:choose that wraps what you want
to do (output <green/> in this case) if p:xquery is available.

<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
    xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0">
    <p:output port="result"/>
    <p:choose>
        <p:when test="p:step-available('p:xquery')">
            <p:identity>
                <p:input port="source">
                    <p:inline><green/></p:inline>
                </p:input>
            </p:identity>
        </p:when>
        <p:otherwise>
            <p:identity>
                <p:input port="source">
                    <p:inline><red/></p:inline>
                </p:input>
            </p:identity>
        </p:otherwise>
    </p:choose>
</p:declare-step>

-- 
--Alex Milowski
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics

Received on Wednesday, 23 May 2012 18:46:19 UTC