Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as XML by alt ( 17 years ago )
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/list">
<xsl:element name="dl">
<xsl:call-template name="processitem" />
</xsl:element>
</xsl:template>
<!-- Improbably naive algo -->
<!-- we use symantic <dl><dt><dd> tags as defined on http://www.w3.org/TR/xhtml2/mod-list.html -->
<xsl:template name="processitem">
<xsl:for-each select="item">
<xsl:variable name="tagname" select="substring(.,1,1)" />
<xsl:if test="not(starts-with(preceding-sibling::*/text(),$tagname))">
<xsl:element name="dt">
<xsl:value-of select="$tagname" />
</xsl:element>
<xsl:for-each select="/list/item/text()">
<xsl:if test="starts-with(.,$tagname)">
<xsl:element name="dd">
<xsl:value-of select="." />
</xsl:element>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Revise this Paste