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

RE: Saxon and HashMap/Hashtable

Subject: RE: Saxon and HashMap/Hashtable
From: William Lam <xeenman@xxxxxxxxx>
Date: Thu, 12 Jul 2001 10:52:24 -0700 (PDT)
william lam
I am using version 6.3

Where can I get 6.4.2?  I only see 6.4 on the website.

--- Michael Kay <mhkay@xxxxxxxxxxxx> wrote:
> I can't reproduce this. The output I get from Saxon
> 6.4.2 is
> 
> <?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, there is no guarantee that an XSLT
> processor will evaluate the
> variable $void: it is never referenced and therefore
> a processor is entitled
> to avoid evaluating it. You cannot rely on variables
> being evaluated in any
> particular order, or at all, unless they are
> actually referenced - calling
> external functions that have side-effects is
> therefore fraught with danger.
> See XSLT Prog Ref Chap 8 (2nd edition), esp
> pp587-590, for a discussion of
> this.
> 
> Mike Kay
> 
> 
> > -----Original Message-----
> > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On
> Behalf Of William Lam
> > Sent: 11 July 2001 18:55
> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > Subject:  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
> >
> 
> 
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> 


__________________________________________________
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.