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

Xalan-J: Setting Objects as Parameters in XSL

Subject: Xalan-J: Setting Objects as Parameters in XSL
From: Seth Milder <mrseth@xxxxxxxxxxxxxxx>
Date: Mon, 20 Oct 2003 19:23:30 -0400
seth milder
Hi List,

I am trying to use the Transformer.setParameter method with a
java.util.HashMap, but the transform tries to use a String type. If I
specify a default in XSL like:

<xsl:param name="parameterMap" select="java:java.util.HashMap.new />

I then just get an empty HashMap. Anyone know how to make this work?
Here's the Java code:

 HashMap propertyMap = new HashMap();
 propertyMap.put("membership", "0000000");
/* more stuff */
 transformer.setParameter("propertyMap", propertyMap);
 transformer.transform(source, result);

Then in the XSL:

<xsl:stylesheet	
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:java="http://xml.apache.org/xslt/java"
  exclude-result-prefixes="java">

  <xsl:param name="parameterMap" select="java:java.util.HashMap.new" />
  <xsl:output method="html" />
  <!-- More stuff -->
   <xsl:variable name="foo" value="membership" />
   <xsl:value-of select="java:get($parameterMap, $foo)"/>


Thanks a lot for any help!


--
Seth Milder
Department of Physics and Astronomy
MS 3f3
George Mason University
Fairfax, VA
http://www.mrseth.org
--
Questions are never indiscreet, answers sometimes are. -- Oscar Wilde



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.