W3C home > Mailing lists > Public > www-svg@w3.org > December 2007

Re: is this switch valid?

From: ~:'' ありがとうございました。 <j.chetwynd@btinternet.com>
Date: Sun, 9 Dec 2007 17:53:36 +0000
Message-Id: <EA1F23C7-B0F6-4F90-9ADF-8298FA67DD10@btinternet.com>
Cc: www-svg List <www-svg@w3.org>
To: "Jukka K. Korpela" <jkorpela@cs.tut.fi>, Doug Schepers <schepers@w3.org>, Chris Lilley <chris@w3.org>


thanks for that, I have difficulty interpreting DTDs.
however I have a testcase that works in Mozilla and used to work in  
there are clear practical reasons why it is sensible to use switch as  
little as necessary.
in this case to play a sound file and present text in a single language:

<g systemLanguage="nl">
  <text x="130" y="65">radio</text>
   <foreignObject class="audio" width="1" height="1" >
     <object xmlns="http://www.w3.org/1999/xhtml" data="sound/nl/ 
radio.mp3" />

This could be separated as two separate switches, but that makes for  
harder maintenance and poor code.


Jonathan Chetwynd
Accessibility Consultant on Media Literacy and the Internet

On 9 Dec 2007, at 08:57, Jukka K. Korpela wrote:

"~:'' ありがとうございました。" wrote:

> the validator is barphing* on the attached SVG sample**.
> some code has been removed to help identify the issue

As usual in validation issues, the URL of the problem document should
have been included.

> * Line 26, Column 3: end tag for "switch" omitted, but OMITTAG NO was
> specified.

That's not the _first_ error message you get, is it? When I test your
fragment (using the W3C validator's nice feature of specifying DOCTYPE
interactively, and adding <svg> tags), I first get

document type does not allow element "foreignObject" here; assuming
missing "switch" start-tag.

After this, it's no big surprise to get a message about missing end tag
as well.

I don't really know SVG, but neither need I know it to see that the

<g  requiredExtensions="http://example.com/SVGExtensions/EmbeddedXHTML">
      <foreignObject width="100" height="50">

is indeed invalid, since by the DTD, a <g> element may not have a
<foreignObject> as its subelement ("child") - unless you're using DTD
extensions. The <foreignObject> element is allowed as a subelement of a
<switch> element only.

Jukka K. Korpela ("Yucca")
Received on Sunday, 9 December 2007 17:53:56 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:29:35 UTC