Only WOW!

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Only WOW!

Hank Ratzesberger

As I have said before, OF is such a terrific environment
to work with XML.  One is able to use all of XPath 2.0 in
pipelines and XForms, and then it just works.

For example, was able to build a list of select's (checkboxes)
that all updated the same reference/node. Have that node
automatically calculated into a sequence, and use the sequence
in a kind of lookup table to another set of data.  Check the
box, and automatically the list grows/shrinks with items that
are related by the key.

I have a larger snippet of code, but when OF handled this
XPath with sequences and filters:

  for $uid in $sequence, $node in //some-nodes[uid=$uid] return $node

and redrew the list...WOW

Cheers,
Hank


<xforms:instance id="select">
        <select xmlns="">
                <uids/>
                <uids-seq/>
        </select
</xforms:instance>
       
<xforms:bind nodeset="instance('select')">
        <xforms:bind nodeset="uids-seq" calculate="string-join(tokenize(../
uids,'\s'),',')"/>
</xforms:bind>

<table>
   <xforms:variable name="uids-seq" select="instance('all-select')/
uids-seq"/>
   <xforms:repeat nodeset="for $uid in $uids-seq, $node in //some-
nodes[uid=$uid] return $node">
     <tr>
       <td> <xforms:output value="uid"/> </td>
       <td> <xforms:output value="some-attribute"/> </td>
     </tr>
   </xforms:repeat>
</table>


Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
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
Reply | Threaded
Open this post in threaded view
|

Re: Only WOW!

ilango_g
Hi Hank
I have just constructed a multiple column checkbox list and would like to use a lookup table with this.
Right now, I use an XML file to populate the values of my checkboxes.

Are you maintaining a code table in eXist or something?

thanks
il
Hank Ratzesberger wrote
As I have said before, OF is such a terrific environment
to work with XML.  One is able to use all of XPath 2.0 in
pipelines and XForms, and then it just works.

For example, was able to build a list of select's (checkboxes)
that all updated the same reference/node. Have that node
automatically calculated into a sequence, and use the sequence
in a kind of lookup table to another set of data.  Check the
box, and automatically the list grows/shrinks with items that
are related by the key.

I have a larger snippet of code, but when OF handled this
XPath with sequences and filters:

  for $uid in $sequence, $node in //some-nodes[uid=$uid] return $node

and redrew the list...WOW

Cheers,
Hank


<xforms:instance id="select">
        <select xmlns="">
                <uids/>
                <uids-seq/>
        </select
</xforms:instance>
       
<xforms:bind nodeset="instance('select')">
        <xforms:bind nodeset="uids-seq" calculate="string-join(tokenize(../
uids,'\s'),',')"/>
</xforms:bind>

   <xforms:variable name="uids-seq" select="instance('all-select')/
uids-seq"/>
   <xforms:repeat nodeset="for $uid in $uids-seq, $node in //some-
nodes[uid=$uid] return $node">
                           </xforms:repeat>
 <xforms:output value="uid"/>  <xforms:output value="some-attribute"/> 


Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Only WOW!

Hank Ratzesberger

Yes, this data is essentially relational tables "dumped" to xml,
and put into eXist.

However, this "table" is small.  I load it as shared instance.
It is the <repeat ref="for ... return $node"> the does the
filtering of what to display.

Otherwise, I would need to send a submission to update the
displayed list.  And actually, I did that at first also,
the data was in a different widget:tab, and updated the
instance on the xforms-select event.

--Hank


On Jun 12, 2008, at 10:51 AM, ilango_g wrote:

