You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Tsui, Alban" <Al...@COGNOS.com> on 2003/09/30 12:39:55 UTC

can reader read external url?

I want to set up a pipeline so that the reader will read in an url as svg
and then it immediately pipes out bmp, for example:

<!-- the query string parameter for url is simply an url path to a svg image
-->
			<map:match pattern="*/svg2bmp?url=**">
				<map:read src="{2}" mime-type="svg+xml"/>
				<map:serialize type="svg2jpeg"/>
			</map:match>


I tried but it didn't seem to work. 

Have I done something wrong? Or can the reader read "src" as url? Can
someone suggest a solution?

Alternative I need to write a xsp generator read the url xml/svg and then
having a transform just copy the content from the root tag generated from
the xsp and then put it through the svg2jpeg serialize step.... yuk.

AT

Join us at Cognos' biggest event of the year Enterprise 2003, The Cognos
Business Forum.  Taking place in over 25 cities around the world, it's an
opportunity for Business and IT leaders to learn about strategies for
driving performance. Visit http://www.cognos.com/enterprise03 for more
details. 

This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.

Re: can reader read external url?

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Tsui, Alban wrote:

> I want to set up a pipeline so that the reader will read in an url as 
> svg and then it immediately pipes out bmp, for example:
>
> <!-- the query string parameter for url is simply an url path to a svg 
> image -->
>                         <map:match pattern="*/svg2bmp?url=**">
>                                 <map:read src="{2}" mime-type="svg+xml"/>
>                                 <map:serialize type="svg2jpeg"/>
>                         </map:match>
>
>
> I tried but it didn't seem to work.
>
> Have I done something wrong? Or can the reader read "src" as url? Can 
> someone suggest a solution?
>

A reader is a kind of complete pipeline on its own, targeted a directly 
providing binary content without involving any XML processing. So 
processing of the sitemap above stops at <map:read> (the svg is sent 
verbatim to the browser) and <map:serialize> is never reached.

> Alternative I need to write a xsp generator read the url xml/svg and 
> then having a transform just copy the content from the root tag 
> generated from the xsp and then put it through the svg2jpeg serialize 
> step.... yuk.
>

Wow, how complicated ! You just need the (default) file generator. And 
you can't match on a request parameter (the ?url=**), but use it in the 
pipeline :
<map:match pattern="*/svg2bmp">
  <map:generate src="{request-param:url}"/>
  <map:serialize type="svg2jpeg"/>
</map:match>

Now I personally prefer to use non-parameterized URIs when it makes sense:
<map:match pattern="*/svg2bmp/**.jpeg">
  <map:generate src="{2}.svg"/>
  <map:serialize type="svg2jpeg"/>
</map:match>

Hope this helps !

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com



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