Re: server-side validation: relevance

Sorry about the ping... I've just signed up, and don't seem to be
getting all the messages coming through...  Looking at the web
archive, I see I have some responses:

Mark did a wonderful job explaining my problem.  I will require
absolute paths for now, and hopefully come up with something in the
future.  I've tried to think up a way to "translate" relative paths
into absolute ones that evaluate to the same value/nodeset, but I
don't think there is a straightforward, reliable way to do that...

If there are any more thoughts/ideas/suggestions, that would be great.

Jay K

On 2/15/06, Jay Knight <jhknight@gmail.com> wrote:
> Anyone have any ideas on this?
>
> On 2/11/06, Jay Knight <jhknight@gmail.com> wrote:
> > I'm playing arround with validating xforms submission on the
> > server.... and this question came up.... How can I tell if something
> > was supposed to be relevant on submission?  Consider this simple
> > example.
> >
> > <model>
> >     <instance>
> >         <things>
> >             <something />
> >             <else />
> >         </things>
> >     </instance>
> >     <bind nodeset="something" relevant="../else = 4" />
> >     <submission action="..." method="post" />
> > </model>
> >
> > ... snip ...
> >
> > <input ref="something"><label>Something</label></input>
> > <input ref="else"><label>Else</label></input>
> >
> > And two possible (valid) submitted instances are:
> >
> > <things>
> >     <something>blah</something>
> >     <else>4</else>
> > </things>
> >
> >
> > <things>
> >     <else>3</else>
> > </things>
> >
> > (Pease excuse any errors... I haven't actually tested this one out :)
> >
> > The idea is that "something" should only be relevant if the value of
> > 'else' is 4.  The problem is that "../else = 4" is a relative xpath
> > expression whose context node is /things/something, which in the case
> > of the second submission is not present.  Therfore, I cannot evaluate
> > that xpath expression meaningfully (so it seems).
> >
> > Any ideas?
> >
> > Jay K
> >
>

Received on Thursday, 16 February 2006 00:56:51 UTC