davej Posted May 1, 2013 Share Posted May 1, 2013 (edited) I'm confused about the outer element that should be used. If I am creating a schema for a table do I want the outer element to be a list of row elements or is the outer element the row element? <?xml version="1.0" encoding="utf-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"attributeFormDefault="unqualified"><xs:elementName="ArtistList"> <xs:complexType> <xs:sequence> <xs:elementName="Artist" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="ArtistName"> <xs:complexType> <xs:sequence> <xs:element name="FirstName" type="xs:string"/> <xs:element name="LastName" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Nationality" type="xs:string"/> <xs:element name="DateOfBirth" type="xs:date"/> <xs:element name="DateDeceased" type="xs:date" minOccurs="0"/> </xs:sequence> <xs:attribute name="ArtistID" type="xs:positiveInteger" use="required"/> </xs:complexType> </xs:element></xs:element></xs:schema> or <?xml version="1.0" encoding="utf-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"attributeFormDefault="unqualified"><xs:elementName="Artist" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence> <xs:element name="ArtistName"> <xs:complexType> <xs:sequence> <xs:element name="FirstName" type="xs:string"/> <xs:element name="LastName" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Nationality" type="xs:string"/> <xs:element name="DateOfBirth" type="xs:date"/> <xs:element name="DateDeceased" type="xs:date" minOccurs="0"/></xs:sequence><xs:attribute name="ArtistID" type="xs:positiveInteger" use="required"/></xs:complexType></xs:element></xs:schema> ---EDIT--- Ok, I see it. "XML documents must contain one element that is the parent of all other elements. This element is called the root element." http://www.w3schools.com/xml/xml_syntax.asp Edited May 16, 2013 by davej Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now