Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] xsltproc and file names

From: Abel Braaksma <abel.online@--------->
To:
Date: 11/4/2007 12:40:00 PM
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.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent