Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


javascipt in xsl not working

From: nx.nine@-----.---
To: NULL
Date: 5/8/2006 4:07:00 AM

i can't figure this one out for the life of me, so i hope someone here
can help

this is the setup:
i have an asp page that retuns xml that is then transformed into an
xhtml page by an xsl file

in that xhtml page i use ajax to load and transfom more xml into
xhtml/javascript which is appended to the document.body

now, the ajax transforms the xml properly, but when it's appended all
the html elements render but none of the javascript is usable.

in firefox it works perfectly, but ie craps out with the javascript (i
have a sneaky suspicion why it might be happening, but i'm hoping i'm
wrong)

can anyone tell me what stupid mistake i might be making?

thanks in advance

this is an edited copy of the xsl file(this one doesn't render the js
either):

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ec="http://e.c/">

<xsl:template match="/">
<div
style="position:absolute;top:0px;left:0px;width:790px;height:412px;">
<div height="15px">
[user: <xsl:value-of select="//ec:user/text()"/> ]
</div>
<div>
<table
style="width:790px;height:397px;background-color:#c0c0c0;padding:0px;">
<tr style="padding:0px;">
<td style="width:100px;height:391px;background-color:#f0f0f0;">
<div style="height:100%;width:100%;">
<xsl:for-each select="//ec:ml/panel">
<xsl:element name="div">
<xsl:attribute name="align">center</xsl:attribute>
<xsl:attribute name="style">border:1px solid
#c0c0c0;padding:1px;margin:1px;cursor:pointer;</xsl:attribute>
<xsl:attribute name="onclick">
hyLink('addr<xsl:value-of select="@id"/>Bod');
</xsl:attribute>
<xsl:value-of select="@name"/>
</xsl:element>
</xsl:for-each>
</div>
</td>

<td style="width:675px;height:391px;background-color:#f0f0f0;">
<div style="height:100%;width:100%;">

<xsl:for-each select="//ec:ml/panel">
<xsl:if test="child::tab!=''">
<xsl:element name="div">
<xsl:attribute name="id">addr<xsl:value-of
select="@id"/>Bod</xsl:attribute>
<xsl:attribute name="style">display:none;</xsl:attribute>


</xsl:element>
</xsl:if>

<xsl:if test="not(child::tab!='')">
<xsl:element name="div">
<xsl:attribute name="id">addr<xsl:value-of
select="@id"/>Bod</xsl:attribute>
<xsl:attribute name="style">display:none;</xsl:attribute>


</xsl:element>
</xsl:if>

</xsl:for-each>
</div>
</td>

</tr>
</table>
</div>
</div>


<script type="text/javascript">
try{

alert("test");

}
catch(e){
alert("error: \n"+e.message);
}
</script>


</xsl:template>

</xsl:stylesheet>



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent