You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Christof Schneider <Ch...@gmx.de> on 2000/10/06 03:22:30 UTC

Script Code

General (beginner's) question:

[apache 1.3.12 - tomcat 3.1 - cocoon 1.8 - Windows 2000]

When generating a HTML document from a xml-file and a xsl file I
need to include java script code. Is there a common way to integrate
java script code in my xsl-code? I discovered that the <xsl:script> 
tag is not part of the w3c drafts.

Thanks in advance.

- Chris



Re: Script Code

Posted by Robin van Nooy <rn...@crisp.nl>.
Maybe you can just use:

<script language="JavaScript" src="mycode.js"></script>

Then you include the javascript code as an external file.

Kind regards,
Robin
http://mp3.com/drastic


----- Original Message ----- 
From: "Christof Schneider" <Ch...@gmx.de>
To: "Cocoon User List" <co...@xml.apache.org>
Sent: Friday, October 06, 2000 3:22 AM
Subject: Script Code


| General (beginner's) question:
| 
| [apache 1.3.12 - tomcat 3.1 - cocoon 1.8 - Windows 2000]
| 
| When generating a HTML document from a xml-file and a xsl file I
| need to include java script code. Is there a common way to integrate
| java script code in my xsl-code? I discovered that the <xsl:script> 
| tag is not part of the w3c drafts.
| 
| Thanks in advance.
| 
| - Chris
| 
| 
| 
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
| For additional commands, e-mail: cocoon-users-help@xml.apache.org
| 
| 


RE: Script Code

Posted by Christof Schneider <Ch...@gmx.de>.
> -----Original Message-----
> From: Robin van Nooy [mailto:rnooy@crisp.nl]
> Sent: Freitag, 6. Oktober 2000 08:25
> To: cocoon-users@xml.apache.org; Christof_Schneider@CompuServe.Com
> Subject: Re: Script Code
> 
> 
> Or did you just want to use the Javascript as part of XSL,
> and not for the HTML-part?


I want to create a HTML from a content (XML) and 
XSL part for the formating. Standard exercise, I guess.
The Javascript should be part of the output tree 
(HTML-Format) and is content dependent (Good idea to
use the include directive, but fails because it has 
to be created).

Any hint? 

- Chris


> 
> 
> 
> ----- Original Message ----- 
> From: "Christof Schneider" <Ch...@gmx.de>
> To: "Cocoon User List" <co...@xml.apache.org>
> Sent: Friday, October 06, 2000 3:22 AM
> Subject: Script Code
> 
> 
> | General (beginner's) question:
> | 
> | [apache 1.3.12 - tomcat 3.1 - cocoon 1.8 - Windows 2000]
> | 
> | When generating a HTML document from a xml-file and a xsl file I
> | need to include java script code. Is there a common way to integrate
> | java script code in my xsl-code? I discovered that the <xsl:script> 
> | tag is not part of the w3c drafts.
> | 
> | Thanks in advance.
> | 
> | - Chris
> | 
> | 
> | 
> | ---------------------------------------------------------------------
> | To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> | For additional commands, e-mail: cocoon-users-help@xml.apache.org
> | 
> | 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 

Re: Script Code

Posted by Robin van Nooy <rn...@crisp.nl>.
Or did you just want to use the Javascript as part of XSL,
and not for the HTML-part?



----- Original Message ----- 
From: "Christof Schneider" <Ch...@gmx.de>
To: "Cocoon User List" <co...@xml.apache.org>
Sent: Friday, October 06, 2000 3:22 AM
Subject: Script Code


| General (beginner's) question:
| 
| [apache 1.3.12 - tomcat 3.1 - cocoon 1.8 - Windows 2000]
| 
| When generating a HTML document from a xml-file and a xsl file I
| need to include java script code. Is there a common way to integrate
| java script code in my xsl-code? I discovered that the <xsl:script> 
| tag is not part of the w3c drafts.
| 
| Thanks in advance.
| 
| - Chris
| 
| 
| 
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
| For additional commands, e-mail: cocoon-users-help@xml.apache.org
| 
| 


Re: Script Code

Posted by Michael Bierenfeld <mi...@atmiralis.de>.
Christof Schneider wrote:
> 
> General (beginner's) question:
> 
> [apache 1.3.12 - tomcat 3.1 - cocoon 1.8 - Windows 2000]
> 
> When generating a HTML document from a xml-file and a xsl file I
> need to include java script code. Is there a common way to integrate
> java script code in my xsl-code? I discovered that the <xsl:script>
> tag is not part of the w3c drafts.
> 
> Thanks in advance.
> 
> - Chris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

We have done it this way :

<xsl:template match="page">

<xsl:processing-instruction name="cocoon-format">
	type="text/html"
</xsl:processing-instruction>

<head>
<script language="JavaScript"
src="../../../xml/ecmascript/command.es"
type="text/javascript">
</script>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1"/>
<title><xsl:value-of select="@title"/></title>
<link rel="stylesheet"
href="../../css/style.css"><!-- do not remove this
comment --></link>
</head>

and so on. ......

Works fine. So there is no need to include
javascript code in xml content. 

Regards

Michael