logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: Passing XML-Instance but only use some 'data': msg#00047

Subject: Re: Passing XML-Instance but only use some 'data'
hi carsten,

check out the 'setvalue' action and use a second instance, e.g. sth. like:

<xf:setvalue ref="instance('i-2')/item[1]" value="instance('i-1')/item[1]"/>

you'd have to do this for every item which value should be copied.

another approach would be to preprocess the instance data with XSLT in order to select only the data you need to edit. you could plug in an URIResolver which performs the XSLT transformation. the advantage would be to have an instance not too large to be processed effectively by Chiba. but then you can't decide within the XForm which data to edit. this is only possible with 'relevant', since it's not a flag, but a dynamically computed property.

hope this helps, uli.

Carsten Sandtner wrote:
Hello,

ok, I just tested and it works. It's a pitty that relevant is
default="true". The XML-Document I have is not "small".

Is there a way of filling an instance out of an other instance?

What I mean is, load the XML as an instance, and use this in an other
instance at the same XForm, using only the values of instance#1?

I tried a bit, but maybe I am to tired this evening or it is not possible.

Again, any suggestions would help.

Cheers,

C. Sandtner


Hello Carsten,

If the xforms relevant attribute on any instance XML element evaluates
to false(), then when the instance is submitted those elements will not
be included.  Check out

http://www.w3.org/TR/xforms/slice6.html#model-prop-relevant

http://xformsinstitute.com/essentials/browse/book.php#ch08-77004

It is pretty straight forward to "turn off" the submission of certain
elements based on combinations of XPath functions, and this works as
expected in Chiba.  If you need an example, I can cook one up.  Also,
check out /forms/wizard-with-relevant.xhtml in the default distribution
of Chiba.

Zach Roberts



Carsten Sandtner wrote:


Hello,

I just test around with Chiba and XForms. Now I have a little probelm:

- I have an instance with a XML-Tree with data
- The Form should only use "some" of the data.
- The XForms should only submit some specified data.

Just an example:

instance:
<data>
<val1>test</val1>
<val2>test</val2>
<val3>test</val3>
<val4>test</val4>
</data>

The Form should only display input's for <val1> and <val2>. And if it is
sent, the sent XML should only have <val1> and <val2> in it, not <val3>
or
<val4>.

I just have one big dump of some XML-Instance-Data, and I can't split it
up (system-Requirements), but I just need to provide several ways of
Forms
for SOME of this data.

Hmm I hope you know what I mean, and I hope someone could help me.



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Chiba-developer mailing list
Chiba-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/chiba-developer







-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
Chiba-developer mailing list
Chiba-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/chiba-developer




--
Ulrich Nicolas Lissé



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/


<Prev in Thread] Current Thread [Next in Thread>