On 08/05/12 17:21, Alex Leach wrote:
> The w3c SVG specification / recommendation
> <http://www.w3.org/TR/SVG/script.html>  allows for<script>  and<style>
> tags, recommending to wrap the text node in a<![CDATA[ … ]]>.

The spec uses a CDATA section in the example, for demonstration purposes only. It's not a recommendation.

CDATA sections are of use for hand-authoring readability, but don't help in machine-serialised documents. You don't get away from the need to encode out-of-band sequences (notably ]]> is still invalid) so it doesn't buy you any simplicity.

> it's definitely a problem when generating SVG

No, not really. Neither XML nor SVG mandate use of CDATA sections here; a normal XML-encoded text node as produced by _serialize_xml is fine, and works with all XML processing tools.

HTML serialisation has custom rules (the two CDATA elements) because the HTML syntax is not XML. XML languages (including SVG and non-legacy served-as-XML XHTML) have no such special cases.

(There are other problems in ElementTree's serialiser that make the output unreflective of the infoset in certain cases, but not here.)

--
And Clover
mailto:a...@doxdesk.com
http://www.doxdesk.com/
gtalk:chat?jid=bobi...@gmail.com
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to