aboutsummaryrefslogtreecommitdiffstats
path: root/poi-ooxml-full/src/main/xmlschema/org/apache/poi/schemas/markup-compatibility.xsd
blob: 6be17c06beca832ada823c0e0c5e68d0c4b8410d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?xml version="1.0" encoding="utf-8"?>
<!--
   ====================================================================
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   ====================================================================
-->
<xsd:schema
	attributeFormDefault="unqualified" elementFormDefault="qualified"
	targetNamespace="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	>
	<!-- based on https://github.com/plutext/docx4j/blob/master/xsd/mce/markup-compatibility-2006-MINIMAL.xsd -->

	<!-- This XSD has 2 objectives:
	
		1. round tripping @mc:Ignorable <w:document 
		xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
		xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" 
		mc:Ignorable="w14 w15 wp14"> 
		
		2. enabling AlternateContent to be manipulated 
		in certain elements (in the unusual case where the content model is xsd:any, 
		it doesn't have to be explicitly added) See further ECMA-376, 4th Edition, 
		Office Open XML File Formats Part 3 : Markup Compatibility and Extensibility 
	-->

	<!-- Objective 1 -->
	<xsd:attribute name="Ignorable" type="xsd:string" />


	<!-- Objective 2 -->

	<xsd:attribute name="MustUnderstand" type="xsd:string" />
	<xsd:attribute name="ProcessContent" type="xsd:string" />


	<!-- An AlternateContent element shall contain one or more Choice child 
		elements, optionally followed by a Fallback child element. If present, there 
		shall be only one Fallback element, and it shall follow all Choice elements. -->
	<xsd:element name="AlternateContent">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="Choice" minOccurs="0" maxOccurs="unbounded">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:any minOccurs="0" maxOccurs="unbounded"
								processContents="strict">
							</xsd:any>
						</xsd:sequence>
						<xsd:attribute name="Requires" type="xsd:string"
							use="required" />
						<xsd:attribute ref="mc:Ignorable" use="optional" />
						<xsd:attribute ref="mc:MustUnderstand" use="optional" />
						<xsd:attribute ref="mc:ProcessContent" use="optional" />
					</xsd:complexType>
				</xsd:element>
				<xsd:element name="Fallback" minOccurs="0" maxOccurs="1">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:any minOccurs="0" maxOccurs="unbounded"
								processContents="strict">
							</xsd:any>
						</xsd:sequence>
						<xsd:attribute ref="mc:Ignorable" use="optional" />
						<xsd:attribute ref="mc:MustUnderstand" use="optional" />
						<xsd:attribute ref="mc:ProcessContent" use="optional" />
					</xsd:complexType>
				</xsd:element>
			</xsd:sequence>
			<!-- AlternateContent elements might include the attributes Ignorable, 
				MustUnderstand and ProcessContent described in this Part of ECMA-376. These 
				attributes’ qualified names shall be prefixed when associated with an AlternateContent 
				element. -->
			<xsd:attribute ref="mc:Ignorable" use="optional" />
			<xsd:attribute ref="mc:MustUnderstand" use="optional" />
			<xsd:attribute ref="mc:ProcessContent" use="optional" />
		</xsd:complexType>
	</xsd:element>


</xsd:schema>