xsl-list
[Top] [All Lists]

RE: [xsl] getting type information in xslt 2.0

2006-10-23 00:57:35
You can test whether a node is an instance of a particular type by using
"instance of". There's no way in standard XPath 2.0 of asking for the type
that a particular node (or atomic value) belongs to. Saxon does have an
extension function for this purpose, saxon:type-annotation(). It's useful
for debugging purposes, but if you actually want to act on the information,
"instance of" is safer because the actual type annotation can always be a
subtype of what you are expecting.

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

-----Original Message-----
From: Erik Wilde [mailto:net(_dot_)dret(_at_)dret(_dot_)net] 
Sent: 23 October 2006 05:23
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Cc: Felix Michel
Subject: [xsl] getting type information in xslt 2.0

hello everybody.

i am happy to see the support of xml schema and xml schema 
type annotations in xpath 2.0. however, i am wondering how i 
can actually get that type information. xdm defines an 
accessor function for the type
information:

http://www.w3.org/TR/xpath-datamodel/#dm-type-name

but there does not seem to be an xpath function which lets me 
use this xdm accessor function. so the questions i am having is:

- is it correct that this xdm accessor function is not 
available in xpath?

- if so, how can i get the type information about an element 
in xpath? 
the functions on nodes in xpath seem to give no way to get to 
these precious annotations in the xdm tree.

http://www.w3.org/TR/xpath-functions/#node-functions

funny enough, xslt 2.0 then gives me a special function to 
discard the type annotations, but i am wondering why it is 
that i can throw them away, but not get to them?

http://www.w3.org/TR/2005/CR-xslt20-20051103/#stripping-annotations

maybe i am simply not looking at the right things, but i 
really could not find a way to get the type information in 
xpath/xslt 2.0, so any help would be greatly appreciated!

thanks and cheers,

dret.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--