>
> Hi Hank
> I have just constructed a multiple column checkbox list and would  
> like to
> use a lookup table with this.
> Right now, I use an XML file to populate the values of my checkboxes.
>
> Are you maintaining a code table in eXist or something?
>
> thanks
> il
>
> Hank Ratzesberger wrote:
>>
>>
>> As I have said before, OF is such a terrific environment
>> to work with XML.  One is able to use all of XPath 2.0 in
>> pipelines and XForms, and then it just works.
>>
>> For example, was able to build a list of select's (checkboxes)
>> that all updated the same reference/node. Have that node
>> automatically calculated into a sequence, and use the sequence
>> in a kind of lookup table to another set of data.  Check the
>> box, and automatically the list grows/shrinks with items that
>> are related by the key.
>>
>> I have a larger snippet of code, but when OF handled this
>> XPath with sequences and filters:
>>
>>   for $uid in $sequence, $node in //some-nodes[uid=$uid] return $node
>>
>> and redrew the list...WOW
>>
>> Cheers,
>> Hank
>>
>>
>> <xforms:instance id="select">
>> <select xmlns="">
>> <uids/>
>> <uids-seq/>
>> </select
>> </xforms:instance>
>>
>> <xforms:bind nodeset="instance('select')">
>> <xforms:bind nodeset="uids-seq" calculate="string-join(tokenize(../
>> uids,'\s'),',')"/>
>> </xforms:bind>
>>
>> <table>
>>    <xforms:variable name="uids-seq" select="instance('all-select')/
>> uids-seq"/>
>>    <xforms:repeat nodeset="for $uid in $uids-seq, $node in //some-
>> nodes[uid=$uid] return $node">
>>      <tr>
>>        <td> <xforms:output value="uid"/> </td>
>>        <td> <xforms:output value="some-attribute"/> </td>
>>      </tr>
>>    </xforms:repeat>
>> </table>
>>
>>
>> Hank Ratzesberger
>> NEES@UCSB
>> Institute for Crustal Studies,
>> University of California, Santa Barbara
>> 805-893-8042
>>
>>
>>
>>
>>
>>
>>
>> --
>> 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
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Only-WOW%21- 
> tp17803191p17805836.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.com.
>
>
> --
> 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
Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Only WOW!

ilango_g
So you are getting the data for the checkboxes from a SQL database and then after you build your repeating nodeset you write that data to eXist?

Do you have a sample on how you did that?

thanks
il
Hank Ratzesberger wrote
Yes, this data is essentially relational tables "dumped" to xml,
and put into eXist.

However, this "table" is small.  I load it as shared instance.
It is the <repeat ref="for ... return $node"> the does the
filtering of what to display.

Otherwise, I would need to send a submission to update the
displayed list.  And actually, I did that at first also,
the data was in a different widget:tab, and updated the
instance on the xforms-select event.

--Hank


On Jun 12, 2008, at 10:51 AM, ilango_g wrote:

>
> Hi Hank
> I have just constructed a multiple column checkbox list and would  
> like to
> use a lookup table with this.
> Right now, I use an XML file to populate the values of my checkboxes.
>
> Are you maintaining a code table in eXist or something?
>
> thanks
> il
>
> Hank Ratzesberger wrote:
>>
>>
>> As I have said before, OF is such a terrific environment
>> to work with XML.  One is able to use all of XPath 2.0 in
>> pipelines and XForms, and then it just works.
>>
>> For example, was able to build a list of select's (checkboxes)
>> that all updated the same reference/node. Have that node
>> automatically calculated into a sequence, and use the sequence
>> in a kind of lookup table to another set of data.  Check the
>> box, and automatically the list grows/shrinks with items that
>> are related by the key.
>>
>> I have a larger snippet of code, but when OF handled this
>> XPath with sequences and filters:
>>
>>   for $uid in $sequence, $node in //some-nodes[uid=$uid] return $node
>>
>> and redrew the list...WOW
>>
>> Cheers,
>> Hank
>>
>>
>> <xforms:instance id="select">
>> <select xmlns="">
>> <uids/>
>> <uids-seq/>
>> </select
>> </xforms:instance>
>>
>> <xforms:bind nodeset="instance('select')">
>> <xforms:bind nodeset="uids-seq" calculate="string-join(tokenize(../
>> uids,'\s'),',')"/>
>> </xforms:bind>
>>
>> >>    <xforms:variable name="uids-seq" select="instance('all-select')/
>> uids-seq"/>
>>    <xforms:repeat nodeset="for $uid in $uids-seq, $node in //some-
>> nodes[uid=$uid] return $node">
>>      >>        >>        >>      >>    </xforms:repeat>
>>
 <xforms:output value="uid"/>  <xforms:output value="some-attribute"/> 
