Langali
Langali

Reputation: 3207

EMPTY CDATA in XML

<body><![CDATA[]]></body>

or

<body></body>

Is there a difference or downside to each? Do I need to do anything while parsing the XML? What do you prefer?

Upvotes: 2

Views: 3103

Answers (1)

Jim Garrison
Jim Garrison

Reputation: 86744

As far as the XML parser is concerned there is NO difference. If you wish to force CDATA creation during XSLT output there is an option (cdata-section-elements) that can be used to cause certain elements to output CDATA.

Upvotes: 3

Related Questions