Information technology — Document Schema Definition Language (DSDL) — Part 2: Regular-grammar-based validation — RELAX NG — Amendment 1: Compact Syntax

Technologies de l'information — Langage de définition de schéma de documents (DSDL) — Partie 2: Validation de grammaire orientée courante — RELAX NG — Amendement 1: Syntaxe compacte

General Information

Status
Withdrawn
Publication Date
19-Jan-2006
Withdrawal Date
19-Jan-2006
Current Stage
9599 - Withdrawal of International Standard
Start Date
10-Dec-2008
Completion Date
30-Oct-2025
Ref Project

Relations

Standard
ISO/IEC 19757-2:2003/Amd 1:2006 - Compact Syntax
English language
10 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)


INTERNATIONAL ISO/IEC
STANDARD 19757-2
First edition
2003-12-15
AMENDMENT 1
2006-01-15
Information technology — Document
Schema Definition Language (DSDL) —
Part 2:
Regular-grammar-based validation —
RELAX NG
AMENDMENT 1: Compact Syntax
Technologies de l'information — Langage de définition de schéma de
documents (DSDL) —
Partie 2: Validation de grammaire orientée courante — RELAX NG
AMENDEMENT 1: Syntaxe compacte

Reference number
ISO/IEC 19757-2:2003/Amd. 1:2006(E)
©
ISO/IEC 2006
ISO/IEC 19757-2:2003/Amd.1:2006(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.

©  ISO/IEC 2006
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 2006 – All rights reserved

ISO/IEC 19757-2:2003/Amd.1:2006(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.
Amendment 1 to ISO/IEC 19757-2:2003 was prepared by Joint Technical Committee ISO/IEC JTC 1,
Information technology, Subcommittee SC 34, Document description and processing languages.

© ISO/IEC 2006 – All rights reserved iii

ISO/IEC 19757-2:2003/Amd.1:2006(E)

Information technology — Document Schema Definition
Language (DSDL) —
Part 2:
Regular-grammar-based validation — RELAX NG
AMENDMENT 1: Compact Syntax
Page 8, Clause 5
Add the following sentence at the end of Clause 5:
An alternative compact syntax is described in Annex C.
Page 34
Add Annex C before the Bibliography.
Annex C
(normative)
RELAX NG Compact Syntax
C.1 Introduction
This Annex describes a compact, non-XML syntax for RELAX NG.
The goals of the compact syntax are to:
— maximize readability
— support all features of RELAX NG; it must be possible to translate a schema from the XML syntax to the compact
syntax and back without losing significant information
— support separate translation; a RELAX NG schema may be spread amongst multiple files; it must be possible to
represent each of the files separately in the compact syntax; the representation of each file must not depend on
the other files
C.2 Syntax
The following is a summary of the syntax in EBNF. Square brackets are used to indicate optionality. The start symbol
is topLevel.
© ISO/IEC 2006 – All rights reserved 1

ISO/IEC 19757-2:2003/Amd.1:2006(E)
topLevel ::=
decl* (pattern | grammarContent*)
decl ::=
("namespace" identifierOrKeyword "=" namespaceURILiteral)
| ("default" "namespace" [identifierOrKeyword] "=" namespaceURILiteral)
| ("datatypes" identifierOrKeyword "=" literal)
pattern ::=
("element" nameClass "{" pattern "}")
| ("attribute" nameClass "{" pattern "}")
| (pattern ("," pattern)+)
| (pattern ("&" pattern)+)
| (pattern ("|" pattern)+)
| (pattern "?")
| (pattern "*")
| (pattern "+")
| ("list" "{" pattern "}")
| ("mixed" "{" pattern "}")
| identifier
| ("parent" identifier)
| "empty"
| "text"
| ([datatypeName] datatypeValue)
| (datatypeName ["{" param* "}"] [exceptPattern])
| "notAllowed"
| ("external" anyURILiteral [inherit])
| ("grammar" { grammarContent* })
| ("(" pattern ")")
param ::=
identifierOrKeyword "=" literal
exceptPattern ::=
"-" pattern
grammarContent ::=
start
| define
| ("div" "{" grammarContent* "}")
| ("include" anyURILiteral [inherit] ["{" includeContent* "}"])
includeContent ::=
define
| start
| ("div" "{" includeContent* "}")
start ::=
"start" assignMethod pattern
define ::=
identifier assignMethod pattern
assignMethod ::=
"="
| "|="
| "&="
nameClass ::=
name
2 © ISO/IEC 2006 – All rights reserved

ISO/IEC 19757-2:2003/Amd.1:2006(E)
| (nsName [exceptNameClass])
| (anyName [exceptNameClass])
| (nameClass | nameClass)
| ("(" nameClass ")")
name ::=
identifierOrKeyword
| CName
exceptNameClass ::=
"-" nameClass
datatypeName ::=
CName
| "string"
| "token"
datatypeValue ::=
literal
anyURILiteral ::=
literal
namespaceURILiteral ::=
literal
| "inherit"
inherit ::=
"inherit" "=" identifierOrKeyword
identifierOrKeyword ::=
identifier
| keyword
identifier ::=
NCName
| quotedIdentifier
quotedIdentifier ::=
"\" NCName
CName ::=
NCName ":" NCName
nsName ::=
NCName ":*"
anyName ::=
"*"
literal ::=
literalSegment ("~" literalSegment)+
literalSegment ::=
('"' (Char - ('"' | newline )* '"')
| ("'" (Char - ("'" | newline)* "'")
| ('"""' (['"']['"'] (Char - '"'))* '"""')
| ("'''" (["'"]["'"] (Char - "'"))* "'''")
© ISO/IEC 2006 – All rights reserved 3

ISO/IEC 19757-2:2003/Amd.1:2006(E)
keyword ::=
"attribute"
| "default"
| "datatypes"
| "div"
| "element"
| "empty"
| "external"
| "grammar"
| "include"
| "inherit"
| "list"
| "mixed"
| "namespace"
| "notAllowed"
| "parent"
| "start"
| "string"
| "text"
| "token"
[4] [5]
NCName is defined in W3C XML Schema . Char is defined in W3C XML . A formal definition for the compact syntax
[6]
is defined in an Oasis Committee Specification .
In order to use a keyword as an identifier, it must be quoted with \. It is not necessary to quote a keyword that is used
as the name of an element or attribute or as datatype parameter.
The value of a literal is the concatenation of the values of its constituent literalSegments. A literalSegment is always
terminated only by an occurrence of the same delimiter that began it. The delimiter used to begin a literalSegment
may be either one or three occurrences of a single or double quote character. Newlines are allowed only in
literalSegments delimited by three quote characters. The value of a literal segment consists of the characters between
its delimiters. One way to get a literal whose value contains both a single and a double quote is to divide the literal
into multiple literalSegments so that the single and double quote are in separate literalSegments. Another way is to
use a literalSegment delimited by three single or double quotes.
Annotations can be specified as described in C.5.
There is no notion of operator precedence. It is an error for patterns to combine the |, &, , and - operators without
using parentheses to make the grouping explicit. For example, foo | bar, baz is not allowed; instead, either (foo | bar),
baz or foo | (bar, baz) must be used. A similar restriction applies to name classes and the use of the | and - operators.
These restrictions are not expressed in the above EBNF.
The value of an anyURILiteral specified with include or external is a URI reference to a grammar in the compact
syntax.
C.3 Lexical structure
Whitespace is allowed between tokens. Tokens are the strings occurring in double quotes in the EBNF in C.2, except
that literalSegment, nsName, CName, identifier and quotedIdentifer are single tokens.
Comments are also allowed between tokens. Comments start with a # and continue to the end of the line. Comments
starting with ## are treated specially; see C.5.
A Unicode character with hex code N can be represented by the escape sequence \x{N}. Using such an escape
sequence is completely equivalent to the entering the corresponding character directly. For example,
element \x{66}\x{6f}\x{6f} { empty }
is equivalent to
element foo { empty }
4 © ISO/IEC 2006 – All rights reserved

ISO/IEC 19757-2:2003/Amd.1:2006(E)
C.4 Declarations
A datatypes declaration declares a prefix used in a QName identifying a datatype. For example,
datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
element height { xsd:double }
In fact, in the above example, the datatypes declaration is not required: the xsd prefix is predeclared to the above
URI.
A namespace declaration declares a prefix used in a QName specifying the name of an element or attribute. For
example,
namespace rng = "http://relaxng.org/ns/structure/1.0"
element rng:text { empty }
As in XML, the xml prefix is predeclared.
A default namespace declaration declares the namespace used for unprefixed names specifying the name of an
element (but not of an attribute). For example,
default namespace = "http://example.com"
element foo { attribute bar { string } }
is equivalent to
namespace ex = "http://example.com"
element ex:foo { attribute bar { string } }
A default namespace declaration may have a prefix as well. For example,
default namespace ex = "http://example.com"
is equivalent to
default namespace = "http://example.com"
namespace ex = "http://example.com"
The URI may be empt
...

Questions, Comments and Discussion

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