[
Lists Home |
Date Index |
Thread Index
]
- From: David Valera <dvalera@pcl-hage.nl>
- To: xml-dev@lists.xml.org
- Date: Tue, 11 Jul 2000 14:58:15 +0200
hello everyone,
I have been thinking how to solve something I want to accomplish with XML
schema's, but I don't know if there is a solution. The issue is as follows:
I have a general XML schema (wich is splitted in two files, one with the
element declarations, one with the datatypes declarations). Some elements in
this schema are optional, with minOccurs set to 0 and maxOccurs set to 1.
However, some companys would like the possibility to restrict this elements,
saying that they are required, i.e. setting the minOccurs value to 1.
The first thing I thought of was derivation by restriction, wich accomplish
just that. The problem is that I would like for each company that needs
those restrictions to have a small schema where the restrictions would be
like a layer on top of the general schema. I don't know how to implement
this or if it is possible at all. Until now I have only two solutions:
1. make use of a script that would apply a XSLT to the general schema
producing the companyspecific schema. This is IMHO quite a good solution
since you will only have to maintain the general schema and the XSLT of each
company
2. make for each company a copy of the general schema and change it to
restrict elements. This would mean that you could only make optional element
required, and not the other way around wich is undesired (all produced
instances must validate against the general schema). The problem with this
approach is that you would have to maintain each (big) companyspecific XML
schema. One change in the general schema would mean that every company
schema must be updated as well.
Are there other approaches to this issue? I would like to have something
like a company schema that would include the general schema. Every datatype
that is then declared inside the comapny schema would then override the
declaration in the general schema. This is AFAIK not possible with XML
schemas.
I appreciate any suggestions on this issue.
David Valera
|