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

Inserting the current node to a remote target

From: Clark, John <CLARKJ2@ccf.org>
Date: Fri, 2 Feb 2007 15:20:40 -0500
Message-ID: <F122C25B4CD6F34BB119A97593679601027CA7FF@CCHSCLEXMB59.cc.ad.cchs.net>
To: www-forms@w3.org

If you are within a particular XPath context, how can you insert the
current context element (e.g. copy it) into a particular empty element?
For example, say you have the following snippet (with the `xf` prefix
bound to the XForms namespace and the `ev` prefix bound to the XML
Events namespace):

  <xf:group ref="what-you-want-to-copy">
    <xf:trigger><xf:label>Do the copy</xf:label>
      <xf:insert nodeset="instance('target')/location" origin="."
ev:event="DOMActivate"/>
    </xf:trigger>
  </xf:group>

As written, this will insert `what-you-want-to-copy` as the next sibling
of `target/location` (by rule 1.d of the processing rules for the insert
action), but we want it to be a child of `target/location` instead.  Now
`nodeset="instance('target')/location/*"` doesn't work, because that's
an empty node set, and we can't use the `current` attribute to change
the insert context or we can no longer reference
`what-you-want-to-copy`.  What's an XMLiphile to do?

Take care,

    John L. Clark  |  Systems Analyst
                   |  Cardio-Thoracic Surgery Research
 Cleveland Clinic  |  9500 Euclid Ave.   |  Cleveland, OH 44195
                   |  (216) 445-6011





Cleveland Clinic is ranked one of the top 3 hospitals in
America by U.S.News & World Report. Visit us online at
http://www.clevelandclinic.org for a complete listing of
our services, staff and locations.


Confidentiality Note:  This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law.  If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If
you have received this communication in error,  please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy.  Thank you.


===================================
Received on Friday, 2 February 2007 20:21:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:08 GMT