CDATA sections being escaped
See original GitHub issueShould the CDATA sections not be escaped? The following code results otherwise:
SyndFeed feed = new SyndFeedImpl();
feed.setFeedType("rss_2.0");
feed.setTitle("title");
feed.setLink("http://localhost/feed");
feed.setDescription("description");
SyndEntry entry = new SyndEntryImpl();
entry.setTitle("entry title");
entry.setUri("http://localhost/feed/item1");
entry.setLink("<![CDATA[http://localhost/feed/item1]]>");
SyndContent entryContent = new SyndContentImpl();
entryContent.setValue("<![CDATA[<p>test</p><p>test</p>]]>");
entry.getContents().add(entryContent);
feed.getEntries().add(entry);
SyndFeedOutput output = new SyndFeedOutput();
System.out.println(output.outputString(feed));
Output:
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
<channel>
<title>title</title>
<link>http://localhost/feed</link>
<description>description</description>
<item>
<title>entry title</title>
<link><![CDATA[http://localhost/feed/item1]]></link>
<content:encoded><![CDATA[<p>test</p><p>test</p>]]></content:encoded>
<guid isPermaLink="false">http://localhost/feed/item1</guid>
</item>
</channel>
</rss>
I’ve tried Rome versions 1.0 and 1.5.1 but the results are similar. I’ve also tried different modes (xml, html) for content. Am I missing some setting here?
Issue Analytics
- State:
- Created 8 years ago
- Comments:26 (16 by maintainers)
Top Results From Across the Web
Is there a way to escape a CDATA end token in xml?
Yes there are multiple CDATA sections, and yes in rare cases this matters. But according to Oxford the broad definition in computing is...
Read more >Avoid CDATA being removed and content being escaped - IBM
There is no way to figure out in a stylesheet which input XML elements contained CDATA sections, that is a general XML processing...
Read more >CData Section getting escaped in RPC - ConfD User Community
Most likely either the Cdata is section itself is escaped . Below is example of rpc response which does not get parsed by...
Read more >CDATA Escaping - Google Groups
I thought the point of CDATA was to eliminate the need to escape. ... CDATA section as HTML. ... is interpreted as HTML,...
Read more >What Characters Need to be Escaped in XML Documents?
A CDATA section in XML is used to escape text containing characters which would otherwise be recognized as markup. It can appear anywhere ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello, how about the following:
@Artgit @krystiankaluzny Makes sense, but how does it relate to Rome not being able to produce cdata sections?