Slowly going mad over this and have tried various solutions found here but nothing seems to be working so far.
I have some XSL as such:
<xsl:variable name="reserved">
<xsl:value-of select="utils:getReservedCodes()"/>
</xsl:variable>
The value of which is determined by some JScript:
function getReservedCodes() {
reservedCodes = reservedCodesList.join("");
return reservedCodes;
}
If I output the value of reserved
using
<xsl:value-of select="$reserved"/>
I get something like this:
<codey value="-STB"></codey><codey value="-SO"></codey>
I'm then attempting to use the contents of this variable as a node set:
<xsl:for-each select="msxsl:node-set($reserved)/codey">
<xsl:value-of select="@value"/>
</xsl:for-each>
This for-each loop doesn't output anything. I get the impression from other answers here that this could be a namespace issue so I've tried declaring the variable with xmlns=""
, I've surrounded all the codey
entries with <Codes xmlns="">
and I've also tried using the JScript prefix in case it was that but I can't seem to get anything to work.
I have no default namespace in my stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:utils="urn:utils">
and in case it's of any use, my script header looks like this:
<msxsl:script implements-prefix="utils" language="javascript">
If anyone out there has any suggestions I would be eternally grateful.