xpath function max() errors

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

xpath function max() errors

Pieter Hartog

I am trying to use the xpath function max(). According to my references the correct syntax is like this:
 max((1,4))  
should result in: 4

However, when I use this in a tag like this:
<xf:output value="max((5,6))"/>
firefox is generating an error saying:
Error: XForms Error (10): Error parsing XPath expression: max((5,6))

Is the max function not supported?
I am using the 0.8.5 xforms add on.
Reply | Threaded
Open this post in threaded view
|

Re: xpath function max() errors

Aaron Reed
Hi Pieter,

According to the XForms spec, max() takes a parameter of type nodeset.
So you should pass in an xpath expression that points to node(s) in your
instance data.

--Aaron

Pieter Hartog wrote:

>
> I am trying to use the xpath function max(). According to my references the
> correct syntax is like this:
>  max((1,4))  
> should result in: 4
>
> However, when I use this in a tag like this:
> <xf:output value="max((5,6))"/>
> firefox is generating an error saying:
> Error: XForms Error (10): Error parsing XPath expression: max((5,6))
>
> Is the max function not supported?
> I am using the 0.8.5 xforms add on.
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: xpath function max() errors

Pieter Hartog
Aaron,

I was not looking at the XForms spec for the max function; thanks for clarifying that.

Could you provide an example of how to use this (including the content of the node used)?
I tried a few things using a node set, but I could not get it to work; it doesn't error anymore, but it returns NaN.

Thanks,
Pieter

Aaron Reed wrote
Hi Pieter,

According to the XForms spec, max() takes a parameter of type nodeset.
So you should pass in an xpath expression that points to node(s) in your
instance data.

--Aaron

Pieter Hartog wrote:
>
> I am trying to use the xpath function max(). According to my references the
> correct syntax is like this:
>  max((1,4))  
> should result in: 4
>
> However, when I use this in a tag like this:
> <xf:output value="max((5,6))"/>
> firefox is generating an error saying:
> Error: XForms Error (10): Error parsing XPath expression: max((5,6))
>
> Is the max function not supported?
> I am using the 0.8.5 xforms add on.
_______________________________________________
dev-tech-xforms mailing list
dev-tech-xforms@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: xpath function max() errors

Aaron Reed
In reply to this post by Pieter Hartog
Hi Pieter,

One good place to look for good, basic examples is the xforms test suite
on w3.org.  Here is the testcase that they have for max() ->
http://www.w3.org/MarkUp/Forms/Test/XForms1.0/Edition3/Chapt7/7.8/7.8.3/7.8.3.a.xhtml

--Aaron

Pieter Hartog wrote:

> Aaron,
>
> I was not looking at the XForms spec for the max function; thanks for
> clarifying that.
>
> Could you provide an example of how to use this (including the content of
> the node used)?
> I tried a few things using a node set, but I could not get it to work; it
> doesn't error anymore, but it returns NaN.
>
> Thanks,
> Pieter
>
>
> Aaron Reed wrote:
>> Hi Pieter,
>>
>> According to the XForms spec, max() takes a parameter of type nodeset.
>> So you should pass in an xpath expression that points to node(s) in your
>> instance data.
>>
>> --Aaron
>>
>> Pieter Hartog wrote:
>>> I am trying to use the xpath function max(). According to my references
>>> the
>>> correct syntax is like this:
>>>  max((1,4))  
>>> should result in: 4
>>>
>>> However, when I use this in a tag like this:
>>> <xf:output value="max((5,6))"/>
>>> firefox is generating an error saying:
>>> Error: XForms Error (10): Error parsing XPath expression: max((5,6))
>>>
>>> Is the max function not supported?
>>> I am using the 0.8.5 xforms add on.
>> _______________________________________________
>> dev-tech-xforms mailing list
>> [hidden email]
>> https://lists.mozilla.org/listinfo/dev-tech-xforms
>>
>>
>
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: xpath function max() errors

Klotz, Leigh
Here are some others:
http://en.wikibooks.org/wiki/XForms
http://code.google.com/p/xforms-examples/ 

-----Original Message-----
From: dev-tech-xforms-bounces+leigh.klotz=[hidden email]
[mailto:dev-tech-xforms-bounces+leigh.klotz=[hidden email]]
On Behalf Of Aaron Reed
Sent: Friday, July 11, 2008 9:58 AM
To: [hidden email]
Subject: Re: xpath function max() errors

Hi Pieter,

One good place to look for good, basic examples is the xforms test suite
on w3.org.  Here is the testcase that they have for max() ->
http://www.w3.org/MarkUp/Forms/Test/XForms1.0/Edition3/Chapt7/7.8/7.8.3/
7.8.3.a.xhtml

--Aaron

Pieter Hartog wrote:
> Aaron,
>
> I was not looking at the XForms spec for the max function; thanks for
> clarifying that.
>
> Could you provide an example of how to use this (including the content

> of the node used)?
> I tried a few things using a node set, but I could not get it to work;

> it doesn't error anymore, but it returns NaN.
>
> Thanks,
> Pieter
>
>
> Aaron Reed wrote:
>> Hi Pieter,
>>
>> According to the XForms spec, max() takes a parameter of type
nodeset.

>> So you should pass in an xpath expression that points to node(s) in
>> your instance data.
>>
>> --Aaron
>>
>> Pieter Hartog wrote:
>>> I am trying to use the xpath function max(). According to my
>>> references the correct syntax is like this:
>>>  max((1,4))
>>> should result in: 4
>>>
>>> However, when I use this in a tag like this:
>>> <xf:output value="max((5,6))"/>
>>> firefox is generating an error saying:
>>> Error: XForms Error (10): Error parsing XPath expression: max((5,6))
>>>
>>> Is the max function not supported?
>>> I am using the 0.8.5 xforms add on.
>> _______________________________________________
>> dev-tech-xforms mailing list
>> [hidden email]
>> https://lists.mozilla.org/listinfo/dev-tech-xforms
>>
>>
>
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms