RE: DTDs to Schema, what am I missing?

Why not something like this?  Granted, in this case you end up with extra
choice groups, which in DTD would be:

<!ENTITY % obj.mix "(a|b|c)">
<!ENTITY % para.mix "(d|e|f)">
<!ELEMENT foo (%obj.mix;|%para.mix;)+>

Not exactly the same as your example.

<?xml version = "1.0"?>
<xsd:schema xmlns:xsd = "http://www.w3.org/1999/XMLSchema">
	<xsd:element name = "foo">
		<xsd:complexType content = "elementOnly">
			<xsd:choice minOccurs = "1" maxOccurs = "unbounded">
				<xsd:group ref = "obj.mix"/>
				<xsd:group ref = "para.mix"/>
			</xsd:choice>
		</xsd:complexType>
	</xsd:element>
	<xsd:group name = "para.mix">
		<xsd:choice>
			<xsd:element ref = "d"/>
			<xsd:element ref = "e"/>
			<xsd:element ref = "f"/>
		</xsd:choice>
	</xsd:group>
	<xsd:group name = "obj.mix">
		<xsd:choice>
			<xsd:element ref = "a"/>
			<xsd:element ref = "b"/>
			<xsd:element ref = "c"/>
		</xsd:choice>
	</xsd:group>
	<xsd:element name = "a" type = "string"/>
	<xsd:element name = "b" type = "string"/>
	<xsd:element name = "c" type = "string"/>
	<xsd:element name = "d" type = "string"/>
	<xsd:element name = "e" type = "string"/>
	<xsd:element name = "f" type = "string"/>
</xsd:schema>

> -----Original Message-----
> From: Norman Walsh [mailto:ndw@nwalsh.com]
> Sent: Friday, August 18, 2000 9:53 AM
> To: xmlschema-dev@w3.org
> Subject: DTDs to Schema, what am I missing?
> 
> 
> Consider the following common case in DTDs:
> 
> <!ENTITY % obj.mix "a|b|c">
> <!ENTITY % para.mix "d|e|f">
> <!ELEMENT foo (%obj.mix;|%para.mix;)+>
> 
> I can't think of a way to express this idiom in XML Schema that
> retains obj.mix and para.mix as discrete "things" and combines them
> as necessary.
> 
> Am I missing something?
> 
>                                         Be seeing you,
>                                           norm
> 
> -- 
> Norman Walsh <ndw@nwalsh.com> | Things work out best for 
> those who make
> http://nwalsh.com/            | the best of the way things work out.
> 

Received on Friday, 18 August 2000 12:26:15 UTC