1、BSI Standards PublicationBS ISO/IEC 26300-2:2015Information technology Open Document Formatfor Office Applications(OpenDocument) v1.2Part 2: Recalculated Formula (OpenFormula)FormatBS ISO/IEC 26300-2:2015 BRITISH STANDARDNational forewordThis British Standard is the UK implementation of ISO/IEC 2630
2、0-2:2015. Together with BS ISO/IEC 26300-1:2015 and BS ISO/IEC 26300-3:2015 it supersedes BS ISO/IEC 26300:2006+A1:2012, which is withdrawn.The UK participation in its preparation was entrusted to Technical Committee IST/41, Document description and processing language.A list of organizations repres
3、ented on this committee can be obtained on request to its secretary.This publication does not purport to include all the necessary provisions of a contract. Users are responsible for its correct application. The British Standards Institution 2015. Published by BSI Standards Limited 2015ISBN 978 0 58
4、0 86556 5 ICS 35.240.30 Compliance with a British Standard cannot confer immunity from legal obligations.This British Standard was published under the authority of the Standards Policy and Strategy Committee on 31 July 2015.Amendments/corrigenda issued since publicationDate Text affectedInformation
5、technology Open Document Format for Office Applications (OpenDocument) v1.2 Part 2: Recalculated Formula (OpenFormula) FormatTechnologies de linformation Format de document ouvert pour applications de bureau (OpenDocument) v1.2 Partie 2: Titre manqueINTERNATIONAL STANDARDISO/IEC 26300-2Reference num
6、ber ISO/IEC 26300-2:2015(E)First edition 2015-07-01 ISO/IEC 2015BS ISO/IEC 26300-2:2015ii ISO/IEC 2015 All rights reservedCOPYRIGHT PROTECTED DOCUMENT ISO/IEC 2015All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized otherwise in any form or by an
7、y means, electronic or mechanical, including photocopying, or posting on the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below or ISOs member body in the country of the requester.ISO copyright officeCase postale 56 CH-1211 Gen
8、eva 20Tel. + 41 22 749 01 11Fax + 41 22 749 09 47E-mail copyrightiso.orgWeb www.iso.orgPublished in SwitzerlandISO/IEC 26300-2:2015(E)BS ISO/IEC 26300-2:2015Open Document Format for Office Applications (OpenDocument) Version 1.2Part 2: Recalculated Formula (OpenFormula) FormatOASIS Standard29 Septem
9、ber 2011Specification URIs:This version:http:/docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.odt (Authoritative)http:/docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.pdf http:/docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.htmlPrevious version:http:/docs.o
10、asis-open.org/office/v1.2/csd06/OpenDocument-v1.2-csd06-part2.odt (Authoritative)http:/docs.oasis-open.org/office/v1.2/csd06/OpenDocument-v1.2-csd06-part2.pdf http:/docs.oasis-open.org/office/v1.2/csd06/OpenDocument-v1.2-csd06-part2.htmlLatest version:http:/docs.oasis-open.org/office/v1.2/OpenDocume
11、nt-v1.2-part2.odt (Authoritative)http:/docs.oasis-open.org/office/v1.2/OpenDocument-v1.2-part2.pdfhttp:/docs.oasis-open.org/office/v1.2/OpenDocument-v1.2-part2.htmlTechnical Committee:OASIS Open Document Format for Office Applications (OpenDocument) TCChairs:Rob Weir, IBMMichael Brauer, Oracle Corpo
12、rationEditors:OpenDocument-v1.2-os-part2 29 September 2011Copyright OASIS Open 2002 - 2011. All Rights Reserved. Standards Track Work Product Page 1 of 234BS ISO/IEC 26300-2:2015 ISO/IEC 26300-2:2015(E)BS ISO/IEC 26300-2:2015David A. WheelerPatrick DurusauEike Rathke, Oracle CorporationRob Weir, IBM
13、Related work:This document is part of the OASIS Open Document Format for Office Applications (OpenDocument) Version 1.2 specification.The OpenDocument v1.2 specification has these parts:OpenDocument v1.2 part 1: OpenDocument SchemaOpenDocument v1.2 part 2: Recalculated Formula (OpenFormula) Format (
14、this part)OpenDocument v1.2 part 3: PackagesDeclared XML namespaces:None.Abstract:This document is part of the Open Document Format for Office Applications (OpenDocument) Version 1.2 specification.It defines a formula language to be used in OpenDocument documents.Status:This document was last revise
15、d or approved by the OASIS Open Document Format for Office Applications (OpenDocument) TC on the above date. The level of approval is also listed above. Check the “Latest version“ location noted above for possible later revisions of this document.Technical Committee members should send comments on t
16、his specification to the Technical Committees email list. Others should send comments to the Technical Committee by using the “Send A Comment” button on the Technical Committees web page at http:/www.oasis-open.org/committees/office/.For information on whether any patents have been disclosed that ma
17、y be essential to implementing this specification, and any offers of patent licensing terms, please refer to the Intellectual Property Rights section of the Technical Committee web page (http:/www.oasis-open.org/committees/office/ipr.php).Citation format:When referencing this specification the follo
18、wing citation format should be used:OpenDocument-v1.2-part2Open Document Format for Office Applications (OpenDocument) Version 1.2 Part 2: Recalculated Formula (OpenFormula) Format. 29 September 2011. OASIS Standard. http:/docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html.OpenDocume
19、nt-v1.2-os-part2 29 September 2011Copyright OASIS Open 2002 - 2011. All Rights Reserved. Standards Track Work Product Page 2 of 234BS ISO/IEC 26300-2:2015 ISO/IEC 26300-2:2015(E)BS ISO/IEC 26300-2:2015NoticesCopyright OASIS Open 20022011. All Rights Reserved.All capitalized terms in the following te
20、xt have the meanings assigned to them in the OASIS Intellectual Property Rights Policy (the “OASIS IPR Policy“). The full Policy may be found at the OASIS website.This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it
21、or assist in its implementation may be prepared, copied, published, and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this section are included on all such copies and derivative works. However, this document itself may not be modified
22、 in any way, including by removing the copyright notice or references to OASIS, except as needed for the purpose of developing any document or deliverable produced by an OASIS Technical Committee (in which case the rules applicable to copyrights, as set forth in the OASIS IPR Policy, must be followe
23、d) or as required to translate it into languages other than English.The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.This document and the information contained herein is provided on an “AS IS“ basis and OASIS DISCLAIMS ALL WARRANTIES,
24、 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.OASIS requests that any OASIS Party or any other party that believes it has pa
25、tent claims that would necessarily be infringed by implementations of this OASIS Committee Specification or OASIS Standard, to notify OASIS TC Administrator and provide an indication of its willingness to grant patent licenses to such patent claims in a manner consistent with the IPR Mode of the OAS
26、IS Technical Committee that produced this specification.OASIS invites any party to contact the OASIS TC Administrator if it is aware of a claim of ownership of any patent claims that would necessarily be infringed by implementations of this specification by a patent holder that is not willing to pro
27、vide a license to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this specification. OASIS may include such claims on its website, but disclaims any obligation to do so.OASIS takes no position regarding the validity or scope of any intellec
28、tual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such ri
29、ghts. Information on OASIS procedures with respect to rights in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an a
30、ttempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this OASIS Committee Specification or OASIS Standard, can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information or list of intellectual p
31、roperty rights will at any time be complete, or that any claims in such list are, in fact, Essential Claims.The names “OASIS“, “OpenDocument”, “Open Document Format”, and “ODF” are trademarks of OASIS, the owner and developer of this specification, and should be used only to refer to the organizatio
32、n and its official outputs. OASIS welcomes reference to, and implementation and use OpenDocument-v1.2-os-part2 29 September 2011Copyright OASIS Open 2002 - 2011. All Rights Reserved. Standards Track Work Product Page 3 of 234BS ISO/IEC 26300-2:2015 ISO/IEC 26300-2:2015(E)BS ISO/IEC 26300-2:2015of, s
33、pecifications, while reserving the right to enforce its marks against misleading uses. Please see http:/www.oasis-open.org/who/trademark.php for above guidance.OpenDocument-v1.2-os-part2 29 September 2011Copyright OASIS Open 2002 - 2011. All Rights Reserved. Standards Track Work Product Page 4 of 23
34、4BS ISO/IEC 26300-2:2015 ISO/IEC 26300-2:2015(E)BS ISO/IEC 26300-2:2015Table of Contents1 Introduction201.1 Introduction.201.2 Terminology.201.3 Purpose201.4 Normative References201.5 Non-Normative References212 Expressions and Evaluators.222.1 Introduction.222.2 OpenDocument Formula Expression222.3
35、 Evaluators.222.3.1 OpenDocument Formula Evaluator.222.3.2 OpenDocument Formula Small Group Evaluator.222.3.3 OpenDocument Formula Medium Group Evaluator.232.3.4 OpenDocument Formula Large Group Evaluator242.4 Variances (Implementation-defined, Unspecified, and Behavioral Changes)253 Formula Process
36、ing Model.263.1 General.263.2 Expression Evaluation.263.2.1 General263.2.2 Expression Calculation .263.2.3 Operator and Function Evaluation.263.3 Non-Scalar Evaluation (aka Array expressions)273.4 Host-Defined Behaviors293.5 When recalculation occurs303.6 Numerical Models.303.7 Basic Limits.304 Type
37、s324.1 General.324.2 Text (String)324.3 Number.324.3.1 General324.3.2 Time.334.3.3 Date.334.3.4 DateTime.33OpenDocument-v1.2-os-part2 29 September 2011Copyright OASIS Open 2002 - 2011. All Rights Reserved. Standards Track Work Product Page 5 of 234BS ISO/IEC 26300-2:2015 ISO/IEC 26300-2:2015(E)BS IS
38、O/IEC 26300-2:20154.3.5 Percentage334.3.6 Currency334.3.7 Logical (Number).334.4 Complex Number344.5 Logical (Boolean)344.6 Error344.7 Empty Cell.354.8 Reference.354.9 ReferenceList354.10 Array.354.11 Pseudotypes.364.11.1 General364.11.2 Scalar.364.11.3 DateParam.364.11.4 TimeParam364.11.5 Integer36
39、4.11.6 TextOrNumber364.11.7 Basis364.11.8 Criterion.384.11.9 Database.394.11.10 Field.394.11.11 Criteria394.11.12 Sequences (NumberSequence, NumberSequenceList, DateSequence, LogicalSequence, and ComplexSequence)404.11.13 Any.405 Expression Syntax415.1 General.415.2 Basic Expressions.415.3 Constant
40、Numbers425.4 Constant Strings.425.5 Operators425.6 Functions and Function Parameters.435.7 Nonstandard Function Names445.8 References.445.9 Reference List.455.10 Quoted Label455.10.1 General455.10.2 Lookup of Defined Labels46OpenDocument-v1.2-os-part2 29 September 2011Copyright OASIS Open 2002 - 201
41、1. All Rights Reserved. Standards Track Work Product Page 6 of 234BS ISO/IEC 26300-2:2015 ISO/IEC 26300-2:2015(E)BS ISO/IEC 26300-2:20155.10.3 Automatic Lookup of Labels.465.10.4 Implicit Intersection475.10.5 Automatic Range.475.10.6 Automatic Intersection.485.11 Named Expressions485.12 Constant Err
42、ors.495.13 Inline Arrays505.14 Whitespace.506 Standard Operators and Functions516.1 General.516.2 Common Template for Functions and Operators516.3 Implicit Conversion Operators.526.3.1 General526.3.2 Conversion to Scalar.526.3.3 Implied intersection526.3.4 Force to array context (ForceArray).526.3.5
43、 Conversion to Number.536.3.6 Conversion to Integer536.3.7 Conversion to NumberSequence.536.3.8 Conversion to NumberSequenceList.546.3.9 Conversion to DateSequence546.3.10 Conversion to Complex Number546.3.11 Conversion to ComplexSequence546.3.12 Conversion to Logical556.3.13 Conversion to LogicalSe
44、quence556.3.14 Conversion to Text.556.3.15 Conversion to DateParam556.3.16 Conversion to TimeParam.556.4 Standard Operators566.4.1 General566.4.2 Infix Operator “+“.566.4.3 Infix Operator “-“566.4.4 Infix Operator “*“566.4.5 Infix Operator “/“576.4.6 Infix Operator “576.4.7 Infix Operator “=“.576.4.
45、8 Infix Operator “=“).58OpenDocument-v1.2-os-part2 29 September 2011Copyright OASIS Open 2002 - 2011. All Rights Reserved. Standards Track Work Product Page 7 of 234BS ISO/IEC 26300-2:2015 ISO/IEC 26300-2:2015(E)BS ISO/IEC 26300-2:20156.4.10 Infix Operator “). All string and character literals refer
46、ences by this specification are in the value space defined by UNICODE thus, “A” is U+0041, “Z” is U+005A, and the range of characters “A-Z” is the range U+0041 through U+005A inclusive.2.3.2OpenDocument Formula Small Group EvaluatorAn OpenDocument Formula Small Group Evaluator is an OpenDocument For
47、mula Evaluator that meets the following additional requirements:OpenDocument-v1.2-os-part2 29 September 2011Copyright OASIS Open 2002 - 2011. All Rights Reserved. Standards Track Work Product Page 22 of 234BS ISO/IEC 26300-2:2015 ISO/IEC 26300-2:2015(E)BS ISO/IEC 26300-2:2015A) It shall implement at
48、 least the limits defined in the “Basic Limits” section.B) It shall implement the syntax defined in these sections on syntax: Criteria; Basic Expressions; Constant Numbers; Constant Strings; Operators; Functions and Function Parameters; Nonstandard Function Names; References; Simple Named Expression
49、s; Errors; Whitespace.C) It shall implement all implicit conversions for the types it implements, at least Text, Conversion to Number, Reference, Conversion to Logical, and Error.D) It shall implement the following operators (which are all the operators except reference union (): Infix Operator Ordered Comparison (“, “=“); Infix Operator “ Infix Operator “+”; Infix Operator “-”; Infix Operator “*”; Infix Operator “/”; Infix Operator “”; Infix Operator “=”; Infix Operator “”; Postfix Operator “%”; Prefix Operator “+”; Prefi