470,826 Members | 1,818 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,826 developers. It's quick & easy.

javascript in XSLT

Any clue on why I got this error when I use javascript function in
XSLT? The same javescript works fine with ASP. What this function
does is to keep only one window (with media player activeX control)
instance.

Your assistance is much appreciated.

Charles

Error message:
----------------
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error
and then click the Refresh button, or try again later.

A name was started with an invalid character. Error processing
resource 'file:///C:/temp/case_export/tt-200312031606/MyCase.xslt'.
Line 39, Position 44

if ( playerwindow && !playerwindow.closed ) {
-------------------------------------------^
XSLT files:
-------------
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:user='urn:user'
version="1.0">
<xsl:output method="html"/>
<xsl:template match="RMSCase">
<HTML>
<HEAD>
<TITLE>My case</TITLE>
<STYLE>
.data {font-family:tahoma, sans-serif; font-size=10pt}
.title {font-family:tahoma, sans-serif; background-color:eeeeee;
font-size:8pt; padding:5,5,5,5}
.text {font-family:courier new; font-size:10pt}
.header {font-family:verdana; font-size=14pt}
.header2 {font-family:verdana; font-size=12pt;}
.header3 {font-family:verdana; font-size=10pt;}
</STYLE>
<SCRIPT language="javascript">
var playerwindow=null;
function LaunchPlayer(name,iname,number,date,duration)
{
var location;
var qlocation;
var winname;
location = document.URL;
location = location.substring(7,location.length);
var pos = location.lastIndexOf("\\");
location = location.substring(0,pos);
location = location.replace(/\\/g,"\\");
location = location + "\\";
qlocation = unescape(location);
winname = 'Player.html?Param=' + qlocation + ',' + name;
winname = winname + ',' + number + ',' + date + ',' + iname +
',' + duration;

if ( playerwindow && !playerwindow.closed ) {
if ( confirm("Are you sure you want to play another
recording?") ) {
playerwindow.document.MediaPlayer.stop();
playerwindow.close();
playerwindow =
window.open(winname,"Player","height=200,width=440 ,status=no,toolbar=no,menubar=no,location=no;
titlebar=no");
playerwindow.focus();
}
}
else {
playerwindow = window.open(winname,"Player","height=200,width=440 ,status=no,toolbar=no,menubar=no,location=no;
titlebar=no");
playerwindow.focus();
}
return;
}
</SCRIPT>
</HEAD>
......
Jul 20 '05 #1
1 5856
ch**********@t-netix.com (Charles Chow) wrote in
news:19**************************@posting.google.c om:
Any clue on why I got this error when I use javascript function in
XSLT? The same javescript works fine with ASP. What this function
does is to keep only one window (with media player activeX control)
instance. A name was started with an invalid character. Error processing
resource 'file:///C:/temp/case_export/tt-200312031606/MyCase.xslt'.
Line 39, Position 44

if ( playerwindow && !playerwindow.closed ) {
-------------------------------------------^


In XML documents (such as XSLT files), "&" has a special meaning and needs
to be escaped (by writing it as &amp; or, probably better when including
scripts, enclosing the whole script in a CDATA section).
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jon Martin Solaas | last post: by
1 post views Thread by Claudio Jolowicz | last post: by
1 post views Thread by Sergio del Amo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.