[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Non Existent attribute, and other things.
Well I would have thought that a possibly non-existent attribute is 0 or not would be not(number(@value)) But that seems to return false when the attribute isn't there. So I end up doing... count(@value) = 0 or not(number(@value)) ...which just seems a little awkward. Also thanks for all of the help with the ancestor-or-self business the other day. Because I was using the test so often I have actually ended up putting it in a scripting tag ( sorry ). As calling xsl:template xsl:with-param was just too much too often, also could somebody explain what Jeni's suggestion meant when it said... key('Ps', $name)[count(.|$Ps) = count($Ps)] ...as I really don't understand it. Finally I thought there was an equivalent to the C ?: notation in XSL but I can't seem to find it. On several occasions in my code I end with the same fragment. <xsl:variable name="shorter"> <xsl:choose> <xsl:when test="@short"> <xsl:value-of select="@short"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@name"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <menu name="{$name}"> There must be a more succinct method. Thanks for all the help but it looks like I won't be able to persuade my company to send me to the XSLT conference so hope you all have a good time. Richard Mitchell Software Developer http://www.vbnonline.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|