- From: Biron,Paul V <Paul.V.Biron@kp.org>
- Date: Wed, 29 May 2002 16:26:39 -0700
- To: "'Eric van der Vlist'" <vdv@dyomedea.com>, ijs@decisionsoft.com
- Cc: xmlschema-dev@w3.org
> -----Original Message----- > From: Eric van der Vlist [SMTP:vdv@dyomedea.com] > Sent: Wednesday, May 29, 2002 4:43 AM > To: ijs@decisionsoft.com > Cc: vdv@dyomedea.com; xmlschema-dev@w3.org > Subject: Re: Inconsistent Validation - mixed content and group > > Ian Stokes-Rees said: > > > I meant this only in the sense that a many data types will have > > difficulty being interpretted meaningfully on mixed content. For > > example, imagine > > > > <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> > Are you sure that the above is a legal RNG schema? Jing complains with the error message: group of "string" or "data" element I can't tell from reading the RNG spec itself whether this should be allowed or not. However, in reading the Turorial that accompanies RNG [1], I find the following in Section 5. Datayping: 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> Which suggests very strongly that your RNG schema above is not correct...but, I'm not positive. > What you can't do with Relax NG alone is to say for instance that the > string value of "A" is a date, but this will be made possible by the DSDL > interoperabily framework (which BTW, should enable W3C XML Schema to do so > as well). > This is precisely that problem that kept us from typing mixed content in XML Schema. Imagine a slight modification to your RNG schema above (I'm relatively sure that this schema is not a legal RNG schema): <element name="A"> <data type="TypeOfStart"/> <optional> <element name="B"> <data type="TypeOfMiddle"/> </element> </optional> <data type="TypeOfEnd"/> </element> How should the following document be interpreted? <A>startend</B> Can you give more info on how the DSDL framework is going to handle this? pvb References [1] http://www.oasis-open.org/committees/relax-ng/tutorial.html#IDA5UYR
Received on Wednesday, 29 May 2002 19:43:41 UTC