Re: What characters can go into a CDATA section and a comment? (I found inconsistencies)

Mukul Gandhi <[email protected]>
Newsgroups gmane.text.xml.devel
Message-ID <CANGHzgCnkCwHZBHpFeRm_wW_dZxdOka7b29YQ8uduL7p4uHaag@mail.gmail.com>
On Thu, Mar 24, 2022 at 1:58 PM Peter Flynn <[email protected]> wrote:

> THE most important use case IMNSHO is for documenting markup. I like to
> be able to write:
>
> <programlisting language="XML"><![CDATA[
> <?xml version="1.0">
> <!DOCTYPE foo SYSTEM "bar.dtd">
> <foo>
>    <title>Some &lt;title></title>
> </foo>
> ]]></programlisting>
>

How is above mentioned code snippet, more useful than writing within
comments like below,

<programlisting language="XML">
<!--<?xml version="1.0">
<!DOCTYPE foo SYSTEM "bar.dtd">
<foo>
   <title>Some &lt;title></title>
</foo>-->
</programlisting>

It seems to me that, XML comments are meant to be ignored (they're sort of
noise). Is that the reason, or only reason to use CDATA section instead?


-- 
Regards,
Mukul Gandhi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.