cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Dulin <>
Subject RE : SAX ElementFilter Transformer
Date Tue, 30 Sep 2003 12:32:50 GMT
I am just curious, why couldn't this be done using an XALT transformer ?

At 09:35 AM 9/25/2003, Rasik Pandey wrote:
>  >I'm interested :=)
>  >
>  >I was planning to make one actually.
>  >
>  >Could you tell me more about it please?
>Vous êtes où en l'hexagone?
>Here is some quick commentary, let me know if it isn't clear!
><!--transformer for filtering elements as sax events
>The parameter names are a list of :
>a)element names (qualified or unqualified
>b)namespace uris of elements unwanted
>         (this will also remove the startPrefixMapping and
>endPrefixMapping events for the uri)
>c)namespace prefixes of elements unwanted
>(this will also remove the startPrefixMapping and endPrefixMapping
>events for the uri)
>d)simple downward traversal xpath not referecing attributes(but maybe in
>the future)
>The values can either be empty strings or the exact namespace uri of the
>element. for which the sax events will be stripped or kept depending on
>the "send" parameter, the "send" parameter default is "false" meaning
>strip the elements specified as parameters.
>Transformer definition in sitemap:
><map:transformer name="elemFilter"
>internal parameter indicating whether to send elements in the parameter
>list or not
>(this parmeter name (send) should be prefixed (blah:send) in the future
>to avoid any confusions with element names) :
><parameter name="send" value="true | false"/>
>example params :
><parameter name=""
>mentaire" value=""/>
><parameter name="pa:unite_documentaire"
>Using it in a pipeline:
><map:match ...>
>         ...
>                 <map:transform type="elemFilter"/>
>                 OR
>                 <map:transform type="elemFilter">
>                         <map:parameter name="send" value="true |
>                         other element name params
>                 </map:transform>
>         ...
></map:match ...>

View raw message