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

/ 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 UTC