How-to: Edit hierarchical structure with tree-view navigation

Posted by Gerrit Boers on
URL: https://discuss.orbeon.com/How-to-Edit-hierarchical-structure-with-tree-view-navigation-tp3677789.html

Hi,

I have another how-to, it's a universal tree-view based master-detail viewer/editor. Before I start writing I would like to check the basic assumption underlying this form:

For any element in an xml document the count(preceding::*)+count(ancestor::*)  uniquely identifies that element.

The tree-view is bound to a navigation instance:

<xforms:select1 ref="instance('navigation')" appearance="xxforms:tree">

The tree-view has the following itemset (all elements in the document):

<xforms:itemset nodeset="instance('xml-instance')//*">

Label and value are:

<xforms:label ref="name()"/>
<xforms:value ref="count(preceding::*)+count(ancestor::*)"/>

The detail view works like this:

<xforms:group ref="instance('xml-instance')//*[count(preceding::*)+count(ancestor::*)=instance('navigation')]">


Here's a screen capture with the form showing itself:


If my assumption is correct, this form can navigate and show/edit any xml document.


Regards,

Gerrit




--
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