html markup escape and CDATA issue

FOX427 <[email protected]> Tue, 3 Mar 2015 12:31:22 -0800 (PST)
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Hi All! I am fetching data from xml as usual, I have a node
${document.details.location} and it might have  html markup in it, so for
example in one xml the node is empty and in another it has a lot of markup
like:

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

The problem is, if I use <#escape x as x?html> and put
${document.details.location} in it the it will give me:

<p> Some Hotel Name <www.google.com>  &#160;<br /> Some Street<br /> Miami,
FL 33131<br /> 305 503 5555 </p>.(including <br> <p> and etc. in the browser
)


If I generate xml and wrap that node in CDATA like here: 
<location>
 
</location>

then I have:

Some Hotel Name
Some Street
Miami, FL 33131
305 503 5555
]]> 

So the issue here I am getting "*]]>* " out of nowhere....Can someone
explain what is best practice in handling random html markup nodes so i can
be safe. Thanks in advance.



--
View this message in context: http://freemarker.624813.n4.nabble.com/html-markup-escape-and-CDATA-issue-tp4655387.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/