[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Advanced use of XML schema's
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|