Re: html markup escape and CDATA issue

FOX427 <[email protected]> Tue, 3 Mar 2015 13:51:08 -0800 (PST)
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Ok, when you have xml with this node:

<location> 
 <p>  Some Hotel Name    &#160;<br /> Some Street<br /> Miami, 
 FL 33131<br /> 305 503 5555 </p>. 
</location> 

in order to get value from it I have to use:

<#list document.details.location as loc>
	<#if loc.p??&&loc.p?has_content>
		<#list loc.p as p>
			<#if p.a??&&p.a?has_content>
				 ${p.a} <${p.a.@href}>  
			</#if>
			<#list p?children as nodes>
				${nodes}
			</#list>
		</#list>
	</#if>
</#list>

and all these lines will be for nothing if next xml has two "<p></p>" or no
"<p></p>" at all or completely different things in node, i dont know why but
freemarker treats <p> as child node, as a result, if node has <p> and you
dont use ${p.xxxx} it complains saying it has child node, and vice versa, if
you add ${p.xxxx} and there is no <p> it prints nothing. So my main goal is
to be able to use freemarker that handles html markups in prompt way so I
don't have to worry about having different html markups in different xml
with the same node name(<location>). 

So i thought maybe I need to use escape or CDATA to get rid of this
issue...I am just starting to learn freemarker, maybe i don't understand a
lot of stuff that might be very basic for you so i apologize in advance :(
Thank you. :)



--
View this message in context: http://freemarker.624813.n4.nabble.com/html-markup-escape-and-CDATA-issue-tp4655387p4655389.html
Sent from the freemarker-user mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/