W3C home > Mailing lists > Public > public-svg-wg@w3.org > April to June 2009

Re: Child element order differences between SVG 1.1 and SVG Tiny 1.2

From: Erik Dahlström <ed@opera.com>
Date: Fri, 17 Apr 2009 11:15:38 +0200
To: "Cameron McCormack" <cam@mcc.id.au>, public-svg-wg@w3.org
Message-ID: <op.usixcccidhsuf5@gnorps.linkoping.osa>
On Fri, 17 Apr 2009 07:32:16 +0200, Cameron McCormack <cam@mcc.id.au> wrote:

> In SVG 1.1, the DTD for various elements restrict the order of the
> element’s children.  For example here is the definition of <rect>
> with the entities expanded out:
>
>   <!ELEMENT "rect"
>      (( desc | title | metadata )*,
>       ( animate | set | animateMotion | animateColor |
>         animateTransform )*)>
>
> So any <desc>, <title> or <metadata> elements have to appear before any
> of the animation elements.

That's good practice.

> It seems for container elements, however, such as <g>, the <desc>,
> <title> and <metdata> elements can go anywhere.

Yes, the spec explicitly says this for container and text elements, see last paragraph of http://www.w3.org/TR/SVG11/struct.html#DescriptionAndTitleElements.

> In SVG Tiny 1.2, the RNG doesn’t require <rect>’s descriptive element
> children to come first.  Is this behaviour we want to backport to 1.1
> when publishing the Second Edition (by virtue of starting from the 1.2T
> RNG and adding on to it)?  I think it is reasonable.

I think there's good reason for recommending <title>, <desc> and <metadata> to be the first child elements. This is a content conformance rule only. I'd like to encourage authors to put these elements before other child elements. So if we decide to remove that rule from the DTD we should put a strong recommendation for authors in the spec instead. 

SVT12 states:
"It is strongly recommended that authors use at most one 'title' and at most one 'desc' element as an immediate child of any particular element, and that these elements appear before any other child elements (except possibly 'metadata' elements) or character data content."

...and then goes on to explain what happens when there are multiple <title> elements etc.

-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed
Received on Friday, 17 April 2009 09:18:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 17 April 2009 09:18:13 GMT