Re: Help Evaluating Nested Maps

Bruce Perryman <[email protected]> Wed, 12 Jul 2006 08:30:59 -0700 (PDT)
Newsgroups gmane.comp.text.fmpp
Message-ID <[email protected]>
--===============0751552326==
Content-Type: multipart/alternative; boundary="0-3566208-1152718259=:67396"
Content-Transfer-Encoding: 7bit

--0-3566208-1152718259=:67396
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Great suggestion!

Implementing your suggestion revealed trailing whitespace in the keys. Re=
moving the whitespace solved the problem.

Thanks a lot for your help and your great insight!

Daniel Dekany <[email protected]> wrote:        I doesn't see any probl=
em with this... so it's probably that GHI really doesn't have an entry wi=
th "A1" key, or that "A1" is mapped to a Java null value (that way the va=
lue is missing despite that the key exists).
=20

 What do you see if you list the hash entries like:
=20

 <#list ABC.DEF.GHI?keys as k>
 ${k} =3D> ${ABC.DEF.GHI[k]?default('Java null')}
 </#list>
=20

 Wednesday, July 12, 2006, 3:41:22 AM, Bruce Perryman wrote:
=20

    >
   OK,
=20

 I'm doing something wrong, again.
=20

 This is the structure of my maps:
=20

 ABC
   ||
   =3D>DEF
         ||
         =3D>GHI
               ||
               =3D>A1=3Da
               =3D>A2=3Db
               =3D>A3=3Dc
         =3D>GHI2
               ||
               =3D>B1=3Dd
               =3D>B2=3De
               =3D>B3=3Df
=20

 Hopefully this description makes sense to you. ABC contains a map DEF an=
d DEF contains a few maps, two of which are GHI, and GHI2.
=20

 I am trying to evaluate A1 at the GHI level. This I do as follows:
=20

 ${ABC.DEF.GHI.A1}
=20

 This results in the error that A1 is undefined. If I evaluate ${ABC.DEF.=
GHI} the error is that a string, etc. is expected but the expression eval=
uates to a simple hash.
=20

 Can you please point me in the right direction? Ultimately, I want to be=
 able to use a variable to represent the GHI level with something like:
=20

 ${ABC.DEF[x].A1}
=20

 But I thought I'd work with the 'simple' case first.
=20

 Thanks in advance for your help.
   =20
=20

=20

 --=20
 Best regards,
  Daniel Dekany
 =20

 	=09
---------------------------------
Do you Yahoo!?
 Everyone is raving about the  all-new Yahoo! Mail Beta.
