I need to be able to check what the "current" value of a variable is inside a redeclaration of that same variable in a different xslt that includes the other.
main.xslt:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="other.xslt"/>
<xsl:variable name="email">
<xsl:if test="string-length($email) = 0">
[email protected]
</xsl:if>
</xsl:variable>
<xsl:template match="/">
<Email>
<xsl:value-of select="$email"/>
</Email>
</xsl:template>
</xsl:stylesheet>
other.xslt:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="email">[email protected]</xsl:variable>
</xsl:stylesheet>
What I would like to do is be able to check what the value of the lower-precedence variable will be to see if I need to overwrite it in the variable in the current xslt. (disclaimer - the current code crashes viciously)