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

RE: XSL doesn't received/recognized parameters send fr

Subject: RE: XSL doesn't received/recognized parameters send from servlet
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Fri, 8 Feb 2002 11:57:47 -0000
RE:  XSL doesn't received/recognized parameters send fr
What XSLT processor are you using?

And what is XString?

The mapping from Java objects to XPath data types in setParameter() is not
defined by JAXP 1.1, and varies a little from one product to another.
Supplying a String as the parameter value should be OK.

Displaying the actual values of the parameters within the output file might
be helpful.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of
> Rosely Kumoi
> Sent: 08 February 2002 03:31
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  XSL doesn't received/recognized parameters send from
> servlet
>
>
> 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
>


 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.