<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en">

    <xsd:annotation>
	<xsd:documentation>
	    Redefines the main XML Query Language schema in XE to validate SQL UPDATE
	    statements.

	    XpressEngine is an open source framework for creating your web sites.
	    http://xpressengine.org/

	    Author: Adrian Constantin, Arnia Software (adrian.constantin@arnia.ro)
	    Date:   09 mar 2012
	</xsd:documentation>
    </xsd:annotation>

    <xsd:include schemaLocation="xml_colassign.xsd" />

    <xsd:simpleType name="updateActionAttributeType">
	<xsd:restriction base="actionAttributeType">
	    <xsd:pattern value="[Uu][Pp][Dd][Aa][Tt][Ee]" />
	</xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="SqlUpdateStatementType">
	<xsd:all>
	    <xsd:element name="columns" type="ColumnsAssignamentType">
		<xsd:key name="distinct_column_names_list">
		    <xsd:selector xpath="column" />
		    <xsd:field xpath="@name" />
		</xsd:key>
	    </xsd:element>
	    <xsd:element name="tables" type="TablesType" />
	    <xsd:element name="conditions" type="ConditionsType" minOccurs="0" />
	    <xsd:element name="index_hint" type="IndexHintsType" minOccurs="0" />
	</xsd:all>

	<xsd:attribute name="id" type="xsd:string" />
	<xsd:attribute name="action" type="updateActionAttributeType" />
	<xsd:attribute name="priority" type="priorityAttributeType" />

    </xsd:complexType>

    <xsd:element name="query" type="SqlUpdateStatementType" />

</xsd:schema>
