Re: showing relationships in xforms


`current()` is an XForms function, and is supported in Orbeon Forms.
It "Returns the context node used to initialize the evaluation of the
containing XPath expression." [1]

In light of this, since you don't say in which XPath context your
expression is running, it's not possible to say what your expression
should return in all cases. But this example works:



On Mon, Apr 16, 2012 at 4:48 AM, Kevin Flynn <> wrote:
> Hi,
> I'm currently experimenting with xforms and having difficulty displaying
> information about relationships. Given a data instance like this:
> <persons>
>  <person>
>   <id>marx</id>
>   <name>Karl Marx</name>
>  </person>
>  <person>
>   <id>engels</id>
>   <name>Friedrich Engels</name>
>   <friend>marx</friend>
>  </person>
> </persons>
> I would expect to be able to display "Karl Marx" from the context
> /persons/person[id='engels'] by doing something like:
> <xforms:output ref="instance('persons')/person[id=current()/friend]/name"/>
> ....but, needless to say, I can't.
> I realize that the current() function I'm used to from XSLT is not available
> in XForms (I use it above for illustration), but I presume that there must
> be something functionally equivalent... Can anybody enlighten me?
> I'm using Orbeon forms, if that is significant.
> Hope somebody can help
> Kevin Flynn

Received on Monday, 16 April 2012 17:45:02 UTC