xsl-list
[Top] [All Lists]

Re: Writing to a text file

2004-04-13 09:02:43
Hi Naomi,

At 11:43 AM 4/13/2004, you wrote:
I'm using a preformatting xsl sheet that I run on an
xml file prior to its transformation in to html.  I'd
like to be able to create a separate text file listing
all the included graphics so I can move them.

<xsl:template match="graphic">
<xsl:copy>
<xsl:copy-of select="@*" />
--Write @fileref to a text file
<xsl:apply-templates />
</xsl:copy>
</xsl:template>

Most examples I've seen have shown how to switch the
entire transformed output to a new file--I'd like to
use something that closer resembles the xsl:message
feature.  Any ideas?

IIRC, Xalan has a feature you can use to direct stuff to a separate file without having to have a distinct file for every subtree you want to siphon off. And the open source processors like Saxon can always be extended to provide this functionality (so for example you could redirect xsl:message yourself if you are willing and able to hack Java).

But why not do this in a completely separate pass? Is there a reason this stylesheet has to be the same as your preformatter? It seems to me that keeping it separate allows more flexibility on when and how the filename-extractor is used.

Cheers,
Wendell


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================



<Prev in Thread] Current Thread [Next in Thread>