[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Reusing a unique constraint

From: Todd Moon <tmrfcm@gmail.com>
Date: Fri, 29 Jun 2007 14:38:32 -0400
Message-ID: <2dc6e4c80706291138m6dc88d82w1f69f3886cb27428@mail.gmail.com>
To: xmlschema-dev@w3.org
Reusing a unique constraint

I have a complexType, "Transaction", which ideally would be reused in
multiple schemas. This may not be possible, though. The Transaction
type has a child sequence of type "PartList". Sometimes the PartList
needs a unique constrain, and sometimes it does not. Since I am
ignorant of any advance feature of XSD that helps me, it seems I have
to define the Transaction type in each of my schemas, and sometimes
it's PartList will have a constraint and sometimes not.

I have a master XSD which defines some basic types and I'm reusing
them in my individual schemas. If I could define two elements of type
PartList in my master schema include, one which is constrained and one
which is not, and reference ("ref") them in my schemas as needed.

I don't mind defining the Transaction or PartList elements in each
schema as long as I can reuse the unique constraint if I need to. In
fact, I think I might always define the Transaction type in each
schema because I want to make certain attributes only appear in
certain transactions. That's basically the same issue as my PartList
issue. Sometimes I want something required, and sometimes I don't, but
it's the same basic Transaction element structure each time

Is there any way to reuse a unique constraint? Is there some other XSD
feature which might help me out?

Is there a way to use a complexType, but then override whether an
attribute is required in specific usages?

Thanks for any info you can provide!

- Todd
Received on Friday, 29 June 2007 18:38:37 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.