cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Pietschmann <j3322...@yahoo.de>
Subject Re: Can I use map:aggregate for XSL files?
Date Wed, 01 Jan 2003 19:35:25 GMT
On Wednesday 01 January 2003 19:26, you wrote:
> I have a rather large application that has a huge XSL file that I would
> like to break down into smaller files. Is it possible to use aggregate
> to do this? The problem is establishing the attributes of the
> xsl:stylesheet element in the root; I don't see a way to do this
> with map:aggregate.

You should try xsl:include and xsl:import first. See
  http://www.w3.org/TR/xslt#include
and
  http://www.w3.org/TR/xslt#import
If you really want aggregate style sheets, you'll have to use an
internal pipeline and a cocoon: redirection, something like
  <map:pipeline internal="yes">
    <map:match pattern="foobar.xsl"
      <map:aggregate element="dummy">
        <map:part src="file:///foo.xsl"/>
        <map:part src="file:///bar.xsl"/>
      </map:aggregate>
      <map:transform src="strip-dummy.xsl"/>
      <map:serialize name="xml"/>
    </map:match>
  </map:pipeline>
with the transformation in strip-dummy containing roughly
 <xsl:template match="dummy">
   <xsl:element name="stylesheet"
     namespace="http://www.w3.org/1999/XSL/Transform">
     <xsl:for-each select="xsl:stylesheet|xsl:transform">
       <xsl:copy-of select="."/>
     </xsl:for-each>
   </xsl:element>
 </xsl:template>
If you want to make more thorough manipulations with the aggregated
XSL, look at xsl:namespace-alias.

J.Pietschmann

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Mime
View raw message