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

Re: Use Case 5.32 Pipeline

From: Innovimax W3C <innovimax+w3c@gmail.com>
Date: Thu, 24 May 2012 01:06:13 +0200
Message-ID: <CAAK2GfHvK3aD4cqx-CApUrLUtkUKu+HKHjTMw_A0RkNZ1144rw@mail.gmail.com>
To: XProc WG <public-xml-processing-model-wg@w3.org>
Interesting side effet

In the process of trying to propose some alternate rewriting using p:template

I did this

<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:template>
    <p:input port="template">
      <p:inline>
        <root>
          Is XQuery available { p:step-available('p:xquery') }
        </root>
      </p:inline>
    </p:input>
    <p:input port="source">
      <p:empty/>
    </p:input>
    <p:input port="parameters">
      <p:empty/>
    </p:input>
  </p:template>
</p:declare-step>

And I get this error :

err:XD0023 : Invalid XPath expression: ' p:step-available('p:xquery')
'. It is a dynamic error if an XPath expression is encountered which
cannot be evaluated (because it is syntactically incorrect, contains
references to unbound variables or unknown functions, or for any other
reason).

My problem is that we didn't define in
http://www.w3.org/TR/xproc-template/, what the XPath context contains
!!

So I cannot even blame Calabash !!

Mohamed


On Wed, May 23, 2012 at 8:45 PM, Alex Milowski <alex@milowski.com> wrote:
> <?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>



-- 
Innovimax SARL
Consulting, Training & XML Development
9, impasse des Orteaux
75020 Paris
Tel : +33 9 52 475787
Fax : +33 1 4356 1746
http://www.innovimax.fr
RCS Paris 488.018.631
SARL au capital de 10.000 
Received on Wednesday, 23 May 2012 23:06:44 GMT

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