我希望能够按照忽略任何定冠词和不定冠词“the”和“a”进行排序的列表。例如:
- The Comedy of Errors
- Hamlet
- A Midsummer Night's Dream
- Twelfth Night
- The Winter's Tale
我认为在XSLT 2.0中,可以按照以下方式实现:
<xsl:template match="/">
<xsl:for-each select="play"/>
<xsl:sort select="if (starts-with(title, 'A ')) then substring(title, 2) else
if (starts-with(title, 'The ')) then substring(title, 4) else title"/>
<p><xsl:value-of select="title"/></p>
</xsl:for-each>
</xsl:template>
然而,我想要使用浏览器内处理,因此必须使用XSLT 1.0。有没有办法在XSLT 1.0中实现这一点?