因此,我有Xml。
<depot id="D7">
<address>
<number>6000</number>
<street>Yonge</street>
<city>Toronto</city>
<province>ON</province>
<postal_code>M2M 2E4</postal_code>
</address>
</depot>
我拥有数百座锡尔的仓库。
now in my xsl, I have defined a variable called locale that stores a postal code like "M1C". After this I want to select only those depot where the postal_code is like locale . In other words, If I specify locale to be "M1C", then I should get all the depot whose postal_code contains "M1C", so depot with "M1C A18", "M1C B2C", etc all should be in the result.
目前,我行文如下:
< xsl:for-each select="depot[address[postal_code=$locale]]">
这只给我贴上准确的邮政编码,而不是“M1C A18”、“M1C B2C”等。 我想用的是这样的东西。
<xsl:for-each select="depot[address[postal_code=*$locale*]]">
与野心相联,但并不奏效。 建议