Node creation functions

We have a wiki page:
http://www.w3.org/MarkUp/Forms/wiki/Node_Creation_XPath_Functions

This indicates the functions are "already in Orbeon".  OK, why?

A too-technical answer is "it would be nice to create elements/attributes 
not expressed beforehand in an instance", but I'm asking what are the use 
cases for the element() and attribute() functions?

For example, one could say "I was trying to write a form that would be an 
XML editor and so I need to be able to create nodes whose names are 
defined by a user, not by a form author who wrote an instance."  Question: 
Was this the use case, or are there any others?

Going a bit further, we now have a version of spec-ready text:
http://www.w3.org/MarkUp/Forms/wiki/XPath_Expressions_Module#Node_creation_Functions

Feedback:
1) it would be good for the examples to show the serialization of the 
nodes created by the example function calls
2) more text is needed to indicate what happens, if anything, in invalid 
scenarios, e.g. what if the qname contains an undefined namespace prefix? 
3) More text needed to describe how the created nodes connect to the rest 
of the machinery of XML.  For example, is the example given really 
intended to assign an ID to an attribute?  Will subsequent calls to id() 
return the node?  Can ID-ness be attached by adding an xsi:type attribute 
to an element being created?  Does attribute creation include the ability 
to create namespace declarations?
4) Provide a real example where the attribute() function must be called 
independently of the element() function, such as inserting an attribute.

Thanks,
John M. Boyer, Ph.D.
Distinguished Engineer, IBM Forms and Smarter Web Applications
IBM Canada Software Lab, Victoria
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

Received on Tuesday, 1 November 2011 19:10:13 UTC