Re: Include multiple complex types into one element ...

2008/7/9 Dragon Fly <dragon-fly999@hotmail.com>:
> 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/

Received on Wednesday, 9 July 2008 12:39:40 UTC