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

XSL doesn't received/recognized parameters send from s

Subject: XSL doesn't received/recognized parameters send from servlet
From: Rosely Kumoi <ceerbk@xxxxxxxxxxxx>
Date: Fri, 08 Feb 2002 11:30:51 +0800
xsl parameter transformer
Servlet code: <using the TRAX library>
        String ttl = request.getParameter("ttl");
        String lang = request.getParameter("lang");
        response.setContentType("text/html");

        try
        {
            TransformerFactory tFactory =
TransformerFactory.newInstance();
            Transformer transformer = tFactory.newTransformer(new
StreamSource("glossary.xsl"));

            // Set the stylesheet parameter
            transformer.setParameter("ttl", new XString(ttl));
            transformer.setParameter("lang", new XString(lang));

           // Perform the transformation.
           transformer.transform(new StreamSource("glossary.xml"), new
StreamResult(out));
       }
       catch (Exception ex)
       {
            System.out.println(ex);
       }

End of Servlet code.

XSL code:

<?xml version='1.0'?>

<xsl:transform
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     version="1.0">

 <xsl:template name="print-glossary">
  <HTML>
  <BODY>

  <xsl:param name="ttl"/>
  <xsl:param name="lang"/>
  <xsl:for-each select="glossary/term[@title=$ttl]">
      <FONT COLOR="RED">
       <xsl:for-each select="content[@language=$lang]">
        <P><xsl:value-of select="."/> </P>
       </xsl:for-each>
      </FONT>
  </xsl:for-each>
  </BODY>
  </HTML>
 </xsl:template>

 <xsl:template match="/">
  <xsl:call-template name="print-glossary">
   <xsl:with-param name="ttl">default value</xsl:with-param>
   <xsl:with-param name="lang">default value</xsl:with-param>
  </xsl:call-template>
 </xsl:template>

</xsl:transform>

End of XSL code.

I also have tried using this code for the parameter passing:
    transformer.setParameter("ttl", "'" + ttl + "'");
also doesn't work, any help or workaround - I thanx in advanced

rosely kumoi


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


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.