[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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:
|
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
|