xsl-list
[Top] [All Lists]

Re: Re: [xsl] Multiple select listbox as parameter

2006-03-10 19:12:07
I've almost got it. (I think)

Here is the xsl:

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.1">
<xsl:param name="lstGroup"/>
<xsl:template match="*">
                
<table>
<tr>
<xsl:for-each select="Indicator[Group/@KEY = $lstGroup]">
<td>
<xsl:value-of select="@Name"/>
</td>
</xsl:for-each>
</tr>
</table>
</xsl:template>
        
<xsl:template match="Indicator">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:transform>

Then on my html page, I have this call:

var oParams = getSyncDom();
oParams.loadXML("<KEYS/>");     
for (var i = 0; i < arrCountry.length; i++){
(oParams.documentElement.appendChild(oParams.createElement("KEY"))).text = 
arrCountry[i];
}
oProc.addParameter("lstGroup", oParams.documentElement.selectNodes("KEY"));
oProc.transform();
alert(oProc.output);
displayarea.innerHTML = oProc.output;

Now, on the alert box, I get pretty much what I'm looking for, with the table 
structure, but in the beginning, I get; <?xml version="1.0" 
encoding="UTF-16"?>.  I don't know where this is coming from, and it's making 
it so the displayarea.innerHTML line doesn't work.  displayarea is an area on 
my html page that I want the table to go.

I think I'm close, but can't get over this last part.  Can you provide some 
more insight?

Thanks,
- Mark


From: "Joe Fawcett" <joefawcett(_at_)hotmail(_dot_)com>
Date: 2006/03/10 Fri PM 12:48:08 EST
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject: Re: Re: [xsl] Multiple select listbox as parameter

----- Original Message ----- 
From: <mfreeman(_at_)comptrex(_dot_)com>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Friday, March 10, 2006 5:43 PM
Subject: Re: Re: [xsl] Multiple select listbox as parameter


Thanks for the reply Joe.  You have certainly maxed out my XSLT abilities.

Anyway, I added your code to my HTML file and for all your functions that 
set a new ActiveXObject, I get the following error:

'Automation server can't create object'

Originally I had all the ActiveXObjects set to 
MSXML2.FreeThreadedDOMDocument, so I tried that, but it crashed when I 
tried to set oParams.loadXML.

It sounds like I have some other problems here than just passing the 
parameter, huh?


Try changing the version from 4.0 to 3.0.
Obviously you'll have to load the actual files from the server etc.

-- 

Joe 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--