471,054 Members | 1,656 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,054 software developers and data experts.

less than operartor wont work

everytime that i try to use the less than operator

function ToCurrency(amt)
{
if (amt <= -1)
{
}
}
i get the following error in the browser
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:/Documents and Settings/William Storey II/Desktop/test.xsl'. Line
12, Position 11

if (x <= -1)
----------^does anyone have any ideas as to why this happens and how to fix
it thanks wstoreyII
Jul 23 '05 #1
2 1543
"WStoreyII" <pa**********@sbcglobal.net> writes:
everytime that i try to use the less than operator .... if (amt <= -1) .... i get the following error in the browser
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:/Documents and Settings/William Storey II/Desktop/test.xsl'. Line
12, Position 11


Why is the extension "xsl"?
My guess is that IE uses the extension to decide that the file is an
XSLT transformation. That means that it is an XML file. Inside an XML
file, the "less than" sign means something, and must be escaped.

Shouldn't it be an "html" file?

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #2
WStoreyII wrote:
everytime that i try to use the less than operator

function ToCurrency(amt)
{
if (amt <= -1)
{
}
}
i get the following error in the browser
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.


In XML, some characters like the less than operator should be translated to
their enitiy. In your case, you should write:

if (amt &lt;= -1)

Alternatively, you can also put the function definition in a CDATA section:

<script type="text/javascript">
<![CDATA[
// JS code
]]>
</script>
JW

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Oliver Spiesshofer | last post: by
19 posts views Thread by Allen Thompson | last post: by
4 posts views Thread by Steve Westwood | last post: by
5 posts views Thread by Mr Newbie | last post: by
11 posts views Thread by Bit byte | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.