starts-with
機能を使用する必要があります。あなたが探している表現、けれども
<xsl:for-each select="node/name[starts-with(., 'Tom')]">
、あなたがそうのように、それをparameteriseする場合があります...
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes" />
<xsl:param name="name" select="'Tom'" />
<xsl:template match="/">
<xsl:for-each select="node/name[starts-with(., $name)]">
<p><xsl:value-of select="." /></p>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
ノートを行いますが、これは大文字と小文字が区別されます。あなたは大文字と小文字を区別しないことを望んだ場合には、もう少し作業がXSLT 1.0で必要とされて...
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes" />
<xsl:variable name="l" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="u" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:param name="name" select="'tom'" />
<xsl:template match="/">
<xsl:for-each select="node/name[starts-with(translate(., $u, $l), translate($name, $u, $l))]">
<p><xsl:value-of select="." /></p>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Timさんに感謝します。私はそれを投稿した後、ほとんど私のソリューションを実現しました=) 徹底していただきありがとうございます...私はあなたのソリューションが良い。 – cerebraldecypher