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

Re: Relationship between @xpath-version and p:system-property('p:xpath-version')

From: Norman Walsh <ndw@nwalsh.com>
Date: Thu, 26 Jun 2008 10:26:20 -0400
To: public-xml-processing-model-wg@w3.org
Message-ID: <m28wwsw9v7.fsf@nwalsh.com>
/ Toman_Vojtech@emc.com was heard to say:
| OK, so if I have a pipeline like this:
|
| <p:pipeline xpath-version="1.0" xmlns:x="http://www.test.com">
|   <p:declare-step type="x:test" xpath-version="2.0">
|     <p:choose>
|       <p:when test="p:system-property('p:xpath-version') = '1.0'">
|         <p:identity>
|           <p:input port="source">
|             <p:inline>
|               <p>XPath 1.0</p>
|             </p:inline>
|           </p:input>
|         <p:identity>
|       </p:when>
|       <p:otherwise>
|         <p:identity>
|           <p:input port="source">
|             <p:inline>
|               <p>XPath 2.0</p>
|             </p:inline>
|           </p:input>
|         <p:identity>
|       </p:otherwise>
|     </p:choose>
|   </p:declare-step>
|
|   <x:test/>
| </p:pipeline>
|
| What will be the result? If p:xpath-version is set on 'per run' basis,
| will it always produce <p>XPath 1.0</p>? Or, if the processor is XPath
| 2.0 based, may I get <p>XPath 2.0</p>?

That's an interesting question.

If the processor (only) supports XPath 1.0, then you'll get <p>XPath 1.0</p>

If the processor supports XPath 2.0, then it will be required to process
XPath expressions in this pipeline using XPath 1.0 backwards compatibility
mode. However, we don't say that p:xpath-version should reflect that.
I wonder if we should.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | Labor, n. One of the processes by which
http://nwalsh.com/            | A acquires property for B.--Ambrose
                              | Bierce

Received on Thursday, 26 June 2008 14:26:55 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 June 2008 14:26:55 GMT