'all' element, mixed content models...HELP:(

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top