1、BRITISH STANDARD BS ISO/IEC 19757-4:2006 Information technology Document Schema Definition Languages (DSDL) Part 4: Namespace-based Validation Dispatching Language (NVDL) ICS 35.240.30 Incorporating corrigendum September 2008National foreword This British Standard is the UK implementation of ISO/IEC
2、 19757-4:2006, incorporating corrigendum September 2008. The start and finish of text introduced or altered by corrigendum is indicated in the text by tags. Text altered by ISO/IEC corrigendum September 2008 is indicated in the text by . The UK participation in its preparation was entrusted to Techn
3、ical Committee IST/41, Document description and processing language. A list of organizations represented 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 appli
4、cation. Compliance with a British Standard cannot confer immunity from legal obligations. BS ISO/IEC 19757-4:2006 This British Standard, was published under the authority of the Standards Policy and Strategy Committee on 30 June 2006 BSI 2009 ISBN 978 0 580 60732 5 Amendments/corrigenda issued since
5、 publication Date Comments 31 July 2009 Implementation of ISO/IEC corrigendum September 2008 Reference number ISO/IEC 19757-4:2006(E)INTERNATIONAL STANDARD ISO/IEC 19757-4 First edition 2006-06-01 Information technology Document Schema Definition Languages (DSDL) Part 4: Namespace-based Validation D
6、ispatching Language (NVDL) Technologies de linformation Langages de dfinition de schma de documents (DSDL) Partie 4: Langage de diffusion de validation despace de nom orient (NVDL) BS ISO/IEC 19757-4:2006ii iii Contents Page Foreword v Introduction vi 1 Scope. 1 2 Normative references 1 3 Terms and
7、definitions. 2 4 Notation 3 5 Data model. 3 5.1 General. 3 5.2 Creating a data model from the infoset. 4 6 Syntax 6 6.1 General. 6 6.2 Full syntax. 6 6.3 Simple syntax 8 6.4 Simplification. 10 6.4.1 General. 10 6.4.2 Annotations. 10 6.4.3 Whitespace 10 6.4.4 message attribute 10 6.4.5 mustSupport at
8、tribute. 10 6.4.6 schemaType attribute of rules elements 11 6.4.7 rules without mode children. 11 6.4.8 child mode elements of validate, allow, reject, attach, unwrap, attachPlaceholder, or context elements 11 6.4.9 namespace or anyNamespace elements 11 6.4.10 mode inclusion 11 6.4.11 competition wi
9、thin mode . 12 6.4.12 default anyNamespace .12 6.4.13 allow and reject .12 6.4.14 useMode attribute. 13 7 Primitive operations 13 7.1 General. 13 7.2 Creating element sections and attribute sections. 13 7.3 Decomposition of element sections by trigger elements 15 7.4 Attaching attribute sections to
10、elements 17 7.5 Attaching element sequences to elements. 17 7.6 Creating placeholder elements from element sections. 18 7.7 Converting attribute sections to empty elements 18 8 Semantics 18 8.1 General. 18 8.2 Preliminaries 19 8.3 Stage 1: Creating element and attribute sections 20 8.4 Stage 2: Cons
11、tructing interpretations. 20 8.5 Stage 3: Combining sections. 20 8.6 Stage 4: Filtering of the combined sections. 22 8.7 Stage 5: Validation 22 8.7.1 General. 22 8.7.2 Determining schemas and schema languages 22 8.7.3 Schema rewriting for attribute sections 23 8.7.4 Options. 23 9 Conformance. 23 BS
12、ISO/IEC 19757-4:2006iv C.2 RELAX NG schema. 35 C.3 NVDL script 40 Annex D (informative) Example 42 D.1 General. 42 D.2 RDF embedded within XHTML. 42 D.2.1Simplification. 42 D.2.2 Dispatching 43 D.2.2.1 General. 43 D.2.2.2 Stage 1. 43 D.2.2.3 Stage 2. 44 D.2.2.4 Stage 3. 44 D.2.2.5 Stage 4. 44 D.2.2.
13、6 Stage 5. 44 D.3 XHTML 2.0 and XForms 44 D.3.1Simplification. 44 D.3.2 Dispatching 47 D.3.2.1 General. 47 D.3.2.2 Stage 1. 47 D.3.2.3 Stage 2. 47 D.3.2.4 Stage 3. 48 D.3.2.5 Stage 4. 48 D.3.2.6 Stage 5. 49 Bibliography. 50 Annex A (normative) Full syntax in RELAX NG 24 Annex B (normative) Simple sy
14、ntax in RELAX NG 31 Annex C (informative) An NVDL script and RELAX NG schema for the full syntax 35 C.1 General. 35 BS ISO/IEC 19757-4:2006v Foreword ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for world
15、wide standardization. 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
16、 fields of mutual interest. 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 draf
17、ted in accordance with the rules given in the ISO/IEC Directives, Part 2. 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 Inter
18、national Standard requires approval by at least 75 % of the national bodies casting a vote. Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights. I
19、SO/IEC 19757-4 was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology, Subcommittee SC 34, Document description and processing languages. ISO/IEC 19757 consists of the following parts, under the general title Information technology Document Schema Definition Languages (DSDL)
20、: Part 1: Overview Part 2: Regular-grammar-based validation RELAX NG Part 3: Rule-based validation Schematron Part 4: Namespace-based Validation Dispatching Language (NVDL) The following parts are under preparation: Part 5: Datatypes Part 6: Path-based integrity constraints Part 7: Character reperto
21、ire description language CRDL Part 8: Document schema renaming language DSRL Part 9: Datatype- and namespace-aware DTDs Part 10: Validation management BS ISO/IEC 19757-4:2006vi Introduction ISO/IEC 19757 defines a set of Document Schema Definition Languages (DSDL) that can be used to specify one or
22、more validation processes performed against Extensible Markup Language (XML) documents. A number of validation technologies are standardized in DSDL to complement those already available as standards or from industry. The main objective of ISO/IEC 19757 is to bring together different validationrelat
23、ed technologies to form a single extensible framework that allows technologies to work in series or in parallel to produce a single or a set of validation results. The extensibility of DSDL accommodates validation technologies not yet designed or specified. The motivations of this part of ISO/IEC 19
24、757 are twofold. One is to allow the interworking of schemas describing different markup vocabularies. The other is to allow these schemas to be written in different schema languages. For this purpose, this part of ISO/IEC 19757 specifies a Namespacebased Validation Dispatching Language (NVDL). The
25、structure of this part of ISO/IEC 19757 is as follows. Clause 5 describes the data model, which is the abstraction of an XML document used throughout the rest of the document. Clause 6 describes the full syntax and the simple syntax of NVDL scripts, and further describes the transformation from the
26、full syntax to the simple syntax. Clause 7 describes primitive operations for the NVDL data model, which are used for defining the NVDL semantics. Clause 8 describes the semantics of a correct NVDL script in the simple syntax; the semantics specify how elements and attributes in a given document are
27、 dispatched to different validators and which schema is used by each of these validators. Clause 9 describes conformance requirements for NVDL dispatchers. Annex A and Annex B define the full syntax and the simple syntax using RELAX NG, respectively. Annex C defines the full syntax using NVDL and RE
28、LAX NG. Finally, Annex D provides examples of the application of NVDL. The origin of NVDL is JIS TR X 00444, which was created and then submitted to ISO/IEC JTC1 as a fasttrack ISO/IEC DTR 2225025 by the Japanese national member body for SC 34. BS ISO/IEC 19757-4:20061 Information technology Documen
29、t Schema Definition Languages (DSDL) Part 4: Namespace-based Validation Dispatching Language (NVDL) 1 Scope This part of ISO/IEC 19757 specifies a Namespacebased Validation Dispatching Language (NVDL). An NVDL script controls the dispatching of elements or attributes in a given XML document to diffe
30、rent validators, depending on the namespaces of the elements or attributes. An NVDL script also specifies which schemas are used by these validators. These schemas may be written in any schema languages, including those specified by ISO/IEC 19757. 2 Normative references The following referenced docu
31、ments are indispensable for the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies. NOTE Each of the following documents has a unique identifier that is used to c
32、ite the document in the text. The unique identifier consists of the part of the reference up to the first comma. ISO/IEC 197572, InformationtechnologyDocument Schema Definition Languages (DSDL) Part 2: RegulargrammarbasedvalidationRELAX NG W3C XML, Extensible Markup Language (XML) 1.0 (Third Edition
33、), W3C Recommendation, 04 February 2004, available at http:/www.w3.org/TR/2004/RECxml20040204/ W3C XMLNames, Namespaces in XML, W3C Recommendation, 14 January 1999, available at http:/www.w3.org/TR/1999/RECxmlnames19990114/ W3C XMLInfoset, XML Information Set (Second Edition), W3C Recommendation, 4
34、February 2004, available at http:/www.w3.org/TR/2004/RECxmlinfoset20040204/ W3C XML Schema Part 2, XML Schema Part 2: Datatypes (Second Edition), W3C Recommendation, 28 October 2004, available at http:/www.w3.org/TR/2004/RECxmlschema220041028/ IETF RFC 2045, Multipurpose Internet Mail Extensions (MI
35、ME) Part One: Format of Internet Message Bodies, Internet Standards Track Specification, November 1996, available at http:/www.ietf.org/rfc/rfc2045.txt IETF RFC 2046, Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types, Internet Standards Track Specification, November 1996, available
36、at http:/www.ietf.org/rfc/rfc2046.txt IETF RFC 3023, XML Media Types, Internet Standards Track Specification, August 1998, available at http:/www.ietf.org/rfc/rfc3023.txt IETF RFC 3986, Uniform Resource Identifiers (URI): Generic Syntax, Internet Standards Track Specification, January 2005, availabl
37、e at http:/www.ietf.org/rfc/rfc3986.txt IETF RFC 3987, Internationalized Resource Identifiers (IRIs), Internet Standards Track Specification, January 2005, available at http:/www.ietf.org/rfc/rfc3987.txt BS ISO/IEC 19757-4:20062 For the purposes of this document, the terms and definitions given in I
38、SO/IEC 197572 and the following apply. NOTE Where a term is defined in this part of ISO/IEC 19757 and in ISO/IEC 197572, the definition given in this part of ISO/IEC 19757 applies. 3.1 action a validate, reject, allow, attach, unwrap, cancelNestedActions, or attachPlaceholder element within an NVDL
39、script 3.2 attribute section a nonempty set of attributes having the same namespace name 3.3 attribute slot node a slot for an attribute section 3.4 NVDL dispatcher software module that determines whether an NVDL script is correct, creates validation candidates from an instance, and invokes validato
40、rs for these validation candidates 3.5 element section an element such that a single namespace name applies to itself and all descendant elements 3.6 element slot node a slot for an element section 3.7 full syntax syntax of an NVDLscript before simplification 3.8 instance XML document from which val
41、idation candidates are created 3.9 media type a twopart identifier specifying the nature of the referenced data 3.10 mode a mapping from namespaces to actions 3.11 NVDL data model abstract representation of an XML document defined by this part of ISO/IEC 19757 3.12 NVDL script specification for name
42、spacebased validation dispatching 3.13 parent element section an element section containing a slot node for another section 3.14 path expression a list of one or more choices separated by |, where each choice is a list of one or more NCNametokens separated by/,optionally preceded by / 3 Terms and de
43、finitions BS ISO/IEC 19757-4:20063 3.15 RELAX NG data model abstract representation of an XML document defined by ISO/IEC 197572 3.16 section either an attribute section or element section 3.17 simple syntax syntax of an NVDL script after simplification 3.18 simplification transformation of an NVDL
44、script in the full syntax to a script in the simple syntax 3.19 slot node either an attribute slot node or element slot node 3.20 validation candidate an element not having any slot nodes as descendants NOTE Different elements in a validation candidate may belong to different namespaces. Different a
45、ttributes of an element in a validation candidate may belong to different namespaces. 4 Notation The following notations have been adopted in the formal definitions provided in this part of ISO/IEC 19757. : the context of an element in the NVDL data model, : the namespace name of an element in the N
46、VDL data model (,): a sequence of elements ,: a set of attributes x+y: the concatenation of two element sequences x and y e sn, x: an element constructed from e by replacing a slot node sn with an element sequence or attribute section x |e|: the number of descendant elements in an element e createPl
47、aceholder(s): a placeholder element created from an element section s as specified in 7.6. virtualElement(s): an empty element created from an attribute section s as specified in 7.7 path(s): the path from the parent element section of s to s as defined in 8.2 5 Data model 5.1 General NVDL deals wit
48、h XML documents representing both schemas and instances through an abstract data model. XML documents representing schemas and instances shall be wellformed in conformance with W3C XML and shall conform to the constraints of W3C XMLNames. BS ISO/IEC 19757-4:2006This abstract NVDL data model is an ex
49、tension of the RELAX NG data model. Names, contexts, attributes, and strings in the NVDL data model are identical to those in the RELAX NG data model defined in ISO/IEC 197572. Elements in the NVDL data model are extended as described in this clause. An element consists of: a name, a context, a set of attributes or attribute slot nodes, and an ordered sequence of zero or more children