Jump to content
Sign in to follow this  
davej

The wrapper?

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...