OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [relax-ng] A mechanism for handling inclusion/exclusion



> Suppose that we want to disallow <a>, <em>, and <span> to have
> immediate or non-immediate subordinate <a>, <em>, and <span>,
> respectively.  A schema (in the compact syntax) for this constraint is
> shown below:

> a =
>   element a {
>     mixed{
>       (([not(ancestor::em)], em) | ([not(ancestor::span)], span))*
>     }
>   }
> 
> span =
>   element span {
>     mixed{
>       (([not(ancestor::a)], a) | ([not(ancestor::em)], em))*
>     }
>   }
> 
> em =
>   element em {
>     mixed{
>       (([not(ancestor::span)], span) | ([not(ancestor::a)], a))*
>     }
>   }

I think it's a little confusing to have context be handled as a new kind
of pattern.  Would it be possible instead to handle it in the
name-class?  Your example might be written instead as:

a = element a - a//a { mixed { (em|span)* } }
span = element span - span//span { mixed { (a|em)* } }
em = element em - em//em { mixed { (span|a)* } }

James




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]