Désolé je reviens sur mon probleme que je n'arrive vraiment pas à résoudre
Sur les conseils du Grand Cocooneur je cherche à transmettre une variable à XInclude par jxtemplate
Mais elle reste vide :
mon sitemap :
<?xml version="1.0" encoding="UTF-8" ?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:components>
<map:generators default="file">
<map:generator name="linkstatus" src="org.apache.cocoon.generation.LinkStatusGenerator" />
<map:generator label="content,data" logger="sitemap.generator.jx" name="jx" src="org.apache.cocoon.generation.JXTemplateGenerator" />
</map:generators>
<map:transformers default="xslt">
<map:transformer name="xinclude" src="org.apache.cocoon.transformation.XIncludeTransformer" />
</map:transformers>
<map:readers default="resource" />
<map:serializers default="html">
<map:serializer name="xls" src="org.apache.cocoon.serialization.HSSFSerializer" locale="us" />
</map:serializers>
<map:matchers default="wildcard">
<map:matcher logger="sitemap.matcher.header" name="filename" src="org.apache.cocoon.matching.modular.CachingRegexpMatcher">
<input-module name="request-param">
<parameter>filename</parameter>
</input-module>
</map:matcher>
</map:matchers>
<map:selectors default="browser" />
</map:components>
<!-- =========================== Views ===================================
-->
<map:views>
<map:view from-label="content" name="content">
<map:serialize type="xml" />
</map:view>
<map:view from-label="content" name="pretty-content">
<map:transform src="context://stylesheets/system/xml2html.xslt" />
<map:serialize type="html" />
</map:view>
<map:view from-position="last" name="links">
<map:serialize type="links" />
</map:view>
</map:views>
<!-- =========================== Pipelines =================================
-->
<map:pipelines>
</map:pipeline>
<map:match pattern="egcinfo.xml">
<map:generate type="jx" src="include-description.xml">
<map:parameter name="prefix" value="FILE1" />
</map:generate>
<map:transform type="xinclude"/>
<map:serialize type="xml" />
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
avec include-description.xml contenant:
<TOTAL xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="${cocoon.parameters['prefix']}.xml">
<xi:fallback/>
</xi:include>
<xi:include href="REP/minimum.xml"/>
</TOTAL>
le résultat :
le fichier xml créé est bien REP/minimum.xml, mais sans FILE1.xml (${cocoon.parameters['prefix']} est vide)
il doit y avoir une déclaration de parametre à ajouter quelque part ? mais ou ?
Wiki parle dans 1.2. Accessing data from implicitly defined Cocoon objects
You have access to some implicitly defined objects (available through both JSTL and XPath):
...
parameters - A map of parameters passed to the generator in the pipeline (org.apache.avalon.framework.parameters.Parameters)
... mais je ne sais pas quoi en faire ! si j'en ai besoin ?
Encore une fois, merci
Christophe
--
Devenez redacteur <XML>fr et contribuez au developpement du
xml francophone (http://xmlfr.org/infos/redacteurs/) !
Liste de diffusion "xml-tech@xmlfr.org" (http://xmlfr.org).
Cette liste est a votre disposition pour discuter en francais de
tout sujet technique lie a XML.
Pour resilier votre abonnement, envoyez un message contenant
la commande "unsubscribe" a xml-tech-request@xmlfr.org
(mailto:xml-tech-request@xmlfr.org?Subject=unsubscribe)
Received on Thu Jan 20 16:57:08 2005