W3C home > Mailing lists > Public > www-forms@w3.org > February 2005

RE: Can xforms add attributes to elements in instance data?

From: Mark Birbeck <mark.birbeck@x-port.net>
Date: Mon, 14 Feb 2005 10:40:20 -0000
To: "'jason'" <jeacott@hardlight.com.au>
Cc: <www-forms@w3.org>
Message-ID: <00fe01c51281$97b8a9b0$0c01a8c0@W100>


> 	I was recently trying to use xforms to manipulate a
> pretty basic bit of xml. I needed the ability to dynamically 
> add elements AND attributes. The elements bit was ok, I can 
> do that with an xf:insert, but what about attributes?

You need to use xf:duplicate, which is a feature of XForms 1.1 [1]. The
major difference between xf:duplicate and xf:insert is that the latter can
only insert a node into a nodeset, the former can also append a child to a

Despite being a 1.1 feature, we have already implemented xf:duplicate in
formsPlayer, since as you have rightly indicated it is crucial to producing
powerful forms. Forms like our RSS Reader side-bar [2] are only possible
with the new xf:duplicate and xf:destroy features.

I believe other processors have also implemented xf:duplicate/xf:destroy in
their 'version 1' processors, but I don't know which ones for certain, so
it's probably best if those responsible reply to this thread ... just in
case I get it wrong!

If anyone would like to see how xf:duplicate and xf:destroy can be used, you
can view the fully commented source code for the formsPlayer RSS Reader here
(even without installing formsPlayer):




[1] <http://www.w3.org/TR/xforms11/#duplicate-action>

[2] The side-bar is installed automatically when using fP 1.3.
    To access it, go to:

      View >> Explorer Bar >> formsPlayer RSS Reader

Mark Birbeck
x-port.net Ltd.

e: Mark.Birbeck@x-port.net
t: +44 (0) 20 7689 9232
w: http://www.formsPlayer.com/
b: http://internet-apps.blogspot.com/

Download our XForms processor from
Received on Monday, 14 February 2005 10:41:09 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:14 UTC