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(filt erField, filterValue, mode)
{
try
{
var s=new ActiveXObject(' MSXML2.FreeThre adedDOMDocument ');
var x=document.XMLD ocument;
if (x==null)
{
x=navigator.XML Document;
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.XSLTempl ate'))
{
alert("here");
stylesheet=s;
with (createProcesso r())
{
addParameter('f ield1',filterFi eld);
addParameter('f ilter1',filterV alue);
input=x;
transform();
with (document.open( 'text/html'))
{
write(output);
navigator.XMLDo cument=x;
navigator.XSLDo cument=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(filt erField, filterValue, mode)
{
try
{
var s=new ActiveXObject(' MSXML2.FreeThre adedDOMDocument ');
var x=document.XMLD ocument;
if (x==null)
{
x=navigator.XML Document;
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.XSLTempl ate'))
{
alert("here");
stylesheet=s;
with (createProcesso r())
{
addParameter('f ield1',filterFi eld);
addParameter('f ilter1',filterV alue);
input=x;
transform();
with (document.open( 'text/html'))
{
write(output);
navigator.XMLDo cument=x;
navigator.XSLDo cument=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
Comment