You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mac Schwarz <mc...@phil.uni-erlangen.de> on 2000/07/03 15:41:30 UTC

Cocoon, XSL and CSS

Hi,

I just can't figure out how to include CSS stylesheets with XSLT. After
playing around with my own files I tested the jakarta.apache.org example
in xml-cocoon/samples/sites/jakarta.apache.org from the Cocoon CVS since
I thought that would work well.

I'm using tomcat 3.1, Java(TM) 2 Runtime Environment, Standard Edition
(build 1.3.0-beta) and a Cocoon2 CVS checkout from yesterday on Solaris
8 x86.

I've got an tomcat context /cocoon with the docbaes
tomcat/webapps/cocoon and can access the welcome page or the Simple XSP
page for example. From the Cocoon CVS tree I copied the files
index-page.xml, page-html.xsl and style.css from 
xml-cocoon/samples/sites/jakarta.apache.org into the cocoon context.
After setting up the sitemap for the index-page.xml

	<process uri="index-page.xml" source="index-page.xml">
        <generator name="file"/>
        <filter name="xslt">
          <parameter name="stylesheet" value="page-html.xsl"/>
        </filter>
        <serializer name="html">
          <parameter name="contentType" value="text/html"/>
        </serializer>
      </process>

I get the error 'Cocoon 2.0: Not Found' 'The requested URI
"/cocoon/style.css" was not found.' if I try to access the page.
Additional to the error messages above there's a
'PATH_INFO="/style.css"' comment in the source of the error page.

After removing the line
<link rel="stylesheet" href="style.css"><!-- no not remove this comment
--></link>
in page-html.xsl the index-page.xml is displayed properly. 

Unfortunately I haven't found any working example yet. However if I use
a stylesheet from my apache server e.g. 
<link rel="stylesheet" href="http://www.myserver.xy/style.css"><!-- no
not remove this comment --></link>

the CSS is prosessed. Any hints how to include the CSS correctly in a
XSL with Cocoon?

Regards,
	mac
-- 
Mac Schwarz / AERIA Projekt / Inst. f. Klassische Archaeologie
e-mail: mac@aeria.phil.uni-erlangen.de  / Tel.: 09131-85-24791
 FAU Erlangen-Nuernberg   /   Kochstr.4   /   91054 Erlangen
  <http://www.phil.uni-erlangen.de/~p1altar/aeriahome.html>

Re: Cocoon 2

Posted by Paul Russell <pa...@luminas.co.uk>.
On Mon, Jul 03, 2000 at 11:43:48AM -0400, Martin O. Mauri wrote:
> Has anyone installed and built Cocoon 2?

'one or two' of us, yes ;)

> The problem is that I'm getting some errors at compile time. It looks like
> a versioning problem, such as "overriding deprecation" error and "method
> not found in interface" among others.

Sounds like you've got an old version of Xerces or Xalan in your
classpath - Could you give us a bit more info about the errors?

Cheers,

Paul

-- 
Paul Russell                               <pa...@luminas.co.uk>
Technical Director,                   http://www.luminas.co.uk
Luminas Ltd.

Re: Cocoon 2

Posted by Giacomo Pati <Gi...@pwr.ch>.
"Martin O. Mauri" wrote:
> 
> Hi everybody:
> 
> Has anyone installed and built Cocoon 2?
> 
> The problem is that I'm getting some errors at compile time. It looks like
> a versioning problem, such as "overriding deprecation" 

This reminds us having methods in the CVS which are deprecated and must
be cleand up.

> error and "method
> not found in interface" among others.

I have no problem compiling it. Can you turn off deprecation in the
build.xml file and send compilation report to the list?

Giacomo

-- 
PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1 856 2202
Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1 856 2201
Hintereichenstrasse 7                     Mailto:Giacomo.Pati@pwr.ch
CH-8166 Niederweningen                    Web:   http://www.pwr.ch

Re: Cocoon 2

Posted by "Martin O. Mauri" <mm...@vates.com>.
Berin Loritsch wrote:

