Re: is this switch valid?

Jukka,

thanks for that, I have difficulty interpreting DTDs.
however I have a testcase that works in Mozilla and used to work in  
Opera:
http://www.peepo.co.uk
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:

   <switch>
<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" />
   </foreignObject>
</g>
...
   </switch>

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

regards

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
markup

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

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")
http://www.cs.tut.fi/~jkorpela/

Received on Sunday, 9 December 2007 17:53:56 UTC