Information technology — Document Schema Definition Languages (DSDL) — Part 8: Document Semantics Renaming Language (DSRL)

ISO/IEC 19757-8:2008 specifies a mechanism that allows users to assign locally meaningful names to XML elements, attributes, entities and processing instructions, without having to completely rewrite the Document Type Definition (DTD) or schema against which they are to be validated. In addition, ISO/IEC 19757-8:2008 provides an XML-based format for declaring the replacement text for entity references and provides a mechanism that allows users to define default values for both element content and attribute values.

Technologies de l'information — Langages de définition de schéma de documents (DSDL) — Partie 8: Langage pour renommer une sémantique de documents (DSRL)

General Information

Status
Published
Publication Date
02-Dec-2008
Current Stage
9093 - International Standard confirmed
Completion Date
06-Jun-2019
Ref Project

Relations

Buy Standard

Standard
ISO/IEC 19757-8:2008 - Information technology -- Document Schema Definition Languages (DSDL)
English language
20 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)

INTERNATIONAL ISO/IEC
STANDARD 19757-8
First edition
2008-12-15


Information technology — Document
Schema Definition Languages (DSDL) —
Part 8:
Document Semantics Renaming
Language (DSRL)
Technologies de l'information — Langages de définition de schéma de
documents (DSDL) —
Partie 8: Langage pour renommer une sémantique de documents
(DSRL)




Reference number
ISO/IEC 19757-8:2008(E)
©
ISO/IEC 2008

---------------------- Page: 1 ----------------------
ISO/IEC 19757-8:2008(E)
PDF disclaimer
This PDF file may contain embedded typefaces. In accordance with Adobe's 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 responsibility of not infringing Adobe's 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
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 that a problem relating to it is found, please inform the Central Secretariat at the address given below.


COPYRIGHT PROTECTED DOCUMENT


©  ISO/IEC 2008
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 photocopying and microfilm, without permission in writing from either ISO at the address below or
ISO's 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 copyright@iso.org
Web www.iso.org
Published in Switzerland

ii © ISO/IEC 2008 – All rights reserved

---------------------- Page: 2 ----------------------
ISO/IEC 19757-8:2008(E)
Contents Page

Foreword. iv

Introduction. v


1 Scope. 1

2 Normative references. 1


3 Terms and definitions. 2

4 The role of the Document Semantics Renaming Language. 2

4.1 Namespace. 2


5 DSRL maps. 3

6 Mapping user-defined names to schema-defined names. 3
6.1 Reassigning element and attribute names. 3

6.2 Mapping attribute values. 5
6.3 Default attribute values. 6

6.4 Mapping element content. 6
6.5 Default content. 6

6.6 Renaming processing instruction targets. 7
6.7 Mapping entity references. 7

7 Declaring entities. 8
8 Conformance. 9
Annex A (normative) Validation of declarative document architectures. 10
A.1 RELAX NG XML Schema for Validating DSRL. 10
A.2 RELAX NG Compact Schema for Validating DSRL maps. 15
A.3 Schematron Rules for Validating DSRL. 16
Annex B (informative) Using DSRL to Transform Document Instances. 17


Bibliography . 20
© ISO/IEC 2008 – All rights reserved iii

---------------------- Page: 3 ----------------------
ISO/IEC 19757-8:2008(E)
Foreword
ISO (the International Organization for Standardization) and IEC (the International Electrotechnical
Commission) form the specialized system for worldwide 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 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 drafted 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 International 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.
ISO/IEC 19757-8 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):
— 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)
— Part 7: Character Repertoire Description Language (CRDL)
— Part 8: Document Semantics Renaming Language (DSRL)
— Part 9: Namespace and datatype declaration in Document Type Definitions (DTDs)

iv © ISO/IEC 2008 – All rights reserved

---------------------- Page: 4 ----------------------
ISO/IEC 19757-8:2008(E)
Introduction

