Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] [XPath-2.0] Get the name of type of a node

From: "Michael Kay" <mike@------------>
To:
Date: 11/1/2005 10:51:00 PM
There's no function to do this: it's a deliberate omission, because the
designers wanted to encourage you instead to test 

$x instance of TYPE

which means your code isn't dependent on implementation details, for example
your code shouldn't be affected if a function decides to return an
unsignedByte when you were expecting an integer. Also, not all types have
names.

However, for diagnostic purposes, Saxon has an extension function
saxon:type-annotation(node)

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



> -----Original Message-----
> From: Florent Georges [mailto:fgeorges.spam@xxxxxxxxx] 
> Sent: 01 November 2005 20:38
> To: XSL List
> Subject: [xsl] [XPath-2.0] Get the name of type of a node
> 
>   Hi
> 
>   Do you know if it's possible to get the name of the type of an
> element, with XPath 2.0?  Say I want to display the type of the 'elem'
> elements.  What can I use in the '@select' of the following
> 'xsl:value-of'?
> 
>     <xsl:template match="elem">
>       <xsl:text>name: 'elem', type: '</xsl:text>
>       <xsl:value-of select="type-name(type-of(.))"/>
>       <xsl:text>'&#10;</xsl:text>
>     </xsl:template>
> 
>   Thanks,
> 
> --drkm


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent