cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rasik Pandey" <>
Subject RE : RE : SAX ElementFilter Transformer
Date Tue, 07 Oct 2003 10:05:59 GMT

 >I am just curious, why couldn't this be done using an XALT 

You are right it could be easily down in that fashion, but we do it in
SAX for better performance.


 >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 
 >>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 
 >>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