>>
>>
>> Hank Ratzesberger
>> NEES@UCSB
>> Institute for Crustal Studies,
>> University of California, Santa Barbara
>> 805-893-8042
>>
>>
>>
>>
>>
>>
>>
>> --
>> You receive this message as a subscriber of the ops-users@ow2.org  
>> mailing
>> list.
>> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
>> For general help: mailto:sympa@ow2.org?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Only-WOW%21- 
> tp17803191p17805836.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.com.
>
>
> --
> You receive this message as a subscriber of the ops-users@ow2.org  
> mailing list.
> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
> For general help: mailto:sympa@ow2.org?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws

Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Only WOW!

ilango_g
In reply to this post by Hank Ratzesberger
So this is what I would like to do:
Store my checkbox data in a relational MySQL table. Retrieve this as XML and dump it into my XML instance, after which I make all my selections and write the resultant data to eXist.

Thanks for suggestions.

ilango
Hank Ratzesberger wrote
Yes, this data is essentially relational tables "dumped" to xml,
and put into eXist.

However, this "table" is small.  I load it as shared instance.
It is the <repeat ref="for ... return $node"> the does the
filtering of what to display.

Otherwise, I would need to send a submission to update the
displayed list.  And actually, I did that at first also,
the data was in a different widget:tab, and updated the
instance on the xforms-select event.

--Hank


On Jun 12, 2008, at 10:51 AM, ilango_g wrote:

>
> Hi Hank
> I have just constructed a multiple column checkbox list and would  
> like to
> use a lookup table with this.
> Right now, I use an XML file to populate the values of my checkboxes.
>
> Are you maintaining a code table in eXist or something?
>
> thanks
> il
>
> Hank Ratzesberger wrote:
>>
>>
>> As I have said before, OF is such a terrific environment
>> to work with XML.  One is able to use all of XPath 2.0 in
>> pipelines and XForms, and then it just works.
>>
>> For example, was able to build a list of select's (checkboxes)
>> that all updated the same reference/node. Have that node
>> automatically calculated into a sequence, and use the sequence
>> in a kind of lookup table to another set of data.  Check the
>> box, and automatically the list grows/shrinks with items that
>> are related by the key.
>>
>> I have a larger snippet of code, but when OF handled this
>> XPath with sequences and filters:
>>
>>   for $uid in $sequence, $node in //some-nodes[uid=$uid] return $node
>>
>> and redrew the list...WOW
>>
>> Cheers,
>> Hank
>>
>>
>> <xforms:instance id="select">
>> <select xmlns="">
>> <uids/>
>> <uids-seq/>
>> </select
>> </xforms:instance>
>>
>> <xforms:bind nodeset="instance('select')">
>> <xforms:bind nodeset="uids-seq" calculate="string-join(tokenize(../
>> uids,'\s'),',')"/>
>> </xforms:bind>
>>
>> >>    <xforms:variable name="uids-seq" select="instance('all-select')/
>> uids-seq"/>
>>    <xforms:repeat nodeset="for $uid in $uids-seq, $node in //some-
>> nodes[uid=$uid] return $node">
>>      >>        >>        >>      >>    </xforms:repeat>
>>
 <xforms:output value="uid"/>  <xforms:output value="some-attribute"/> 
>>
>>
>> Hank Ratzesberger
>> NEES@UCSB
>> Institute for Crustal Studies,
>> University of California, Santa Barbara
>> 805-893-8042
>>
>>
>>
>>
>>
>>
>>
>> --
>> You receive this message as a subscriber of the ops-users@ow2.org  
>> mailing
>> list.
>> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
>> For general help: mailto:sympa@ow2.org?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Only-WOW%21- 
> tp17803191p17805836.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.com.
>
>
> --
> You receive this message as a subscriber of the ops-users@ow2.org  
> mailing list.
> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
> For general help: mailto:sympa@ow2.org?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws

Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Only WOW!

Hank Ratzesberger
In reply to this post by ilango_g
Hi Ilango,

I don't know if this is the best practice, only that when it
worked I was really impressed.

The data is already in eXist. It is simply that it was made
from sql and so it has relationships like that.  One of them
is that a 'station' has one to many with 'channel' so the path

   //channels[sta='WLA']

returns a many nodes.  I want to list the stations, then when
they are checked/unchecked, expand/shrink the list.

Something like this:

--Hank


<xforms:instance id="sites"
   src="http://example.org/exist/rest/db/sites.xml"/>

<xforms:instance id="chans"
   src="http://example.org/exist/rest/db/chans.xml"/>

