Rahul Agarwal wrote:
There is somewhat a complex situation. I receive the data through an external XML file in "/Root/Rs/...". Each control on the page is bound to some node in this tree but a node may not be received in a particular situation. It all happens during run-time depending on user group and access rights. If a particular node is not received, control bound to this node will not be rendered on the screen. I need to attach other bind expressions like "required", "count" etc on various controls. Orbeon throws error if I give "nodeset" or "ref" attribute mapped to a node which does not exist in <xforms:instance> So, the solution I found was -
1. for "ref" attribute - I handle it using XSL like this -
<xsl:if test="/Root/Rs/DwellUseCd">
<xforms:input ref="/Root/Template/DwellUseCd"/>
</xsl:if>
2. for "nodeset" attribute - I map it to a template node (which contains all possible nodes) and copy the contents of "/Root/Rs/..." using "calculate" bind expression. This way, when the page is rendered, it gets the correct initial value.
I see. Right now in Presentation Server:
1) A "ref" attribute must reference exacly one node in the instance, otherwise you will get an error.
2) However, the "nodeset" attribute in an <xforms:bind> can reference zero, one, or more nodes. If it does not reference any node, it has no effect.
So it seems to me that in your case, you do not need this other /Root/Template section of the instance where you copy data over. Just work on the /Root/Rs and have both the <bind> elements and the control elements reference nodes under /Root/Rs.
By having an <xforms:if> around the XForms controls, you will make sure that a control is not displayed if the element it is bound to is not there in the instance. And the <bind nodeset="..."> pointing to inexistent elements will just have no effect, but you won't get an error. Would this scheme work for you?
Alex
------------------------------------------------------- This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 _______________________________________________ orbeon-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/orbeon-user
