[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Best approach for adding Java Script?

Subject: Best approach for adding Java Script?
From: Arthur Maloney <ArthurM@xxxxxxxxxx>
Date: Mon, 9 Feb 2009 16:06:44 +0000
 Best approach for adding Java Script?
Hello Xsl-list,

Using Xml v1 & Xsl v1
Pulling Xml From a database
Using Xsl to build Xhtml page (v1 or v1.1)

I have a template that adds meta to the head (Works Fine)

e.g.
<xsl:template  name="meta">
	<meta http-equiv="Content-Type" content="text/html;
charset=application/xhtml+xml; charset=UTF-8" ></meta>
	<meta http-equiv="Content-Language" content="en-GB" ></meta>
	<meta http-equiv="Script-Content-Type" content="text/javascript"></meta>
	<meta http-equiv="Content-Style-Type" content="text/css"></meta>

	<meta name ="author" content="Arthur Maloney"></meta>
	<meta name ="distribution" content="Global"></meta>
	<meta name ="generator" content="M5PC77"></meta>
...
</xsl:template>

What is the best way?
1.  To add a comment (AS below lt IE7)
2.  Embed Java Script inside the head element(example below)?

<!--Code Head Element
<head>

    <!--[if lt IE 7]>
    <link rel="stylesheet" href="styles/ie6.css" type="text/css" />
    <![endif]-->

<script type="text/javascript">
	startList = function() {
	if (document.all && document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i = 0; i < navRoot.childNodes.length; i++) {
				node = navRoot.childNodes[i];
				if (node.nodeName == "li") {
					node.onmouseover = function() {
						this.className += " over";
						}
				node.onmouseout = function() {
					this.className = this.className.replace(" over", "");
					}
				}
		}
	}
}

startList();
</script>
</head>

--
Best regards,
 Arthur                          mailto:ArthurM@xxxxxxxxxx

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.