You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by migselv46 <mi...@yahoo.dk> on 2008/06/08 18:34:44 UTC

Cocoon in Eclipse??

Hi

I have searched everywhere and tried everything trying to use cocoon in
Eclipse/Tomcat (or even better in WSAD 5.x) - that is - not by using ant,
maven or jetty server.

Is it at all possible?

If yes - how does it work? A normal web application described by 'web.xml'
does not know anything about sitemaps, pipelines or the like.

How do I connect cocoon and a "normal" servlet?

I have not been able to find anything whatsoever in the documentation?!?

brgds Erik

-- 
View this message in context: http://www.nabble.com/Cocoon-in-Eclipse---tp17720458p17720458.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon in Eclipse??

Posted by migselv46 <mi...@yahoo.dk>.
I guess I am not expressing my question correct. I think basically what I
need to know is what the web.xml-file should look like to configure the
CocoonServlet and perhaps the 'cocoon.xconf'-file if this is needed as well.

Where is this described in the documentation? Is everybody just guessing?
:-)

I am not able to find this information anywhere. Can anyone please point to
this?

Thanks

-- 
View this message in context: http://www.nabble.com/Cocoon-in-Eclipse---tp17720458p17787698.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon in Eclipse??

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
migselv46 pisze:
> Hi Andy
> 
> Thanks a lot for your reply. 
> 
> I am using Eclipse 3.2 and Cocoon 2.2 (although I have tried a lot of other
> versions as well as nothing seems to really work without exotic errors.... )
> 
> I was very much in doubt with the setup of the CocoonServlet so that is good
> to know. I tried to create a small Cocoon project using Maven which works. I
> can build, install and run the application in the Jetty server fine. I used
> this project and used the command 
> mvn eclipse:eclipse
> hoping that I would get the necessary setup as "promised" on the Apache
> cocoon page. But no web.xml-file is generated which I would believe was a
> minimum for a Eclipse project and as I understand by your reply as well - in
> that as you state the CocoonServlet needs to be setup.
> I guess that I could get this setup some other way....
> 
> Is the CocoonServlet the only servlet that needs to be setup?
> 
> When copying the COB-INF directory to the Eclipse project should iit be
> placed at the same level as the META-INF-directory?

Erik,

you confuse many things here. Eclipse is an IDE not servlet container so valid Eclipse project does 
not necessary have to include web.xml and other WEB-INF contents. When you run

   mvn eclipse:eclipse

you tell Maven to generate Eclipse project descriptor files so project can be imported into Eclipse.

Completely separate affair is to get WAR file for your webapp so you can deploy it to any servlet 
container you like. This is described here:
http://cocoon.apache.org/2.2/1362_1_1.html

Note that after running mvn package you will find WAR file in target directory of myCocoonWebapp.

-- 
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon in Eclipse??

Posted by migselv46 <mi...@yahoo.dk>.
Hi Andy

Thanks a lot for your reply. 

I am using Eclipse 3.2 and Cocoon 2.2 (although I have tried a lot of other
versions as well as nothing seems to really work without exotic errors.... )

I was very much in doubt with the setup of the CocoonServlet so that is good
to know. I tried to create a small Cocoon project using Maven which works. I
can build, install and run the application in the Jetty server fine. I used
this project and used the command 
mvn eclipse:eclipse
hoping that I would get the necessary setup as "promised" on the Apache
cocoon page. But no web.xml-file is generated which I would believe was a
minimum for a Eclipse project and as I understand by your reply as well - in
that as you state the CocoonServlet needs to be setup.
I guess that I could get this setup some other way....

Is the CocoonServlet the only servlet that needs to be setup?

When copying the COB-INF directory to the Eclipse project should iit be
placed at the same level as the META-INF-directory?


-- 
View this message in context: http://www.nabble.com/Cocoon-in-Eclipse---tp17720458p17731128.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: character-maps in cocoon

Posted by Joerg Heinicke <jo...@gmx.de>.
On 09.06.2008 06:29, Heather Rankin wrote:

