Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Reusing XSD information for full and update record [Thread Next] Re: Reusing XSD information for full and update recordTo: NULL Date: 7/9/2009 5:17:00 PM Greg <gdab71@h...> writes: ... > In the schema definition, I don't have to have different element types > for a full record and an update record, but I'm doing that right now, > with the same sequence of child elements (id, lastname, firstname), > only that in the update version, there is minOccurs=0 maxOccurs=1 for > everything but the id while in the full version both attributes are 1 > to make all elements mandatory. > > Is there a better way to express this? Whenever fields are added, > removed or modified I have to edit .xsd files in two places, the type > of the full and the update record. This is error-prone. It sure is. On the other hand, if in the full record all child elements are required, it's hard to see a good alternative. Me, I'd make one type definition or the other the 'master' copy and write an XSLT transformation to generate the other type definition from it, by systematically changing the value of minOccurs. (If you don't use XSLT, by all means substitute your XML processing tool of choice.) HTH Michael Sperberg-McQueen -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