--0-3566208-1152718259=:67396
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Great suggestion!<br><br>Implementing your suggestion revealed trailing w=
hitespace in the keys. Removing the whitespace solved the problem.<br><br=
>Thanks a lot for your help and your great insight!<br><br><b><i>Daniel D=
ekany &lt;[email protected]&gt;</i></b> wrote:<blockquote class=3D"repl=
bq" style=3D"border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; p=
adding-left: 5px;"><title></title>   <meta http-equiv=3D"Content-Type" co=
ntent=3D"text/html; charset=3Diso-8859-1"> <meta http-equiv=3D"Content-St=
yle-Type" content=3D"text/css"> <style type=3D"text/css"><!-- body {   ma=
rgin: 5px 5px 5px 5px;   background-color: #ffffff; } /* =3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D Text Styles =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ hr { color: #0=
00000} body, table /* Normal text */ {  font-size: 9pt;  font-family: 'Co=
urier New';  font-style: normal;  font-weight: normal;  color: #000000;  =
text-decoration: none; } span.rvts1 /* Heading */ {  font-size: 10pt;  fo=
nt-family: 'Arial';  font-weight: bold;  color: #0000ff; } span.rvts2 /* =
Subheading */ {=20
 font-size: 10pt;  font-family: 'Arial';  font-weight: bold;  color: #000=
080; } span.rvts3 /* Keywords */ {  font-size: 10pt;  font-family: 'Arial=
';  font-style: italic;  color: #800000; } a.rvts4, span.rvts4 /* Jump 1 =
*/ {  font-size: 10pt;  font-family: 'Arial';  color: #008000;  text-deco=
ration: underline; } a.rvts5, span.rvts5 /* Jump 2 */ {  font-size: 10pt;=
  font-family: 'Arial';  color: #008000;  text-decoration: underline; } s=
pan.rvts6 {  font-size: 11pt;  font-family: 'tahoma';  font-weight: bold;=
  color: #ffffff; } span.rvts7 {  font-size: 11pt;  font-family: 'tahoma'=
; } a.rvts8, span.rvts8 {  font-size: 11pt;  font-family: 'tahoma';  colo=
r: #0000ff;  text-decoration: underline; } span.rvts9 {  font-size: 8pt; =
 font-family: 'arial';  font-style: italic;  color: #c0c0c0; } /* =3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D Para Styles =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ p,ul,=
ol /* Paragraph Style */ {  text-align: left;  text-indent: 0px;  padding=
: 0px 0px 0px 0px;  margin: 0px 0px 0px 0px; } .rvps1 /* Centered */ {=20
 text-align: center; } --></style>   <div>I doesn't see any problem with =
this... so it's probably that GHI really doesn't have an entry with "A1" =
key, or that "A1" is mapped to a Java null value (that way the value is m=
issing despite that the key exists).</div> <div><br></div> <div>What do y=
ou see if you list the hash entries like:</div> <div><br></div> <div>&lt;=
#list ABC.DEF.GHI?keys as k&gt;</div> <div>${k} =3D&gt; ${ABC.DEF.GHI[k]?=
default('Java null')}</div> <div>&lt;/#list&gt;</div> <div><br></div> <di=
v>Wednesday, July 12, 2006, 3:41:22 AM, Bruce Perryman wrote:</div> <div>=
<br></div> <div><table style=3D"border-style: solid; border-color: rgb(0,=
 0, 0);" border=3D"0" cellpadding=3D"1" cellspacing=3D"2"> <tbody><tr val=
ign=3D"top"> <td style=3D"background-color: rgb(0, 0, 255);" width=3D"14"=
> <div><span class=3D"rvts6">&gt;</span></div> </td> <td style=3D"backgro=
und-color: rgb(255, 255, 255);" width=3D"547"> <div><span class=3D"rvts7"=
>OK,</span></div> <div><br></div> <div><span class=3D"rvts7">I'm
 doing something wrong, again.</span></div> <div><br></div> <div><span cl=
ass=3D"rvts7">This is the structure of my maps:</span></div> <div><br></d=
iv> <div><span class=3D"rvts7">ABC</span></div> <div><span class=3D"rvts7=
">&nbsp; ||</span></div> <div><span class=3D"rvts7">&nbsp; =3D&gt;DEF</sp=
an></div> <div><span class=3D"rvts7">&nbsp; &nbsp; &nbsp; &nbsp; ||</span=
></div> <div><span class=3D"rvts7">&nbsp; &nbsp; &nbsp; &nbsp; =3D&gt;GHI=
</span></div> <div><span class=3D"rvts7">&nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; ||</span></div> <div><span class=3D"rvts7">&nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =3D&gt;A1=3Da</span></div> <div><span=
 class=3D"rvts7">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =3D&gt;=
A2=3Db</span></div> <div><span class=3D"rvts7">&nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; =3D&gt;A3=3Dc</span></div> <div><span class=3D"rvt=
s7">&nbsp; &nbsp; &nbsp; &nbsp; =3D&gt;GHI2</span></div> <div><span class=
=3D"rvts7">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ||</span></di=
v>
 <div><span class=3D"rvts7">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; =3D&gt;B1=3Dd</span></div> <div><span class=3D"rvts7">&nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =3D&gt;B2=3De</span></div> <div><span c=
lass=3D"rvts7">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =3D&gt;B3=
=3Df</span></div> <div><br></div> <div><span class=3D"rvts7">Hopefully th=
is description makes sense to you. ABC contains a map DEF and DEF contain=
s a few maps, two of which are GHI, and GHI2.</span></div> <div><br></div=
> <div><span class=3D"rvts7">I am trying to evaluate A1 at the GHI level.=
 This I do as follows:</span></div> <div><br></div> <div><span class=3D"r=
vts7">${ABC.DEF.GHI.A1}</span></div> <div><br></div> <div><span class=3D"=
rvts7">This results in the error that A1 is undefined. If I evaluate ${AB=
C.DEF.GHI} the error is that a string, etc. is expected but the expressio=
n evaluates to a simple hash.</span></div> <div><br></div> <div><span cla=
ss=3D"rvts7">Can you please point me in the right direction?
 Ultimately, I want to be able to use a variable to represent the GHI lev=
el with something like:</span></div> <div><br></div> <div><span class=3D"=
rvts7">${ABC.DEF[x].A1}</span></div> <div><br></div> <div><span class=3D"=
rvts7">But I thought I'd work with the 'simple' case first.</span></div> =
<div><br></div> <div><span class=3D"rvts7">Thanks in advance for your hel=
p.</span></div> </td> </tr> </tbody></table> </div> <div><br></div> <div>=
<br></div> <div><span class=3D"rvts9">--&nbsp;</span></div> <div><span cl=
ass=3D"rvts9">Best regards,</span></div> <div><span class=3D"rvts9">&nbsp=
;Daniel Dekany</span></div>  </blockquote><br><p>&#32;
		<hr size=3D1>Do you Yahoo!?<br> Everyone is raving about the <a href=3D=
"http://us.rd.yahoo.com/evt=3D42297/*http://advision.webevents.yahoo.com/=
handraisers"> all-new Yahoo! Mail Beta.</a>
--0-3566208-1152718259=:67396--


--===============0751552326==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

--===============0751552326==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
fmpp-open mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fmpp-open

--===============0751552326==--