<xforms:instance id="all-select">
   <select xmlns="">
     <stas/>
     <sta-seq/>
   </select>
</xforms:instance>
       
<xforms:bind nodeset="instance('all-select')">
   <xforms:bind nodeset="sta-seq" calculate="string-join(tokenize(../
stas,'\s'),',')"/>
</xforms:bind>

<!-- list of stations to select -->
<xforms:group ref="instance('sites')">
   <xforms:repeat nodeset="/sites/site" id="sites-repeat">
     <xxforms:variable name="sta" select="sta"/>
     <xforms:select ref="instance('all-select')/stas" appearance="full">
       <xforms:choices>
         <xforms:item>
           <xforms:value><xforms:output value="$sta"/></xforms:value>
           <xforms:label><xforms:output value="$sta"/></xforms:label>
         </xforms:item>
        </xforms:choices>
     </xforms:select>
   </xforms:repeat>
</xforms:group>


<!-- list that gets auto-updated when stations are selected -->
<xforms:group ref="instance('chans')">
   <xforms:variable name="sta-seq" select="instance('all-select')/sta-
seq"/>
   <xforms:repeat nodeset="for $seq in instance('all-select')/sta-
seq, $chan in //sitechan[sta=$seq] return $chan">
     <xforms:output value="sta"/>
     <xforms:output value="chan"/> </td>
   </xforms:repeat>
</xforms:group>


On Jun 12, 2008, at 12:05 PM, ilango_g wrote:

>
> So you are getting the data for the checkboxes from a SQL database  
> and then
> after you build your repeating nodeset you write that data to eXist?
>
> Do you have a sample on how you did that?
>
> thanks
> il
>
> Hank Ratzesberger wrote:
>>
>>
>> Yes, this data is essentially relational tables "dumped" to xml,
>> and put into eXist.
>>
>> However, this "table" is small.  I load it as shared instance.
>> It is the <repeat ref="for ... return $node"> the does the
>> filtering of what to display.
>>
>> Otherwise, I would need to send a submission to update the
>> displayed list.  And actually, I did that at first also,
>> the data was in a different widget:tab, and updated the
>> instance on the xforms-select event.
>>
>> --Hank
>>
>>
>> On Jun 12, 2008, at 10:51 AM, ilango_g wrote:
>>
>>>
>>> Hi Hank
>>> I have just constructed a multiple column checkbox list and would
>>> like to
>>> use a lookup table with this.
>>> Right now, I use an XML file to populate the values of my  
>>> checkboxes.
>>>
>>> Are you maintaining a code table in eXist or something?
>>>
>>> thanks
>>> il
>>>
>>> Hank Ratzesberger wrote:
>>>>
>>>>
>>>> As I have said before, OF is such a terrific environment
>>>> to work with XML.  One is able to use all of XPath 2.0 in
>>>> pipelines and XForms, and then it just works.
>>>>
>>>> For example, was able to build a list of select's (checkboxes)
>>>> that all updated the same reference/node. Have that node
>>>> automatically calculated into a sequence, and use the sequence
>>>> in a kind of lookup table to another set of data.  Check the
>>>> box, and automatically the list grows/shrinks with items that
>>>> are related by the key.
>>>>
>>>> I have a larger snippet of code, but when OF handled this
>>>> XPath with sequences and filters:
>>>>
>>>>   for $uid in $sequence, $node in //some-nodes[uid=$uid] return  
>>>> $node
>>>>
>>>> and redrew the list...WOW
>>>>
>>>> Cheers,
>>>> Hank
>>>>
>>>>
>>>> <xforms:instance id="select">
>>>> <select xmlns="">
>>>> <uids/>
>>>> <uids-seq/>
>>>> </select
>>>> </xforms:instance>
>>>>
>>>> <xforms:bind nodeset="instance('select')">
>>>> <xforms:bind nodeset="uids-seq" calculate="string-join(tokenize
>>>> (../
>>>> uids,'\s'),',')"/>
>>>> </xforms:bind>
>>>>
>>>> <table>
>>>>    <xforms:variable name="uids-seq" select="instance('all-select')/
>>>> uids-seq"/>
>>>>    <xforms:repeat nodeset="for $uid in $uids-seq, $node in //some-
>>>> nodes[uid=$uid] return $node">
>>>>      <tr>
>>>>        <td> <xforms:output value="uid"/> </td>
>>>>        <td> <xforms:output value="some-attribute"/> </td>
>>>>      </tr>
>>>>    </xforms:repeat>
>>>> </table>
>>>>
>>>>
>>>> Hank Ratzesberger
>>>> NEES@UCSB
>>>> Institute for Crustal Studies,
>>>> University of California, Santa Barbara
>>>> 805-893-8042
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> 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
>>>>
>>>>
>>>
>>> --
>>> View this message in context: http://www.nabble.com/Only-WOW%21-
>>> tp17803191p17805836.html
>>> Sent from the ObjectWeb OPS - Users mailing list archive at
>>> Nabble.com.
>>>
>>>
>>> --
>>> 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
>>
>> Hank Ratzesberger
>> NEES@UCSB
>> Institute for Crustal Studies,
>> University of California, Santa Barbara
>> 805-893-8042
>>
>>
>>
>>
>>
>>
>>
>> --
>> 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
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Only-WOW%21- 
> tp17803191p17807508.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.com.
>
>
> --
> 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
Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Only WOW!

   </xforms:repeat>
