[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Saxon and 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|