AW: [xsl] Supplying input file name as parameter

Subject: AW: [xsl] Supplying input file name as parameter
From: "Fries, Markus, fiscus GmbH, Bonn" <M.Fries@xxxxxxxxxxx>
Date: Thu, 23 May 2002 12:55:50 +0200

If you need one stylesheet with different inputs but only one at a time, you
do depending on your stylesheet processor like 

xalan -XSL <stylesheet> -IN <inputfile> -OUT <outputfile>

If you do need more than one input file in a single transformation you have
options.  You read from 

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="";

  <xsl:param name="inputfile"/>
  <xsl:output method="text"/>

  <xsl:template match="/">
    <xsl:value-of select="item1"/>
    <xsl:value-of select="document(item1/@name)/item"/>
    <xsl:value-of select="document($inputfile)/item"/>



xalan -XSL <stylesheet> -IN <inputfile> -OUT <outputfile> -PARAM inputfile

<item1 name="referenced.txt">
Item 1 Text

<?xml version="1.0" encoding="utf-8"?>
Referenced Text

will result in

Item 1 Text
Referenced Text
Referenced Text

So you can read from a file with a fixed name the list of inputs. Or you
pass it with the parameters.
What does not work is using document({$inputfile}) as those are attribute
value templates.

Maybe you need some more basic reading?



-----Ursprüngliche Nachricht-----
Von: Mukul.Mudgal@xxxxxxxxxxx [mailto:Mukul.Mudgal@xxxxxxxxxxx]
Gesendet: Donnerstag, 23. Mai 2002 11:23
An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Betreff: [xsl] Supplying input file name as parameter

Hi all
How can we supply a input (Source)file name as parameter instead of using
document() function in XSL file

I need to make a XSL file so generic so that it could be worked upon a
number of input files.So I need to supply file name as a parameter instead
of using document() function.


 XSL-List info and archive:

 XSL-List info and archive:

Current Thread