Re: BUG?? - please help (JavaScript inside CDATA)

Subject: Re: BUG?? - please help (JavaScript inside CDATA)
From: Dan Morrison <dman@xxxxxxxx>
Date: Tue, 30 May 2000 14:01:06 +1200
juggy@xxxxxxx wrote:
> Hi there,
> I just discovered something that appears to be a nasty bug. I am
> using the MSXMLDOM in a ASP to convert XML + XSl to HTML.

First, thanks for reminding me what an issue it can be learning a third
language by way of a second!

I've noticed the high number of German (and Italian, and...)
contributors to this group and XML resources in general before.
Sometimes I've wondered how hard this can be, but decided that it's the
syntax of the code in question that we're both looking at, and the
language shouldn't be an issue.

Your code showed that there's a LOT of context in the variable names
(and content) used in examples which is very important. By this I mean I
had to think a lot harder about what you were doing than usual.
Luckily my German is still good enough to hold up a conversation
(although I can't spell)...

SO.. Language issues aside, what you're trying looks OK. 
We assume you're using the updated MSXML. (RIGHT?!)

My suspicions would fall upon the & characters that appear once or twice
in your CDATA. 
I know CDATA is supposed to be safe from parsing, but in many
implimentations, it's NOT.

The attitude I've seen here is that "&" IS, to all intents and purposes
the same thing as &amp; and (the numerical version which I can never
remember). This means that parsers are a bit too keen to escape it for
internal representation. 
As a keen client-side scripter, I disagree, but just work around it.
Often I write code that writes code that writes code (jumping through
three languages on the way). I prefer to do my own escaping.
There are some output-method settings which I believe help.

SO, see if you get better results if your content strings have no &
characters in them.

Also try
  <xsl:script language="JavaScript">
        ... ..

As it's 
  A: more correct. 
  B: safer from the parser.

If not, what was the view-source output when you did it client-side?
Paste that page into a syntax-coulouring editor and it may throw some
light on things.


: Dan Morrison        : The Web Limited    :
: :  :
:  dman@xxxxxxxx      :  danm@xxxxxxxxx    :
:  04 384 1472        :  04 495 8250       :
:  025 207 1140       :                    :
: If ignorance is bliss, why aren't more people happy?

 XSL-List info and archive:

Current Thread