ISO/IEC 19757 defines a set of Document Schema Definition Languages (DSDL) that can be used to specify one or
more validation processes performed against Extensible Markup Language (XML) or Standard Generalized Markup
Language (SGML) documents. (XML is an application profile of SGML, ISO 8879:1986.)
A document model is an expression of the constraints to be placed on the structure and content of documents to be
validated with the model. A number of technologies have been developed through various formal and informal consortia
since the development of Document Type Definitions (DTDs) as part of ISO 8879, notably by the World Wide Web
Consortium (W3C) and the Organization for the Advancement of Structured Information Standards (OASIS). A number
of validation technologies are standardized in DSDL to complement those already available as standards or from
industry.
To validate that a structured document conforms to specified constraints in structure and content relieves the potentially
many applications acting on the document from having to duplicate the task of confirming that such requirements
have been met. Historically, such tasks and expressions have been developed and utilized in isolation, without
consideration for how the features and functionality available in other technologies might enhance validation objectives.
The primary objective of ISO/IEC 19757 is to bring together different validation-related tasks and expressions 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.
In the past, different design and use criteria have led users to choose different validation technologies for different
portions of their information. Bringing together information within a single XML document sometimes prevents existing
document models from being used to validate sections of data. By providing an integrated suite of constraint description
languages that can be applied to different subsets of a single XML document, ISO/IEC 19757 allows different validation
technologies to be integrated under a well-defined validation policy.
ISO/IEC 19757 integrates constraint description technologies into a suite that
— provides user control of names, order and repeatability of information objects (elements),
— allows users to identify restrictions on the co-concurrence of elements and/or element contents,
— allows specific subsets of structured documents to be validated,
— allows restrictions to be placed on the contents of specific elements, including restrictions based on the content
of other elements in the same document,
— allows the character set that can be used within specific elements to be managed, based on the application of
the ISO/IEC 10646 Universal Multiple-Octet Coded Character Set (UCS),
— allows default values to be assigned to element content and attribute values,
— allows SGML to be used to declare document structure constraints that extend DTDs to include functions such
as namespace-controlled validation and datatypes.
© ISO/IEC 2008 – All rights reserved v

---------------------- Page: 5 ----------------------
INTERNATIONAL STANDARD ISO/IEC 19757-8:2008(E)

Information technology — Document Schema Definition
Languages (DSDL) —
Part 8:
Document Semantics Renaming Language (DSRL)
1 Scope
This part of ISO/IEC 19757 specifies a mechanism that allows users to assign locally meaningful names to
XML elements, attributes, entities and processing instructions, without having to completely rewrite the DTD or
schema against which they are to be validated. In addition, this part of ISO/IEC 19757 provides an XML-based
format for declaring the replacement text for entity references and provides a mechanism that allows users to
define default values for both element content and attribute values.
2 Normative references
The following referenced documents 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 that is not an International Standard has a unique identifier that is used to
cite the document in the text. The unique identifier consists of the part of the reference up to the first comma.
IRI, IETF RFC 3987, Internationalized Resource Identifiers (IRIs), Internet Standards Track Specification,
January 2005, http://www.ietf.org/rfc/rfc3987.txt
ISO/IEC 19757-2:2003, Information technology — Document Schema Definition Language (DSDL) — Part 2:
Regular-grammar-based validation — RELAX NG
ISO/IEC 19757-2:2003/Amd.1:2006, Information technology — Document Schema Definition Language
(DSDL) — Part 2: Regular-grammar-based validation — RELAX NG — Amendment 1: Compact Syntax
ISO/IEC 19757-3:2006, Information technology — Document Schema Definition Languages (DSDL) — Part 3:
Rule-based validation — Schematron
ISO 8879:1986, Information processing — Text and office systems — Standard Generalized Markup
Language (SGML)
XML, Extensible Markup Language (XML) 1.0 (Fourth Edition), W3C Recommendation, 16 August 2006,
http://www.w3.org/TR/2006/REC-xml-20060816
XML-Infoset, XML Information Set (Second Edition), W3C Recommendation, 4 February 2004,
http://www.w3.org/TR/2004/REC-xml-infoset-20040204
XML-Names, Namespaces in XML 1.0 (Second Edition), W3C Recommendation, 16 August 2006,
http://www.w3.org/TR/2006/REC-xml-names-20060816
XML Schema, XML Schema Part 1: Structures Second Edition, W3C Recommendation, 28 October 2004,
http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/
XSD, XML Schema Part 2: Datatypes Second Edition, W3C Recommendation, 28 October 2004,
http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/
XSLT 2.0, XSL Transformations (XSLT) Version 2.0, W3C Recommendation, 23 January 2007,
http://www.w3.org/TR/2007/REC-xslt20-20070123/
© ISO/IEC 2008 – All rights reserved 1

