1、 INCITS/ISO/IEC TR 22250-1:2002 2015 (ISO/IEC TR 22250-1:2002, IDT) Information technology - Document description and processing languages - Regular Language Description for XML (RELAX) - Part 1: RELAX Core (Technical Report) INCITS/ISO/IEC TR 22250-1:2002 2015 PDF disclaimer This PDF file may conta
2、in embedded typefaces. In accordance with Adobes licensing policy, this file may be printed or viewed but shall not be edited unless the typefaces which are embedded are licensed to and installed on the computer performing the editing. In downloading this file, parties accept therein the responsibil
3、ity of not infringing Adobes licensing policy. The ISO Central Secretariat accepts no liability in this area. Adobe is a trademark of Adobe Systems Incorporated. Details of the software products used to create this PDF file can be found in the General Info relative to the file; the PDF-creation para
4、meters were optimized for printing. Every care has been taken to ensure that the file is suitable for use by ISO member bodies. In the unlikely event that a problem relating to it is found, please inform the Central Secretariat at the address given below. Registered by INCITS (InterNational Committe
5、e for Information Technology Standards) as an American National Standard. Date of Registration: 2/1/2015 Published by American National Standards Institute, 25 West 43rd Street, New York, New York 10036 Copyright 2015 by Information Technology Industry Council (ITI). All rights reserved. These mater
6、ials are subject to copyright claims of International Standardization Organization (ISO), International Electrotechnical Commission (IEC), American National Standards Institute (ANSI), and Information Technology Industry Council (ITI). Not for resale. No part of this publication may be reproduced in
7、 any form, including an electronic retrieval system, without the prior written permission of ITI. All requests pertaining to this standard should be submitted to ITI, 1101 K Street NW, Suite 610, Washington DC 20005. Printed in the United States of America ii ITIC 2015 All rights reserved Reference
8、numberISO/IEC TR 22250-1:2002(E)ISO/IEC 2002TECHNICAL REPORT ISO/IECTR22250-1First edition2002-02-15Information technology Document description and processing languages Regular Language Description for XML (RELAX) Part 1: RELAX Core Technologies de linformation Description de documents et langages d
9、e traitement Description de langage courant pour XML (RELAX) Partie 1: Noyau RELAX ISO/IEC TR 22250-1:2002(E) PDF disclaimer This PDF file may contain embedded typefaces. In accordance with Adobes licensing policy, this file may be printed or viewed but shall not be edited unless the typefaces which
10、 are embedded are licensed to and installed on the computer performing the editing. In downloading this file, parties accept therein the responsibility of not infringing Adobes licensing policy. The ISO Central Secretariat accepts no liability in this area. Adobe is a trademark of Adobe Systems Inco
11、rporated. Details of the software products used to create this PDF file can be found in the General Info relative to the file; the PDF-creation parameters were optimized for printing. Every care has been taken to ensure that the file is suitable for use by ISO member bodies. In the unlikely event th
12、at a problem relating to it is found, please inform the Central Secretariat at the address given below. ISO/IEC 2002 All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopyin
13、g and microfilm, without permission in writing from either ISO at the address below or ISOs member body in the country of the requester. ISO copyright office Case postale 56 CH-1211 Geneva 20 Tel. + 41 22 749 01 11 Fax + 41 22 749 09 47 E-mail copyrightiso.ch Web www.iso.ch Printed in Switzerland ii
14、 ISO/IEC 2002 All rights reservedISO/IEC TR 22250-1:2002(E) ISO/IEC 2002 All rights reserved iiiContents Page Forewordv 1 Scope 1 2 References .1 3 Terms and definitions .2 3.1 XML 1.0 .2 3.2 Name Spaces in XML.3 3.3 XML Schema Part 2 .3 3.4 XML Information Set3 3.5 Definitions specific to RELAX Cor
15、e.3 4 Notations 4 5 Basic concepts 4 5.1 Design principles.4 5.2 Instances, schemas, and meta schemas 4 5.2.1 Instances 4 5.2.2 RELAX schema 5 5.2.3 RELAX meta schema.5 5.3 Modules and frameworks5 5.4 Islands and instances .5 5.5 Behaviour of the RELAX Core processor .6 5.6 Datatypes6 5.7 Roles and
16、clauses .7 5.8 Production rules, labels, and hedge models 7 5.8.1 General7 5.8.2 Element hedge models8 5.8.3 Mixed hedge models .8 5.8.4 Datatype references 8 5.9 Taxonomy and occurrences of names8 6 Module Constructs 9 6.1 module 9 6.2 interface9 6.3 export10 6.4 tag10 6.5 attPool.11 6.6 ref with t
17、he role attribute.11 6.7 attribute.11 6.8 elementRule .12 6.9 hedgeRule 13 6.10 ref with the label attribute.13 6.11 hedgeRef 13 6.12 sequence 14 6.13 choice14 6.14 empty 14 6.15 none 14 6.16 mixed.14 6.17 element .15 6.18 include 15 6.19 div16 6.20 annotation 16 6.21 documentation .16 ISO/IEC TR 22
18、250-1:2002(E) iv ISO/IEC 2002 All rights reserved6.22 appinfo 16 7 Datatypes17 7.1 General17 7.2 Built-in datatypes of XML Schema Part 217 7.3 Datatypes Specific to RELAX .18 7.3.1 none 18 7.3.2 emptyString 18 7.4 Facets18 8 Reference model19 8.1 General19 8.2 Creation of element hedge models19 8.3
19、Expansion of include.19 8.4 Expansion of element19 8.5 Expansion of module 19 8.6 Expansion of tag embedded in elementRule 20 8.7 Interpretation20 9 Conformance21 9.1 General21 9.2 Conformance levels of RELAX modules .21 9.3 Conformance levels of the RELAX Core processor.21 Annex A DTD for RELAX Cor
20、e.23 Annex B RELAX Module for RELAX Core 27 Bibliography 36 ISO/IEC TR 22250-1:2002(E) ISO/IEC 2002 All rights reserved vForeword ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for worldwide standardization
21、. National bodies that are members of ISO or IEC participate in the development of International Standards through technical committees established by the respective organization to deal with particular fields of technical activity. ISO and IEC technical committees collaborate in fields of mutual in
22、terest. Other international organizations, governmental and non-governmental, in liaison with ISO and IEC, also take part in the work. In the field of information technology, ISO and IEC have established a joint technical committee, ISO/IEC JTC 1. International Standards are drafted in accordance wi
23、th the rules given in the ISO/IEC Directives, Part 3. The main task of the joint technical committee is to prepare International Standards. Draft International Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as an International Standard re
24、quires approval by at least 75 % of the national bodies casting a vote. In exceptional circumstances, the joint technical committee may propose the publication of a Technical Report of one of the following types: type 1, when the required support cannot be obtained for the publication of an Internat
25、ional Standard, despite repeated efforts; type 2, when the subject is still under technical development or where for any other reason there is the future but not immediate possibility of an agreement on an International Standard; type 3, when the joint technical committee has collected data of a dif
26、ferent kind from that which is normally published as an International Standard (“state of the art”, for example). Technical Reports of types 1 and 2 are subject to review within three years of publication, to decide whether they can be transformed into International Standards. Technical Reports of t
27、ype 3 do not necessarily have to be reviewed until the data they provide are considered to be no longer valid or useful. Attention is drawn to the possibility that some of the elements of this part of ISO/IEC TR 22250 may be the subject of patent rights. ISO and IEC shall not be held responsible for
28、 identifying any or all such patent rights. ISO/IEC TR 22250-1, which is a Technical Report of type 3, was prepared by JISC (as JIS/TR X 0029) and was adopted, under a special “fast-track procedure”, by Joint Technical Committee ISO/IEC JTC 1, Information technology, in parallel with its approval by
29、 national bodies of ISO and IEC. ISO/IEC TR 22250 consists of the following parts, under the general title Information technology Document description and processing languages Regular Language Description for XML (RELAX): Part 1: RELAX Core Part 2: RELAX Namespace TECHNICAL REPORT ISO/IEC TR 22250-1
30、:2002(E) ISO/IEC 2002 All rights reserved 1Information technology Document description and processing languages Regular Language Description for XML (RELAX) Part 1: RELAX Core 1 Scope This Technical Report gives mechanisms for formally specifying the syntax of XML-based languages. For example, the s
31、yntax of XHTML 1.0 can be specified in RELAX. Compared with DTDs, RELAX provides the following advantages: - Specification in RELAX uses XML instance (i.e., document) syntax, - RELAX provides rich datatypes, and - RELAX is namespace-aware. The RELAX specification consists of two parts, RELAX Core an
32、d RELAX Namespace. This part of the Technical Report gives RELAX Core, which may be used to describe markup languages containing a single XML namespace. Part 2 of this Technical Report gives RELAX Namespace, which may be used to describe markup languages containing more than a single XML namespace,
33、consisting of more than one RELAX Core document. Given a sequence of elements, a software module called the RELAX Core processor compares it against a specification in RELAX Core and reports the result. The RELAX Core processor can be directly invoked by the user, and can also be invoked by another
34、software module called the RELAX Namespace processor. RELAX may be used in conjunction with DTDs. In particular, notations and entities declared by DTDs can be constrained by RELAX. This part of the Technical Report also gives a subset of RELAX Core, which is restricted to DTD features plus datatype
35、s. This subset is very easy to implement, and with the exception of datatype information, conversion between this subset and XML DTDs results in no information loss. NOTE 1 Since XML is a subset of WebSGML (TC2 of ISO 8879), RELAX is applicable to SGML. NOTE 2 A successor of RELAX Core is being deve
36、loped at the RELAX NG TC of OASIS. 2 References ISO 8879:1986, Information processing Text and office systems Standard Generalized Markup Language (SGML) ISO 8879:1986/Cor 2:1999, Information processing Text and office systems Standard Generalized Markup Language (SGML) Technical Corrigendum 2 ISO/I
37、EC TR 22250-1:2002(E) 2 ISO/IEC 2002 All rights reservedW3C (World Wide Web Consortium), Extensible Markup Language (XML) 1.0 (Second Edition), W3C Recommendation, http:/www.w3.org/TR/REC-xml, 2000 W3C (World Wide Web Consortium), Name Spaces in XML, W3C Recommendation, http:/www.w3.org/TR/REC-xml-n
38、ames, 1999 W3C (World Wide Web Consortium), XML Information Set, W3C Proposed Recommendation, http:/www.w3.org/TR/xml-infoset, 2001 W3C (World Wide Web Consortium), XML Schema Part 2, W3C Recommendation, http:/www.w3.org/TR/xmlschema-2, 2001 IETF (Internet Engineering Task Force). RFC2396: Uniform R
39、esource Identifiers (URI): Generic Syntax, 1998. 3 Terms and definitions 3.1 XML 1.0 For the purposes of this part of the Technical Report, the following terms and definitions given in XML 1.0 apply. a) start tag b) end tag c) empty-element tag d) attribute e) attribute name f) content g) content mo
40、del h) attribute-list declaration i) DTD j) XML processor k) validity l) validating processor m) non-validating processor n) whitespace o) child p) parameter entity q) match NOTE 3 On top of those meanings given in XML 1.0, “match” has another meaning (see 5.8). ISO/IEC TR 22250-1:2002(E) ISO/IEC 20
41、02 All rights reserved 33.2 Name Spaces in XML For the purposes of this part of the Technical Report, the following terms and definitions given in “Name Spaces in XML” apply. a) namespace b) namespace name 3.3 XML Schema Part 2 For the purposes of this part of the Technical Report, the following ter
42、ms and definitions given in “XML Schema Part 2“ apply. a) lexical representation b) facet c) datatype d) built-in datatype 3.4 XML Information Set For the purposes of this part of the Technical Report, the following terms and definitions given in “XML Information Set” apply. a) information set b) do
43、cument information item c) element information item d) property e) core property f) reference to skipped entity information item g) entity information item h) notation information item 3.5 Definitions specific to RELAX Core 3.5.1 tag name names in start tags, end tags, and empty-element tags (generi
44、c identifiers in ISO 8879) NOTE 4 This term is adopted from DOM. 3.5.2 hedge ordered sequences of elements and character data ISO/IEC TR 22250-1:2002(E) 4 ISO/IEC 2002 All rights reserved4 Notations This part of the Technical Report uses DTD in order to specify the syntax of RELAX modules. However,
45、since DTDs provide no support for XML namespaces, this part of the Technical Report only uses some of the constructs possible in DTDs. To specify permissible contents of elements, this part of the Technical Report uses content models, which match the non-terminal symbol contentspec in XML 1.0. EXAMP
46、LE 1 The following content model specifies that an element is constrained to a sequence beginning with a frontmatter element followed by a body element, and finally an optional backmatter element. (frontmatter, body, backmatter?) To specify permissible attributes of elements, this part of the Techni
47、cal Report uses fragments of attribute-list declarations, which match the non-terminal symbol AttDef of XML 1.0. EXAMPLE 2 The following attribute-list fragment specifies that an element has an optional attribute class and that any character string can be used as the attribute value. class CDATA #IM
48、PLIED Elements representing RELAX modules shall belong to the namespace “http:/www.xml.gr.jp/xmlns/relaxCore“. There shall be no constraints on subelements not belonging to this namespace and no constraints on qualified attributes. 5 Basic concepts 5.1 Design principles The design principles of RELA
49、X Core are: a) RELAX Core shall be simple and powerful. b) The design shall be prepared quickly. c) The design shall be formal and concise. d) It shall be possible to implement RELAX Core using existing XML document APIs (e.g., SAX and DOM). e) RELAX Core shall be upward-compatible with DTDs. f) RELAX Core shall have a subset such that conversion to and from DTDs loses no information except datatype information.