Re: html markup escape and CDATA issue
Daniel Dekany <[email protected]> Thu, 5 Mar 2015 01:14:11 +0100
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Wednesday, March 4, 2015, 8:11:38 PM, FOX427 wrote:
> Thanks Daniel,
>
> @@nested_markup - that's what i need! But I used @@markup before it worked
> perfectly fine if node has a lot of markups but failed to show result if
> node had a string(<location>Mars</location>) so even node has string value
> it treats it as empty node?
You have overlooked something there... If you go to
http://freemarker-online.kenshoo.com/ and copy-paste this into the
template field:
Nested markup: ${doc.location.@@nested_markup}
Markup: ${doc.location.@@markup}
and this to the data-model field:
doc=<location>Marsh</location>
then output will be:
Nested markup: Marsh
Markup: <location>Marsh</location>
> Also, I would like to know what do you think about including html inside
> XML? Do you think it is a good idea? If its bad then what would you suggest?
If you won't parse that HTML content then store it in the XML as
non-XML character data. Like inside a CDATA section, or just escaped.
Especially as HTML is not always well-formed XML. Then you don't need
@@markup and such either. It's much faster to load and output the
content then.
> Thanks again
>
>
>
>
> --
> View this message in context:
> http://freemarker.624813.n4.nabble.com/html-markup-escape-and-CDATA-issue-tp4655387p4655391.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/
> _______________________________________________
> FreeMarker-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freemarker-user
>
--
Thanks,
Daniel Dekany
------------------------------------------------------------------------------
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/