W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > May 2012

Use Case 5.32 Pipeline

From: Alex Milowski <alex@milowski.com>
Date: Wed, 23 May 2012 11:45:49 -0700
Message-ID: <CABp3FNLVgN3cpzRpHci1ty8QXk096ZPuagpeCdtFpOS+nHP2rQ@mail.gmail.com>
To: XProc WG <public-xml-processing-model-wg@w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 23 May 2012 18:46:19 GMT