xsl-list
[Top] [All Lists]

Re: [xsl] Determining if an optional attribute is present

2006-10-17 09:40:23


you are making it too hard:-)


test="@revision" is the test you arre looking for, but you don't need
the test at all.


replace

<node>
<xsl:attribute name="revision">
  <xsl:if test="not(string(@revision)) = false()">
    <xsl:value-of select="@revision"/>
  </xsl:if>
  <xsl:if test="not(string(@revision))">
    <xsl:text>0</xsl:text>
  </xsl:if>
</xsl:attribute>
</node>

by

<node revision="0">
 <xsl:copy-of select="@revision"/>
</node>

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--