Click to See Complete Forum and Search --> : passing HTML markup to XSL via parameters


rodic66
01-10-2005, 05:01 PM
Hi all,
I’ve stumbled across one problem, passing and displaying HTML markup via parameters.
Lets say I need to pass HTML string containing combo box to XSL and display it.

In JSP I set up parameters like this:

Hashtable params = new Hashtable();
params.put("param1", value);
strCombo = “<select><option>Test Value</option></select>”;
params.put("param2", strCombo);



in XSL I try to except and display it:

<?xml version="1.0" encoding="windows-1252"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:param name=" param1"></xsl:param>
<xsl:param name=" param2"></xsl:param>
<xsl:template match="/">
<xsl:copy-of select=”$param2”/>
</xsl:template>
</xsl:stylesheet>

and instead of combo box I see literal string print out,
I know that I’m on the rght path, because when I do this:

<?xml version="1.0" encoding="windows-1252"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:param name=" param1"></xsl:param>
<xsl:param name=" param2"><select><option>Test Value</option></select></xsl:param>
<xsl:template match="/">
<xsl:copy-of select=”$param2”/>
</xsl:template>
</xsl:stylesheet>

It will display combo box as it should. I’m definitely missing something, but what.
Please do not make suggestions like not passing HTML to XSL, it has to be like that, and that is that.
Thanks in advance

[B]

rodic66
01-21-2005, 01:05 PM
I've got helped out, if anybody is still interested.
Instead of passing a string containing HTML markup, I created a DOM document loading this string to a XMLDOM and pass it to XSL via parameter, and everything became as it should be.
Thanks to good people from Tek-tips and other forums.