|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: question about javascript and XSL
My first guess is that the namespace you are using may not support this functionality(??). Also, I tried your code using a command line version of msxml4.0 and it responded "The "http://www.w3.org/TR/WD-xsl" namespace is no longer supported in this version of MSXML."
If you have to use the <html xmlns:xsl="http://www.w3.org/TR/WD-xsl"> namespace - maybe you can escape the javascript in-line, as below:
<script language="Javascript">
if ( 1 > 1 )
{
document.write("passed")
}
else
{
document.write("failed")
}
</script>
Otherwise, using "xmlns:xsl="http://www.w3.org/1999/XSL/Transform", your code transformed correctly.
HTH
-----Original Message-----
From: Simon Choy [mailto:Simon.Choy@xxxxxxxxxxxxxxxxxxxx]
Sent: Tuesday, May 07, 2002 1:38 PM
To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Subject: RE: question about javascript and XSL
This is true
my question is, how do i get around this?
i thought placing it with a CDATA would do the trick
but it didn't solve the error
-----Original Message-----
From: Nik Krimm [mailto:Nik.Krimm@xxxxxxxxxxxxxxx]
Sent: Tuesday, May 07, 2002 11:32 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: question about javascript and XSL
Simon:
The error you are getting ["A RunTime erro has occured. Do you wish to
Debug? Error: Expected ')'] is an IE client-side js error. It looks to me
like your tranformation is replacing the (1>1) with (1>1). You can view
the source in the browser window to see if this is true.
-----Original Message-----
From: Simon Choy [mailto:Simon.Choy@xxxxxxxxxxxxxxxxxxxx]
Sent: Tuesday, May 07, 2002 1:06 PM
To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Subject: RE: question about javascript and XSL
<?xml version="1.0" encoding="ISO-8859-1" ?>
<html xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<script language="Javascript">
<![CDATA[
if ( 1 > 1 )
{
document.write("passed")
}
else
{
document.write("failed")
}
]]>
</script>
<body>
...
well this is an XSL file that's used to display information about an XML
file
please imaging there are xSL codes within there
I am sure that my XSL code isn't causing the problem
but the
if (1 > 1 ) part is
the error it is giving me is
"A RunTime erro has occured. Do you wish to Debug?
Error: Expected ')'
and if i debug, line 3 is the line just above
if (1 > 1)
if i replace
1 > 1
with
1 == 1
everything is fine
any insight?
ps. both ( 1 > 1 ) AND ( 1 < 1 ) don't work
-----Original Message-----
From: Greg Faron [mailto:gfaron@xxxxxxxxxxxxxxxxxx]
Sent: Tuesday, May 07, 2002 10:51 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: question about javascript and XSL
At 11:39 AM 5/7/2002, you wrote:
>I know this has been asked before, but i've searched through many postings
>and I still cannot find an answer to this
>
>The follow code looks syntatically correct
>however, the < is still giving me error!
>
>can anyone spot the reason??
>
><?xml version="1.0" encoding="ISO-8859-1"?>
You mention JavaScript in the subject line, but I don't see any of that
(or any XSL for that matter). If it's complaining on the line that you
posted, I would recommend that you ensure that there is NO whitespace
before the XML declaration.
If there's a complaint from an area where you do a common JavaScript
comparison (for example, "i < 100"), reverse the comparison ("100 >
i"). If that's not the problem, post more code.
Greg Faron
Integre Technical Publishing Co.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








