RE: [XSLT 2.0] Is it possible to display the type of a node / val ue / variable?

Typeswitch is an XQuery-only expression. You can get the same semantics
using if-then-else, instance of and treat as. They are all described in
the XPath and XQuery specs.

HTH
Michael

> -----Original Message-----
> From: David.Pawson@rnib.org.uk [mailto:David.Pawson@rnib.org.uk]
> Sent: Wednesday, May 21, 2003 0:51 AM
> To: Michael Rys; public-qt-comments@w3.org
> Subject: RE: [XSLT 2.0] Is it possible to display the type of a node /
val
> ue / variable?
> 
> 
> 
> I can find references to typeswitch, but no such function Michael?
> Where is it please?
> 
> regards DaveP
> 
> 
> -----Original Message-----
> From: Michael Rys [mailto:mrys@microsoft.com]
> Sent: 20 May 2003 23:45
> To: Svgdeveloper@aol.com; public-qt-comments@w3.org
> Subject: RE: [XSLT 2.0] Is it possible to display the type of a node /
> value
> / variable?
> 
> 
> You can use the instance of and typeswitch expressions to inspect the
> type.
> 
> Exposing the type name is a feature of the debugger in my opinion and
not
> a
> language feature.
> 
> Best regards
> Michael
> 
> 
> 
> 
> From: Svgdeveloper@aol.com [mailto:Svgdeveloper@aol.com]
> Sent: Tuesday, May 20, 2003 12:01 PM
> To: public-qt-comments@w3.org
> Subject: [XSLT 2.0] Is it possible to display the type of a node /
value /
> variable?
> 
> Having spent a great deal of time today trying to work out where a
typing
> problem was going wrong (my coding, Saxon 7.5 support of what I wanted
to
> do, etc) I would really have liked to be able to display the type of
(in
> my
> case) a variable at various points in the code - in order to see what
was
> and what wasn't working.
> 
> Is there a function to do that? As far as I can see the data()
function
> which is said to return the "typed value" doesn't actually return the
> type,
> at least not in a form that I could serialize, which I would need to
do in
> this debugging scenario.
> 
> If not, it seems to me that a function to display the type of a node,
an
> atomic value and a variable would be useful for debugging XSLT 2.0
> stylesheets as people grapple with the "interesting" aspects of typing
in
> XSLT 2.0 not behaving quite as expected.
> 
> Andrew Watt
> 
> -
> 
> NOTICE: The information contained in this email and any attachments is
> confidential and may be legally privileged. If you are not the
> intended recipient you are hereby notified that you must not use,
> disclose, distribute, copy, print or rely on this email's content. If
> you are not the intended recipient, please notify the sender
> immediately and then delete the email and any attachments from your
> system.
> 
> RNIB has made strenuous efforts to ensure that emails and any
> attachments generated by its staff are free from viruses. However, it
> cannot accept any responsibility for any viruses which are
> transmitted. We therefore recommend you scan all attachments.
> 
> Please note that the statements and views expressed in this email
> and any attachments are those of the author and do not necessarily
> represent those of RNIB.
> 
> RNIB Registered Charity Number: 226227
> 
> Website: http://www.rnib.org.uk
> 

Received on Wednesday, 21 May 2003 20:56:57 UTC