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

Saxon and HashMap/Hashtable

Subject: Saxon and HashMap/Hashtable
From: William Lam <xeenman@xxxxxxxxx>
Date: Wed, 11 Jul 2001 10:55:10 -0700 (PDT)
hashmap hashtable
I use Saxon with this style sheet:

<xsl:stylesheet version="1.0"
 xmlns:Hashtable="whatever/java.util.Hashtable"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 exclude-result-prefixes="Hashtable String" 
 xmlns:String="whatever/java.lang.String">
    <xsl:output method="xml" indent="yes" />
    <xsl:variable name="hash" select="Hashtable:new()"
/>
    <xsl:variable name="key" select="'key'" />
    <xsl:variable name="void" 
select="Hashtable:put($hash, $key, 'value')" />

    <xsl:template match="/">
         <test>
             <test_1>
                 <xsl:value-of
select="Hashtable:get($hash, String:new('key'))" />
             </test_1>
             <test_2>
                 <xsl:value-of
select="Hashtable:get($hash, $key)" />
             </test_2>
             <hashcode_1>
                 <xsl:value-of
select="String:hashCode($key)" />
             </hashcode_1>
             <hashcode_2>
                 <xsl:value-of
select="String:hashCode(String:new('key'))" />
             </hashcode_2>
             <size>
                 <xsl:value-of
select="Hashtable:size($hash)" />
             </size>
         </test>
     </xsl:template>

</xsl:stylesheet>


===================================================

I want this output:

<?xml version="1.0" encoding="utf-8"?>
<test>
   <test_1>value</test_1>
   <test_2>value</test_2>
   <hashcode_1>106079</hashcode_1>
   <hashcode_2>106079</hashcode_2>
   <size>1</size>
</test>

====================================================

However, I get this output:

<?xml version="1.0" encoding="utf-8"?>
<test>
   <test_1/>
   <test_2>value</test_2>
   <hashcode_1>106079</hashcode_1>
   <hashcode_2>106079</hashcode_2>
   <size>1</size>
</test>

===================================================

test_1 is missing!  I have no problems with this using Xalan.

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

 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.