David Carlisle wrote:
[quoting Tad]
Post by Tad McClellanA sensible person should not _want_ elements inside of attributes.
Only Arvin has actually answered the OP's question (yes, < is allowed
in SGML CDATA attributes, but not in XML), but this highlights the
underlying problem.
Post by Tad McClellanWhen they think they want that, it is an indication that they
have made the wrong choice in the frequently discussed
"element vs. attribute" wars^H^H^H^H discussions.
true, but sometimes those choices were made by someone else, decades ago,
and requirements have changed.
It is sometimes useful to be able to edit a document to correct it, but
retain the original (incorrect) markup in an SGML CDATA attribute for
other purposes. But it's rare outside scholarly applications like TEI,
and I'd rather see that kind of stuff in a comment anyway.
The difficulty is almost always poor DTD/Schema design, which fails to
cater for a requirement by the user to preserve some aspect of an earlier
version of the document in a form which will persist through processing
and which can later be reprocessed in a different manner. PIs can sometimes
help, but it still comes back to using the right data model for your DTD
or Schema, and that is something which requires skill and flexibility.
///Peter
--
"The cat in the box is both a wave and a particle"
-- Terry Pratchett, introducing quantum physics in _The Authentic Cat_