S
Swaroop Kumar
Hi:
I'm trying to write a schema that contains information as
described below:
1. The first element is a mandatory fixed string.
2. The second element is a mixed content element that can contain
multiple occurrences of two possible elements interspersed with
regular text.
This does not seem to be possible to describe using a schema. At
first, I tried to ignore the first requirement and came up with this
to satisfy the second.
<complexType mixed="true">
<all maxOccurs="unbounded">
<element name="tag2" type="xs:string"/>
<element name="tag3" type="xs:string"/>
</all>
</complexType>
Then, I added the first element and encapsulated the whole thing in a
single complexType as in:
<complexType>
<sequence>
<element name="Version" type="xs:string"
fixed="Version_1_0.xsd"/>
<complexType mixed="true">
<all maxOccurs="unbounded">
<element name="tag2" type="xs:string"/>
<element name="tag3" type="xs:string"/>
</all>
</complexType>
</sequence>
</complexType>
XMLSPY v5.4 doesn't like this very much though. Can somebody please
suggest a workaround for this?
Thanx,
Swaroop
I'm trying to write a schema that contains information as
described below:
1. The first element is a mandatory fixed string.
2. The second element is a mixed content element that can contain
multiple occurrences of two possible elements interspersed with
regular text.
This does not seem to be possible to describe using a schema. At
first, I tried to ignore the first requirement and came up with this
to satisfy the second.
<complexType mixed="true">
<all maxOccurs="unbounded">
<element name="tag2" type="xs:string"/>
<element name="tag3" type="xs:string"/>
</all>
</complexType>
Then, I added the first element and encapsulated the whole thing in a
single complexType as in:
<complexType>
<sequence>
<element name="Version" type="xs:string"
fixed="Version_1_0.xsd"/>
<complexType mixed="true">
<all maxOccurs="unbounded">
<element name="tag2" type="xs:string"/>
<element name="tag3" type="xs:string"/>
</all>
</complexType>
</sequence>
</complexType>
XMLSPY v5.4 doesn't like this very much though. Can somebody please
suggest a workaround for this?
Thanx,
Swaroop