> Mac Schwarz wrote:
> >
> > "Martin O. Mauri" wrote:
> > >
> > > Hi everybody:
> > >
> > > Has anyone installed and built Cocoon 2?
> > >
> > > The problem is that I'm getting some errors at compile time. It looks like
> > > a versioning problem, such as "overriding deprecation" error and "method
> > > not found in interface" among others.
> > >
> > > Any solution, suggestion, etc....?
> > >
> > > Thanks in advance!
> > >
> > > Martin
> >
> > I've got the same message but rather as warnings than errors( '2 files
> > use or override a deprecated API'). However the examples work after
> > installing the jar files as well as some small XML/XSL pages I wrote so
> > far. I think you can ignore the warnings and just install and test
> > Cocoon2. Cocoon2 ist still at alpha stage I think so you have to live
> > with those minor flaws.
>
> If FO2PDFSerializer.java does not compile with errors, it is because many
> of the carriage returns were lost.  After adding them back in, it should work
> fine.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

In fact the error says something about a "getQName" method in an interface called
"org.xml.sax.Attributes".

I'm using JDK 1.3

Any suggestions?

thanks again!

Martin

Re: Cocoon 2

Posted by Berin Loritsch <bl...@infoplanning.com>.
Mac Schwarz wrote:
> 
> "Martin O. Mauri" wrote:
> >
> > Hi everybody:
> >
> > Has anyone installed and built Cocoon 2?
> >
> > The problem is that I'm getting some errors at compile time. It looks like
> > a versioning problem, such as "overriding deprecation" error and "method
> > not found in interface" among others.
> >
> > Any solution, suggestion, etc....?
> >
> > Thanks in advance!
> >
> > Martin
> 
> I've got the same message but rather as warnings than errors( '2 files
> use or override a deprecated API'). However the examples work after
> installing the jar files as well as some small XML/XSL pages I wrote so
> far. I think you can ignore the warnings and just install and test
> Cocoon2. Cocoon2 ist still at alpha stage I think so you have to live
> with those minor flaws.

If FO2PDFSerializer.java does not compile with errors, it is because many
of the carriage returns were lost.  After adding them back in, it should work
fine.

Re: Cocoon 2

Posted by Mac Schwarz <mc...@phil.uni-erlangen.de>.
"Martin O. Mauri" wrote:
> 
> Hi everybody:
> 
> Has anyone installed and built Cocoon 2?
> 
> The problem is that I'm getting some errors at compile time. It looks like
> a versioning problem, such as "overriding deprecation" error and "method
> not found in interface" among others.
> 
> Any solution, suggestion, etc....?
> 
> Thanks in advance!
> 
> Martin

I've got the same message but rather as warnings than errors( '2 files
use or override a deprecated API'). However the examples work after
installing the jar files as well as some small XML/XSL pages I wrote so
far. I think you can ignore the warnings and just install and test
Cocoon2. Cocoon2 ist still at alpha stage I think so you have to live
with those minor flaws. 

	mac


-- 
Mac Schwarz / AERIA Projekt / Inst. f. Klassische Archaeologie
e-mail: mac@aeria.phil.uni-erlangen.de  / Tel.: 09131-85-24791
 FAU Erlangen-Nuernberg   /   Kochstr.4   /   91054 Erlangen
  <http://www.phil.uni-erlangen.de/~p1altar/aeriahome.html>

Cocoon 2

Posted by "Martin O. Mauri" <mm...@vates.com>.
Hi everybody:

Has anyone installed and built Cocoon 2?

The problem is that I'm getting some errors at compile time. It looks like
a versioning problem, such as "overriding deprecation" error and "method
not found in interface" among others.

Any solution, suggestion, etc....?

Thanks in advance!

Martin

Starting question

Posted by HuiSion Teh <hu...@magix.com.sg>.
hi
I am new to cocoon and xml and am experimenting my first website based on
XML. Let say my website will have home page, news, products, disclaimer and
privacy policy.

1. Do I use the same schema for all the above content?
	For example:
			<page>
				<title>
				</title>
			</page>
2. Or do I use different schema for each?
	For example:
	For index.xml-	<homepage>
				</homepage>
	For news.xml-		<news>
       				</news>
	For disclaimer.xml-	<Disclaimer>
				      </Disclaimer>

pls help..thanks
Regards


Re: Cocoon, XSL and CSS

Posted by Mac Schwarz <mc...@phil.uni-erlangen.de>.
Paul Sharpe wrote:
> 
> I just output the link in a really simple XSLT template:
> 
>   <xsl:template match="page">
>     <html>
>       <head>
>         <link rel="stylesheet" type="text/css" href="/foo.css"/>
>         <title>foo</title>
>       </head>
>       <body>
>         <xsl:apply-templates/>
>       </body>
>     </html>
>   </xsl:template>
> 
> paul

