1、ECMA-376, 4th Edition Office Open XML File Formats Markup Compatibility and Extensibility December 2012 Table of Contents iii Table of Contents Foreword v Introduction vi 1. Scope 1 2. Conformance . 2 2.1 Document Conformance . 2 2.2 Application Conformance . 2 3. Normative References . 3 4. Terms a
2、nd Definitions 4 5. Notational Conventions . 6 6. Acronyms and Abbreviations . 7 7. General Description . 8 8. Overview . 9 9. Markup Compatibility Fundamentals.10 9.1 Core Concepts . 10 9.2 Markup Compatibility Namespace 11 10. Markup Compatibility Attributes and Elements .12 10.1 Compatibility-Rul
3、e Attributes . 13 10.1.1 Ignorable Attribute . 13 10.1.2 ProcessContent Attribute . 15 10.1.3 MustUnderstand Attribute . 17 10.2 Alternate-Content Elements . 18 10.2.1 AlternateContent Element 19 10.2.2 Choice Element . 20 10.2.3 Fallback Element . 21 10.2.4 Alternate-Content Examples . 21 11. Names
4、pace Subsumption 24 11.1 The Subsumption Process . 24 11.2 Special Considerations for Attributes . 24 12. Application-Defined Extension Elements .27 13. Preprocessing Model for Markup Consumption .29 Annex A. (informative) Validation Using NVDL .33 A.1 Validation Against Requirements of this Part of
5、 ECMA-376 . 33 A.2 Validation Against the Combination of Office Open XML and Extensions . 34 Annex B. (informative) Index .38 Foreword v Foreword Changes from the 3rd edition were made to align this 4th edition Standard with ISO/IEC 29500:2012. Both this 4th edition and ISO/IEC 29500:2012 refer to t
6、he 1st edition. As such, this 4th edition does not cancel or replace the 1st edition. This 4th edition does, however, cancel and replace the 3rd edition. ECMA-376 consists of the following parts: Part 1: Fundamentals and Markup Language Reference Part 2: Open Packaging Conventions Part 3: Markup Com
7、patibility and Extensibility Part 4: Transitional Migration Features Annexes A and B are for information only. ECMA-376 Part 3 vi Introduction ECMA-376 specifies a family of XML schemas, collectively called Office Open XML, which define the XML vocabularies for word-processing, spreadsheet, and pres
8、entation documents, as well as the packaging of documents that conform to these schemas. The goal is to enable the implementation of the Office Open XML formats by the widest set of tools and platforms, fostering interoperability across office productivity applications and line-of-business systems,
9、as well as to support and strengthen document archival and preservation, all in a way that is fully compatible with the existing corpus of Microsoft Office documents. The following organizations have participated in the creation of ECMA-376 and their contributions are gratefully acknowledged: Apple,
10、 Barclays Capital, BP, The British Library, Essilor, Intel, Microsoft, NextPage, Novell, Statoil, Toshiba, and the United States Library of Congress 1. Scope 1 1. Scope This Part of ECMA-376 describes a set of conventions that are used by Office Open XML documents to clearly mark elements and attrib
11、utes introduced by future versions or extensions of Office Open XML documents, while providing a method by which consumers can obtain a baseline version of the Office Open XML document (a version without extensions) for interoperability. ECMA-376 Part 3 2 2. Conformance The text in this Part of ECMA
12、-376 is divided into normative and informative categories. Unless documented otherwise, any feature shall be implemented as specified by the normative text describing that feature in this Part of ECMA-376. Text marked informative (using the mechanisms described in 7) is for information purposes only
13、. Unless stated otherwise, all text is normative. Use of the word “shall” indicates required behavior. Each Part of this multi-part standard has its own conformance clause. The term conformance class is used to disambiguate conformance within different Parts of this multi-part standard. This Part of
14、 ECMA-376 has only one conformance class, MCE (that is, Markup Compatibility and Extensibility). As such, conformance to that class implies conformance to the whole Part. 2.1 Document Conformance A document has conformance class MCE if it satisfies the syntax constraints on elements and attributes d
15、efined in this Part of ECMA-376. Document conformance to this Part of ECMA-376 is purely syntactic. 2.2 Application Conformance An application implementing this Part of ECMA-376 has conformance class MCE if any one of the following is true: The application is a markup consumer that does not reject a
16、ny documents of conformance class MCE; or The application is a markup producer that is able to produce documents of conformance class MCE Application conformance to this Part of ECMA-376 is purely syntactic. Note: Application conformance to this Part of ECMA-376 cannot be based on semantics, since t
17、he semantics depend on the choice of application-defined extension elements. end note 3. Normative References 3 3. Normative References The following referenced documents are indispensable for the application of this document. For dated references, only the edition cited applies. For undated referen
18、ces, the latest edition of the referenced document (including any amendments) applies. ISO/IEC 2382-1:1993, Information technology Vocabulary Part 1: Fundamental terms. ISO/IEC 10646, Information technology Universal Coded Character Set (UCS). ISO/IEC 19757-4:2006, Information technology Document Sc
19、hema Definition Languages (DSDL) Part 4: Namespace-based Validation Dispatching Language (NVDL). RFC 3986 Uniform Resource Identifier (URI): Generic Syntax, The Internet Society, Berners-Lee, T., R. Fielding, and L. Masinter, 2005, http:/www.ietf.org/rfc/rfc3986.txt. RFC 4234 Augmented BNF for Synta
20、x Specifications: ABNF, The Internet Society, Crocker, D., P. Overell, 2005, http:/www.ietf.org/rfc/rfc4234.txt The Unicode Consortium. The Unicode Standard, http:/www.unicode.org/standard/standard.html. XML, Tim Bray, Jean Paoli, Eve Maler, C. M. Sperberg-McQueen, and Franois Yergeau (editors). Ext
21、ensible Markup Language (XML) 1.0, Fourth Edition.1 World Wide Web Consortium. 2006. http:/www.w3.org/TR/2006/REC-xml-20060816/ Implementers should be aware that a further correction of the normative reference to XML to refer to the 5th Edition will be necessary when the related Reference Specificat
22、ions to which this International Standard also makes normative reference and which also depend upon XML, such as XSLT, XML Namespaces and XML Base, are all aligned with the 5th Edition. XML Base, Marsh, Jonathan. XML Base. World Wide Web Consortium. 2001. http:/www.w3.org/TR/2001/REC-xmlbase-2001062
23、7/ XML Namespaces, Tim Bray, Dave Hollander, Andrew Layman, and Richard Tobin (editors). Namespaces in XML 1.0 (Third Edition), 8 December 2009. World Wide Web Consortium. http:/www.w3.org/TR/2009/REC-xml-names-20091208/ XML Schema Part 0: Primer (Second Edition), W3C Recommendation 28 October 2004,
24、 http:/www.w3.org/TR/xmlschema-0/ XML Schema Part 1: Structures (Second Edition), W3C Recommendation 28 October 2004, http:/www.w3.org/TR/xmlschema-1/ XML Schema Part 2: Datatypes (Second Edition), W3C Recommendation 28 October 2004, http:/www.w3.org/TR/xmlschema-2/ ECMA-376 Part 3 4 4. Terms and De
25、finitions For the purposes of this document, the following terms and definitions apply. Other terms are defined where they appear in italics typeface. Terms not explicitly defined in this Part of ECMA-376 are not to be presumed to refer implicitly to similar terms defined elsewhere. Throughout this
26、Part of ECMA-376, the terms namespace declaration, namespace name, qualified name, expanded name, prefixed name, unprefixed name, and local name shall have the meanings as defined in the W3C Recommendation, “Namespaces in XML.” alternate content A set of alternatives of XML markup and character data
27、, of which no more than one shall be processed by a markup consumer. A markup consumer chooses from among the alternatives based upon its set of understood namespaces. byte A sequence of 8 bits treated as a unit. compatibility-rule attribute An XML attribute described in this Part of ECMA-376 that e
28、xpresses rules governing markup consumers behavior when encountering XML elements and attributes from non-understood namespaces. id In some XML-related technologies, the term id implies use of the xsd:ID data type. In this international standard, this term is used to refer to a variety of different
29、identification schemes. See unique identifier. ignore To disregard the presence of an element or attribute, processing the markup as if that element or attribute did not exist. markup consumer A tool that can read and parse a markup document and further conforms to the requirements of a markup speci
30、fication. Note: Because a markup consumer might be implemented as a markup pre-processor, this term is not coalesced with the definition for a consumer, which would process the XML document output by the markup pre-processor. end note markup document An XML document that conforms to the requirements
31、 of a markup specification. markup preprocessor A software module, designed for use in the implementation of markup consumers, that follows the rules of this Part of ECMA-376 to remove or replace all elements and attributes from the Markup Compatibility namespace, all elements and attributes from ig
32、norable non-understood namespaces, and all elements and attributes from subsumed namespaces. markup producer A tool that can generate a markup document, and conforms to a markup specification. markup specification An XML-based format definition that incorporates all of the namespaces, elements, attr
33、ibutes, and requirements specified in this Part of ECMA-376. 4. Terms and Definitions 5 namespace, ignorable A namespace, identified in markup, whose elements and attributes shall be ignored by a markup consumer that does not understand that namespace. namespace, understood An XML namespace containi
34、ng any recognized XML elements or attributes. qualified attribute name An attributes qualified name. qualified element name An elements qualified name. recognize To identify that an XML element, XML attribute, or attribute-value is defined in this Part of ECMA-376 or in the markup specification agai
35、nst which the containing XML document purports to be conformant. unique identifier In some XML-related technologies, the term unique identifier implies use of the xsd:ID data type. In this international standard, this term is used to refer to a variety of different identification schemes. See id. EC
36、MA-376 Part 3 6 5. Notational Conventions The following typographical conventions are used in ECMA-376: 1. The first occurrence of a new term is written in italics. Example: The text in ECMA-376 is divided into normative and informative categories. end example 2. In each definition of a term in 4 (T
37、erms and Definitions), the term is written in bold. Example: behavior External appearance or action. end example 3. The tag name of an XML element is written using a distinct style and typeface. Example: The bookmarkStart and bookmarkEnd elements specify end example 4. The name of an XML attribute i
38、s written using a distinct style and typeface. Example: The dropCap attribute specifies end example 5. The value of an XML attribute is written using a constant-width style. Example: The attribute value of auto specifies end example 6. The qualified or unqualified name of a simple type, complex type
39、, or base datatype is written using a distinct style and typeface.Example: The possible values for this attribute are defined by the ST_HexColor simple type. end example 6. Acronyms and Abbreviations 7 6. Acronyms and Abbreviations This clause is informative The following acronyms and abbreviations
40、are used throughout this Part of ECMA-376 IEC the International Electrotechnical Commission ISO the International Organization for Standardization W3C World Wide Web Consortium End of informative text ECMA-376 Part 3 8 7. General Description This Part of ECMA-376 is divided into the following subdiv
41、isions: 1. Front matter (clauses 17); 2. Overview and introductory material (clause 89); 3. Main body (clauses 1013); 4. Annexes Examples are provided to illustrate possible forms of the constructions described. References are used to refer to related clauses. Notes are provided to give advice or gu
42、idance to implementers or programmers. The following form the normative pieces of this Part of ECMA-376: Clauses 15, 7, and 912 The following form the informative pieces of this Part of ECMA-376: Introduction Clause 6, 8, and 13 All annexes All notes and examples Except for whole clauses or annexes
43、that are identified as being informative, informative text that is contained within normative text is indicated in the following ways: 1. Example: code fragment, possibly with some narrative end example 2. Note: narrative end note 3. Rationale: narrative end rationale 4. Guidance: narrative end guid
44、ance 8. Overview 9 8. Overview This clause is informative This Part of ECMA-376 describes a set of XML elements and attributes whose purpose is to collectively enable producers to explicitly guide consumers in their handling of any XML elements and attributes not understood by the consumer. These el
45、ements and attributes are intended to enable the creation of future versions of and extensions to ECMA-376, while enabling these desirable compatibility goals: A markup producer can produce markup documents that exploit new features defined by versions and extensions, yet remain interoperable with m
46、arkup consumers that are unaware of those versions and extensions. For any such markup document, a markup consumer whose implementation is aware of the exploited versions and extensions can deliver functionality that is enhanced by the markup documents use of those versions and extensions. For any s
47、uch markup document, the markup producer can enable and precisely control graceful degradation that might occur when the markup document is processed by a markup consumer that is unaware of the exploited versions and extensions. End of informative text ECMA-376 Part 3 10 9. Markup Compatibility Fund
48、amentals 9.1 Core Concepts Any XML-based document specification can use the markup language described in this Part of ECMA-376 as the basis of its compatibility with previous and future specification revisions, and to enable the creation of independent extensions of its specification. This Part of E
49、CMA-376 is dependent on XML namespace names, expressed as URIs. A markup specification defines a set of elements and attributes within one or more namespaces. A characteristic of a markup consumer is that it can recognize the elements and attributes within understood namespaces, including those containing elements and attributes defined in the markup specification. Markup consumers shall treat all recognized elements and attributes of any understood name