Re: More on SVG within HTML pages

Simon Pieters wrote:
> 4) Make SVG <metadata> a RAWTEXT element. This will silence the
> validator with little effort on Henri, while allowing authors to invoke
> an XML parser on its textContent to get the same stuff as they get when
> using XML, with more or less the same code path as when using XML
> directly. It would still allow validators to validate the contents if
> they want to. This has the drawback that if authors copy-and-paste only
> the start tag and only test in legacy browsers, the rest of the page
> will be eaten in new browsers. The content model of the SVG <metadata>
> element would need to change to allow plain text, at least in text/html.

This would have an effect on the suggested feature for browsers to allow 
exporting the SVG from HTML as a well formed SVG document.  It's likely 
that they would either have to strip the content of the <metadata> 
element, or output it in a CDATA section, or equivalent.  If they don't, 
and just try to output it as is, they have no way of guaranteeing that 
the result will be well formed.

e.g.

<metadata>
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
     ...
   </rdf:RDF>
</metadata>

When exported from HTML as XML would become:

<metadata><![CDATA[
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
     ...
   </rdf:RDF>
]]></metadata>

So such content will not be able to safely round trip from XML to HTML 
and back again, without additional processing to reparse the metadata 
content as a fragment of XML.

I personally have no opinion about whether or not this a significant 
problem, just pointing it out as an issue to consider.

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/

Received on Monday, 7 September 2009 18:21:16 UTC