xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] testing for typeof


Subject: Re: [xsl] testing for typeof
From: Rob Rohan <me@xxxxxxxxxxxx>
Date: 05 May 2003 21:10:51 -0700

> I am playing around with xslt2.0, and I need a way to test the typeof
> something. I did a quick search on google, and I have greped my quick
> reference (1.0 though). Is there a way, or some totally obvious function
> to say something like
> 
> <xsl:if test="isNodeset(item)"...
> <xsl:if test="isString(item)"...
> <xsl:if test="isFloat(item)"...
> etc?

Ok, new question I found a way :)
http://www.exslt.org/exsl/functions/object-type/index.html

Which is built into Saxon7.4 (Saxon rocks) - but when I try to use it I
get:

No method matching objectType with 1 parameter found in class
net.sf.saxon.exslt.Sets

when passing

...xmlns:set="http://exslt.org/sets"...

<xsl:value-of select="set:object-type('test')" />


According to the site:

Function Syntax
string exsl:object-type(object)

The exsl:object-type function returns a string giving the type of the
object passed as the argument. The possible object types are: 'string',
'number', 'boolean', 'node-set', 'RTF' or 'external'. 

Confusion


-- 
Rob Rohan <me@xxxxxxxxxxxx>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor