Designing Your own XML Schema: Restrictions and User Defined Types - User-defined Complex Type in XML Schema (Page 7 of 7 )
In the previous sections, we dealt only with simple user-defined types. Now, we shall deal with the user-defined complex type.
Let us consider that I would like to define my own data type called “AddressType,” which holds Street, City and Zip elements. After defining “AddressType,” I would like to use it with two elements, “ResAddress” (residential address) and “OffAddress” (Office Address) as part of the “Employee” definition. The following listing of a complete XML Schema does the same:
Any comments, suggestions, feedback, bugs, errors are highly appreciated at firstname.lastname@example.org
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.