XML::DO...Section(3)

πŸ’– NAME πŸ’–

okay bestie, meet XML::DOM::CDATASection β€” the page title is XML::DOM::CDATASection(3), and the header line squishes it down to XML::DO...Section(3) like it's texting in a hurry. This is from the User Contributed Perl Documentation pile, and the official vibe is: XML::DOM::CDATASection - Escaping XML text blocks in XML::DOM. ✨

🌸 DESCRIPTION 🌸

okay so first things first: XML::DOM::CDATASection extends XML::DOM::CharacterData, which extends XML::DOM::Node. Inheritance chain? Slay. πŸ‘‘

CDATA sections are used to escape blocks of text containing characters that would otherwise be regarded as markup. The only delimiter that is recognized in a CDATA section is the "]]>" string that ends the CDATA section. And bestie, CDATA sections can not be nested. The primary purpose is for including material such as XML fragments, without needing to escape all the delimiters. πŸ’…

The DOMString attribute of the Text node holds the text that is contained by the CDATA section. Note that this may contain characters that need to be escaped outside of CDATA sections and that, depending on the character encoding ("charset") chosen for serialization, it may be impossible to write out some characters as part of a CDATA section. 😭

The CDATASection interface inherits the CharacterData interface through the Text interface. Adjacent CDATASections nodes are not merged by use of the Element.normalize() method. no cap, they stay separate. πŸ¦‹

NOTE: XML::DOM::Parser and XML::DOM::ValParser convert all CDATASections to regular text by default. To preserve CDATASections, set the parser option KeepCDATA to 1. 🫢

mwah πŸ’‹ β€” this page runs on perl v5.42.0, dated 2022-05-23. that's the sign-off, bestie. periodt. πŸŽ€

πŸ“¦ where this page comes from