Re: SVG and proper XML design

On Tuesday, April 10, 2007, 8:50:32 AM, David wrote:

DW> Bill Dwyer wrote:

>>  Simple: Create an XML grammar definition for paths and other
>> arbitrary string formats such as style. It would be much easier to
>> parse the language of it the grammar included something like:

DW> The reason for the style syntax is that it is intended for direct human
DW> use (and as style sheets, rather than decorating individual elements).

Yes, SVG (and XSL) inherited the property value syntax from CSS.

DW> More generally, I think one could actually make a good argument for not
DW> using XML for SVG.  Apart from the political need to use XML,

Politics was hardly a factor. XML was chosen for its sound technical benefits.
The choice of what to model and how granular to encode was carefully chosen, but XML was clearly the right choice.
 
DW>  the main
DW> reasons for using XML in SVG is to allow it to used in mixed namespace
DW> environments.

Thats one reason. There are others, like DOM access.

DW>   However, neither Adobe SVG viewer nor Firefox support 
DW> this 

I find that assertion to be incorrect.
 
DW> and a whole generation of authors has grown up viewing SVG as an 
DW> external resource for HTML, rather than a truly embedded one for 
DW> XHTML+XML, or one that can be decorated with additional namespaces.

I find that use of other namespaces with SVG is fairly common.

DW> The other reason for using XML or SGML syntaxes is that the document is
DW> intended to be directly viewable and editable by humans, and tha primary
DW> content is the text nodes; i.e. for true markup languages. 

Yes, in general we ensured that huan readable text was element content, not in attributes.

DW> One of the main current drivers for SVG seems to be the mobile phone 
DW> industry, for which data volume is still an issue, so they would benefit
DW> from a less redundant format, even if compression does compensate for 
DW> the verbosity.

The Efficient XML work at W3C loks like the best way to acheive that aim. There have been a number of attempts to make a hard-coded binary syntax for SVG, but they tended to be fragile in the face of language changes or admixture of other namespaces.

DW> Note, one other use for which XML is beneficial is when using XSLT to 
DW> generate SVG from an application specific markukp language.  I don't 
DW> know if that is much done.

It is, although you rapidly run into issues of calculating paths and layout positions. However, taking an XML syntax generated by a program and then XSLTing it to SVG is a useful technique.


-- 
 Chris Lilley                    mailto:chris@w3.org
 Interaction Domain Leader
 Co-Chair, W3C SVG Working Group
 W3C Graphics Activity Lead
 Co-Chair, W3C Hypertext CG

Received on Tuesday, 10 April 2007 14:44:22 UTC