top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

In XML how can the user create code which contains content that would be ignored by the parser?

0 votes
758 views
In XML how can the user create code which contains content that would be ignored by the parser?
posted Jan 2, 2018 by Sathaybama

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Generally an xml parser would parse through all the text in an XML document. When the parser parses through an xml element all the text between the tags is also parsed. The parser has been programmed to do so as a tag may contain more tags inside it. In case the user wants to specify any content that he does not want the parser to parse he can use the property of CDATA. Everything that a user specifies within a cdata section would be ignored by the parser.

The syntax for CDATA section:

<![CDATA[" and ends with "]]>

Some of the restrictions of the cdata section are:
- A cdata section cannot contain the string “]]>”.
- CDATA section nesting is not allowed.

answer Jan 2, 2018 by Shivaranjini
...