cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thorsten.scherler....@juntadeandalucia.es>
Subject XPath transformer (infos/documentation) and a small example
Date Tue, 20 Jul 2004 11:29:29 GMT
Hello users,

I am looking for information/documentation on the XPath transformer. 
Does anybody have some good links? I searched the wiki but did not get 
very much out of it. The XPath transformer is not listed at 
http://cocoon.apache.org/2.1/userdocs/transformers/transformers.html either!

*Background*
I have the following transformation:
<map:transform type="xpath">
    <map:parameter name="include" value="//*[@wholesite='true']"/>
</map:transform>

That will include all nodes (and their children) that have the attribute 
wholesite='true'. e.g.

<samples label="Samples" href="samples/" tab="samples" wholesite="true">
  <sample2 label="Static content" href="sample2.html" 
      description="More Samples" />
  <sample-wiki label="Wiki page" href="wiki-sample.html" 
      description="wiki-sample" />
  <sample-ihtml label="ihtml page" href="ihtml-sample.html" 
      description="Test iHTML page" />
</samples>


But now I want to exclude some of the children with the attribute 
wholesite='false'. e.g.

<samples label="Samples" href="samples/" tab="samples" wholesite="true">
  <sample2 label="Static content" href="sample2.html" 
      description="More Samples" wholesite='false'/>
  <sample-wiki label="Wiki page" href="wiki-sample.html" 
      description="wiki-sample" />
  <sample-ihtml label="ihtml page" href="ihtml-sample.html" 
      description="Test iHTML page" />
</samples>


I thought about something like:
<map:parameter name="include" 
value="//*[@wholesite='true']//*[@wholesite!='false']"/>
...but that gave me a blank page!

Then I tried
  <map:transform type="xpath">
    <map:parameter name="include" value="//*[@wholesite='true']"/>
    <map:parameter name="exclude" value="//*[@wholesite='false']"/>
  </map:transform>

...and it worked just fine, but it would be nice to have a documentation 
on that because I came up with the solution after try'n error ;-).

King regards
thorsten

-- 
Thorsten Scherler

Departamento de Desarrollo de Proyectos
Sociedad Andaluza para el Desarrollo de la Sociedad de la InformaciĆ³n S.A.U.



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


Mime
View raw message