> I'm trying to build a website with two frames, one for 
> navigation purposes
> and a second one for the main content.
> I'm checking out JavaScript; I'm not very familiar with it, 
> but I got it
> working in XMLSpy with saxon.
> The problem is that JavaScript is often complaining about newlines
> (that I don't know where they are coming from), that it makes it very
> difficult for me working with
> it.

That's right, you have to be carefull, when you write javascript in your
stylesheet.
Pay attention to extra spaces/carriage returns/tabs when formating the XSL
in your editor.
Smart editors indent XSL well, but they also mess things up when you work
with code...
I put all my javascript code in a <![CDATA[ ]]>, and it is outputed just the
way it looks in my stylesheet (see below).

> So one question is: are there other possibilities for 
> building frames out
> of one single xml-file? 

I'm not really familiar with javascript, and I try to avoid complex things,
so my suggestions are:
1) you could use a basic HTML file to build the frameset, each frame
pointing to the appropriate HTML/XML file
2) if you really want to build the frameset from one XML file with
javascript, try to use CDATA sections like this (only the 'xsl:value-of' or
XSLT stuffs are "outside"):

   <xsl:template match="foo:order">
      <xsl:apply-templates select="common:form" />
<SCRIPT language='JavaScript'>
<![CDATA[function refreshTable()
{
    var i;
    var total = 0;
    for (i=0; i<]]><xsl:value-of select="count(//foo:product)" /><![CDATA[;
i++) {
        var q;
        var p;
......
} ]]>
</SCRIPT>
   </xsl:template>

Note: you don't have to use
<![CDATA[']]><![CDATA[+']]>
<![CDATA['+']]> is enough.
Same thing for <xsl:element name="br"/>, <br/> doas the same thing and it's
shorter

> The second question concerns cocoon (1.8.2 on tomcat 3.2.1): 
> cocoon won't
> display the frames (only shows the main frame) but doesn't give an
> error message. I am missing something?

It's a browser issue; look at the HTML source of the page to see what
happens.
Olivier

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to