|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Need a way to hide children with certain attributes.
Is there a way to hide children with a certain attribute but display all
others. I need this functionality not when I create the page, but in an
onclick event. I using a script to do it now, but I don't know how to make
the script read attributes from the XML tags.
XML:
<Authors>
<Author Onclick="show">Smith J</Author>
<Author Onclick="hide">Doe J</Author>
</Authors>
Currently the stylesheet formats it like this:
- Authors
Smith J
Doe J
Script for an onclick event:
e = window.event.srcElement;
// find the +/- symbol
mark = e.children(0);
// if it is already collapsed, expand it by showing the
children
if (mark.innerText == "+")
{
mark.innerText = "-";
for (var i = 1; i < e.children.length; i++)
{
e.children(i).style.display = "";
}
}
// if it is expanded, collapse it by hiding the children
else if (mark.innerText == "-")
{
mark.innerText = "+";
for (var i = 1; i < e.children.length; i++)
{
e.children(i).style.display="none";
}
}
I want the format to look like this:
- Authors
Smith J
Doe J
Then Onclick to look like this:
- Authors
Smith J
It may not be possible, but any suggestions would be greatly appreciated.
Thanks in advance.
--------------------------------------
Kara Lee
Applied Technical Systems
karal@xxxxxxxxxxxxxx
http://www.apptechsys.com
CCM Technology Demo:
http://www.apptechsys.com/ccm
---------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








