xsl-list
[Top] [All Lists]

xsl match first letter of data?

2003-03-03 04:08:40
Using MSXMLDOM with XML file:

<windows>
        <product>
                <name>Product Name</name>
                ....
        </product>
</windows>

and XSL:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match="windows">

    <xsl:for-each select="product">
        <xsl:sort select="Name"/>
        <xsl:if test="Category='business'">
      <div class="menuitem">
        <a href="{URL}"><xsl:value-of select="Name"/></a>
      </div>
      <div class="catdesc">
        <xsl:value-of select="Description"/> [<a href="{URL}">More</a>]
      </div>
        </xsl:if>               
    </xsl:for-each>
</xsl:template>
</xsl:stylesheet>

Question:

What xsl:if or other tag can I use to specify that only 'products' with a 
'name' beginning with the letter "a" should be displayed?  Hope this makes 
sense, I am 
fairly new to XSL but I have read for two days now and can't find a way to do 
this so far. Thanks!



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>