> Are character-maps supported in Cocoon 2.1? I need to replace &lt; and
> &gt; entity references with the literal characters '<' and '>' and can't
> get it to work in Cocoon. I have the following character-map in my XSLT:
> 
> <xsl:output use-character-maps="cm1" method="xml" indent="yes"
> encoding="UTF-8" media-type="text/xml"/>
> 	
> <xsl:character-map name="cm1">
> 	<xsl:output-character character="&lt;" string="&lt;"/>
> 	<xsl:output-character character="&gt;" string="&gt;"/>
> </xsl:character-map>
> 
> This works fine outside of cocoon (e.g. in Oxygen). But when I run it
> through the second transformer in the following pipleline:
> 
> <map:match pattern="terms">
> 	<map:generate src="{request-param:url}" type="html"/>
> 	<map:transform type="xslt2" src="transforms/getTerms.xsl"/>
> 	<map:transform type="xslt2"
> src="transforms/convertStringToXML.xsl"/>
> 	<map:serialize type="xml"/>
> </map:match>
> 
> ... the &lt; and &gt; characters do not get replaced (remain escaped).
> Is this something to do with the xml serializer? Do I need to change
> something there?

disable-output-escaping (and it seems also charater-map) only passes 
serializer hints along with the actual XML. With a second transformation 
following the one using disable-output-escaping these hints get lost. 
That's why you should not use this "feature" in Cocoon. It only works in 
a non-streaming environment, where you serialize after each transformation.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: character-maps in cocoon

Posted by Heather Rankin <He...@bbc.co.uk>.
Thanks Geert,

If you mean I should use saxon as my XSLT processor in my XSLT
transforer, I'm already doing that:

<component logger="core.xslt"
 	     role="org.apache.excalibur.xml.xslt.XSLTProcessor/saxon"
           class="org.apache.cocoon.components.xslt.TraxProcessor">
    <parameter name="use-store" value="true"/>
    <parameter name="transformer-factory"
value="net.sf.saxon.TransformerFactoryImpl"/>
</component>

But if you mean I should be using saxon in the xml serializer (which I
didn't know you could do), do you mean something like this?

<map:serializer logger="sitemap.serializer.xml" mime-type="text/xml"
name="xml" src="org.apache.cocoon.serialization.XMLSerializer">
 
<transformer-factory>net.sf.saxon.TransformerFactoryImpl</transformer-fa
ctory>
</map:serializer>

(PS, I triedf this and it doesn't seem to work either.)

Sorry if I've misunderstood... I shall wait for your code example.

Heather

-----Original Message-----
From: Geert Josten [mailto:geert.josten@daidalos.nl] 
Sent: 09 June 2008 11:46
To: users@cocoon.apache.org
Subject: RE: character-maps in cocoon

Heather,

This could be done by using Saxon as (XSL)Serializer. I have some code
around somewhere, but I won't be able to look it up till the end of the
day (CET time).

Kind regards,
Geert

> 
  
 
Drs. G.P.H. Josten
Consultant
 
 
http://www.daidalos.nl/
Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665 JZ Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
http://www.daidalos.nl/
KvK 27164984
De informatie - verzonden in of met dit emailbericht - is afkomstig van
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u
dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te
verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.
 

> From: Jeroen Reijn [mailto:j.reijn@onehippo.com]
> Sent: maandag 9 juni 2008 12:38
> To: users@cocoon.apache.org
> Subject: Re: character-maps in cocoon
> 
> Hi!
> 
> You could try to use disable-output-escaping in your xslt files. Maybe

> that will help.
> 
> Regards,
> 
> Jeroen
> 
> 
> Heather Rankin wrote:
> > Hi,
> > 
> > Are character-maps supported in Cocoon 2.1? I need to
> replace &lt; and
> > &gt; entity references with the literal characters '<' and '>' and 
> > can't get it to work in Cocoon. I have the following
> character-map in my XSLT:
> > 
> > <xsl:output use-character-maps="cm1" method="xml" indent="yes"
> > encoding="UTF-8" media-type="text/xml"/>
> > 	
> > <xsl:character-map name="cm1">
> > 	<xsl:output-character character="&lt;" string="&lt;"/>
> > 	<xsl:output-character character="&gt;" string="&gt;"/> 
> > </xsl:character-map>
> > 
> > This works fine outside of cocoon (e.g. in Oxygen). But
> when I run it
> > through the second transformer in the following pipleline:
> > 
> > <map:match pattern="terms">
> > 	<map:generate src="{request-param:url}" type="html"/>
> > 	<map:transform type="xslt2" src="transforms/getTerms.xsl"/>
> > 	<map:transform type="xslt2"
> > src="transforms/convertStringToXML.xsl"/>
> > 	<map:serialize type="xml"/>
> > </map:match>
> > 
> > ... the &lt; and &gt; characters do not get replaced
> (remain escaped).
> > Is this something to do with the xml serializer? Do I need
> to change
> > something there?
> > 
> > Heather
> > 
> > http://www.bbc.co.uk/
> > This e-mail (and any attachments) is confidential and may
> contain personal views which are not the views of the BBC unless 
> specifically stated.
> > If you have received it in error, please delete it from your system.
> > Do not use, copy or disclose the information in any way nor
> act in reliance on it and notify the sender immediately.
> > Please note that the BBC monitors e-mails sent or received.
> > Further communication will signify your consent to this.
> > 					
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
					

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: character-maps in cocoon

Posted by Geert Josten <ge...@daidalos.nl>.
Hi,

Other people may have raised their ears in expectation, so I am going to
give away the most essential details anyway.. ;-)

You need to create a new Java Cocoon component unfortunately. The
easiest way is to extend the AbstractTextSerializer. You basically only
need to overrule the setOutputStream function to create a transform
handler and register that as content handler. Something like:

			SAXTransformerFactory tfactory =
this.getTransformerFactory();
			Templates templates = tfactory.newTemplates(new
StreamSource(xslURI));
			TransformerHandler transformerHandler =
tfactory.newTransformerHandler(templates);

	
transformerHandler.getTransformer().setOutputProperties(this.format);
			transformerHandler.setResult(new
StreamResult(this.output));
			
			this.setContentHandler(transformerHandler);
			this.setLexicalHandler(transformerHandler);

xslURI is a parameter that could be passed to the component by using the
configure interface (creation of object), or perhaps even through setup
interface (preparation of sitemap, perhaps more convenient).

The java code of XMLSerializer has pretty much everything you need,
except that it doesn't lookup this xslURI variable and it doesn't create
a new TransformerHandler each time as it isn't applying any XSL..

Also make sure to add the following parameter to the map:serializer
definition and also something to specify the XSL containing the
character maps:

	
<transformer-factory>net.sf.saxon.TransformerFactoryImpl</transformer-fa
ctory>

If you google for 'XSLSerializer', you will find lots of comments of
some other people having created similar things. (Found no real code
though.) The general conclusion is to keep the serializer clean, so just
add stuff in the XSL that cannot be put in an XSL transform before...

Anyhow, I have extended the AbstractTextSerializer for other uses as
well. It really takes a large step to create a first component of
yourselves, but once that is behind you... ;-)

Kind regards,
Geert

