cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Taras Yurij Vasylovitch <taras.y...@softsky.com.ua>
Subject Re: accessing xml files
Date Tue, 27 Dec 2005 14:01:44 GMT
On Tue, 2005-12-27 at 05:22 -0800, kavitha ramesh wrote:
> Hi,
>  
> I have 3 xml files in a directory say A.xml,B.xml,C.xml.The names A,
> B, C changes into A1,B1,C1 after 5 minutes.And after 5 minutes it
> changes to A2,B2, C2 and so on...Now my sitemap looks like this,,,
>  
> <map:match pattern="output.html">
>  <map:aggregate element="newroot">
>   <map:part src="directory/A.xml"/>
>   <map:part src="directory/B.xml"/>
>   <map:part src="directory/C.xml"/>
>  </map:aggregate>
>   <map:transform src="style/xsl/ABC.xsl"/>
>   <map:serialize type="html"/>
> </map:match> 
>  
> When my xml files changes into different names, how do I tell my
> sitemap to access the files with new names?
> If someone knows pls help me,,,
>  
> Rgds
> Kavitha.
> Yahoo! DSL Something to write home about. Just $16.99/mo. or less

What about creating XSP that will check, what files it should use?
Another way is using "directory" generator
( http://cocoon.apache.org/2.1/userdocs/directory-generator.html ),
transforming result file using XSLT to sms like 
<newroot>
 <xi:include src="directory/A6.xml"/>
 <xi:include src="directory/B6.xml"/>
 <xi:include src="directory/C6.xml"/>
</newroot>
and use XInclude or CInclude. 
http://cocoon.apache.org/2.1/userdocs/xinclude-transformer.html
http://cocoon.apache.org/2.1/userdocs/cinclude-transformer.html
IMHO the best way is to change sms in system logic and use pipelines
instead of reading from files, i.e.
<map:match pattern="output.html">
<map:aggregate element="newroot">
  <map:part src="cocoon:/last_version_of/A.xml"/>
  <map:part src="cocoon:/last_version_of/B.xml"/>
  <map:part src="cocoon:/last_version_of/C.xml"/>
 </map:aggregate>
  <map:transform src="style/xsl/ABC.xsl"/>
  <map:serialize type="html"/>
</map:match> 
<map:match pattern="last_version_of/*.xml">
   <!-- Read the last version of file, using XSP, directory+XSLT or sms
else. -->
<map:match>
Later you can move your data, i.e. in DB and you'll have to change only
last_version_of pipeline, while output.html will remain the same.


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


Mime
View raw message