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

Re: Obtaining a node's schema type

Subject: Re: Obtaining a node's schema type
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Mon, 26 Jul 2010 12:21:52 +0100
Re:  Obtaining a node's schema type
There's no standard function to get the type annotation name of a node; the nearest thing is that you can test whether the node is of type X (or a subtype of X) using "instance of". Saxon fills this gap with saxon:type-annotation(). I'm not sure I can present the case why the WG decided not to provide such a function, but the essence of the argument is probably that implementations always have freedom to use a subtype, which might not be meaningful to the user, and might not be interoperable - for example the result of 3+3 is specified in the spec to be xs:integer, but an implementation might use xs:positiveInteger, or xs:int, or my:integer-in-range-4-to-8, provided these are subtypes of xs:integer.

Michael Kay
Saxonica

On 26/07/2010 11:04, Wolfgang Laun wrote:
Given an XPath denoting a "leaf" element or an attribute of the input
XML and that the XML Schema describing this document is available, I'd
like to obtain the XML Schema type of that item. I think that I can
implement such a function (for this particular application) without
spraining too many synapses, but, being lazy:

- Is such a function (XSLT 2.0) freely available, and where?

- Would this be an out-of-the-box function of a schema-aware XSLT processor?

Regards
Wolfgang

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.