Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - RE: Include multiple complex types into one element ... >Thread Next - RE: Include multiple complex types into one element ... Re: Include multiple complex types into one element ...To: "Dragon Fly" <dragon-fly999@-------.---> Date: 7/9/2008 2:39:00 PM 2008/7/9 Dragon Fly <dragon-fly999@h...>: > Thank you both for the information. Andrew, what is the benefit of defining > a "simple" element globally? For example, the nameGroup can be defined as > follows (i.e. no refs are used for the FirstName and LastName elements). > > <xs:group name="nameGroup"> > <xs:sequence> > <xs:element name="FirstName" type="non-empty-string"/> > <xs:element name="LastName" type="non-empty-string"/> > </xs:sequence> > </xs:group> - the element can be reused (so LastName can be used (ref'd) in multiple places) - the element is defined in one place (so changing the type of LastName only needs to be done once, not everywhere that it's used) - the types are exposed to applications, so you can match on type define variables as that type in schema-aware XSLT or XQuery - it follows a consistent style, and turns the upper part of your schema into a data dictionary :) -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/ From mike@s... Wed Jul 09 12:50:21 2008 Received: from [128.30.52.63] (helo=ba | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
