", and nested CDATA parts are not allowed; 2. The "]]>" marking the end of the CDATA part cannot contain spaces or line breaks."/> ", and nested CDATA parts are not allowed; 2. The "]]>" marking the end of the CDATA part cannot contain spaces or line breaks.">

Home  >  Article  >  Backend Development  >  How to use cdata tags

How to use cdata tags

coldplay.xixi
coldplay.xixiOriginal
2020-10-27 16:34:136374browse

Methods for using cdata tags: 1. The CDATA part cannot contain the string "]]>", and nested CDATA parts are not allowed; 2. "]]>" that marks the end of the CDATA part cannot Contains spaces or line breaks.

How to use cdata tags

Methods used with cdata tags:

CDATA

The term CDATA refers to the Text data parsed by the XML parser (Unparsed Character Data).

In XML elements, "bed367fce9c6e7f22b8b38f888e9822c":

<script>
<![CDATA[
function matchwo(a,b)
{
if (a < b && a < 0) then
  {
  return 1;
  }
else
  {
  return 0;
  }
}
]]>
</script>

In the above example, the parser will Ignore everything in the CDATA section.

Notes on the CDATA part:

  • The CDATA part cannot contain the string "]]>". Nested CDATA sections are also not allowed.

  • The "]]>" marking the end of the CDATA section cannot contain spaces or line breaks.

The above is the detailed content of How to use cdata tags. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn