p***@thomsondigital.com
2010-08-26 09:30:43 UTC
Hello all,
I just did the following test for one of the requirement in my stylesheet.
Though I am able to get the correct result but somehow I am not convinced
with the approach. There must be better/correct way of doing this.
source
=====
<label>#x2022</label><!-- HEXADECIMAL FOR BULLET ACTUALLY WITH
'AMPERSAND' AND ; ADDED TO IT -->
Test
====
<xsl:template match="label">
<xsl:copy>
<xsl:choose>
<xsl:when test=".='.'"><!-- ='.' IS LITERAL BULLET SYMBOL -->
<!-- Do Something here -->
</xsl:when>
<xsl:when test=".!='.'"><!-- ='.' IS LITERAL BULLET SYMBOL -->
<!-- Do Something different here -->
</xsl:when>
</xsl:choose>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:when test=".= 'BULLET SIGN'"> doesn't seems to be nice to me. Is
there any better way to test hexadecimal values.
Apart from this is there a way of testing whether string is a digit or
character <label>1.</label> <label>a.</label>.
Not tested:
I believe <xsl:when test=".='BULLET SIGN'"> will check for the literal
string instead of something like [A-Za-z0-9]. I am using XSLT 1.0.
Any thoughts will be appreciated.
TIA,
Pankaj
--~------------------------------------------------------------------
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-***@lists.mulberrytech.com>
--~--
I just did the following test for one of the requirement in my stylesheet.
Though I am able to get the correct result but somehow I am not convinced
with the approach. There must be better/correct way of doing this.
source
=====
<label>#x2022</label><!-- HEXADECIMAL FOR BULLET ACTUALLY WITH
'AMPERSAND' AND ; ADDED TO IT -->
Test
====
<xsl:template match="label">
<xsl:copy>
<xsl:choose>
<xsl:when test=".='.'"><!-- ='.' IS LITERAL BULLET SYMBOL -->
<!-- Do Something here -->
</xsl:when>
<xsl:when test=".!='.'"><!-- ='.' IS LITERAL BULLET SYMBOL -->
<!-- Do Something different here -->
</xsl:when>
</xsl:choose>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:when test=".= 'BULLET SIGN'"> doesn't seems to be nice to me. Is
there any better way to test hexadecimal values.
Apart from this is there a way of testing whether string is a digit or
character <label>1.</label> <label>a.</label>.
Not tested:
I believe <xsl:when test=".='BULLET SIGN'"> will check for the literal
string instead of something like [A-Za-z0-9]. I am using XSLT 1.0.
Any thoughts will be appreciated.
TIA,
Pankaj
--~------------------------------------------------------------------
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-***@lists.mulberrytech.com>
--~--