W3C home > Mailing lists > Public > xproc-dev@w3.org > October 2012

toggling the value of an attribute on a substep based on a passed in option

From: David Cramer <david@thingbag.net>
Date: Sat, 13 Oct 2012 09:18:55 -0500
Message-ID: <5079784F.1040507@thingbag.net>
To: XProc Dev <xproc-dev@w3.org>
Hi there,
So I'd like to achieve the effect of doing something like the following,
where I pass in dtd-id-idref-warnings as an option and then use the
value of the passed in option to toggle the value of the attribute
dtd-id-idref-warnings: dtd-id-idref-warnings="${dtd-id-idref-warnings}".
But that's clearly the wrong way to do it.

<p:declare-step version="1.0"
        <p:option name="dtd-id-idref-warnings" select="'true'"/>


  <p:input port="source">
    <p:pipe step="main" port="source"/>
  <p:input port="schema">
    <p:pipe step="main" port="schema"/>

I've also tried doing a choose/when with a validate-with-relax-ng in
each branch, but then there are problems with the visibility of the
result port from xmlvalidate.

So what's the right way to achieve this? I could have two complete
different versions of the step, but I was hoping there was a more
elegant way.

Received on Saturday, 13 October 2012 14:19:23 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:17:05 UTC