Inserting attributes

This should work right?


  <instance>
     <tests xmlns="">
        <test attr=""/>
     </tests>
  </instance>


  <instance id="template">
     <template xmlns="">
        <test pass="" res="1" req="1"/>
     </template>
  </instance>


 <action ev:event="xforms-ready">
             <insert ref="test/@attr" 
origin="instance('template')/test/@pass"/>
         </action>




So should this right?


             <insert ref="test/@*" origin="instance('template')/test/@*"/>


But what if test/@* is empty? What is then the correct formulation?


The spec says:


if the target-sequence is empty, the context node from the in-scope 
evaluation context is used;


but that is not what we want.


Is the correct formulation this?


             <insert context="test/@*" 
origin="instance('template')/test/@*"/>


Clearly we should have some examples.


Steven

Received on Wednesday, 2 June 2021 11:30:10 UTC