[Home] [By Thread] [By Date] [Recent Entries]
> The extra > libraries and expressiveness of > XPath2 fits well with user requirements, not so much the datatyping. Yes, I've been wondering about that. Generally, the existing constraints that you can express in XML Schema, such as enumerations, are type-sensitive: if an enumeration for xs:decimal allows 20, then it also allows 20.0. On the whole my feeling is that if you add more expressive constraints to XML Schema, they should work on typed values rather than string values. For example if you say @price > @discount, then it should do a numeric comparison if the attributes are both numeric, while if you say @date-of-birth < current-date(), it should do a date comparison. But I've been wondering about not only using XPath for defining constraints, but also using XPath for type determination: perhaps an implicit xsi:type attribute computed as the result of an XPath expression. This provides a rather powerful constraint mechanism. In this case the XPath expression has to be evaluated before validation, so it would seem it has to work on the untyped data. Fortunately XPath 2.0 is defined to work both on typed and untyped data. Michael Kay http://www.saxonica.com/
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |

Cart



