Subject: [xsl] First attempt at xsl:result-document From: Spencer Tickner <spencertickner@xxxxxxxxx> Date: Mon, 25 Apr 2005 09:59:02 -0700 |
Hi everyone, and thanks in advance for the help. I have a magical and wonderful xsl that was doing everything I needed it too. Unfortunately as this buisness goes, requirements changed. Some of the html documents I was producing were getting too large for our website. The decision was made to split the larger ones up by part. So after some research I found xsl:result-document. Here is some sample xml, my single file xsl transformer and my attempt at multi-file transformation. xml <act> <part>this is a part we will divide a file on</part> <section>This is a section</section> <clause>This is a clause</clause> <part>This is another part, in the new scheme of things, a second file</part> <section>Yet another section</section> </act> original xsl (works fine) <xsl:template match="act"> <html> <body> <xsl:apply-templates mode="tableofcontents"/> <xsl:apply-templates mode="content"/> </body> </html> </xsl:template> <!-- Down here of course I have the templates that apply the styles for either mode --> new xsl (well, not so fine) <xsl:template match="act"> <xsl:result-document href="file:///toc.html" format="html"> <html> <body> <xsl:apply-templates mode="tableofcontents"/> </body> </html> </xsl:result-document> <xsl:for-each select="part"> <xsl:variable name="filename" select="concat('file:///', position(), '.htm'"/> <xsl:result-document href={$filename}" format="html"> <html> <body> <xsl:apply-templates mode="content"/> </body> </html> </xsl:result-document> </xsl:for-each> </xsl:template> <!-- Exact same templates that apply the styles for either mode as original xsl --> In the new xsl, I get the tableof contents no problem. in terms of content I get a number of files (same as the number of parts) with no content in them. I realize that the for-each statement probably doesn't do what I'm hoping it will do, but I can't quite wrap my mind around any other ways of doing this. I would really appreciate any suggestions or advice. Thank you all very much, Spencer
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] accessing different nodes, Aron Bock | Thread | Re: [xsl] First attempt at xsl:resu, JBryant |
RE: [xsl] XSL distinct group by dat, Mindy McCutchan | Date | RE: [xsl] XSL distinct group by dat, Jacoby, Peter R. |
Month |