</xforms:group>


On Jun 12, 2008, at 12:05 PM, ilango_g wrote:

>
> So you are getting the data for the checkboxes from a SQL database  
> and then
> after you build your repeating nodeset you write that data to eXist?
>
> Do you have a sample on how you did that?
>
> thanks
> il
>
> Hank Ratzesberger wrote:
>>
>>
>> Yes, this data is essentially relational tables "dumped" to xml,
>> and put into eXist.
>>
>> However, this "table" is small.  I load it as shared instance.
>> It is the <repeat ref="for ... return $node"> the does the
>> filtering of what to display.
>>
>> Otherwise, I would need to send a submission to update the
>> displayed list.  And actually, I did that at first also,
>> the data was in a different widget:tab, and updated the
>> instance on the xforms-select event.
>>
>> --Hank
>>
>>
>> On Jun 12, 2008, at 10:51 AM, ilango_g wrote:
>>
>>>
>>> Hi Hank
>>> I have just constructed a multiple column checkbox list and would
>>> like to
>>> use a lookup table with this.
>>> Right now, I use an XML file to populate the values of my  
>>> checkboxes.
>>>
>>> Are you maintaining a code table in eXist or something?
>>>
>>> thanks
>>> il
>>>
>>> Hank Ratzesberger wrote:
>>>>
>>>>
>>>> As I have said before, OF is such a terrific environment
>>>> to work with XML.  One is able to use all of XPath 2.0 in
>>>> pipelines and XForms, and then it just works.
>>>>
>>>> For example, was able to build a list of select's (checkboxes)
>>>> that all updated the same reference/node. Have that node
>>>> automatically calculated into a sequence, and use the sequence
>>>> in a kind of lookup table to another set of data.  Check the
>>>> box, and automatically the list grows/shrinks with items that
>>>> are related by the key.
>>>>
>>>> I have a larger snippet of code, but when OF handled this
>>>> XPath with sequences and filters:
>>>>
>>>>   for $uid in $sequence, $node in //some-nodes[uid=$uid] return  
>>>> $node
>>>>
>>>> and redrew the list...WOW
>>>>
>>>> Cheers,
>>>> Hank
>>>>
>>>>
>>>> <xforms:instance id="select">
>>>> <select xmlns="">
>>>> <uids/>
>>>> <uids-seq/>
>>>> </select
>>>> </xforms:instance>
>>>>
>>>> <xforms:bind nodeset="instance('select')">
>>>> <xforms:bind nodeset="uids-seq" calculate="string-join(tokenize
>>>> (../
>>>> uids,'\s'),',')"/>
>>>> </xforms:bind>
>>>>
>>>>
ilango_g
Can I test that example in the sandbox. Of course, I will have to write a pipeline to access eXist?


Hank Ratzesberger wrote
Hi Ilango,

I don't know if this is the best practice, only that when it
worked I was really impressed.

The data is already in eXist. It is simply that it was made
from sql and so it has relationships like that.  One of them
is that a 'station' has one to many with 'channel' so the path

   //channels[sta='WLA']

returns a many nodes.  I want to list the stations, then when
they are checked/unchecked, expand/shrink the list.

Something like this:

--Hank