---------------------- Page: 6 ----------------------
ISO/IEC 19757-8:2008(E)

3 Terms and definitions

For the purposes of this document, the terms and definitions given in ISO/IEC 19757-2, ISO/IEC 19757-3
and the following apply.

3.1
DSRL map
set of rules that is used to map a document instance to a document model defined by one or more schemas

3.2
entity
ISO 8879:1986 general entity that can be referenced using an XML entity reference

3.3
entity node
node in a Document Object Model that identifies an entity and, where appropriate, contains details of its replacement
text
3.4
IRI
Internationalized Resource Identifiers as defined in IETF RFC 3987
3.5
SGML
Standard Generalized Markup Language defined in ISO 8879:1986
4 The role of the Document Semantics Renaming Language
The Document Semantics Renaming Language (DSRL) provides a mechanism for declaring how an application can
map locally meaningful element, attribute, entity and processing instruction names to the names assigned to equivalent
XML elements, attributes, entities and processing instructions within a document model without having to completely
rewrite the DTD or schema to which they are required to conform.
In addition, DSRL provides an XML-based format for declaring the replacement text for entity references and provides
a mechanism that allows users to define default values for both element content and attribute values. To allow for
schemas that do not support the use of attributes, DSRL also allows users to convert attribute values to element
content.
4.1 Namespace
Elements and attributes that conform to this Part of DSDL shall have an XML namespace definition (as defined in
XML-Names) whose associated resource identifier (IRI) is:
  http://purl.oclc.org/dsdl/dsrl
In this Part the prefix dsrl: is used to identify points at which this IRI defines the namespace.
NOTE: In most applications of DSRL this namespace prefix will not be required as the IRI can be assigned as the default XML
namespace.
Other namespaces required to group elements and attributes into processable units can be assigned as required for
validation.
2 © ISO/IEC 2008 – All rights reserved

---------------------- Page: 7 ----------------------
ISO/IEC 19757-8:2008(E)
5 DSRL maps
The outermost element of a DSRL map has the following structure:

 .

Two optional attributes can be associated with this element:
— targetNamespace may be used to record the IRI assigned as the target namespace for the validating schema;
— targetSchemaLocation may be used to record the IRI assigned to the schema to be used to validate the
mapped document instances.
The targetNamespace attribute is required when the schema identified by the targetSchemaLocation attribute
has a target namespace.
NOTE: The targetSchemaLocation attribute can be used to provide a specific location for the schema to be used for the
validation of the result document. If there is no requirement to validate both the optional attributes can be omitted. If
a null value is present for targetSchemaLocation the DTD to be used to validate it is presumed to be part of the
document. If a namespace is declared but no schema location is stated the namespace is mapped against an empty
string.
The formal declaration for this element, defined using the RELAX NG Compact Syntax, is:
 namespace xsd="http://www.w3.org/2001/XMLSchema-datatypes"
 namespace dsrl="http://purl.oclc.org/dsdl/dsrl"
 maps = element dsrl:maps
     {target-namespace?, schema-location?,
     (element-map | attribute-map | map-pi-target )+,
     entity-name-map?, define-entity*
     }
 target-namespace = attribute targetNamespace {xsd:anyURI}
 schema-location = attribute targetSchemaLocation {xsd:anyURI}
NOTE: Support for the optional entity-name-map component is a conformance issue (see Clause 8).
6 Mapping user-defined names to schema-defined names
6.1 Reassigning element and attribute names
The dsrl:element-map element is used to record replacements that apply to element names and to their associated
attributes. The model for this element is:
element-map = element dsrl:element-map (parent?, (name | name-map),
                     attribute-map*, default-content?)
