You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Morrison, John" <Jo...@uk.experian.com> on 2002/06/17 16:57:16 UTC

HeaderSelector...

Hi all :)

I'm trying to use the header selector, but I keep dropping through
to the default (jpeg).  Does anybody have a clue what I'm missing/
doing wrong?  The {1} and {2} files exist I just keep getting a jpeg
even though I have both the svg plugin and png support!

I'm (as usual ;) using the head of cvs and the latest beta of TC 4.

<map:match pattern="*/*">
 <map:generate src="data/{1}.xml"/>
 <map:transform src="charts/{2}.xsl"/>
 <map:select type="header">
  <map:when test="accepts('image/svg-xml')">
   <map:serialize type="svgxml"/>
  </map:when>
  <map:otherwise>
   <map:select>
    <map:when test="accepts('image/png')">
     <map:serialize type="svg2png"/>
    </map:when>
    <map:otherwise>
     <map:serialize type="svg2jpeg"/>
    </map:otherwise>
   </map:select>
  </map:otherwise>
 </map:select>
</map:match>

Thanks,

J.

--LongSig

It's so stupid of modern civilization to have given up believing in the
Devil when he is the only explanation of it.


=======================================================================
Information in this email and any attachments are confidential, and may
not be copied or used by anyone other than the addressee, nor disclosed
to any third party without our permission.  There is no intention to
create any legally binding contract or other commitment through the use
of this email.

Experian Limited (registration number 653331).  
Registered office: Talbot House, Talbot Street, Nottingham NG1 5HF

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

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: HeaderSelector...

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Morrison, John [mailto:John.Morrison@uk.experian.com]
> 
> Hi all :)
> 
> I'm trying to use the header selector, but I keep dropping through
> to the default (jpeg).  Does anybody have a clue what I'm missing/
> doing wrong?  The {1} and {2} files exist I just keep getting a jpeg
> even though I have both the svg plugin and png support!

Have your seen your logs? ;)
I bet that they have something like:

  getLogger().warn("No header name given -- failing.");


Other thing: are you sure that you have:

  Accepts=accepts('image/svg-xml')

In the HTTP header?


> I'm (as usual ;) using the head of cvs and the latest beta of TC 4.
> 
> <map:match pattern="*/*">
>  <map:generate src="data/{1}.xml"/>
>  <map:transform src="charts/{2}.xsl"/>
>  <map:select type="header">

<map:parameter name="header-name" value="accepts-or-whatever-you-need"/>

Vadim


>   <map:when test="accepts('image/svg-xml')">
>    <map:serialize type="svgxml"/>
>   </map:when>
>   <map:otherwise>
>    <map:select>
>     <map:when test="accepts('image/png')">
>      <map:serialize type="svg2png"/>
>     </map:when>
>     <map:otherwise>
>      <map:serialize type="svg2jpeg"/>
>     </map:otherwise>
>    </map:select>
>   </map:otherwise>
>  </map:select>
> </map:match>
> 
> Thanks,
> 
> J.
> 
> --LongSig
> 
> It's so stupid of modern civilization to have given up believing in
the
> Devil when he is the only explanation of it.


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

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>