[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] javascript problem


Subject: Re: [xsl] javascript problem
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 19 Jul 2002 10:21:07 +0100

Hi Paul,

> OK, apologies if this was not an xslt issue. I thought the problem
> had to do with output encoding or something. But you and others say
> it won't execute simply because the written-out tag is in the
> document header. And then only because it is output from a preceding
> xslt transformation since placing the script in the head of a
> straight html doc works just fine.

If you're doing this transformation server-side, there should be
absolutely no difference between loading the HTML page that's
generated by the transformation statically and having the
transformation done automatically. An HTML page shouldn't "know" that
it's the result of an XSLT transformation.

Try running the transformation on your machine to create the HTML page
and then viewing the result. Does it work? If it doesn't, you need to
fix the HTML, then fix the XSLT so that it creates that HTML.

If it does work, then try accessing the page via Cocoon, then doing
"View Source" to see what's actually being sent to your browser,
saving that as an HTML file, and loading it. Does it work?

If it does, then I suspect that your browser is doing something funny
like using the extension (.xml) used in the URL rather than the
content type reported by Cocoon in order to figure out what to do with
the document. Try saving the document with a different extension to
see if you can replicate the problem; then change Cocoon's
configuration so that it uses a .html extension or something that's
interpreted properly.

If the locally-saved version of the HTML document doesn't work, then
there's something in the configuration of Cocoon that is making the
output of the transformation wonky -- perhaps it's being serialised as
an XML document rather than HTML. Changing the xsl:output element in
the stylesheet will not help at all as Cocoon (I assume you're using
Cocoon 2) ignores that and uses its own serialisers. You need to make
sure that Cocoon is configured to return the result of the query that
you're making as HTML (say) rather than XML.

I hope something there works for you.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords