ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xsl-list
xsl-list
RE: [xsl] access document object during xform on IE6
by Dan Diebolt other posts by this author
Nov 5 2002 11:00PM messages near this date
Re: AW: [xsl] expression must evaluate to a nodeset / shortcuts ! | RE: [xsl] access document object during xform on IE6
>  During XSLT transformation using IE6 I am trying to access 
>  the document object to extract the URL of the XML doc currently being 
>  transformed. 

MK> Just pass it in to the transformation as a parameter.

I don't control the xml source document structure or the url 
parameters. I basically just have control over stylesheet
parameter name and the stylesheet's content:

  http://www.domain.com/DoIt?xml=file.xml&xsl=file.xsl

file.xml and file.xsl are placed on the server through some other
mechanism and the only thing I can author or modify is file.xsl.

So in loading this URL in IE6, is there a way to gain access
to the the above URL *during* transformation? Are there any objects
exposed within in the scope of the following javascript call?
Or do I have to wait till the transformation is complete and
then learn the URL through handling the onload event:

<body onload="AccessDocumentLocationHref()"> 

Does this clear up what I am asking? I want to know what objects
if any might be available durng transformation through JavaScript?
Clearly document does not exist yet when the javascript is called.

>   <msxsl:script language="javascript" implements-prefix="user">
>    <![CDATA[
>     function DoIt() {
>       return   document.location.href;
>     }
>    ]]> 
>   </msxsl:script>
> Since the document object does not exist I am 
>  getting an error. Q1) Is there any way to salvage the 
>  approach used below to somehow access the URL of the XML page 
>  being transformed? Q2) If the document object is unavailable 
>  is there any other object that can be used in its place? 
>  Thanks in advance.
>  
>  <?xml version="1.0"?>
>  
>  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>                  xmlns:msxsl="urn:schemas-microsoft-com:xslt"
>                  xmlns:user="http://mycompany.com/mynamespace"
>                  version="1.0">
>  
>   <msxsl:script language="javascript" implements-prefix="user">
>    <![CDATA[
>     function DoIt() {
>       return   document.location.href;
>     }
>    ]]> 
>   </msxsl:script>
>   
>   <xsl:template match="/">  
>    <xsl:value-of select="user:DoIt()"/>
>   </xsl:template>
>  </xsl:stylesheet>
>  
>   XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>  




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
Thread:
Dan Diebolt
Américo Albuquerque

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved