You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by KOZLOV Roman <r-...@opencascade.com> on 2002/02/27 15:12:07 UTC

xsl:output problem

    Hello,

    Could somebody help me, please? Is it possible to use xsl:output in
stylesheets processed by cocoon's xslt transformer? It seems that it has
no effect.  Indeed, the problem is that I can't tell to xslt transformer
that I need a pure XML as a result, but the xslt transformer always
transforms <img .../> to <img ...> and it leads to crash of a pipeline.
My xsl begins like this:

  <?xml version="1.0" encoding="UTF-8" ?>
  <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" encoding="ISO-8859-1" indent="yes"/>
    . . .

Thank you in advance.


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: xsl:output problem

Posted by Nicola Ken Barozzi <ba...@nicolaken.com>.
From: "Bartomeu Adrover" <to...@uib.es>

[...]
> I has a problem, because the serializer don't put the ISO-8859-1 encoding.
> My solution was put the encoding in the serializer definition:
> <map:serializers default="html-iso">
>    <map:serializer name="xml-iso" mime-type="text/xml"
> logger="sitemap.serializer.xml.iso"
> src="org.apache.cocoon.serialization.XMLSerializer" pool-max="32"
> pool-min="16" pool-grow="4">
>     <encoding>iso-8859-1</encoding>
>    </map:serializer>

Now you can also define default encoding in web.xml and have an Action set
it beforehand.

--
Nicola Ken Barozzi                 barozzi@nicolaken.com
            - verba volant, scripta manent -
   (discussions get forgotten, just code remains)
---------------------------------------------------------------------


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: xsl:output problem

Posted by Bartomeu Adrover <to...@uib.es>.
Hello, the xslt tranform xml to xml, but the HTML serializer transform the
result xml in html. If you tell to the sitemap that the serilizer is xml
then your result as xml.
For example:
<map:match pattern="files/**.xml">
    <map:generate src="{1}.xml"/>
    <map:transform src="transformer.xsl"/>
    <map:serialize type="xml"/>
</map:match>
I has a problem, because the serializer don't put the ISO-8859-1 encoding.
My solution was put the encoding in the serializer definition:
<map:serializers default="html-iso">
   <map:serializer name="xml-iso" mime-type="text/xml"
logger="sitemap.serializer.xml.iso"
src="org.apache.cocoon.serialization.XMLSerializer" pool-max="32"
pool-min="16" pool-grow="4">
    <encoding>iso-8859-1</encoding>
   </map:serializer>
   <map:serializer name="html-iso" mime-type="text/html"
logger="sitemap.serializer.html"
src="org.apache.cocoon.serialization.HTMLSerializer">
    <encoding>iso-8859-1</encoding>
   </map:serializer>
  </map:serializers>

KOZLOV Roman wrote:

>     Hello,
>
>     Could somebody help me, please? Is it possible to use xsl:output in
> stylesheets processed by cocoon's xslt transformer? It seems that it has
> no effect.  Indeed, the problem is that I can't tell to xslt transformer
> that I need a pure XML as a result, but the xslt transformer always
> transforms <img .../> to <img ...> and it leads to crash of a pipeline.
> My xsl begins like this:
>
>   <?xml version="1.0" encoding="UTF-8" ?>
>   <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>     <xsl:output method="xml" encoding="ISO-8859-1" indent="yes"/>
>     . . .
>
> Thank you in advance.
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>

RE: output problem

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: KOZLOV Roman [mailto:r-kozlov@opencascade.com]
> 
>     Hello,
> 
>     Could somebody help me, please? Is it possible to use xsl:output
in
> stylesheets processed by cocoon's xslt transformer? It seems that it
has
> no effect.  Indeed, the problem is that I can't tell to xslt
transformer
> that I need a pure XML as a result, but the xslt transformer always
> transforms <img .../> to <img ...> and it leads to crash of a
pipeline.

You are mixing up things here I guess. XSLT transformer *can* *not*
output <img> instead of <img/>. It's HTML serializer that has the
knowledge of HTML, not XSLT transformer.

What's your pipeline looks like? What's the exact problem?

Vadim

> My xsl begins like this:
> 
>   <?xml version="1.0" encoding="UTF-8" ?>
>   <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>     <xsl:output method="xml" encoding="ISO-8859-1" indent="yes"/>
>     . . .
> 
> Thank you in advance.


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>