Re: [xsl] JavaScript and XSL Problems

Subject: Re: [xsl] JavaScript and XSL Problems
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 19 Jul 2002 15:02:17 +0100
Mr. Railan,

Please call me Jeni.

> I tried it, and in the HTML output, it just put quotes around the
> last string, which is fine, but I still get similar errors. I'll
> paste them right here:
>
> Error: Expected ']' <----I have narrowed this down to having to do
> with one of the .js files (as when they're not in the same directory
> as they should be, the error goes away).
>
> Error: Object Expected <----I get this one now that I've put in
> those quotes, instead of it having expected a ')' like before. I
> suspect it's something to do with my inline javascript code, but I
> don't know what.

What I suggest you do is create, by hand, an HTML page that works.
When you have an HTML page that works, have a look at the HTML that
you're generating from the stylesheet and see where they differ, then
fix the XSLT so that it generates the HTML that works. It is hopeless
trying to disentangle errors that might come from JavaScript, might
come from XSLT, or might come from some strange combination of the
two. Take it one step at a time.

> I'll also better explain what I'm attempting to do. What my original
> intentions were, were to create a frame, and to display the main
> document by using only one XML file, and one XSL file. I was able to
> get the formatting down, and to have the Table of Contents created,
> but of course you need two seperate files for it to work, and you
> can't just pass HTML to the frame src and expect it to display.

Well, you can get the document in a particular frame and write stuff
to it:

         frame.document.open();
         frame.document.write(XSLTProcessor.output);
         frame.document.close();

Try having just one script, in the frame document, managing all the
transformations for the separate frames, and redirect the output from
the different transformations to the separate frames with code like
the above.

> Also, when I try to count the
> //sectiontitle //title and //subtitle, it shows up with about 30
> more things then it should, and I have NO idea how and/or why.

Well, you're counting all the sectiontitle, title and subtitle
elements in the document. I don't know what you want to do, but
perhaps the problem is with the path.

Cheers,

Jeni

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


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


Current Thread