You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ki...@apache.org on 2017/12/30 22:17:55 UTC

svn commit: r1819690 - in /poi: site/src/documentation/content/xdocs/ trunk/ trunk/src/ooxml/resources/org/apache/poi/schemas/

Author: kiwiwings
Date: Sat Dec 30 22:17:55 2017
New Revision: 1819690

URL: http://svn.apache.org/viewvc?rev=1819690&view=rev
Log:
#61939 - Provide schema for AlternateContent - provide new ooxml-schemas-1.4.jar

Added:
    poi/trunk/src/ooxml/resources/org/apache/poi/schemas/markup-compatibility.xsd
Modified:
    poi/site/src/documentation/content/xdocs/status.xml
    poi/trunk/.classpath
    poi/trunk/build.xml
    poi/trunk/src/ooxml/resources/org/apache/poi/schemas/ooxmlSchemas.xsdconfig

Modified: poi/site/src/documentation/content/xdocs/status.xml
URL: http://svn.apache.org/viewvc/poi/site/src/documentation/content/xdocs/status.xml?rev=1819690&r1=1819689&r2=1819690&view=diff
==============================================================================
--- poi/site/src/documentation/content/xdocs/status.xml (original)
+++ poi/site/src/documentation/content/xdocs/status.xml Sat Dec 30 22:17:55 2017
@@ -67,6 +67,7 @@
         <summary-item>Removal of deprecated classes and methods that were marked for removal in v3.18</summary-item>
       </summary>
       <actions>
+        <action dev="PD" type="fix" fixes-bug="61939" module="OPC">Provide schema for AlternateContent - provide new ooxml-schemas-1.4.jar</action>
         <action dev="PD" type="fix" fixes-bug="61787" module="HSSF">Change how deleted content is detected to not incorrectly see too much text as deleted, this was introduced with bug 58067</action>
         <action dev="PD" type="fix" fixes-bug="61798" module="HSSF">Fix usage of getLastCellNum() when calculating worksheet dimension during saving</action>
         <action dev="PD" type="fix" fixes-bug="61911" module="HWPF">Avoid IndexOutOfBounds access when reading pictures</action>

Modified: poi/trunk/.classpath
URL: http://svn.apache.org/viewvc/poi/trunk/.classpath?rev=1819690&r1=1819689&r2=1819690&view=diff
==============================================================================
--- poi/trunk/.classpath (original)
+++ poi/trunk/.classpath Sat Dec 30 22:17:55 2017
@@ -22,7 +22,7 @@
 	<classpathentry kind="lib" path="lib/hamcrest-core-1.3.jar"/>
 	<classpathentry kind="lib" path="lib/junit-4.12.jar"/>
 	<classpathentry kind="lib" path="ooxml-lib/curvesapi-1.05.jar"/>
-	<classpathentry exported="true" kind="lib" path="ooxml-lib/ooxml-schemas-1.3.jar" sourcepath="ooxml-lib/ooxml-schemas-1.3-sources.jar"/>
+	<classpathentry exported="true" kind="lib" path="ooxml-lib/ooxml-schemas-1.4.jar" sourcepath="ooxml-lib/ooxml-schemas-1.4-sources.jar"/>
 	<classpathentry exported="true" kind="lib" path="ooxml-lib/ooxml-security-1.1.jar" sourcepath="ooxml-lib/ooxml-security-1.1-sources.jar"/>
 	<classpathentry kind="lib" path="lib/jmh-core-1.19.jar"/>
 	<classpathentry kind="lib" path="lib/jmh-generator-annprocess-1.19.jar"/>

Modified: poi/trunk/build.xml
URL: http://svn.apache.org/viewvc/poi/trunk/build.xml?rev=1819690&r1=1819689&r2=1819690&view=diff
==============================================================================
--- poi/trunk/build.xml (original)
+++ poi/trunk/build.xml Sat Dec 30 22:17:55 2017
@@ -208,15 +208,18 @@ under the License.
     <property name="forbidden.jar" location="${main.lib}/forbiddenapis-2.3.jar"/>
     <property name="forbidden.url" value="${repository.m2}/maven2/de/thetaphi/forbiddenapis/2.3/forbiddenapis-2.3.jar"/>
 
