Re: Don't understand NodeModel.get with XML
"Ista Pouss" <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
My problem is solved but I don't understand why.
I process in a macro some XML with some attributes (ex : <abc lien="
the-clown.com">)
First I've wrote (I simplify) :
<#macro abc>
<#if .node.@lien?has_content>
<a href="empty?"><#recurse></a>
<#else>
<a href="${urlInHTTP(.node.@lien)}"><#recurse></a>
... the choice was always "empty".
Now I write if_exists in place of has_content :
<#macro abc>
<#if .node.@lien[0]?if_exists == "true">
<a href="empty?"><#recurse></a>
<#else>
<a href="${urlInHTTP(.node.@lien)}"><#recurse></a>
... the choice is what I excpected ("the-clown.com").
Please can you explain ?
Thanks in advance.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user