1

Topic: Transmission of a variable from JavaScript in XSLT

All greetings! I create a similar subject in other branch.
In JS there is a variable mybrowser , whether on which value depends to display parameters or not.

<body>
<xsl:for-each select = "rp:task">
...
<script type = "text/javascript">
browser=navigator.userAgent.toLowerCase ();
if (browser.indexOf (' chrome ')>-1)
mybrowser = ('chrome ')
{alert (mybrowser);}/*proverka for itself - later alert uberem*/
</script>
<xsl:if test = "[color=red] @mybrowser [/color] = ' chrome '">
...
</xsl:if>
...
</xsl:for-each>
</body>

<xsl:if> - inside <script> it is not read sad((
the Question: prompt how to transfer, please, a variable from JS in XSLT? And whether generally it is possible?

2

Re: Transmission of a variable from JavaScript in XSLT

For what reason js it should be executed in xslt?
It is necessary to fulfill a script before transformation start, to receive value, to make its part of the xml-document, and only then it is possible to work with it.

3

Re: Transmission of a variable from JavaScript in XSLT

It if transformation on the client happens. If on the server the script does not help. It is necessary to take a title of the browser from http-heading and again  to do by its part of the document.