我想要一个列表排序,忽略任何初始的定冠词/不定冠词“the”和“a”。例如:
- 错误喜剧
- 村庄
- 仲夏夜之梦
- 第十二夜
- 冬天的故事
我认为也许在 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。有没有办法在 XLST 1.0 中实现这一点?