[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.

Subject: Need a way to hide children with certain attributes.
From: "Kara Lee" <karal@xxxxxxxxxxxxxx>
Date: Wed, 28 Jul 1999 13:05:48 -0700
event.srcelement 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.