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

basic question about xalan/xsl param ?

Subject: basic question about xalan/xsl param ?
From: "NGUYEN Hong Thai" <Hong-Thai.Nguyen@xxxxxxx>
Date: Mon, 2 May 2005 10:58:06 +0200
xalan param
Hi all,
I tried to pass a parameter from java (xalan) to XSLT, and get result after
tranform. In XSL file, it depend on the param passed to call the =
templete and only one templete at moment:
Code Java:
Transformer transformer =3D tFactory.newTransformer(new
StreamSource(Constante.xsltPath));
transformer.setParameter("typeElement",param); //pass the param to XSLT
transformer.transform(source,cible);
XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
    <xsl:output method="text"/>
    <xsl:param name="typeElement" select="/"/>
    <xsl:template>
        <xsl:if test="$typeElement=Var">
            <xsl:call-template name="typeVar"/>
        </xsl:if>
        <xsl:if test="$typeElement=Prca">
            <xsl:call-template name="typePrca"/>
        </xsl:if>
    </xsl:template>

    <xsl:template name="typeVar">
         <!-- Code to transform Var -->
    </xsl:template>

    <xsl:templete name="typePrca">
         <!-- code to transform Prca -->
    </xsl:templete>

</xsl:stylesheet>
But, it doesn't work yet. Some one can help me ?
Thanks !


NGUYEN Hong Thai
(M2R. Universite' Joseph Fourier)
GETA, CLIPS, IMAG-campus, BP53
385, rue de la Bibliothe`que
38041 Grenoble Cedex 9, France
Mel: Hong-Thai.Nguyen@xxxxxxx
Tel:  +33.4 - 7651- 4817
Fax: +33.4 - 76-514405/446675
Mobile: +33 (06) 88 54 94 13

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.