[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Filtering files with data
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|