|
As an example, we use built in documenting features of Visual Studio to have duplicate copies of our updated source code. Wrapping a CDATA around it is the only effective way to handle it, because when its rendered if you use html escape tags they will be broken when displayed.
Here's an example, I have some code that creates an HTML string that has a link to a javascript function that performs some action. It might look like :
html += "(less than sign)a href=", etc etc etc, whereas the less than sign is an actual less than sign. When I put that into the example/code section, to be written as XML, I'd have to escape it so as to not form bad XML. If I use the HTML markup tags, when those are displayed in my HTML documents, its going to show the link instead of showing that I'm constructing a link. In that case, I want to ensure the documenting tools we use know that's pure data.
That's just one simple example, considering the variety of uses for XML I'm sure when you're talking about transmitting documents and datasets as XML strings in an XML document that may have many other elements using XML strings, CDATA is a good way to show that. Using some ambiguious markup definition that isn't standardized is an ineffective and largely unneccessary way of doing things.
|