変数を xsl ファイルに割り当て、後でこのファイルで使用しようとしています。
これが私がそれらを割り当てる方法です:
<xsl:choose>
<xsl:when test="matches(normalize-space(tokenize((//span[@class='timark' and matches(.,'Наименование и адрес')]/following-sibling::div[1]/p[@class='addr'])[1],',')[1]), 'BG[0-9]')">
<xsl:variable name="authtitle" select="normalize-space(tokenize((//span[@class='timark' and matches(.,'Наименование и адрес')]/following-sibling::div[1]/p[@class='addr'])[1],',')[2])" />
<xsl:variable name="authstreet" select="normalize-space(tokenize((//span[@class='timark' and matches(.,'Наименование и адрес')]/following-sibling::div[1]/p[@class='addr'])[1],',')[3])" />
</xsl:when>
<xsl:otherwise>
<xsl:variable name="authtitle" select="normalize-space(tokenize((//span[@class='timark' and matches(.,'Наименование и адрес')]/following-sibling::div[1]/p[@class='addr'])[1],',')[1])" />
<xsl:variable name="authstreet" select="normalize-space(tokenize((//span[@class='timark' and matches(.,'Наименование и адрес')]/following-sibling::div[1]/p[@class='addr'])[1],',')[2])" />
</xsl:otherwise>
</xsl:choose>
そして、私がそれらを使おうとすると
<name>
<xsl:value-of select="$authtitle" />
</name>
エラーが発生しました!なんで?
のみを削除すると
<xsl:value-of select="$authtitle" />
大丈夫です。そのため、変数に正しくアクセスしていないようです。