<?xml version="1.0" encoding="UTF-8"?>
<grammar
	xmlns="http://relaxng.org/ns/structure/1.0"

	xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
	xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
>
	<start>
		<ref name="office-document-content"/>
	</start>
	<define name="office-document-content">
		<element name="office:document-content">
			<ref name="office-document-common-attrs"/>
			<ref name="office-scripts"/>
			<ref name="office-automatic-styles"/>
			<ref name="office-body"/>
		</element>
	</define>
	<define name="office-automatic-styles">
		<optional>
			<element name="office:automatic-styles">
				<zeroOrMore>
					<element name="style:style">
						<attribute name="style:name"><value>NamespaceTable</value></attribute>
						<ref name="style-style-content"/>
					</element>
				</zeroOrMore>
			</element>
		</optional>
	</define>
	<define name="office-document-common-attrs">
		<attribute name="office:version">
			<value>1.2</value>
		</attribute>
	</define>
	<define name="office-scripts">
		<optional>
			<element name="office:scripts">
				<empty/>
			</element>
		</optional>
	</define>
	<define name="office-body">
		<element name="office:body">
			<element name="office:text">
				<empty/>
			</element>
		</element>
	</define>
	<define name="style-table-properties">
		<element name="style:table-properties">
			<empty/>
		</element>
	</define>
	<define name="style-chart-properties">
		<element name="style:chart-properties">
			<empty/>
		</element>
	</define>
	<define name="style-style-content">
		<choice>
			<group>
				<attribute name="style:family">
					<value>chart</value>
				</attribute>
				<optional>
					<ref name="style-chart-properties"/>
				</optional>
			</group>
			<group>
				<attribute name="style:family">
					<value>table</value>
				</attribute>
				<optional>
					<ref name="style-table-properties"/>
				</optional>
			</group>
		</choice>
	</define>
</grammar>
