Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: javascipt in xsl not working >Thread Next - Re: javascipt in xsl not working Re: javascipt in xsl not workingTo: 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 < 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
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
