Re: Detecting presence of attributes
Thanks to all those who pointed out that @foo can be used as a standalone Boolean as well as the LH side of an =. RTFM would have been a good idea, but being so used to the explicitness of Omnimark I didn't actually expect XSLT to possess the feature :-) >XT honors (a) and not (b) and that's the right behavior. That now follows. >To get the feature you want to have, you need to convert the node-set >into a string first: No, all I wanted was detection of the existence of the attribute. I'm not clear what converting the node-set into a string achieves. [position()] >I don't see this either. This looks like my xt may be out of date. Strange, I only downloaded it a few weeks ago. Take a simple example: I have an attribute declared as ENTITIES whose values are multiple entity names which I want output as a list separated by commas instead of spaces: <xsl:for-each select="@foo"> <xsl:value-of select="."/> <xsl:if test="not(position()=last)"> <xsl:text>,</xsl:text> </xsl:if> </xsl:for-each> I'm curious to know why the output contains the entity names separated by spaces instead of commas. ///Peter 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