[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] distinguish whether variable holds string or node set
Hi, sorry for the messed up message I sent from my other mail account. I should have known that it wouldn't work as I experienced this issue before. Is there a way to determine whether a variable holds a string or a node set? Something like: <xsl:template name="my-template"> <xsl:param name="arg"/> <xsl:choose> <xsl:when test="pseudo test: type($arg)='node-set'">Do something</xsl:when> <xsl:otherwise>Do something else</xsl:otherwise> </xsl:choose> </xsl:template> I've so far not been able to find an answer to this on the web and in the archives. XPath makes it pretty hard with all the implicit type conversion e.g. when testing equality. I hoped that any of the XPath functions that expect a node set as an argument would maybe return an empty string/node set or false when a string is passed as an argument, but this will only stop processing with an error. I'm looking for an XSLT 1.0 solution as I want it to work in browsers. TIA Thomas W.
|
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
|