Handling Lexical Events
Lexical information in an XML document implies information that pertains to the text of the XML itself. In an XML document, the CDATA section, comments, and the references to parsed entities constitute the lexical information.
Normally, the CDATA section is used in an XML document when you want to store text that is not be parsed. This happens when an element contains large sections of text that might include special characters, and it is inconvenient to replace each occurrence with an appropriate entity reference. The CDATA section is analogous to the <pre></pre> tags of HTML.
For example, to put the following text in an XML file, you will need to escape every occurrence of <, >, and &; otherwise, the parser will generate ...
Get Java™ APIs for XML Kick Start now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.