[stringtemplate-interest] problem with first(attribute) expression when attribute is a list of hashes

Terence Parr parrt at cs.usfca.edu
Fri Dec 14 11:56:14 PST 2007


hmm..strange.  So you are sure that list_attribute[0] is non null?  Is  
"hash_member" a valid key, btw?

Ter
On Dec 14, 2007, at 11:40 AM, matt at thataddress.com wrote:

>
>
> Hello list (new here),
>
> I have a web page where I stuff a List
> of HashMap into a string template, and I want to use one of the  
> members of
> the first hash in the list.  So I tried:
>
> $first(list_attribute).hash_member$
>
> This resulted in a
> NullPointerException in ConditionalExpr.write (line 88).
>
> Then I
> tried:
>
> $first(list_attribute):{ $it.hash_member$ }$
>
> This approach resulted in an empty string (and I verified that the
> member I want to reference is in fact passed into the template).  Is
> there some other way to do what I want, that I'm missing?  I'm using
> StringTemplate 3.1b1.
>
> - Matt Brown
>
>
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest



More information about the stringtemplate-interest mailing list