My own xsl page is similar to yours but I got the same 'The requested
URI "/stylesheets/netlingua.css" was not found.<!--
PATH_INFO="/stylesheets/netlingua.css" -->' error I got at the
jakarta.apache.org example:
------------------------------------------
 <xsl:template match="netlingua">
<html>
  <head>
     <title><xsl:value-of select="title"/></title>
     <link href="stylesheets/netlingua.css" rel="StyleSheet"
type="text/css"/>
 </head>
  <body>
<H1><xsl:value-of select="title"/></H1>
<xsl:apply-templates/>
   </body>
   </html>
</xsl:template>
------------------------------------------

The xml page is webapps/ROOT/index.xml and the xsl and CSS pages are
located in webapps/ROOT/stylesheets/

	mac

-- 
Mac Schwarz / AERIA Projekt / Inst. f. Klassische Archaeologie
e-mail: mac@aeria.phil.uni-erlangen.de  / Tel.: 09131-85-24791
 FAU Erlangen-Nuernberg   /   Kochstr.4   /   91054 Erlangen
  <http://www.phil.uni-erlangen.de/~p1altar/aeriahome.html>

Re: Cocoon, XSL and CSS

Posted by Paul Sharpe <pa...@miraclefish.com>.
I just output the link in a really simple XSLT template:

  <xsl:template match="page">
    <html>
      <head>
        <link rel="stylesheet" type="text/css" href="/foo.css"/>
        <title>foo</title>
      </head>
      <body>
        <xsl:apply-templates/>
      </body>
    </html>
  </xsl:template>

paul

On Mon, 3 Jul 2000, Mac Schwarz wrote:

> Hi,
> 
> I just can't figure out how to include CSS stylesheets with XSLT. After
> playing around with my own files I tested the jakarta.apache.org example
> in xml-cocoon/samples/sites/jakarta.apache.org from the Cocoon CVS since
> I thought that would work well.
> 
> I'm using tomcat 3.1, Java(TM) 2 Runtime Environment, Standard Edition
> (build 1.3.0-beta) and a Cocoon2 CVS checkout from yesterday on Solaris
> 8 x86.
> 
> I've got an tomcat context /cocoon with the docbaes
> tomcat/webapps/cocoon and can access the welcome page or the Simple XSP
> page for example. From the Cocoon CVS tree I copied the files
> index-page.xml, page-html.xsl and style.css from 
> xml-cocoon/samples/sites/jakarta.apache.org into the cocoon context.
> After setting up the sitemap for the index-page.xml
> 
> 	<process uri="index-page.xml" source="index-page.xml">
>         <generator name="file"/>
>         <filter name="xslt">
>           <parameter name="stylesheet" value="page-html.xsl"/>
>         </filter>
>         <serializer name="html">
>           <parameter name="contentType" value="text/html"/>
>         </serializer>
>       </process>
> 
> I get the error 'Cocoon 2.0: Not Found' 'The requested URI
> "/cocoon/style.css" was not found.' if I try to access the page.
> Additional to the error messages above there's a
> 'PATH_INFO="/style.css"' comment in the source of the error page.
> 
> After removing the line
> <link rel="stylesheet" href="style.css"><!-- no not remove this comment
> --></link>
> in page-html.xsl the index-page.xml is displayed properly. 
> 
> Unfortunately I haven't found any working example yet. However if I use
> a stylesheet from my apache server e.g. 
> <link rel="stylesheet" href="http://www.myserver.xy/style.css"><!-- no
> not remove this comment --></link>
> 
> the CSS is prosessed. Any hints how to include the CSS correctly in a
> XSL with Cocoon?
> 
> Regards,
> 	mac
> -- 
> Mac Schwarz / AERIA Projekt / Inst. f. Klassische Archaeologie
> e-mail: mac@aeria.phil.uni-erlangen.de  / Tel.: 09131-85-24791
>  FAU Erlangen-Nuernberg   /   Kochstr.4   /   91054 Erlangen
>   <http://www.phil.uni-erlangen.de/~p1altar/aeriahome.html>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 
> 

--
paul@miraclefish.com