Assignment 11

Xml

1. Create a new xml schema collection named GrantNotesSchema with the following schema:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" 
xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="grantnotes">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="circumstance" type="xs:string" />
				<xs:element name="actions">
					<xs:complexType>
					  <xs:sequence>
						<xs:element maxOccurs="unbounded" name="action" type="xs:string" />
					 </xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>

2. Alter the table GrantDetail. Drop the xml column GrantNotes.

3. Alter the table GrantDetail. Add back the GrantDetails with the schema

	GrantNotes xml (GrantNotesSchema)

4. Insert the following record into GrantNotes

GrantKey              30
GrantDetailDate       3/19/2010
GrantNote
<?xml version="1.0" encoding="utf-8"?>
<grantnotes>
	<circumstance>
		Unable to make the rent this month due to medical bills. Need a one time grant to
		make this month's rent payment. this is the second month in a row
		that the client has needed this assistance
	</circumstance>
	<actions>
		<action>provide $1200 toward rent</action>
		<action>Explore possiblility of getting on State Insurance fund for future medical bills</action>
		<action>Meet again in one month's time</action>
	</actions>
</grantnotes>

5. Change the <action> element to <Action> and try to reinsert the record. What results do you get?

6. Out put the person table as xml as elements with a root <persons> and a group element <name>