S
Sharon
Hi!
I have this function to add some parameters to my XSL and then
retransform my XML with it, resulting in a neatly filtered table. It
works great, but as soon as I take out the alert, it doesn't do
anything anymore, seemingly. This is the function:
function renderData(filterField, filterValue, mode)
{
try
{
var s=new ActiveXObject('MSXML2.FreeThreadedDOMDocument');
var x=document.XMLDocument;
if (x==null)
{
x=navigator.XMLDocument;
if (mode=="pos"){s.load("/lib/xtable/xTablepos.xsl")}
else if (mode=="neg"){s.load("/lib/xtable/xTableneg.xsl")};
}
else {
if (mode=="pos"){s.load("/lib/xtable/xTablepos.xsl")}
else if (mode=="neg"){s.load("/lib/xtable/xTableneg.xsl")};
}
with (new ActiveXObject('MSXML2.XSLTemplate'))
{
alert("here");
stylesheet=s;
with (createProcessor())
{
addParameter('field1',filterField);
addParameter('filter1',filterValue);
input=x;
transform();
with (document.open('text/html'))
{
write(output);
navigator.XMLDocument=x;
navigator.XSLDocument=s;
close();
}
}
}
}
catch(exception)
{
}
}
I know that the problem lies with loading the XSL, because the alert
only makes it work when it is placed either right before the "with(new
ActiveXObject...) statement or right after it, before the
stylesheet=s; statement. The extra time for the alert is obviously
needed to load the xsl, without that extra time nothing happens. Now I
want the thing to work WITHOUT the alert, does anyone know how I can
make sure the XSL loads properly and then continue with the rest of
the function? Hope someone can help me! Thanks, Sharon
I have this function to add some parameters to my XSL and then
retransform my XML with it, resulting in a neatly filtered table. It
works great, but as soon as I take out the alert, it doesn't do
anything anymore, seemingly. This is the function:
function renderData(filterField, filterValue, mode)
{
try
{
var s=new ActiveXObject('MSXML2.FreeThreadedDOMDocument');
var x=document.XMLDocument;
if (x==null)
{
x=navigator.XMLDocument;
if (mode=="pos"){s.load("/lib/xtable/xTablepos.xsl")}
else if (mode=="neg"){s.load("/lib/xtable/xTableneg.xsl")};
}
else {
if (mode=="pos"){s.load("/lib/xtable/xTablepos.xsl")}
else if (mode=="neg"){s.load("/lib/xtable/xTableneg.xsl")};
}
with (new ActiveXObject('MSXML2.XSLTemplate'))
{
alert("here");
stylesheet=s;
with (createProcessor())
{
addParameter('field1',filterField);
addParameter('filter1',filterValue);
input=x;
transform();
with (document.open('text/html'))
{
write(output);
navigator.XMLDocument=x;
navigator.XSLDocument=s;
close();
}
}
}
}
catch(exception)
{
}
}
I know that the problem lies with loading the XSL, because the alert
only makes it work when it is placed either right before the "with(new
ActiveXObject...) statement or right after it, before the
stylesheet=s; statement. The extra time for the alert is obviously
needed to load the xsl, without that extra time nothing happens. Now I
want the thing to work WITHOUT the alert, does anyone know how I can
make sure the XSL loads properly and then continue with the rest of
the function? Hope someone can help me! Thanks, Sharon