PS: I am not able to share the real code, for copyrights reasons.
Sorry.. :-(

> -----Original Message-----
> From: Heather Rankin [mailto:Heather.Rankin@bbc.co.uk] 
> Sent: maandag 9 juni 2008 17:01
> To: users@cocoon.apache.org
> Subject: RE: character-maps in cocoon
> 
> Hi Geert,
> 
> Just to save you some digging, I managed to get this working with the
> saxon:parse() extension instead. This works fine (no need for 
> character
> maps):
> 
> <!-- Where <node> contains text mixed with enity references 
> --> <xsl:copy-of select="saxon:parse(results/node)"/>
> 
> Thanks for the help.
> 
> Heather
> 
> -----Original Message-----
> From: Geert Josten [mailto:geert.josten@daidalos.nl]
> Sent: 09 June 2008 11:46
> To: users@cocoon.apache.org
> Subject: RE: character-maps in cocoon
> 
> Heather,
> 
> This could be done by using Saxon as (XSL)Serializer. I have 
> some code around somewhere, but I won't be able to look it up 
> till the end of the day (CET time).
> 
> Kind regards,
> Geert
> 
> > 
>   
>  
> Drs. G.P.H. Josten
> Consultant
>  
>  
> http://www.daidalos.nl/
> Daidalos BV
> Source of Innovation
> Hoekeindsehof 1-4
> 2665 JZ Bleiswijk
> Tel.: +31 (0) 10 850 1200
> Fax: +31 (0) 10 850 1199
> http://www.daidalos.nl/
> KvK 27164984
> De informatie - verzonden in of met dit emailbericht - is 
> afkomstig van Daidalos BV en is uitsluitend bestemd voor de 
> geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, 
> verzoeken wij u het te verwijderen. Aan dit bericht kunnen 
> geen rechten worden ontleend.
>  
> 
> > From: Jeroen Reijn [mailto:j.reijn@onehippo.com]
> > Sent: maandag 9 juni 2008 12:38
> > To: users@cocoon.apache.org
> > Subject: Re: character-maps in cocoon
> > 
> > Hi!
> > 
> > You could try to use disable-output-escaping in your xslt 
> files. Maybe
> 
> > that will help.
> > 
> > Regards,
> > 
> > Jeroen
> > 
> > 
> > Heather Rankin wrote:
> > > Hi,
> > > 
> > > Are character-maps supported in Cocoon 2.1? I need to
> > replace &lt; and
> > > &gt; entity references with the literal characters '<' 
> and '>' and 
> > > can't get it to work in Cocoon. I have the following
> > character-map in my XSLT:
> > > 
> > > <xsl:output use-character-maps="cm1" method="xml" indent="yes"
> > > encoding="UTF-8" media-type="text/xml"/>
> > > 	
> > > <xsl:character-map name="cm1">
> > > 	<xsl:output-character character="&lt;" string="&lt;"/>
> > > 	<xsl:output-character character="&gt;" string="&gt;"/> 
> > > </xsl:character-map>
> > > 
> > > This works fine outside of cocoon (e.g. in Oxygen). But
> > when I run it
> > > through the second transformer in the following pipleline:
> > > 
> > > <map:match pattern="terms">
> > > 	<map:generate src="{request-param:url}" type="html"/>
> > > 	<map:transform type="xslt2" src="transforms/getTerms.xsl"/>
> > > 	<map:transform type="xslt2"
> > > src="transforms/convertStringToXML.xsl"/>
> > > 	<map:serialize type="xml"/>
> > > </map:match>
> > > 
> > > ... the &lt; and &gt; characters do not get replaced
> > (remain escaped).
> > > Is this something to do with the xml serializer? Do I need
> > to change
> > > something there?
> > > 
> > > Heather
> > > 
> > > http://www.bbc.co.uk/
> > > This e-mail (and any attachments) is confidential and may
> > contain personal views which are not the views of the BBC unless 
> > specifically stated.
> > > If you have received it in error, please delete it from 
> your system.
> > > Do not use, copy or disclose the information in any way nor
> > act in reliance on it and notify the sender immediately.
> > > Please note that the BBC monitors e-mails sent or received.
> > > Further communication will signify your consent to this.
> > > 					
> > > 
> > > 
> > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > > For additional commands, e-mail: users-help@cocoon.apache.org
> > > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> > 
> > 
> 
>  
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> http://www.bbc.co.uk/
> This e-mail (and any attachments) is confidential and may 
> contain personal views which are not the views of the BBC 
> unless specifically stated.
> If you have received it in error, please delete it from your system.
> Do not use, copy or disclose the information in any way nor 
> act in reliance on it and notify the sender immediately.
> Please note that the BBC monitors e-mails sent or received.
> Further communication will signify your consent to this.
> 					
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: character-maps in cocoon

Posted by Heather Rankin <He...@bbc.co.uk>.
Hi Geert,

Just to save you some digging, I managed to get this working with the
saxon:parse() extension instead. This works fine (no need for character
maps):

<!-- Where <node> contains text mixed with enity references -->
<xsl:copy-of select="saxon:parse(results/node)"/>

Thanks for the help.

Heather

-----Original Message-----
From: Geert Josten [mailto:geert.josten@daidalos.nl] 
Sent: 09 June 2008 11:46
To: users@cocoon.apache.org
Subject: RE: character-maps in cocoon

Heather,

This could be done by using Saxon as (XSL)Serializer. I have some code
around somewhere, but I won't be able to look it up till the end of the
day (CET time).

Kind regards,
Geert

> 
  
 
Drs. G.P.H. Josten
Consultant
 
 
http://www.daidalos.nl/
Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665 JZ Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
http://www.daidalos.nl/
KvK 27164984
De informatie - verzonden in of met dit emailbericht - is afkomstig van
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u
dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te
verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.
 

> From: Jeroen Reijn [mailto:j.reijn@onehippo.com]
> Sent: maandag 9 juni 2008 12:38
> To: users@cocoon.apache.org
> Subject: Re: character-maps in cocoon
> 
> Hi!
> 
> You could try to use disable-output-escaping in your xslt files. Maybe

> that will help.
> 
> Regards,
> 
> Jeroen
> 
> 
> Heather Rankin wrote:
> > Hi,
> > 
> > Are character-maps supported in Cocoon 2.1? I need to
> replace &lt; and
> > &gt; entity references with the literal characters '<' and '>' and 
> > can't get it to work in Cocoon. I have the following
> character-map in my XSLT:
> > 
> > <xsl:output use-character-maps="cm1" method="xml" indent="yes"
> > encoding="UTF-8" media-type="text/xml"/>
> > 	
> > <xsl:character-map name="cm1">
> > 	<xsl:output-character character="&lt;" string="&lt;"/>
> > 	<xsl:output-character character="&gt;" string="&gt;"/> 
> > </xsl:character-map>
> > 
> > This works fine outside of cocoon (e.g. in Oxygen). But
> when I run it
> > through the second transformer in the following pipleline:
> > 
> > <map:match pattern="terms">
> > 	<map:generate src="{request-param:url}" type="html"/>
> > 	<map:transform type="xslt2" src="transforms/getTerms.xsl"/>
> > 	<map:transform type="xslt2"
> > src="transforms/convertStringToXML.xsl"/>
> > 	<map:serialize type="xml"/>
> > </map:match>
> > 
> > ... the &lt; and &gt; characters do not get replaced
> (remain escaped).
> > Is this something to do with the xml serializer? Do I need
> to change
> > something there?
> > 
> > Heather
> > 
> > http://www.bbc.co.uk/
> > This e-mail (and any attachments) is confidential and may
> contain personal views which are not the views of the BBC unless 
> specifically stated.
> > If you have received it in error, please delete it from your system.
> > Do not use, copy or disclose the information in any way nor
> act in reliance on it and notify the sender immediately.
> > Please note that the BBC monitors e-mails sent or received.
> > Further communication will signify your consent to this.
> > 					
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
					

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: character-maps in cocoon

Posted by Heather Rankin <He...@bbc.co.uk>.
Thanks Jeroen,

I have tried disable-output-escaping. That also works outside of Cocoon,
but not in Cocoon. As disable-output-escaping has been deprecated in
XSLT2 and replaced with Character Maps, I went the character-map route
(hoping for a result)!

Heather 

-----Original Message-----
From: Jeroen Reijn [mailto:j.reijn@onehippo.com] 
Sent: 09 June 2008 11:38
To: users@cocoon.apache.org
Subject: Re: character-maps in cocoon

Hi!

You could try to use disable-output-escaping in your xslt files. Maybe
that will help.

Regards,

Jeroen


Heather Rankin wrote:
> Hi,
> 
> Are character-maps supported in Cocoon 2.1? I need to replace &lt; and

> &gt; entity references with the literal characters '<' and '>' and 
> can't get it to work in Cocoon. I have the following character-map in
my XSLT:
> 
> <xsl:output use-character-maps="cm1" method="xml" indent="yes"
> encoding="UTF-8" media-type="text/xml"/>
> 	
> <xsl:character-map name="cm1">
> 	<xsl:output-character character="&lt;" string="&lt;"/>
> 	<xsl:output-character character="&gt;" string="&gt;"/> 
> </xsl:character-map>
> 
> This works fine outside of cocoon (e.g. in Oxygen). But when I run it 
> through the second transformer in the following pipleline:
> 
> <map:match pattern="terms">
> 	<map:generate src="{request-param:url}" type="html"/>
> 	<map:transform type="xslt2" src="transforms/getTerms.xsl"/>
> 	<map:transform type="xslt2"
> src="transforms/convertStringToXML.xsl"/>
> 	<map:serialize type="xml"/>
> </map:match>
> 
> ... the &lt; and &gt; characters do not get replaced (remain escaped).
> Is this something to do with the xml serializer? Do I need to change 
> something there?
> 
> Heather
> 
> http://www.bbc.co.uk/
> This e-mail (and any attachments) is confidential and may contain
personal views which are not the views of the BBC unless specifically
stated.
> If you have received it in error, please delete it from your system.
> Do not use, copy or disclose the information in any way nor act in
reliance on it and notify the sender immediately.
> Please note that the BBC monitors e-mails sent or received.
> Further communication will signify your consent to this.
> 					
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
					

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: character-maps in cocoon

Posted by Geert Josten <ge...@daidalos.nl>.
Heather,

This could be done by using Saxon as (XSL)Serializer. I have some code
around somewhere, but I won't be able to look it up till the end of the
day (CET time).

Kind regards,
Geert

> 
  
 
Drs. G.P.H. Josten
Consultant
 
 
http://www.daidalos.nl/
Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665 JZ Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
http://www.daidalos.nl/
KvK 27164984
De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.
 

> From: Jeroen Reijn [mailto:j.reijn@onehippo.com] 
> Sent: maandag 9 juni 2008 12:38
> To: users@cocoon.apache.org
> Subject: Re: character-maps in cocoon
> 
> Hi!
> 
> You could try to use disable-output-escaping in your xslt 
> files. Maybe that will help.
> 
> Regards,
> 
> Jeroen
> 
> 
> Heather Rankin wrote:
> > Hi,
> > 
> > Are character-maps supported in Cocoon 2.1? I need to 
> replace &lt; and 
> > &gt; entity references with the literal characters '<' and '>' and 
> > can't get it to work in Cocoon. I have the following 
> character-map in my XSLT:
> > 
> > <xsl:output use-character-maps="cm1" method="xml" indent="yes"
> > encoding="UTF-8" media-type="text/xml"/>
> > 	
> > <xsl:character-map name="cm1">
> > 	<xsl:output-character character="&lt;" string="&lt;"/>
> > 	<xsl:output-character character="&gt;" string="&gt;"/> 
> > </xsl:character-map>
> > 
> > This works fine outside of cocoon (e.g. in Oxygen). But 
> when I run it 
> > through the second transformer in the following pipleline:
> > 
> > <map:match pattern="terms">
> > 	<map:generate src="{request-param:url}" type="html"/>
> > 	<map:transform type="xslt2" src="transforms/getTerms.xsl"/>
> > 	<map:transform type="xslt2"
> > src="transforms/convertStringToXML.xsl"/>
> > 	<map:serialize type="xml"/>
> > </map:match>
> > 
> > ... the &lt; and &gt; characters do not get replaced 
> (remain escaped).
> > Is this something to do with the xml serializer? Do I need 
> to change 
> > something there?
> > 
> > Heather
> > 
> > http://www.bbc.co.uk/
> > This e-mail (and any attachments) is confidential and may 
> contain personal views which are not the views of the BBC 
> unless specifically stated.
> > If you have received it in error, please delete it from your system.
> > Do not use, copy or disclose the information in any way nor 
> act in reliance on it and notify the sender immediately.
> > Please note that the BBC monitors e-mails sent or received.
> > Further communication will signify your consent to this.
> > 					
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: character-maps in cocoon

Posted by Jeroen Reijn <j....@onehippo.com>.
Hi!

You could try to use disable-output-escaping in your xslt files. Maybe 
that will help.

Regards,

Jeroen


Heather Rankin wrote:
> Hi,
> 
> Are character-maps supported in Cocoon 2.1? I need to replace &lt; and
> &gt; entity references with the literal characters '<' and '>' and can't
> get it to work in Cocoon. I have the following character-map in my XSLT:
> 
> <xsl:output use-character-maps="cm1" method="xml" indent="yes"
> encoding="UTF-8" media-type="text/xml"/>
> 	
> <xsl:character-map name="cm1">
> 	<xsl:output-character character="&lt;" string="&lt;"/>
> 	<xsl:output-character character="&gt;" string="&gt;"/>
> </xsl:character-map>
> 
> This works fine outside of cocoon (e.g. in Oxygen). But when I run it
> through the second transformer in the following pipleline:
> 
> <map:match pattern="terms">
> 	<map:generate src="{request-param:url}" type="html"/>
> 	<map:transform type="xslt2" src="transforms/getTerms.xsl"/>
> 	<map:transform type="xslt2"
> src="transforms/convertStringToXML.xsl"/>
> 	<map:serialize type="xml"/>
> </map:match>
> 
> ... the &lt; and &gt; characters do not get replaced (remain escaped).
> Is this something to do with the xml serializer? Do I need to change
> something there?
> 
> Heather
> 
> http://www.bbc.co.uk/
> This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
> If you have received it in error, please delete it from your system.
> Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
> Please note that the BBC monitors e-mails sent or received.
> Further communication will signify your consent to this.
> 					
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


character-maps in cocoon

Posted by Heather Rankin <He...@bbc.co.uk>.
Hi,

Are character-maps supported in Cocoon 2.1? I need to replace &lt; and
&gt; entity references with the literal characters '<' and '>' and can't
get it to work in Cocoon. I have the following character-map in my XSLT:

<xsl:output use-character-maps="cm1" method="xml" indent="yes"
encoding="UTF-8" media-type="text/xml"/>
	
<xsl:character-map name="cm1">
	<xsl:output-character character="&lt;" string="&lt;"/>
	<xsl:output-character character="&gt;" string="&gt;"/>
</xsl:character-map>

This works fine outside of cocoon (e.g. in Oxygen). But when I run it
through the second transformer in the following pipleline:

<map:match pattern="terms">
	<map:generate src="{request-param:url}" type="html"/>
	<map:transform type="xslt2" src="transforms/getTerms.xsl"/>
	<map:transform type="xslt2"
src="transforms/convertStringToXML.xsl"/>
	<map:serialize type="xml"/>
</map:match>

... the &lt; and &gt; characters do not get replaced (remain escaped).
Is this something to do with the xml serializer? Do I need to change
something there?

Heather

http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
					

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon in Eclipse??

Posted by Andy Stevens <in...@googlemail.com>.
migselv46 wrote:
> Hi
> 
> I have searched everywhere and tried everything trying to use cocoon in
> Eclipse/Tomcat (or even better in WSAD 5.x) - that is - not by using ant,
> maven or jetty server.
> 
> Is it at all possible?

What version - 2.1.x or 2.2?  With 2.1.x, the Ant build can generate a 
simple web app for you.  I just copied everything from that into the 
source folders of my own web app project, and started editing...

> If yes - how does it work? A normal web application described by 'web.xml'
> does not know anything about sitemaps, pipelines or the like.

No, but it "knows" about the Cocoon servlet.  Just include the 
appropriate entries for servlet (including init params) & 
servlet-mapping.  Then amend the various Cocoon config files as 
required.  No doubt there's a preferences setting somewhere in 
WSAD/eclipse to get it to recognise .xmap, .xconf, etc. as XML files 
rather than plain text.

Speaking of WSAD; if you're deploying to Websphere you may want to
- use PARENT_LAST classloader mode (at both application and web module 
levels) when you deploy your application, so that it uses the Xerces & 
Xalan versions shipped with Cocoon rather than Websphere's own. 
Alternatively, use the ParanoidCocoonServlet.
- in cocoon.xconf, change the jsp-engine implementation to use the 
"named servlet dispatcher" one (sorry, can't remember the exact 
classname, check the jsp block's jar) and configure it to use the "JSP 
1.2 Processor" (I think that's right, check the log messages as 
Websphere starts up to make sure).  If you use the default 
implementation, and have *.jsp mapped to Cocoon, you get an infinite 
loop as the RequestDispatcher Cocoon is given for any JSPs will call 
Cocoon itself again (which in all likelihood will map:match the same 
pipeline again).

> How do I connect cocoon and a "normal" servlet?

What do you mean by "connect"?  Cocoon *is* a normal servlet, albeit a 
rather complex one, so you can do the usual RequestDispatcher forwards & 
includes with it.  Only thing to watch out for is Cocoon always uses 
getOutputStream rather than getWriter, so jsp:include won't work; 
instead, use the JSTL's c:import tag which handles the writer/stream 
conversion.  Also, if you do want to use JSPs that forward/include to 
Cocoon (rather than have everything go through Cocoon and call the JSPs 
via the JSP generator/reader) make sure you don't map *.jsp to Cocoon in 
the servlet mappings.


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source Sudoku solver

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org