parent = element dsrl:parent { text }
name = element dsrl:name { added-attribute*, xsd:QName }
added-attribute = attribute additional { xsd:boolean }
name-map = { (from, to) }
from = element dsrl:from { text }
to = element dsrl:to { text }
The contents of a dsrl:element-map element consists of a sequence of elements that define which name in a
document instance is to be matched to which element in the validation schema, and which attributes of the element
are to be mapped. Optionally default content can also be defined for the element.
The name of the element to be mapped is recorded in the content of the dsrl:from element. This content shall be
a valid XML name, which can include a prefix that identifies the appropriate namespace. If the content is a prefixed
© ISO/IEC 2008 – All rights reserved 3

---------------------- Page: 8 ----------------------
ISO/IEC 19757-8:2008(E)
name, it is recommended that the prefix used be declared in a namespace declaration that is declared as an attribute
of the dsrl:from element.
NOTE: If the namespace is declared within the definition of the dsrl:from element you can be certain that the association
of the name with the referenced IRI is correctly recorded. This makes it easier to reuse the definition safely, and can
make processing easier.
If the named element needs to be replaced in different ways in different contexts the optional dsrl:parent element
can be used to record XML Stylesheet Langauge Transformation (XSLT) patterns that distinguish between the different
contexts in which replacement of the name is to be applied. No two dsrl:element-map elements shall have identical
contents for both their dsrl:parent element and their dsrl:from element. If two or more maps with different
contents match the same result path the last of matches shall be applied.
NOTE: This precedence rule allows the XSLT error recovery rule for matching paths using the last template defined to be
applied when processing DSRL using XSLT.
The name to be applied to the mapped element when it is validated is recorded as the content of the dsrl:to element.
This content shall be a valid XML name, which can include a prefix that identifies the appropriate namespace. If the
content is a prefixed name, it is recommended that the prefix used be declared in a namespace declaration that is
declared as an attribute of the dsrl:to element.
If the element name is to stay the same, but one or more attributes of the element is to have its name or values
mapped, the dsrl:name element can be used in place of the dsrl:from and dsrl:to pair. The content of a
dsrl:name element shall be a valid XML name, which can include a prefix that identifies the appropriate namespace.
Names can be qualified providing the relevant namespace prefixes have been declared within the map. They cannot
contain spaces, or any other character that is not a valid name character as defined in the W3C XML specification.
The contents of the dsrl:parent element shall form a valid XSLT pattern that identifies a permitted parent for the
element to be renamed.
NOTE: A typical example of a DSRL element name map for which no attribute mapping is required would be:
  
    adresse
    address
  
If namespaces are used for the source or result element they should be declared as part of the definition, giving the declaration
the form:
  
    old:name
    new:name
  
The dsrl:attribute-map element is used within dsrl:element-map elements to record replacements that
apply to attribute names and values. The model for this element is:
attribute-map = element dsrl:attribute-map {(name | attribute-name-map),
                       values-map?, default-value?}
attribute-name-map = (from, (to|to-element))
to-element = element dsrl:to-element { text }
Each dsrl:attribute-map replaces a single attribute. The name of the attribute to be mapped is recorded as the
content of the dsrl:from element. No two dsrl:attribute-map elements within a given dsrl:element-map
shall have the same value for their dsrl:from element.
4 © ISO/IEC 2008 – All rights reserved

---------------------- Page: 9 ----------------------
ISO/IEC 19757-8:2008(E)
If the attribute is to be directly mapped to an attribute in the result document, the name to be applied to the mapped
attribute when it is validated is recorded as the contents of the immediately following dsrl:to element. If the dsrl:to
element is empty the attribute named in the dsrl:from element is to be removed prior to validation.
If the attribute is to be mapped to an element in the result document that is to precede any existing contents of the
element containing the mapped attribute, the name to be applied to the mapped element when it is validated is
recorded as the contents of the immediately following dsrl:to-element element. It is an error if both a dsrl:to
and dsrl:to-element occur in the same attribute map.
If the values of an attribute are to be mapped without the name of the attribute changing a dsrl:name element can
be used in place of the dsrl:from and dsrl:to pair.
If an attribute that is not in the source document is required to be present for document instances to be validated
against a target schema the dsrl:name element shall be assigned an additional="true" boolean attribute.
NOTE: If the additional="true" is present a default value shall be assigned to the attribute using the mechanisms specified
in 6.3.
If the attribute map is defined as child of a dsrl:maps element, rather than a dsrl:element-map element, the
attribute map will be applied to all elements that have an attribute of that name for which a specific mapping has not
been declared.
Attribute names can be qualified providing the relevant namespace prefixes have been declared within the map. They
cannot contain spaces, or any other character that is not a valid name character as defined in the W3C XML
specification.
NOTE: A typical example of a DSRL attribute name map which could be nested with the dsrl:element-map example shown
above is:
  
   sorte
   type
  
