xsl定义的全局变量怎么没有值
a.xsl
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:variable name="tabid" select="//input[@name='tabid']/@value"> </xsl:variable> <xsl:template match="/" > <html> <INPUT type="text" name="tabid" value="10000" /><!--value值不是固定的--> </html> </xsl:template></xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:import href="b.xsl" /> <xsl:template match="/" > <html> <INPUT type="text" name="" value="{$tabid}" /><!--如何能获取到10000这个值,这里是空--> </html> </xsl:template></xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:variable name="tabid" select="document('')//INPUT[@name='tabid']/@value"> </xsl:variable> <xsl:template match="/" > <html> <INPUT type="text" name="tabid" value="10000" /><!--value值不是固定的--> </html> </xsl:template></xsl:stylesheet>