Control-instance not working

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

Control-instance not working

Smith, Donald
The attached view.xhtml attempts to implement a control-instance where
the content of the form instance determines which portion of the
interface appears.

Except that it's not working. It runs ok, and you can open the file in
the sandbox, but after the line that begins "Search Step 3. . .", one of
the following groups of "control-instance" should appear in the
interface, depending on the content of the "main" instance.

I've gone over all the Xpaths involved and don't see any problem there
(but still could have missed it). If anyone can spot the problem, I'd
really appreciate it.

Thanks,

Don


--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

view.xhtml (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Control-instance not working

Damiano Albani-2
Don,

When you use instance() in XPath, beware that it returns the root
element of your instance.

So, for example, with :

<xforms:instance id="book-instance">
  <book>
    <chapter/>
    <chapter/>
  </book>
</xforms:instance>

you would write <xforms:repeat nodeset="instance('book-instance')/chapter">...

I think that should solve your problem.

--
Damiano ALBANI



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Control-instance not working

Erik Bruchez
Administrator
That is correct. This is a difference with the XPath 2.0 and XSLT doc()
and document() functions, which return a document node.

But once you get used to it, the fact that instance() returns the root
element turns out to be very convenient.

-Erik

Damiano Albani wrote:

> Don,
>
> When you use instance() in XPath, beware that it returns the root
> element of your instance.
>
> So, for example, with :
>
> <xforms:instance id="book-instance">
>  <book>
>    <chapter/>
>    <chapter/>
>  </book>
> </xforms:instance>
>
> you would write <xforms:repeat
> nodeset="instance('book-instance')/chapter">...
>
> I think that should solve your problem.
--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws