Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: javascipt in xsl not working

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

"I don't know it
this helps, but I can't think of a reason to include executable code
in a transform that goes into an already-running page with scripts
already loaded."

if you look in my xsl above, you notice that i generate html elements
with ID's based on the xml attribute "id", and that onclick they
trigger hyLink().

hyLink is a function that hides a set of div's based on id, then
displays the elements that are passed to it as arguements.

function hyLink(){
var hyArgv = hyLink.arguments;
var hyArgc = hyArgv.length;

<xsl:for-each select="//ec:ml/panel">
document.getElementById('addr<xsl:value-of
select="@id"/>Bod').style.display='none';
document.getElementById('addr<xsl:value-of
select="@id"/>View').style.display='none';
document.getElementById('addr<xsl:value-of
select="@id"/>Sel').style.display='none';
<xsl:if test="child::tab!=''">
<xsl:for-each select="tab">
document.getElementById('addr<xsl:value-of
select="@name"/>Con').style.display='none';
</xsl:for-each>
</xsl:if>
<xsl:if test="not(child::tab!='')">
document.getElementById('addr<xsl:value-of
select="@id"/>Con').style.display='none';
</xsl:if>
</xsl:for-each>

for (var hyI = 0; hyI &lt; hyArgc; hyI++){
document.getElementById(hyArgv[hyI]).style.display='';
}
}

i have found that the above method is the best way of doing this (in
firefox anyway) since  i can never be sure of exactly how many panels
will be drawn at runtime, due to the tabs  being drawn (it's all a web
front-end to an xml-driven piece of software).

i also have a similar function that is used to clear the text fields i
generate, and stick info into the appropriate field.

thank you all for the suggestions, i know i'm dipping into javascript,
but the javascript forums i've posted in so far have either left my
post unanswered, or given me advice that completely breaks my attempt
at simple cross-browser functionality.

again thank you guys so much for the bits of help, and sorry if i'm
going too far off topic



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