Hi Bryan,
I think this can be done (up to a certain point) through the
xforms:relevant MIP. I have attached a test document that
demonstrates
the basic approach:
The structure of the instance is like this:
<root>
<e1>
<sub></sub>
</e1>
<e2>
<sub></sub>
</e2>
</root>
There is a binding that binds to every child of the
root-element, that
says that the node is only relevant if the text content of
the element's
"sub"-child is non-empty:
<xf:bind nodeset="/root/*"
relevant="string-length(./sub)>0"/>
Now, if only the second "sub"-element has text
content (aaa) the
following XML is submitted:
[d:]type sub2.xml
<?xml version="1.0"?>
<root><e2><sub>aaa</sub></e2>&
lt;/root>
Note that e1 is not submitted, because it got marked with
relevant=false.
Cheers,
Lars
bryan rasmussen wrote:
> Hi,
>
> I've asked this before and haven't heard a response
yet. In an Xform
> running in Open Office how do I stop output of elements
that are
> empty? This should basically stop output of all
elements where none of
> the descendant elements have input as well as stopping
the more
> prosaic output of empty elements
>
>
> Cheers,
> Bryan Rasmussen
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribe xml.openoffice.org
> For additional commands, e-mail: dev-help xml.openoffice.org
>
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe xml.openoffice.org
For additional commands, e-mail: dev-help xml.openoffice.org
|