Jump to content

The wrapper?


davej

Recommended Posts

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 by davej
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...