![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: Typed datas in XPath2 [Thread Next] Re: Typed datas in XPath2To: 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 ! | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
