我在 XSLT 中有一个小问题。我需要写这样的东西:
$city1 = substring-after($address, ',')
$city2 = substring-before($city1, ' -')
$city = $city2 or $city1 if $city2 empty
我已经有了这个
<xsl:variable name="city1" select = "substring-after($adress,',')" />
<xsl:variable name="city2" select = "substring-before($city1,'-')" />
<xsl:variable name="city" select = "normalize-space($city2 or $city1)" />
但是最后一轮不起作用...我该如何解决?