Proposed RNG Changes

Shaun McCance <shaunm at gnome.org>
Wed Feb 16 10:17:04 EST 2011

Hi folks,

I'd like to change some details of how the RNG schema is defined.
I want to split out definitions for attributes and content. For
example, this is the current definition for block media:

mal_block_media = element media {
  attribute type { "image" | "video" | "audio" | "application" } ?,
  attribute mime { text } ?,
  attribute src { text },
  attribute height { text } ?,
  attribute width { text } ?,
  attribute style { xsd:NMTOKENS } ?,
  mal_attr_external *,

  mal_block *
}

What I'm proposing is this:

mal_block_media = element media {
  mal_block_media_attr,
  mal_block_media_cont
}
mal_block_media_attr = (
  attribute type { "image" | "video" | "audio" | "application" } ?,
  attribute mime { text } ?,
  attribute src { text },
  attribute height { text } ?,
  attribute width { text } ?,
  attribute style { xsd:NMTOKENS } ?,
  mal_attr_external *
)
mal_block_media_cont = (
  mal_block *
)

This has no effect on the validity of existing documents. It's
semantically equivalent. What it does is make it easier to write
extensions. For example, I did some work on embedding TTML into
Mallard for video captions:

http://blogs.gnome.org/shaunm/2010/11/08/mallardttml-video-captions/

With this proposal, the extension schema for Mallard+TTML would
have something like this:

mal_block_media_cont |= element tt:tt { ... }

Without this proposal, we'd have to add tt:tt to the mal_block
choice, which would allow TTML in all sorts of places.

The one downside is that it does make the schema a bit harder
to read. I don't know how many people read the schema to learn
Mallard, versus reading the notes and examples. I'm a schema
person.

Any objections?

--
Shaun