W3C home > Mailing lists > Public > www-forms@w3.org > January 2009

Re: Clarification needed on cloning for insertion

From: Erik Bruchez <ebruchez@orbeon.com>
Date: Tue, 27 Jan 2009 19:48:08 -0800
Cc: xforms <www-forms@w3.org>
Message-Id: <C748056B-24A4-4E31-A8D4-A3088422C175@orbeon.com>
To: Forms WG <public-forms@w3.org>

Good point. For reference, XInclude, XSLT 2 and XProc all have a  
notion of namespace fixup:


What happens upon insertion in XForms is similar to the operations  
described in those specifications. We should get some inspiration from  


On Jan 26, 2009, at 5:27 PM, John Boyer wrote:

> In bullet 6 of the insert action [1], it states that the origin  
> nodes are cloned.  Step 8 then describes inserting the cloned nodes  
> into the XForms instances.
> [1] http://www.w3.org/MarkUp/Forms/specs/XForms1.1/index-diff.html#action-insert
> The specification assumes that the cloning/inserting will be done in  
> a way that preserves the integrity of the cloned nodes with respect  
> to XML namespaces.  This is based on the statement that XForms is  
> backed by an XPath data model.  However, since many implementations  
> use DOM machinery to implement, it is worth clarifying the  
> difference between simple DOM cloning versus what is actually  
> expected.
> For example, suppose you have an origin node E in the following  
> context:  <prototypes xmlns="abc"> <E>hello</E> </prototypes>
> Now suppose you insert it into live data as follows:  <livedata  
> xmlns="xyz"> </livedata>
> The question has arisen which of the two results is obtained:
> A) <livedata xmlns="xyz"> <E>hello</E> </livedata>
> B) <livedata xmlns="xyz"> <E xmlns="abc">hello</E> </livedata>
> The answer should be choice B, since an element in the XPath data  
> model is defined by its local name plus its namespace URI.
> Further it is easier to see that this should be the case for  
> consistency with the following example.
> Suppose you have an origin node E in the following context:   
> <prototypes  xmlns:e="abc"> <e:E>hello</e:E> </prototypes>
> Now suppose you insert it into live data as follows:  <livedata  
> xmlns="xyz"> </livedata>
> A) <livedata xmlns="xyz"> <e:E>hello</e:E> </livedata>
> B) <livedata xmlns="xyz"> <e:E xmlns:e="abc">hello</e:E> </livedata>
> It is clear that answer B is correct since answer A, where there is  
> an absence of proper namespace processing in the cloning process,  
> results in an XML well-formedness violation.
> John M. Boyer, Ph.D.
> STSM, Interactive Documents and Web 2.0 Applications
> Chair, W3C Forms Working Group
> Workplace, Portal and Collaboration Software
> IBM Victoria Software Lab
> E-Mail: boyerj@ca.ibm.com
> Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer
> Blog RSS feed: http://www.ibm.com/developerworks/blogs/rss/JohnBoyer?flavor=rssdw

Orbeon Forms - Web Forms for the Enterprise Done the Right Way
Received on Wednesday, 28 January 2009 03:48:50 UTC

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