-    <!-- See http://www.ecma-international.org/publications/standards/Ecma-376.htm -->
+    <property name="maven.ooxml.xsds.version.id" value="1.4"/>
+    <property name="maven.ooxml.xsds.jar" value="${maven.ooxml.xsds.version.id}.jar"/>
+	
+	<!-- See http://www.ecma-international.org/publications/standards/Ecma-376.htm -->
     <!-- "Copy these file(s), free of charge" -->
     <property name="ooxml.xsds.ozip.1" value="OfficeOpenXML-Part4.zip"/>
     <property name="ooxml.xsds.izip.1" value="OfficeOpenXML-XMLSchema.zip"/>
     <property name="ooxml.xsds.url.1"
               value="http://www.ecma-international.org/publications/files/ECMA-ST/Office%20Open%20XML%201st%20edition%20Part%204%20(PDF).zip"/>
     <property name="ooxml.xsds.src.dir" location="build/ooxml-xsds-src"/>
-    <property name="ooxml.xsds.src.jar" location="${ooxml.lib}/ooxml-schemas-1.3-sources.jar"/>
-    <property name="ooxml.xsds.jar" location="${ooxml.lib}/ooxml-schemas-1.3.jar"/>
+    <property name="ooxml.xsds.src.jar" location="${ooxml.lib}/ooxml-schemas-${maven.ooxml.xsds.version.id}-sources.jar"/>
+    <property name="ooxml.xsds.jar" location="${ooxml.lib}/ooxml-schemas-${maven.ooxml.xsds.version.id}.jar"/>
 
     <!-- additional schemas are packed into the poi schemas jar, -->
     <!-- so we don't have to care about a seperate versioning of the original ooxml schemas -->
@@ -234,10 +237,6 @@ under the License.
     <property name="ooxml.visio.xsd.dir" location="src/ooxml/resources/org/apache/poi/xdgf"/>
     <property name="ooxml.schema.xsdconfig.dir" location="src/ooxml/resources/org/apache/poi/schemas"/>
 
-
-    <property name="maven.ooxml.xsds.version.id" value="1.3"/>
-    <property name="maven.ooxml.xsds.jar" value="ooxml-schemas-${maven.ooxml.xsds.version.id}.jar"/>
-
     <!-- Coverage -->
     <property name="coverage.dir" value="build/coverage"/>
     <!-- Exclude some uninteresting classes from coverage-instrumentation as we do not want to measure coverage in those packages anyway -->
@@ -592,6 +591,8 @@ under the License.
                 <include name="ooxml-schemas-1.1.jar"/>
                 <include name="ooxml-schemas-1.2-sources.jar"/>
                 <include name="ooxml-schemas-1.2.jar"/>
+                <include name="ooxml-schemas-1.3-sources.jar"/>
+                <include name="ooxml-schemas-1.3.jar"/>
                 <include name="ooxml-security-1.0-sources.jar"/>
                 <include name="ooxml-security-1.0.jar"/>
                 <include name="curvesapi-1.03.jar"/>

Added: poi/trunk/src/ooxml/resources/org/apache/poi/schemas/markup-compatibility.xsd
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/resources/org/apache/poi/schemas/markup-compatibility.xsd?rev=1819690&view=auto
==============================================================================
--- poi/trunk/src/ooxml/resources/org/apache/poi/schemas/markup-compatibility.xsd (added)
+++ poi/trunk/src/ooxml/resources/org/apache/poi/schemas/markup-compatibility.xsd Sat Dec 30 22:17:55 2017
@@ -0,0 +1,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>
\ No newline at end of file

Modified: poi/trunk/src/ooxml/resources/org/apache/poi/schemas/ooxmlSchemas.xsdconfig
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/resources/org/apache/poi/schemas/ooxmlSchemas.xsdconfig?rev=1819690&r1=1819689&r2=1819690&view=diff
==============================================================================
--- poi/trunk/src/ooxml/resources/org/apache/poi/schemas/ooxmlSchemas.xsdconfig (original)
+++ poi/trunk/src/ooxml/resources/org/apache/poi/schemas/ooxmlSchemas.xsdconfig Sat Dec 30 22:17:55 2017
@@ -39,4 +39,8 @@
     <xb:package>com.microsoft.schemas.vml</xb:package>
   </xb:namespace>
 
+  <xb:namespace uri="http://schemas.openxmlformats.org/markup-compatibility/2006">
+    <xb:package>com.microsoft.schemas.compatibility</xb:package>
+  </xb:namespace>
+
 </xb:config>
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org