Problem in referencing DHTML 'document' object within <xsl:script>

Subject: Problem in referencing DHTML 'document' object within <xsl:script>
From: "Amit Rekhi" <amitr@xxxxxxxxxxxxx>
Date: Wed, 14 Apr 1999 15:19:58 +0530
Hello,

ENVIRONMENT
- Browser :- MS IE5
- DOM Implementation :- Specific to IE5
- DHTML Object Model :- Specific to IE5

PROBLEM STATEMENT
I am trying to use the 'document' object exposed by 
IE5 DHTML Object Model within an <xsl:script> which 
is called from an XSL template as follows :-
.
.
1.<?xml version="1.0"?>
2.<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl";>
3. <xsl:script language="JScript"> 
4.  function WriteDocTitle()
5.  {
6.    document.title = "Document Title";
7.  }
8. </xsl:script>
9. <xsl:template match="/">
10.   <HTML>
11.     <HEAD>
12.       <xsl:eval language="JScript">WriteDocTitle()</xsl:eval>
13.     </HEAD>
14.   </HTML>
15. </xsl:template>
16.</xsl:stylesheet>

But on processing the above XSL stylesheet
IE5 gives me the following error message: 

"Microsoft JScript runtime error 
'document' is undefined line = 7, col = 3 
(line is offset from the tag). 
Error returned from property or method call." 

QUESTIONS
* What change do I need to make to the above
XSL fragment so that the 'document' element
could be recognised?

* Does the 'document' element stand for the 
<HTML> element at LineNumber = 10. (see above)?
If not what does the 'document' element stand for 
in the context of the above XSL stylesheet?

* What do I need to do to access the <HTML> element at 
LineNumber = 10 (see above) within the WriteDocTitle() function
(at LineNumber = 4)?

Thanks in advance for any replies,
AMIT




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread