[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Is there a way to tell if a node is an integer?

Subject: RE: Is there a way to tell if a node is an integer?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 22 Apr 2006 09:17:13 +0100
RE:  Is there a way to tell if a node is an integer?
> Is there a way to tell if a node is an integer? I found this message:
> http://www.xslt.com/html/xsl-list/2004-10/msg00364.html where 
> it appears to say you can use a statement like this:
> 
> <xsl:if test="data($a) instance of xs:integer">
> 
> But this looks kind of strange, and maybe it is pseudo-code 
> because it breaks my transform. 

This code should work provided that:

(a) you are running an XSLT 2.0 schema-aware processor

(b) your source document has been validated against a schema that declares
the type of the element to be an integer.

(c) you have bound "xs" to the XML Schema namespace.

To know which of those conditions you haven't met, I would want to see the
error message...

Michael Kay
http://www.saxonica.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.