Skip to main content
edited body
Source Link
cHao
  • 87.1k
  • 21
  • 147
  • 178

CDATA sections are just for the convenience of human authors, not for programs. ThereTheir only use is to give humans the ability to easily include e.g. svgSVG example code in a xhtmlan XHTML page without needing to carefully replacing every << with &lt;&lt; and so on.

That is for me the intended use. Not to make the resulting document a few bytes smaller because you can use << instead of &lt;&lt;.

Also again taking the sample from above (svgSVG code in xhtml) it makes it easy for me to check the source code of the xhtmlXHTML file and just copy-paste the svgSVG code out without again needing to back-replace &lt;&lt; with <<.

CDATA sections are just for the convenience of human authors, not for programs. There only use is to give humans the ability to easily include e.g. svg code in a xhtml page without needing to carefully replacing every < with &lt; and so on.

That is for me the intended use. Not to make the resulting document a few bytes smaller because you can use < instead of &lt;.

Also again taking the sample from above (svg code in xhtml) it makes it easy for me to check the source code of the xhtml file and just copy-paste the svg code out without again needing to back-replace &lt; with <.

CDATA sections are just for the convenience of human authors, not for programs. Their only use is to give humans the ability to easily include e.g. SVG example code in an XHTML page without needing to carefully replacing every < with &lt; and so on.

That is for me the intended use. Not to make the resulting document a few bytes smaller because you can use < instead of &lt;.

Also again taking the sample from above (SVG code in xhtml) it makes it easy for me to check the source code of the XHTML file and just copy-paste the SVG code out without again needing to back-replace &lt; with <.

Source Link
jitter
  • 54.8k
  • 11
  • 114
  • 130

CDATA sections are just for the convenience of human authors, not for programs. There only use is to give humans the ability to easily include e.g. svg code in a xhtml page without needing to carefully replacing every < with &lt; and so on.

That is for me the intended use. Not to make the resulting document a few bytes smaller because you can use < instead of &lt;.

Also again taking the sample from above (svg code in xhtml) it makes it easy for me to check the source code of the xhtml file and just copy-paste the svg code out without again needing to back-replace &lt; with <.