Newbie question

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

Newbie question

Dan Godley
Hi,

I'm trying to get an XForms application to run on Presentation Server, but have come across a couple of problems....

1) First problem occurs when processing this line in my xforms-model.xml file:

<xf:bind nodeset="instance('instWizardController')/currentPage" calculate="if(. &lt; 1, 1, if(. &gt; ../pageSize, ../pageSize, .))" readonly="false()" />

I get this error message complaining about the last character in the 'calculate' expression:

XPath syntax error at char 55 in {...../pageSize, ../pageSize, ....}: expected "then", found ")"

2) If I take out the offending calculation in the line above, the processor carries on but I'm then left with an error on the very first line of the xforms-model.xml file.  This time, there is no clue as to what is wrong - the message is [No error message provided.]

This is the first line in the file:

<xf:model id="mdl_migwiz" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xi="http://www.w3.org/2001/XInclude">

The application was initially developed for the Novell XForms IE plug in, but now I'm trying to get it working with Presentation Server.  All I've really done is split the model and view into 2 files and created a config file.

Anyone got any idea what I'm doing wrong?

Cheers, Dan




--
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: Newbie question

Erik Bruchez
Administrator
Dan,

 > I'm trying to get an XForms application to run on Presentation
 > Server, but have come across a couple of problems....
 >
 > 1) First problem occurs when processing this line in my
 >    xforms-model.xml file:
 >
 > <xf:bind nodeset="instance('instWizardController')/currentPage"
 > calculate="if(. &lt; 1, 1, if(. &gt; ../pageSize, ../pageSize, .))"
 > readonly="false()" />
 >
 > I get this error message complaining about the last character in the
 > 'calculate' expression:
 >
 > XPath syntax error at char 55 in {...../pageSize, ../pageSize,
 > ....}: expected "then", found ")"

This is an easy one. While non-compliant in this respect, the OPS
XForms engine uses an XPath 2.0 engine instead of an XPath 1.0
engine. Because XPath 2.0 has its own built-in if() construct, it was
not possible to implement the XForms if() function as is. Instead, you
can:

o Use the XPath 2.0 if() construct, which you would write:

   "if (. &lt; 1)
    then 1
    else if (. &gt; ../pageSize) then ../pageSize else ."

o Replace if() with xfif(), which implements the original XForms 1.0
   if() function.

We actually planned to put an XPath 1.0 engine in there, but so far
have decided it was not worth the trouble as XPath 2.0 provides so
many benefits.

 > 2) If I take out the offending calculation in the line above, the
 > processor carries on but I'm then left with an error on the very
 > first line of the xforms-model.xml file.  This time, there is no
 > clue as to what is wrong - the message is [No error message
 > provided.]
 >
 > This is the first line in the file:
 >
 > <xf:model id="mdl_migwiz" xmlns:xf="http://www.w3.org/2002/xforms"
 > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 > xmlns:ev="http://www.w3.org/2001/xml-events"
 > xmlns:xi="http://www.w3.org/2001/XInclude">
 >
 > The application was initially developed for the Novell XForms IE
 > plug in, but now I'm trying to get it working with Presentation
 > Server.  All I've really done is split the model and view into 2
 > files and created a config file.

You souldn't be using a separate xforms-model.xml file. Just write
your XHTML+XForms file and hook this up as a page view in your page
flow:

<page id="my-page" path-info="/my/path" view="my-view.xhtml"/>

Don't use the page/@xforms attribute as this is an obsolete way of
handling XForms in OPS.

-Erik

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