Resources

Resources provide a type of "subroutine" function for sitemaps. The resources element defines a set of individual resources. Each of these contain a pipeline fragment that can be run when called by another pipeline. For example:

<map:resources> <map:resource name="outputXML"> <map:transform src="context://resources/transforms/xml2xhtml.xsl"/> <map:serialize type="xhtml"/> </map:resource> </map:resources>

This is called by using the map:call instruction:

<map:match pattern="raw/sitemap.xmap"> <map:generate src="cocoon:/sitemap.xmap"/> <map:call resource="outputXML"/> </map:match>

The output of the generator is piped directly to the resource xml2xhtml and the transform.

Copyright 2006 – 2011 Hugh Field-Richards. All Rights Reserved.