Re: XPath discrepancy

Hi Swithun,

One strike two down, a bug for every implementation ;)

Have you tried:
boolean(instance('inst')/teiHeader/fileDesc/editionStmt/edition[@n='closet']='true') 


or

boolean(instance('inst')/teiHeader/fileDesc/editionStmt/edition[@n='closet' 
and .='true'])

I'm not sure but the problem can be caused if the conversions from 
nodeset to boolean is done incorrectly by the implementation. I think 
you should report the problem directly to both implementers as both 
expression should work.

Best regards,
David


Swithun Crowe wrote:
>
> Hello
>
> I came across an interesting difference between formsPlayer (latest 
> 1.4 release) and Mozilla XForms 0.3.
>
> I want to display one of 2 outputs depending on the state of a 
> checkbox. So, there is a node bound to type xsd:boolean and an input 
> that refs this node.
>
> Then I have 2 outputs, bound to nodes in another instance. One node is 
> relevant when the node above is true, the other when it is false.
>
> The difference is in the XPath used in the relevant attribute. In 
> formsPlayer, the following works:
>
> instance('inst')/teiHeader/fileDesc/editionStmt/edition[@n='closet']='true' 
>
>
> In Mozilla however the above doesn't work, but this does:
>
> instance('inst')/teiHeader/fileDesc/editionStmt/edition[@n='closet' 
> and .='true']
>
> And this doesn't work in formsPlayer.
>
> The first version should return a boolean value, the second version 
> should return a nodeset which will be evaluated as boolean. Both 
> should be valid, I would have thought.
>
> Has anyone got any ideas?
>
> Swithun.
>


-- 
--------------------------------------------
David Landwehr (david.landwehr@solidapp.com)
Chief Executive Officer, SolidApp
Web: http://www.solidapp.com
Office: +45 48268212
Mobile: +45 24275518
--------------------------------------------

Received on Monday, 27 February 2006 10:46:22 UTC