[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Cannot compare xs:untypedAtomic to xs:double
> On 29 Jul 2015, at 19:54, Jorge . chocolate.camera@xxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > When comparing numeric values of node attributes to a double, I have > to explicitly convert those attribute values too into a double or else > Saxon complains that I cannot compare an untyped value to a double. Saxon of course is only doing what the XSLT 2.0 specification requiresb&. The general comparison operators like b<b (unlike bltb) convert an untyped operand to the type of the other operand. This is often handy, but it does make optimization more difficult (for example, Saxon-EE isnbt able to use hashing and indexing unless it can infer the types of the operands statically). > > Considering that the input tree actually is generated some steps above > via an identity copy and stored into a variable, is there a way to > create it so that Saxon does know that those attribute values are > doubles Yes, you can make the stylesheet schema-aware, in which case the numeric attributes will be labelled as numeric rather than being untyped. Michael Kay Saxonica
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|