|
Has anybody ran into problem with msxsl:script when you want to access the html page properties like location or document.
The script functions must be defined in the header part of the xsl document. But when working with header part the HTML properties are yet unknown. They become known when xsl processor has started compiling the templates.
I've got a serious problem and it taken me days, but still no results. Here's the header of XSL:
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:java="urn:schemas-microsoft-com:JavaScript"
xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:output method="html"/>
<msxsl:script language="JavaScript" implements-prefix="java">
<![CDATA[
function getFieldValue(strFieldName)
{
var strFieldValue;
var objRegExp = new RegExp(strFieldName + "=([^&]+)","gi");
if (objRegExp.test(location.search))
strFieldValue = unescape(RegExp.$1);
else strFieldValue="";
return strFieldValue;
}
]]>
</msxsl:script>
the function getFieldValue(strFieldName) would fetch the values from request for given name. It works fine as long as it is defined inside the template. But if it is inside a template it can not be accessed by:
<xsl:value-of select="getFieldValue('action')">
I'm runing out of ideas and tried almost everything I could find. Is there another way to access the location object? Or can it be done with something else rather than javascript?
If someone has already solved a problem like this please post a Re. Or e-mail me to: theboogie@email.si
|