Title: Tired of complicated specifications You just RELAX
1Tired of complicated specifications? You just
RELAX!
- MURATA Makoto (INSTAC XML SWGHIYAMA Masayuki
(INSTAC XML SWG KOSAKI Motohiro (Matsushita AVC
Multimedia Software)
2What is RELAX?
- RELAX (REgular LAnguage description for XML) is a
specification for describing XML-based languages. - RELAX is expected to become JIS technical
reports.
3Comparison with DTD
- Description in RELAX is represented by tags and
attributes. - RELAX has rich datatypes.
- RELAX is namespace-aware.
4Standardization of RELAX
- INSTAC XML SWG of Japan standardizes RELAX.
- RELAX is expected to become JIS technical reports
by June, 2000. - RELAX is likely to be submitted to the fast track
of ISO.
5RELAX Core and RELAX Namespace
- RELAX RELAX Core RELAX Namespace
- RELAX Core single namespace
- 2000 March
- RELAX Namespace multiple namespaces
- 2000 June
6Conformance levels of RELAX Core
- RELAX Core, classic DTD features - default
values - entities - notations datatypes - RELAX Core, fully relaxed RELAX Core, classic
Horn clauses regular hedge grammars
7RELAX Core, classic
- ltmodulegt elements and ltinterfacegt elements
- Element type declarations
- Parameter entities for content models
- Attribute-list declarations
- Parameter entities for attribute declarations
8ltmodulegt and ltinterfacegt
- ltmodulegt ltinterfacegt ltexport labels "doc " /gt
lt/interfacegt ...lt/modulegt
9Element type declarartions (1)
- lt!ELEMENT section (para)gt
- ltelementRule pred"section"gt ltref label"para"
occurs""/gtlt/elementRulegt
10Element type declarartions (2)
- lt!ELEMENT para (PCDATA fnote)gt
- ltelementRule pred"para"gt ltmixedgt ltref
label"fnote" occurs""/gt lt/mixedgtlt/elementR
ulegt
11Parameter entities for content models
- lthedgeRule label "inline"gt ltchoicegt ltref
label "a"/gt ltref label "special"/gt ltref
label "phrase"/gt lt/choicegtlt/hedgeRulegt
12Attribute-List Declarations
- lt!ATTLIST section id ID REQUIREDgt
- lttag name"section"gt ltattribute
name"id" type"ID" required"true"/gtlt/taggt
13Parameter entities for attribute declarations
- ltattList pred "common "gt ltattribute
name"id" type"ID" required"true"/gtlt/attLis
tgt - lttag name "section" gt ltref pred
"common"/gtlt/taggt
14Comparison with XML Schema
- Datatypes are borrowed from XML Schema Part 2.
- RELAX is much simpler than XML Schema Part 1.
- XML Schema will take long time. RELAX will be
available very soon. - XML Schema attaches semantics to documents, but
RELAX does not. - XML Schema requires extensions to DOM and SAX,
but RELAX does not.
15Will RELAX survive?
- As of today, nobody knows.
- At best, standard bodies merely suggest
specifications. - Users and developers make the final call.
- RELAX may survive
- RELAX can be easily implemented
- Migration from DTD to RELAX and from RELAX to XML
Schema are kept easy - RELAX is not controlled by any private company.
16RELAX helps migration from DTD to XML Schema
- Use RELAX and datatypes right now.
- Migrate to XML Schema or DTD, when necessary and
possible. - If you use RELAX Core, classic,
- Conversion is automatic
- No loss of information
17RELAX Core, fully relaxed
- Regular Hedge Grammars
- Ancestor-sensitive content models
- Local scoping
- Equivalence classes
- Horn Clauses
- Mutually-exclusive attributes
- Attribute-sensitive content models
18Ancestor-sensitive content models
- ltelementRule pred"para" label"paraWithFNotes"gtlt
mixedgt ltref label"footnote" occurs""/gtlt/mixed
gt - lt/elementRulegt
- ltelementRule pred"para" label"paraWithoutFNotes"
gtltmixedgt ltempty/gtltmixed/gt - lt/elementRulegt
19Ancestor-sensitive content models, continued
- ltelementRule pred "sec"gtltref label"paraWithFNot
es" occurs""/gt - lt/elementRulegt
- ltelementRule pred "table-cell"gtltref
label"paraWithoutFNotes" occurs""/gt - lt/elementRulegt
20Simulating local scoping
- ltelementRule pred"point"gt ltelement name"x"
type"integer"/gt ltelement name"y"
type"integer"/gtlt/elementRulegt
21Simulating equivalence classes
- blockElement
- ol
- ul
- lthedgeRule label"blockElement"gt ltref
label"ol"/gtlt/hedgeRule gtlthedgeRule
label"blockElement"gt ltref label"ul"/gtlt/hedgeRu
le gt
22Mutually exclusive attributes
- lttag name"A"gt ltattribute name"name"
type"NMTOKEN"/gt ltattribute name"href"
type"none"/gtlt/taggtlttag name"A"gt ltattribute
name"href" type"URI"/gt ltattribute name"name"
type"none"/gtlt/taggt
23Attribute-sensitive content models
- lttag name"div" pred"div-as-section"gtltattribute
name"class" type"NMTOKEN" required"true"gt ltenu
meration value"section /gtlt/attributegt - lt/taggt
- lttag name"div" pred"div-as-subsection"gt
ltattribute name"class" type"NMTOKEN"
required"true"gt ltenumeration value"subsection
/gtlt/attributegt - lt/taggt
24Attribute-sensitive content models, continued
- ltelementRule pred"div-as-section"gt
- ltref label"div-as-subsection" occurs""/gt
- lt/elementRulegt
25Implementations
- DTD-to-RELAX (in Java)
- Alpha version is already available
- Verifier of RELAX Core (in C)
- Alpha version is already available
- Generation of Java classes from RELAX Core
- Alpha version is already available
26Official site for RELAX
- http//www.xml.gr.jp/relax/
- FAQ
- Tutorial (HOW TO RELAX)
- Implementations
- Specifications (in preparation)
27Conclusion
- RELAX will be available very soon.
- Enjoy and RELAX!