This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Need example of PARAM in XALAN



Given the following xml and xsl:

== x01.xml ==
<doc execution_path="la-la"/>

== x01.xsl ==
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:param name="execution_path" select="doc/@execution_path" >
  <xsl:value-of select="doc/@execution_path" />
</xsl:param>

<xsl:template match="/">
     <out><xsl:value-of select="$execution_path"/></out>
</xsl:template>

</xsl:stylesheet>

If I call from the command line without any -param switch, I get:

<?xml version="1.0" encoding="UTF-8"?>
<out>la-la</out>

For XalanJ2, I can do:

E:\xml-xalan\test\tests\conf\x>java -classpath e:
\xml-xalan\java\build\xalan.jar
;e:\xml-xerces\java\build\xerces.jar org.apache.xalan.xslt.Process -xsl
x01.xsl
-in x01.xml -param execution_path "toodles"

(notice no equals, and not quote marks, since the param is a string in
XalanJ2), in which case I get:

<?xml version="1.0" encoding="UTF-8"?>
<out>toodles</out>

In XalanJ1, the param is an expression (turned out to be a very bad idea),
so you add the single quotes:  -param execution_path "'toodles'".

Xalan specific question should normally be sent to the xalan-dev list.  Go
to http://xml.apache.org/mail.html to subscribe.

-scott




                                                                                                                                 
                    "Roshan Sharma"                                                                                              
                    <roshansharma@hotmail.com>         To:     xsl-list@lists.mulberrytech.com                                   
                    Sent by:                           cc:     (bcc: Scott Boag/CAM/Lotus)                                       
                    owner-xsl-list@lists.mulber        Subject:     [xsl] Need example of PARAM in XALAN                         
                    rytech.com                                                                                                   
                                                                                                                                 
                                                                                                                                 
                    03/11/2001 03:02 PM                                                                                          
                    Please respond to xsl-list                                                                                   
                                                                                                                                 
                                                                                                                                 




Could someone please show me how to use -PARAM option in XALAN XSL
processor?

Thanks
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list






 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]