Re: Inconsistent Validation - mixed content and group

Hi Eric,

> > <A>start<B>middle</B>end</A>
> >
> > If the data type for A is any numeric data type, a date, or some
> > pattern, it will be very difficult to meaningfully apply.
>
> This is also what I meant :-) ... with Relax NG you can define what
> "start", "middle" and "end" look like. And this is so simple that it's
> surprising that other schema languages may stumble on this issue:
> <element name="A">
>  <data type="TypeOfStart"/>
>  <element name="B">
>    <data type="TypeOfMiddle"/>
>  </element>
>  <data type="TypeOfEnd"/>
> </element>

Can you really do this with RELAX-NG? I'm just learning the powers of RNG so
I'm not sure yet of all the features but in the tutorial at [1] it says:

"If the children of an element or an attribute match a data pattern, then
complete content of the element or attribute must match that data pattern. It
is not permitted to have a pattern which allows part of the content to match a
data pattern, and another part to match another pattern. For example, the
following pattern is not allowed:

      <element name="bad">
        <data type="int"/>
        <element name="note">
          <text/>
        </element>
      </element>"

Doesn't this mean that you can't actually define datatypes for mixed content?
However, since the <text/> pattern is allowed anywhere it does mean that you
can decide where in the mixed content your character data should appear.

Cheers,
/Eddie

Received on Wednesday, 29 May 2002 19:44:02 UTC