RE: is XForms suitable for my problem ?

Hi,
 
I am not sure if this is the most elegant way but this works using
formsplayer.
 
<html xmlns:ev=" http://www.w3.org/2001/xml-events
<http://www.w3.org/2001/xml-events> " xmlns:xforms="
http://www.w3.org/2002/xforms <http://www.w3.org/2002/xforms> " xmlns="
http://www.w3.org/2002/06/xhtml2 <http://www.w3.org/2002/06/xhtml2> ">
 <head>
  <object width="0" height="0" id="FormsPlayer"
classid="CLSID:4D0ABA11-C5F0-4478-991A-375C4B648F58">
   <b>FormsPlayer has failed to load! Please check your installation.</b>
   <br />
   <br />
  </object>
  <?import namespace="xforms" implementation="#FormsPlayer"?>
  <xforms:model>
   <xforms:instance>
    <article>
     <section>
      <section>
       <section>
        <para>
         <ulink url="doc1.pdf">document 1</ulink>
        </para>
        <para>
         <ulink url="doc2.pdf">document 2</ulink>
        </para>
       </section>
       <section>
        <para>
         <ulink url="doc3.pdf">document 3</ulink>
        </para>
       </section>
      </section>
     </section>
    </article>
   </xforms:instance>
  </xforms:model>
 </head>
 <body>
  <xforms:repeat id="repSection1" nodeset="/article/section">
   <xforms:repeat id="repSection2" nodeset="section">
    <xforms:repeat id="repSection3" nodeset="section">
     <xforms:output>Start Repeat</xforms:output>
     <xforms:repeat id="repulink" nodeset="para/ulink">
      <xforms:output ref="." />
      <xforms:trigger>
       <xforms:label>delete</xforms:label>
       <xforms:delete ev:event="DOMActivate"
nodeset="/article/section/section/section[index('repSection3')]/para/ulink"
at="index('repulink')" />
      </xforms:trigger>
     </xforms:repeat>
     <br/>
    </xforms:repeat>
   </xforms:repeat>
  </xforms:repeat>
 </body>
</html>
 
Regards
 
Rhydian Morris
 
www.xformation.com <http://www.xformation.com> 

-----Original Message-----
From: LEBUR Guillaume [mailto:guillaume.lebur@justice.fr]
Sent: 05 April 2005 14:15
To: www-forms@w3.org
Subject: RE: is XForms suitable for my problem ?


Hi,
 
I'm having a hard time trying to understand  how to use XPath in XForms
actions. Especially when it comes to performing an action nested in a
<repeat> :
 
<repeat nodeset="/article/section"> 
   <repeat nodeset="section"> 
    <repeat nodeset="section">
            <output ref="para/ulink"/>
            <group><trigger>  
                 <label>delete</label>
                 <delete ev:event="DOMActivate" nodeset="section"
at="para/ulink"/>
       </trigger></group>
    </repeat>
  </repeat>
</repeat>
 
With instance data like this :
 
<article>
    <section>
        <section>
            <section>
                <para><ulink url="doc1.pdf">document 1</ulink></para>
                <para><ulink url="doc2.pdf">document 2</ulink></para>
            </section>
            <section> 
                <para><ulink url="doc3.pdf">document 3</ulink></para>
            </section>
        </section>
    </section>
<:article>
 
In front of each document title (ulink), there must be a button to delete
this document.
I don't know what to put in the nodeset and at attributes of the <delete>
action. Is nodeset compulsory since we are inside a <repeat> element ?
 
 
 
Thanks for your help.
 

 
Guillaume Lebur


 
 

Received on Tuesday, 5 April 2005 13:51:59 UTC