RE: re injecting options and another question

If my assumption was correct (I still haven't seen anyone from the WG confirming it), you can probably differentiate between options with the same names by creating a third custom option + a condition that will affect only one of the real options.

Example:
<p:pipeline xmlns:p="http://www.w3.org/ns/xproc">
 <p:option name="allow-version-mismatch-on-XSLT2" value="yes"/>
 <p:option name="allow-version-mismatch-on-XQuery2" value="yes"/>
 <p:option name="template-name" value="start"/>
 <p:choose>
  <p:when test=”$allow-version-mismatch-on-XSLT2 = ‘yes’ and allow-version-mismatch-on-XQuery2= ‘no’”>
   <p:option name=”allow-version-mismatch” value=”yes”>
   <p:xslt2>
    <p:input port="stylesheet">
     <p:document href="stylesheet1.xsl"/>
    </p:input>
   </p:xslt2>
   <p:xslt2>
    <p:input port="stylesheet">
     <p:document href="stylesheet2.xsl"/>
    </p:input>
   </p:xslt2>
   <p:xslt2>
    <p:option name="template-name" value="finish"/>
    <p:input port="stylesheet">
     <p:document href="stylesheet2.xsl"/>
    </p:input>
         </p:xslt2>
         <p:option name=”allow-version-mismatch” value=”no”>
         <p:xquery2/>
         <p:unescape-markup/>
         <p:xquery2/>
        </p:when>
        <p:when test=”$allow-version-mismatch-on-XSLT2 = ‘no’ and allow-version-mismatch-on-XQuery2= ‘yes’”>
   <p:option name=”allow-version-mismatch” value=”no”>
   <p:xslt2>
    <p:input port="stylesheet">
     <p:document href="stylesheet1.xsl"/>
    </p:input>
   </p:xslt2>
   <p:xslt2>
    <p:input port="stylesheet">
     <p:document href="stylesheet2.xsl"/>
    </p:input>
   </p:xslt2>
   <p:xslt2>
    <p:option name="template-name" value="finish"/>
    <p:input port="stylesheet">
     <p:document href="stylesheet2.xsl"/>
    </p:input>
         </p:xslt>
         <p:option name=”allow-version-mismatch” value=”yes”>
         <p:xquery2/>
         <p:unescape-markup/>
   <p:xquery2/>
  </p:when>
  <!--All other possible cases I won’t bother to describe-->
 </p:choose>
</p:pipeline>

It's very verbose, I know. But you can encompass the whole process as your own pipeline so that you can call it as a single step. Think of it as a set of named XSLT templates, one chosen based on the value of a parameter. It's pretty much the same deal here.

-----Original Message-----
From: public-xml-processing-model-comments-request@w3.org [mailto:public-xml-processing-model-comments-request@w3.org] On Behalf Of James Fuller
Sent: Tuesday, October 09, 2007 9:04 AM
To: public-xml-processing-model-comments@w3.org
Subject: re injecting options and another question


Thx Vasil and Jeni,

I think we are all on the same page .... but I am struggling with
interpreting this bit of implicit behavior from the spec.

If anyone can point to the relevant area in spec are allowing for
implementator determined behavior e.g. injecting options, would be
great.

now for another option related question,

perhaps someday there will be an p:xquery2 and it will also have an

    allow-version-mismatch

attribute, and it will be part of official optional or required
step(lets say Xproc v2.0)

IT is unclear in Vasil example, and setting from commandline how XProc
would disambiguate options with the same names?

cheers, Jim Fuller

Received on Tuesday, 9 October 2007 10:42:41 UTC