What the difference between xs:decimal and number in xslt 2.0 ?
What the difference between xs:decimal and number in xslt 2.0 ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In XSLT and XPath 1.0 there was just a single number type, double precision floating point numbers. XSLT and XPath 2.0 has a richer type system taken from the W3C XML schema language (and partly extending that type system).
xs:decimalis both a type and a constructor function in XSLT and XPath 2.0 so you can use it where you specify a sequence type, like in theasattribute (e.g.<xsl:param name="input" as="xs:decimal"/>) as well as to convert a value to anxs:decimalvalue in any XPath expression e.g.<xsl:variable name="input" select="xs:decimal(//foo)"/>.The
[number][2]function exists since XSLT and XPath 1.0 and converts its argument to a double precision floating point number, represented in the XSLT and XPath 2.0 type system by the typexs:doublee.g.<xsl:variable name="input" select="number(//foo)"/>. There is also a constructor functionxs:doublein XPath and XSLT 2.0.