Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XMLSchema: elements with either a set of attributes or another one

Status
Not open for further replies.

FailedJoiner

Programmer
Oct 30, 2002
2
IT
Hello world,
what I'm looking for is a way to write the portion of an XMLSchema document that describes a certain kind of elements.
These elements may have either a certain set of attributes, or another set of attributes, but neither both, nor some attributes from the first set and some attributes from the second set.
For example, here is how the XML document validated by the abovesaid XMLSchema could look like:

...
<create-replace-service number=&quot;0233873&quot;/>
...
<create-replace-service type=&quot;email&quot; dept=&quot;network&quot;/>
...

As you can see, the create-replace-service is an element with no subelements, and it may have either an attribute called 'number', or two attributes called 'type' and 'dept'. The first option excludes the second one.
How can I describe this situation within the XMLSchema used to validate such an XML document? I know that this could be accomplished straighforwardly using <xsd:choice> and subelements instead of attributes, but I strongly need to use attributes.
Thank you for any help,
Alessio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top