According to the above example, the document root element would be “EmployeeDetails.” The element “EmployeeDetails” internally can contain “Employee” elements. The element “Employee” internally contains three more elements: “ID,” “Name” and “Address.” “Address” is again a complex type and internally contains the elements “Street,” “City” and “State”.
You should observe that there could be any number of “Employee” elements within “EmployeeDetails.” And finally you can have a maximum of three “Address” elements for each “Employee.”
You should also observe that “ID,” “Name,” “Street,” “City” and “State” are defined with “simple types” rather than with “complex types.” The only complex elements are “EmployeeDetails,” “Employee” and “Address.”
Now, how would the XML document look when it conformed to the above XML Schema? The following would be a sample XML document which conforms to the XML Schema above.
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.