Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Typed datas in XPath2

From: Philippe Poulard <philippe.poulardNO@---------.-->
To: NULL
Date: 1/9/2008 3:36:00 PM

Martin Honnen a écrit :
> Philippe Poulard wrote:
> 
>> consider this :
>> <foo bar="false"/>
>>
>> in XPath2
>> /foo[@bar]
>> returns my foo element since the bar attribute exists
>>
>> but if the bar attribute has the type xs:boolean (and that the parser 
>> validates with the appropriate schema and that PSVI augmentation was 
>> set), does the predicate return true() or false() ?
> 
> The "effective boolean value" of @bar with an existing attribute named 
> 'bar' is true, that does not depend on any schema type being available, 
> that solely depends on whether @bar is an empty sequence or a sequence 
> where the first item is a node. See 
> <URL:http://www.w3.org/TR/xpath20/#id-ebv>.

Hi Martin,

I'm afraid that a typed value can't be tested in an intuitive way :
/foo[boolean(@bar)] doesn't work either with the typed value, but with 
the EBV rules

What about :
/foo[@bar!=false()]
/foo[@bar!='false']
/foo[data(@bar)]
?

I think the former predicate returns true for the same reason you mentioned
the 2nd returns false since the string value is involved
the latter returns false since the typed value is involved

Right ?

-- 
Cordialement,

               ///
              (. .)
  --------ooO--(_)--Ooo--------
|      Philippe Poulard       |
  -----------------------------
  http://reflex.gforge.inria.fr/
        Have the RefleX !


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent