cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorg Heymans <Jorg.Heym...@12snap.com>
Subject RE: xinclude - cinclude - map:aggregate ??
Date Wed, 06 Aug 2003 13:37:36 GMT
Is this in 2.1? Can't find it under the 2.0.4 (version I'm using)
transformer list

-----Original Message-----
From: Chris Clark [mailto:Chris.Clark@teranet.ca] 
Sent: Mittwoch, 6. August 2003 15:21
To: users@cocoon.apache.org
Subject: RE: xinclude - cinclude - map:aggregate ??

Have you tried the session transformer?  I think it might be able to do what
you want...
Here's a sample:

sitemap stuff:
<!-- General pattern for most everything else -->
  <map:match pattern="*">
    <map:generate src="content/xml/{1}.xml"/> 
    <!-- session transformer to do variable substitution -->
    <map:transform type="session"/>             
    <map:serialize/>
  </map:match>

xml source stuff:
  <?xml version="1.0"?>

  <html xmlns:session="http://apache.org/cocoon/session/1.0">
  <head><title>Page Title</title></head>
  <body>
  <h1>Test data from "authentication" context: 
    <!-- tag that the session transformer will resolve into data -->
    <session:getxml context="authentication" path="*/data/rlname"/>
  </h1>
  </body>
  </html>

In this case the information is in the "authentication" context which I
filled in when teh user logged on.  I'm pretty sure you can specify the
"rqeuest" context.  The path is just an xpath expression for the variable
you want to substitute.  You might need to write an intemediary XSLT to
convert your placeholders into the <session:getxml> tags, depending on what
your needs are.

Hope this helps,
Chris
  


> -----Original Message-----
> From:	Jorg Heymans [SMTP:Jorg.Heymans@12snap.com]
> Sent:	Wednesday, August 06, 2003 8:51 AM
> To:	'users@cocoon.apache.org'
> Subject:	RE: xinclude - cinclude - map:aggregate ??
> 
> Ooowwwwkay, looking at the wiki this does not seem possible (unless it's
an
> undocumented feature). The src attribute of map:part does not seem to give
> access to the requestgenerator in some way or another
> 
> 
> I'll rephrase my problem then, maybe there is something more fundamental
> wrong with my logic.
> 
> 1)I have an xml file
> 2)This xml file has placeholders that need to arbitrary replaced with
> request parameters. Eg invoking url myfile.xml?placeholder1=myvaluehere
> outputs the xml document with every occurrence of placeholder1 replaced
with
> "myvaluehere".
> 3)unlimited amount of placeholders can be defined, this results in an
> arbitrary amount of requestparameters, hence I really need to be able
query
> the requestobject and loop over them.
> 
> 
> Hope this clarifies my problem a bit. Should I approach this differently?
> 
> Jorg
> 
> -----Original Message-----
> From: Jorg Heymans [mailto:Jorg.Heymans@12snap.com] 
> Sent: Mittwoch, 6. August 2003 14:12
> To: 'users@cocoon.apache.org'
> Subject: xinclude - cinclude - map:aggregate ??
> 
> Hi list,
>  
> I want to iterate over the requestparameter variables in my stylesheet.
> Following won't work
>  
>     <map:match pattern="*.smil">
>             <map:generate src="{1}.smil" />
>             <map:transform src="stylesheets/replace.xsl" >
>                         <map:parameter name="use-request-parameters"
> value="true"/>
>             </map:transform>
>             <map:serialize type="smil"/>
>     </map:match>
>  
> Is the map:aggregate or xinclude functionality the thing I'm looking for?
> How would I reference the request object as a source then?
>  
> <map:aggregate element="smil">
>      <map:part src="resource://="{1}.smil" />
>      <map:part src="cocoon://request" />
> </map:aggregate>
>  
> this didn't bring what I was looking for..
>  
> Normally I would do map:generate type="request" and then transform from
> there on, but I need to keep the Smil file as the starting point here.
>  
> Any thoughts?
> Jorg
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

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

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


Mime
View raw message