On ven, 2005-09-02 at 10:50 -0400, Norman Walsh wrote:
> The interest in microformats (architectural forms by any other name
> for you old timers) got me thinking about RNG validation of these
> embedded vocabularies.
>
> Clearly DTDs and W3C XML Schema are right out the door for this sort
> of thing. Schematron can obviously do it, but can RELAX NG? My first
> thought was yes, but now I'm not so sure.
>
> If I have an attribute with an enumerated list of values, I can easily
> use the various possible values to select an appropriate element
> pattern, but can I do the same thing for attributes that are
> effectively CDATA?
>
> Suppose I have two patterns:
>
> normal.div = element div { ... }
> vevent.div = element div { ... }
>
> And consider James' definition of the XHTML class attribute:
>
> class.attrib = attribute class { NMTOKENS.datatype }?
>
> Suppose I want vevent.div to match
>
> <div class="vevent">
>
> but I want normal.div to match
>
> <div class="any-other-random-token">
>
> Can that be accomplished without bounding the set of possible
> "any-other-random-token" values?
Yes, there is no restriction at that level, but note that if you write
something such as :
element div { (
attribute class { "foo" },
content1) | (
attribute class { token },
content2) }
you won't avoid that if you have a class attribute equal to "foo", the
processor will try to validate the content against both content1 and
content2 (since "foo" is a valid token).
If you want to avoid that, you'll have to write:
element div { (
attribute class { "foo" },
content1) | (
attribute class { token - "foo" },
content2) }
I have also been thinking to use RNG to validate the usage of styles in
documents (could be OpenOffice documents as well as XHTML...).
One of the limitations that comes to mind to validate character styles
is the fact that co-constraints do not play well with interleave and
that, if
element div {
attribute class { "foo" },
content1},
element div {
attribute class { "bar" },
content1},
is allowed,
element span {
attribute class { "foo" },
content1} &
element span {
attribute class { "bar" },
content1},
is strictly forbidden.
Which can be a limitation for validating style usage (and most probably
micro-formats).
Hope that helps.
Eric
> Be seeing you,
> norm
>
--
Read me on Advogato.
http://advogato.org/person/vdv/
------------------------------------------------------------------------
Eric van der Vlist http://xmlfr.org http://dyomedea.com
(ISO) RELAX NG ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/2U_rlB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/rng-users/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/