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

IE5 B2 and JavaScript

Subject: IE5 B2 and JavaScript
From: "Wendu Cameron" <wcam001@xxxxxxxxxx>
Date: Sat, 20 Feb 1999 11:49:57 +1100
ie5 javascript compatibility
Im new to XML and XSL and also heavy srcipting in HTML etc.  I am using
IE5B2 for display

My Questions are
1)Is the DOM not available to the script unless your inside a template. Ie i
cant use document.all(targetID) or targetElement.style.display = ""
Ive had errors like document is not an object
style is not an object etc.
2)What script languages are supported in IE5B2 to what extent.  What are the
limitations on the ways you can access them.
3)Is it the case that IE5 always uses JScript whenever interpreting
JavaScript.

Help lost in JScript Errors! in XSL
Any enlightement you can pass on would be appreciated!!

Background Information

I realise JScript is Microsofts Implementation of JavaScript.  Im also aware
of ECMA Script and the DOM.  Which I think the latest draft is being
supported in IE5.  No indepth knowledge as yet. Im looking at them.

Yes ive seen examples of scripts which work inside the stylesheet
declaration these scripts dont use references to elements (nodes) within the
XSL Stylesheet.

Stylesheet

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
	<xsl:template language="JavaScript" match="/">
      </xsl:template>
</xsl:stylesheet>
This is my Java Script. Which is called from any HTML tag
using onclick="ClickHandler(this);" and the child element with name
Out1details is hidden.
Yes im only developing for one browser IE5 no backwards compatibility or
cross browser compatibility.

function clickHandler(ElementType, srcElement) {
  var targetId, targetElement;
  srcElement = window.event.srcElement;
  targetId = srcElement.id + "details";
  targetElement = document.all(targetId);
  if (targetElement.style.display == "none") {
        targetElement.style.display = "";
  } else {
      targetElement.style.display = "none";
  }
}

If I place this script inside HTML SCRIPT Tags within the Template tags it
works fine.  However if I move the script out a level to the stylesheet and
use xsl:script I get a JScript Syntax error. Despite specifying JavaScript.

I copied the following example from Microsofts site
<xsl:stylesheet language="VBScript">
  <xsl:template match="*">
    <xsl:eval>Call Celsius(32)</xsl:eval>
  </xsl:template>
</xsl:stylesheet>
<xsl:script language="VBScript">
  Function Celsius(fDegrees)
    Celsius = (fDegrees - 32) * 5 / 9
  End Function
</xsl:script>

Which no matter what I do I cant make it work.
First error is There is more than one element in stylesheet
After changing that All. I get is VBScript errors.

Regards Wendy


 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.