This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]