<xforms:instance id="sites"
   src="http://example.org/exist/rest/db/sites.xml"/>

<xforms:instance id="chans"
   src="http://example.org/exist/rest/db/chans.xml"/>

<xforms:instance id="all-select">
   <select xmlns="">
     <stas/>
     <sta-seq/>
   </select>
</xforms:instance>
       
<xforms:bind nodeset="instance('all-select')">
   <xforms:bind nodeset="sta-seq" calculate="string-join(tokenize(../
stas,'\s'),',')"/>
</xforms:bind>


<xforms:group ref="instance('sites')">
   <xforms:repeat nodeset="/sites/site" id="sites-repeat">
     <xxforms:variable name="sta" select="sta"/>
     <xforms:select ref="instance('all-select')/stas" appearance="full">
       <xforms:choices>
         <xforms:item>
           <xforms:value><xforms:output value="$sta"/></xforms:value>
           <xforms:label><xforms:output value="$sta"/></xforms:label>
         </xforms:item>
        </xforms:choices>
     </xforms:select>
   </xforms:repeat>
</xforms:group>



<xforms:group ref="instance('chans')">
   <xforms:variable name="sta-seq" select="instance('all-select')/sta-
seq"/>
   <xforms:repeat nodeset="for $seq in instance('all-select')/sta-
seq, $chan in //sitechan[sta=$seq] return $chan">
     <xforms:output value="sta"/>
     <xforms:output value="chan"/> 
>>>>    <xforms:variable name="uids-seq" select="instance('all-select')/
>>>> uids-seq"/>
>>>>    <xforms:repeat nodeset="for $uid in $uids-seq, $node in //some-
>>>> nodes[uid=$uid] return $node">
>>>>      >>>>        >>>>        >>>>      >>>>    </xforms:repeat>
>>>>
 <xforms:output value="uid"/>  <xforms:output value="some-attribute"/> 
>>>>
>>>>
>>>> Hank Ratzesberger
>>>> NEES@UCSB
>>>> Institute for Crustal Studies,
>>>> University of California, Santa Barbara
>>>> 805-893-8042
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> You receive this message as a subscriber of the ops-users@ow2.org
>>>> mailing
>>>> list.
>>>> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
>>>> For general help: mailto:sympa@ow2.org?subject=help
>>>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>>>
>>>>
>>>
>>> --
>>> View this message in context: http://www.nabble.com/Only-WOW%21-
>>> tp17803191p17805836.html
>>> Sent from the ObjectWeb OPS - Users mailing list archive at
>>> Nabble.com.
>>>
>>>
>>> --
>>> You receive this message as a subscriber of the ops-users@ow2.org
>>> mailing list.
>>> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
>>> For general help: mailto:sympa@ow2.org?subject=help
>>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>> Hank Ratzesberger
>> NEES@UCSB
>> Institute for Crustal Studies,
>> University of California, Santa Barbara
>> 805-893-8042
>>
>>
>>
>>
>>
>>
>>
>> --
>> You receive this message as a subscriber of the ops-users@ow2.org  
>> mailing
>> list.
>> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
>> For general help: mailto:sympa@ow2.org?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Only-WOW%21- 
> tp17803191p17807508.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.com.
>
>
> --
> You receive this message as a subscriber of the ops-users@ow2.org  
> mailing list.
> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
> For general help: mailto:sympa@ow2.org?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws

Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Only WOW!

Alessandro Vernet
Administrator
In reply to this post by Hank Ratzesberger
Hi Hank,

On Thu, Jun 12, 2008 at 8:44 AM, Hank Ratzesberger
<[hidden email]> wrote:

> As I have said before, OF is such a terrific environment
> to work with XML.  One is able to use all of XPath 2.0 in
> pipelines and XForms, and then it just works.
>
> For example, was able to build a list of select's (checkboxes)
> that all updated the same reference/node. Have that node
> automatically calculated into a sequence, and use the sequence
> in a kind of lookup table to another set of data.  Check the
> box, and automatically the list grows/shrinks with items that
> are related by the key.
>
> I have a larger snippet of code, but when OF handled this
> XPath with sequences and filters:
>
>  for $uid in $sequence, $node in //some-nodes[uid=$uid] return $node
>
> and redrew the list...WOW
Thank you for the positive comments. Very much appreciated!

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet


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