6.2 Mapping attribute values
A mapping can be declared between attribute values in a source document and attribute values in a target schema.
The model for the dsrl:values-map element that is nested within the appropriate dsrl:attribute-map element
is:
   values-map = element dsrl:values-map {name-map+}
The value to be mapped is recorded as the content of a dsrl:from element. No two dsrl:from elements within
the same dsrl:values-map element can have identical content. If two or more dsrl:from elements with different
contents refer to the same result path the last of matches shall be applied.
NOTE: This allows the default XSLT rules for matching paths using the last template to be defined to be applied when processing
DSRL using XSLT.
The value to be assigned to the mapped attribute when it is validated is recorded as the contents of the associated
dsrl:to element.
NOTE: A typical example of a DSRL attribute values map is:
  
   maisonhome
   bureauoffice
  
© ISO/IEC 2008 – All rights reserved 5

---------------------- Page: 10 ----------------------
ISO/IEC 19757-8:2008(E)
6.3 Default attribute values
A dsrl:default-value element can be used to define a default value for an attribute at the end of an attribute
map. The model for this element is:
  default-value = element dsrl:default-value {text}
The default value to be assigned is recorded as the contents of the dsrl:default-value element. Any value
assigned to the named attribute within the document instance will be used during validation of the document, but if
the attribute is not present the default value will be applied.
If an attribute has been declared to be an additional attribute by the addition of an additional="true" attribute
to a dsrl:name element the attribute map shall contain a dsrl:default-value element.
NOTE: A typical example of a DSRL default attribute value definition, as introduced as the last element in an
dsrl:attribute-map element, is:
code-source
iso3166
6.4 Mapping element content
A mapping can be declared between a text string in a source element whose only content is text and replacement
values to be applied when validating the document against the target schema. The model for the dsrl:values-map
element that is nested within the appropriate dsrl:element-map element is:
   values-map = element dsrl:values-map {name-map+}
The element content to be mapped is recorded as the content of a dsrl:from element. No two dsrl:from elements
within the same dsrl:values-map element shall have the same contents.
The value to be assigned as the replacement text when the element is validated is recorded as the contents of the
associated dsrl:to element.
NOTE: A typical example of a DSRL element values map is:
  
   BSIANSI
   ISOISO/IEC
  
6.5 Default content
A dsrl:default-content element can used to define a default value for an element defined in a schema. The
model for this element is:
  default-content = element dsrl:default-content {after, any-content}
  after = attribute after {text}
  any-content = (mixed {any-element*})
  any-element = element * {any-attribute, any-content}
  any-attribute = (attribute * {text})*
The default content for the element is recorded as the content of the dsrl:default-content element. Any contents
assigned to the element within the document instance will be used during validation of the document, but if the element
is empty, or not present, the default content will be applied during validation.
The after attribute of the dsrl:default-content element records the name of the target element after which
the content has to be inserted if not found in the source instance. The element the default content is to be placed
after shall be declared within the same DSRL map, even if it is not altered in any way. To ensure that the after
6 © ISO/IEC 2008 – All rights reserved

---------------------- Page: 11 ----------------------
ISO/IEC 19757-8:2008(E)
attribute can be applied in the appropriate context the containing dsrl:element-map element shall start with a
dsrl:parent statement that contains the name of the element within which the element identified by the after
attribute occurs.
NOTE: A typical example of a DSRL default content definition is:
Downtown
NOTE: A typical example of a DSRL element map with mapped attribute values and a default attribute value, might be:
  
    adresse
    ville
    locality
   
      required
      true

...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.