cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rasik Pandey" <rasik.pan...@ajlsm.com>
Subject RE : SAX ElementFilter Transformer
Date Thu, 25 Sep 2003 13:35:59 GMT
Salut,

 >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"
src="fr.gouv.culture.sdx.sitemap.transformers.ElementFilter"
logger="sitemap.transformer.elemFilt">

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="http://bnsa.aquitaine.fr/ap/format-pivot/1.0"
value=""/>
<parameter
name="/sdx:document/sdx:results/sdx:result/record/metadata/pa:unite_docu
mentaire" value=""/>
<parameter name="pa:unite_documentaire"
value="http://bnsa.aquitaine.fr/ap/format-pivot/1.0"/>

</map:transformer>
            
Using it in a pipeline: 
                
<map:match ...>
	...
		<map:transform type="elemFilter"/>

		OR 
		<map:transform type="elemFilter">
			<map:parameter name="send" value="true |
false"/>
			other element name params
		</map:transform>
	...                 
</map:match ...>	
                

-->


Rasik




Mime
View raw message