[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xsltproc and file names

Subject: Re: xsltproc and file names
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Sun, 04 Nov 2007 13:38:18 +0100
Re:  xsltproc and file names
Tommy Nordgren wrote:
Version info:
emac$ xsltproc -V
Using libxml 20626, libxslt 10117 and libexslt 813
xsltproc was compiled against libxml 20626, libxslt 10117 and libexslt 813
libxslt 10117 was compiled against libxml 20626
libexslt 813 was compiled against libxml 20626
Work Directory: ~ :
I am new to xsl. I need to find out the following info, which I have been unable to locate in
the list archive.
How do I generate an output file name in an xsl stylesheet?

You can't in XSLT 1.0. You can in XSLT 2.0, but then you will have to switch processors to Saxon 8.9 (open source for B-version), Gestalt (open source) or AltovaXML (free, proprietary).


And how can I test if an attritue of an element matches the output file name?

Again, you can't in 1.0. In 2.0 it would be something like:


  <xsl:if test="$output-filename = @my-attribute">
      do something if it matches
  </xsl:if>

and you can write the output document doing:

  <xsl:result-document href="{$output-filename}">
       the instructions that go into this result doc
  </xsl:result-document>


HTH, Cheers, -- Abel Braaksma

PS: of course, if you are stuck with XSLT 1.0, it shouldn't be too hard to add a meta tag to your output document (i.e., a PI instruction) which would hold the name of your target file. Then, in your workflow logic, you read this name and you use it to rename the target file.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.