cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alain Pannetier" <>
Subject Re: Parsing sitemap from within XSLT Transformer
Date Fri, 18 Aug 2006 18:24:29 GMT
Hi Toby,

Thanks for your suggestion.
This is actually what I started doing but then it finally dawned on me
that a given document or a given pattern generating various document
needs to cater for various types of SVG documents.

There are various types of documents because SVG support is variable
across browsers.
Firefox for instance doesn't support filters.

So I cannot assume that a given document will emit all SVG embedded
pictures as vector or as bitmaps.

I've been working on this today and I'm nearly through.
I ended up implementing a Sitemap Xalan XSLT extension that
  - reads the sitemap
  - stores the pipelines matches
  - hijacks Cocoon's WildcardHelper class (I use only the wildcard matcher).
  - exposes a function that can predict under what form each distinct
SVG image will be sent.

This helps the stylesheet emitting the corresponding 'Tidy' XHTML.

I find this to be a cleaner solution than the other options I also had in mind.

Thanks to all.
Keep the suggestions coming in : I could always refactor things for a
better solution.

Alain Pannetier

On 8/18/06, Toby <> wrote:
> Alain Pannetier wrote:
> > I am in a situation in which I need to know from within an XSLT
> > transformer what matcher will be selected for a given URL.
> I don't understand every detail of your setup, but I think you should
> run that diagram-format action on both the html and picture pipelines
> (or rather put the relevant matchers inside the action) so that you can
> pass the diagramType parameter to the stylesheet:
> <map:act type="diagram-format">
>   [svg_rule_* parameters...]
>   <map:match pattern="**/*somepattern*.svg">
>     [...]
>   </map:match>
>   <map:match pattern="*.html">
>     <!-- this generates the html that calls the diagram -->
>     [...]
>     <map:transform src="layout.xsl">
>       <map:parameter name="diagramType" value="{../diagramType}"/>
>     </map:transform>
>     [...]
>   </map:match>
> </map:act>
> Then just put a <xsl:param name="diagramType"/> at the top of your XSL
> and you can use it in any XSL test.
> Better yet, you could put the action around everything, as the first and
> only child of <map:pipelines>.  But then you'd better modify it so that
> it only computes diagramType on the first request of every session, and
> then just returns a cached value.
> Toby
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message