problem with dynamic nodes in xforms

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

problem with dynamic nodes in xforms

Laxmi Narayana-3

Hi All,
 
I am using xforms-upload control aplication of ops 3.5.1 .
 
While click event on add ,it adds one more control.
 
So dynamically i have to get finame attributes in xpl. how to get it please help me.
 
Ex:
In xhtml:
<main-instance>
     <file filename="one.txt" mediatype="" size=""/>
     <file filename="two.txt" mediatype="" size=""/>
     <file filename="three.txt" mediatype="" size=""/>
 </main-instance>
 
in xpl:
xslt processor:
<xsl :for-each select="//file">
  <filename> <xsl:value-of select="//file/@filename"/></filename>
</xsl>
 
I need to get 3 filenames here .But here it is overriding . By using concat syntax how to get these three filenames at one node(means one.txt+two.txt+three.txt).

--
Please help me, I am new in XForms, It is urgent in my project!
Thanks in advance,
Laxmi Narayana.

--
Please help me, I am new in XForms, It is urgent in my project!
Thanks in advance,
Laxmi Narayana.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: problem with dynamic nodes in xforms

richhl
You can define this initial instance:

<xforms:instance id="fileset_inst">
        <main-instance>
                <file filename="one.txt" mediatype="" size=""/>
        <main-instance>
</xforms:instance>

and this template:

<xforms:instance id="filetemplate_inst">
                <file filename="noname.txt" mediatype="" size=""/>
</xforms:instance>

Then render the fileset group like this:

<xforms:repeat nodeset="instance('fileset_inst')">
        <xforms:upload ref="file">
                <xforms:filename ref="@filename"/>
                <xforms:mediatype ref="@mediatype"/>
                <xxforms:size ref="@size"/>
        </xforms:upload>
</xforms:repeat>

The action for adding a new file would be like this:

<xforms:action>
        <xforms:insert context="instance('fileset_inst')" nodeset="file" origin="instance('filetemplate_inst')"
                                    at="last()" position="after"/>
        <xforms:recalculate/>
</xforms:action>

You can send to the xpl something like:

> <main-instance>
>      <file filename="one.txt" mediatype="" size=""/>
>      <file filename="two.txt" mediatype="" size=""/>
>      <file filename="three.txt" mediatype="" size=""/>
>  </main-instance>
>

and your xslt can do what you need with that structure....

> in xpl:
> xslt processor:
> <xsl :for-each select="//file">
>   <filename> <xsl:value-of select="//file/@filename"/></filename> !!!!!!UMMMM //file/@filename or better @filename!!!!!
> </xsl>

don't know if I have understood well your problems

greetings,

rich


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws