Subject: RE: [xsl] Filtering files with data From: "Morgan, Corey" <CMorgan@xxxxxxxxx> Date: Mon, 20 Oct 2003 13:48:51 -0600 |
Hello. I'm not clear on how you wish to partition your output into various output files, or what they are to be named, but I'll assume that you want to create a seperate .doc file using the @name attriibute of each <llnode> element. There are a number of ways to go to generate seperate files. In a production environment, we'll control the input and output externally. The pipelines in Cocoon, for example, you can use an xpath expression to extract the particular <llnode> that you want, and then direct that output to whereever you want. Saxon, Xalan, and other XSL 1.0 drivers have extensions for redirecting your generated output to different files. The following sample is using Xalan's org.apache.xalan.lib.Redirect class to create a different .doc file for each <llnode>. The "primary" document would just be a log of what's been created, of the form: Creating file lindgre2.doc Creating file lindgre3.doc ... Hope this helps. Corey Morgan --- snip begin ---------------------------------------------------------------------------- -------- <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:redirect="org.apache.xalan.lib.Redirect" extension-element-prefixes="redirect" exclude-result-prefixes="redirect"> <!--+ | Processes nodes of this form: | <livelink><llnode name="some doc name">... +--> <xsl:template match="livelink//llnode"> <xsl:variable name="file-name"> <xsl:text>./</xsl:text> <xsl:apply-templates select="./@name" /> <xsl:text>.doc</xsl:text> </xsl:variable> <xsl:text/>Creating file <xsl:value-of select="$file-name" />. <xsl:text/> <redirect:write file="$file-name"> <xsl:apply-templates select="." mode="doc-file" /> </redirect:write> </xsl:template> <xsl:template match="llnode" mode="doc-file"> ... </xsl:template> --- snip end ---------------------------------------------------------------------------- ---------- XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Filtering files with data, Wendell Piez | Thread | RE: [xsl] Filtering files with data, SHEIKH Sajjad |
Re: [xsl] Is this node, the documen, Wendell Piez | Date | Re: [xsl] RE: XPath: selecting matc, Wendell Piez |
Month |