SlideShare ist ein Scribd-Unternehmen logo
1 von 29
RELAX NG to DTD and XSD 
using the Open Toolkit 
Using RELAX NG for DITA shells and 
modules 
Eliot Kimber 
Contrext, LLC 
DITA OT Day Munich 2014 
11/24/2014 Contrext, LLC 1
About the Author 
• Responsible for DITA 1.3 grammar files 
• Independent consultant focusing on DITA analysis, 
design, and implementation 
• Doing SGML and XML for cough 30 years cough 
• Founding member of the DITA Technical Committee 
• Founding member of the XML Working Group 
• Co-editor of HyTime standard (ISO/IEC 10744) 
• Primary developer and founder of the DITA for 
Publishers project 
• Author of DITA for Practitioners, Vol 1 (XML Press) 
11/24/2014 Contrext, LLC 2
Agenda 
• A brief demonstration 
• What is RELAX NG? 
• RELAX NG and DITA 
• DITA document types and modules 
• Anatomy of a RELAX NG shell 
• See how easy: generating DTD and XSD shells 
11/24/2014 Contrext, LLC 3
Executive Summary 
• RELAX NG makes XML vocabulary definition 
much, much easier 
• RELAX NG is a good match to DITA 
requirements 
• Can generate conforming DITA DTD and XSD 
files from RELAX NG 
• Makes creating DITA document type shells 
about as easy as it can be 
• No more need to fight with DTD or XSD syntax 
11/24/2014 Contrext, LLC 4
Demonstration 
• Create a new document type shell 
• Create a new domain specialization 
• Create a new topic speicalization 
• Generate DTD and XSD versions of all of these 
grammars 
11/24/2014 Contrext, LLC 5
WHAT IS RELAX NG? 
11/24/2014 Contrext, LLC 6
RELAX NG is 
• A grammar (or schema) language for XML 
documents 
• An OASIS and ISO/IEC standard (ISO/IEC 
19757-2) 
• Most like XML DTDs but easier to use 
• Designed to be as simple as possible 
• Used for other XML standards, most 
prominently DocBook 
11/24/2014 Contrext, LLC 7
RELAX NG Basics 
• RELAX NG has both an XML and character-based syntax: 
<grammar> 
<start> 
<ref name=“concept.element”/> 
</start> 
… 
</grammar> 
______________________________________ 
grammar { 
start concept.element 
… 
} 
• The two are functionally equivalent 
11/24/2014 Contrext, LLC 8
RELAX NG Basics (cont.) 
• A RELAX NG grammar defines a set of 
“patterns” that documents must match 
• Patterns can have names (analagous to DTD 
parameter entities) 
• Pattern combination mechanisms are more 
flexible than DTD parameter entities or XSD 
groups 
• Grammars can be modularized into multiple 
files 
11/24/2014 Contrext, LLC 9
RELAX NG AND DITA 
11/24/2014 Contrext, LLC 10
Good Match to DITA Requirements 
• RELAX NG’s pattern-based approach works 
well with DITA’s modular vocabulary 
• Patterns can allow extension by other patterns 
• Patterns can unilaterally extend other 
patterns: the extending pattern names the 
pattern it extends 
• Makes combining vocabularies as easy as it 
could be 
11/24/2014 Contrext, LLC 11
No Added Overhead 
• Unlike DTDs, RELAX NG has much simpler and 
easier-to-use syntax 
• Avoids the conceptual and syntactic 
complexity of XSD 
• Close semantic match to existing DTD-defined 
rules 
11/24/2014 Contrext, LLC 12
Does require DTD Compatibility 
Feature 
• Base RELAX NG standard does not provide for 
defining attribute defaults 
• Companion standard RELAX NG DTD 
Compatibility provides attribute defaults 
• DITA depends on default attribute values 
• George Bina (oXygenXML) has implemented 
DTD compatibility in Java for use with Xerces 
XML parser (open source) 
11/24/2014 Contrext, LLC 13
Result: Everything is Awesome 
• RELAX NG makes DITA document type shells 
as easy to create as it can be 
• Can generate DITA-conforming DTDs and XSDs 
from the RELAX NG grammars 
• Makes it possible, if not in fact easy, for 
anybody to configure their own DITA 
document types 
11/24/2014 Contrext, LLC 14
DITA DOCUMENT TYPES AND 
SHELLS 
11/24/2014 Contrext, LLC 15
DITA Document Types 
• A DITA document type is a unique set of 
vocabulary and constraint modules 
• Modules are invariant 
– Every copy of a given module should be identical 
– You never modify modules directly 
• You implement DITA document types by 
integrating vocabulary and constraint 
modules using a document type shell 
11/24/2014 Contrext, LLC 16
Document Type Shells 
• Integrate modules to form a working 
document schema 
• Refer to the vocabulary and constraint 
modules of the DITA document type 
• Do any configuration required 
• Two document type shells that integrate the 
same same set of modules implement the 
same DITA document type 
11/24/2014 Contrext, LLC 17
ANATOMY OF A RELAX NG 
SHELL 
11/24/2014 Contrext, LLC 18
Shell for Base Topic Document 
Type (basetopic.rng) 
<grammar xmlns=http://relaxng.org/ns/structure/1.0 
xmlns:dita="http://dita.oasis-open.org/architecture/2005/" 
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"> 
… 
<div> 
<a:documentation>ROOT ELEMENT DECLARATION</a:documentation> 
<start combine="choice"> 
<ref name="topic.element"/> 
</start> 
</div> 
<div> 
<a:documentation>DOMAINS ATTRIBUTE</a:documentation> 
<define name="domains-att"> 
<attribute name="domains" 
a:defaultValue=”(topic topic) (topic hazard-d) (topic hi-d) (topic indexing-d) 
(topic ut-d) (topic hazard-d)”/> 
</define> 
</div> 
<div> 
<a:documentation>MODULE INCLUSIONS</a:documentation> 
<include href="topicMod.rng"> 
<define name="topic-info-types"> 
<ref name="topic.element"/> 
</define> 
</include> 
<include href="hazardstatementDomainMod.rng"/> 
<include href="highlightDomainMod.rng"/> 
<include href="indexingDomainMod.rng"/> 
<include href="utilitiesDomainMod.rng"/> 
</div> 
… 
</grammar> 
11/24/2014 Contrext, LLC 19
Integration: Just Include the 
Module 
• All you do is include the module you want to 
integrate: 
<include href="topicMod.rng"> 
<define name="topic-info-types"> 
<ref name="topic.element"/> 
</define> 
</include> 
<include href="hazardstatementDomainMod.rng"/> 
<include href="highlightDomainMod.rng"/> 
<include href="indexingDomainMod.rng"/> 
<include href="utilitiesDomainMod.rng"/> 
11/24/2014 Contrext, LLC 20
Modules are Self Integrating 
• Unilaterally extend the base patterns (from highlightDomainMod.rng): 
<define name="hi-d-ph"> 
<choice> 
<ref name="b.element"/> 
<ref name="i.element"/> 
<ref name="sup.element"/> 
<ref name="sub.element"/> 
<ref name="tt.element"/> 
<ref name="u.element"/> 
</choice> 
</define> 
<define name="ph" combine="choice"> 
<ref name="hi-d-ph"/> 
</define> 
• Only need to do something special when you need to impose constraints 
11/24/2014 Contrext, LLC 21
Compare With DTD 
<!-- ============================================================= --> 
<!-- TOPIC NESTING OVERRIDE --> 
<!-- ============================================================= --> 
<!ENTITY % topic-info-types 
"topic" 
> 
<!-- ============================================================= --> 
<!-- DOMAINS ATTRIBUTE OVERRIDE --> 
<!-- ============================================================= --> 
<!ENTITY included-domains 
"&hazard-d-att; 
&hi-d-att; 
&indexing-d-att; 
&ut-d-att; 
" 
> 
<!-- ============================================================= --> 
<!-- CONTENT CONSTRAINT INTEGRATION --> 
<!-- ============================================================= --> 
<!-- ============================================================= --> 
<!-- TOPIC ELEMENT INTEGRATION --> 
<!-- ============================================================= --> 
<!ENTITY % topic-type 
SYSTEM "topic.mod" 
>%topic-type; 
<!-- ============================================================= --> 
<!-- DOMAIN ELEMENT INTEGRATION --> 
<!-- ============================================================= --> 
<!ENTITY % hazard-d-def 
SYSTEM "hazardstatementDomain.mod" 
>%hazard-d-def; 
<!ENTITY % hi-d-def 
SYSTEM "highlightDomain.mod" 
>%hi-d-def; 
<!ENTITY % indexing-d-def 
SYSTEM "indexingDomain.mod" 
>%indexing-d-def; 
<!ENTITY % ut-d-def 
SYSTEM "utilitiesDomain.mod" 
>%ut-d-def; 
<!-- ============================================================= --> 
<!-- DOMAIN ENTITY DECLARATIONS --> 
<!-- ============================================================= --> 
<!ENTITY % hazard-d-dec 
SYSTEM "hazardstatementDomain.ent" 
>%hazard-d-dec; 
<!ENTITY % hi-d-dec 
SYSTEM "highlightDomain.ent" 
>%hi-d-dec; 
<!ENTITY % indexing-d-dec 
SYSTEM "indexingDomain.ent" 
>%indexing-d-dec; 
<!ENTITY % ut-d-dec 
SYSTEM "utilitiesDomain.ent" 
>%ut-d-dec; 
<!-- ============================================================= --> 
<!-- DOMAIN ATTRIBUTES DECLARATIONS --> 
<!-- ============================================================= --> 
<!-- ============================================================= --> 
<!-- DOMAIN EXTENSIONS --> 
<!-- ============================================================= --> 
<!-- One for each extended base element, with 
the name of the domain(s) in which the 
extension was declared --> 
<!ENTITY % note "note | 
%hazard-d-note; 
"> 
<!ENTITY % ph "ph | 
%hi-d-ph; 
"> 
<!ENTITY % index-base "index-base | 
%indexing-d-index-base; 
"> 
<!ENTITY % fig "fig | 
%ut-d-fig; 
"> 
<!-- ============================================================= --> 
<!-- DOMAIN ATTRIBUTE EXTENSIONS --> 
<!-- ============================================================= --> 
<!ENTITY % props-attribute-extensions 
"" 
> 
<!ENTITY % base-attribute-extensions 
"" 
> 
11/24/2014 Contrext, LLC 22
SEE HOW EASY: GENERATING 
DTD AND XSD SHELLS 
11/24/2014 Contrext, LLC 23
RNG-to-DITA DTD and XSD 
Converters 
• Generate conforming DTD and XSD shells and 
modules from DITA RELAX NG modules 
• Require DITA-specific metadata in the shells 
and modules 
• Maintained by the DITA Community under 
direction of the DITA TC 
– Eliot writes and maintains the code, the TC 
determines what the code needs to do to be 
correct and complete. 
11/24/2014 Contrext, LLC 24
DITA OT RNG Conversion Plugin 
• TC currently provides: 
– OT plugin for DITA 1.3 grammars: 
org.oasis-open.dita.dita13.doctypes 
– OT plugin for RNG conversion: 
org.oasis-open.dita.rng.converter 
• Defines transformation types: 
– rng2dtd 
– Rng2all 
• Requires Saxon 9.6+ 
11/24/2014 Contrext, LLC 25
File Organization Requirements 
• RNG files must be organized in the same way as 
the TC-provided files: 
– Top-level directory to hold all grammars types: 
• doctypes/ 
– Directory named “rng/” for RNG grammars: 
• doctypes/rng 
– Directory for each group of grammars (e.g., one per 
shell): 
• doctypes/rng/indirector 
– Directory named “rng” under that: 
• doctypes/rng/indirectory/rng 
11/24/2014 Contrext, LLC 26
Running The DTD Generator 
• Use transtype “rng2dtd” 
• Apply transform to file in parent directory 
containing all RNG modules: 
– E.g., catalog.xml in your doctypes/rng/ directory 
• By default, only generates shells 
11/24/2014 Contrext, LLC 27
Plugin Parameters 
• generateModules=true|false 
– Default is “false” (only generate shells) 
• usePublicIDsInShell=true|false 
– Default is true 
• generateCatalogs=true|false 
– Default is true 
11/24/2014 Contrext, LLC 28
Resources 
• RELAX NG specifications: http://relaxng.org 
• DITA 1.3 spec: http://tools.oasis-open. 
org/version-control/svn/dita/spec/ 
• DITA RELAX NG conversion tools: 
http://tools.oasis-open.org/version-control/ 
svn/dita/doctypes/tools/relaxng/ 
• Me: ekimber@contrext.com, 
http://contrext.com 
11/24/2014 Contrext, LLC 29

Weitere ähnliche Inhalte

Was ist angesagt? (19)

01 xml document structure
01 xml document structure01 xml document structure
01 xml document structure
 
Xml processors
Xml processorsXml processors
Xml processors
 
Xml
XmlXml
Xml
 
XML
XMLXML
XML
 
XMl
XMlXMl
XMl
 
Xml dom
Xml domXml dom
Xml dom
 
They Worked Before, What Happened? Understanding DITA Cross-Book Links
They Worked Before, What Happened? Understanding DITA Cross-Book Links They Worked Before, What Happened? Understanding DITA Cross-Book Links
They Worked Before, What Happened? Understanding DITA Cross-Book Links
 
XML Document Object Model (DOM)
XML Document Object Model (DOM)XML Document Object Model (DOM)
XML Document Object Model (DOM)
 
Understanding XML DOM
Understanding XML DOMUnderstanding XML DOM
Understanding XML DOM
 
XML's validation - XML Schema
XML's validation - XML SchemaXML's validation - XML Schema
XML's validation - XML Schema
 
XML for beginners
XML for beginnersXML for beginners
XML for beginners
 
Xml presentation
Xml presentationXml presentation
Xml presentation
 
XML2004
XML2004XML2004
XML2004
 
Xml Lecture Notes
Xml Lecture NotesXml Lecture Notes
Xml Lecture Notes
 
Xml schema
Xml schemaXml schema
Xml schema
 
02 xml schema
02 xml schema02 xml schema
02 xml schema
 
XML Schemas
XML SchemasXML Schemas
XML Schemas
 
Xsd
XsdXsd
Xsd
 
Dom parser
Dom parserDom parser
Dom parser
 

Ă„hnlich wie Generate DTD and XSD from RELAX NG for DITA Shells

Xml
XmlXml
XmlAnas Sa
 
Jdom how it works & how it opened the java process
Jdom how it works & how it opened the java processJdom how it works & how it opened the java process
Jdom how it works & how it opened the java processHicham QAISSI
 
DFDL and Apache Daffodil(tm) Overview from Owl Cyber Defense
DFDL and Apache Daffodil(tm) Overview from Owl Cyber DefenseDFDL and Apache Daffodil(tm) Overview from Owl Cyber Defense
DFDL and Apache Daffodil(tm) Overview from Owl Cyber DefenseMike Beckerle
 
DITA-Workshop on Saturday 5 May 2018 at Pune
DITA-Workshop on Saturday 5 May 2018 at PuneDITA-Workshop on Saturday 5 May 2018 at Pune
DITA-Workshop on Saturday 5 May 2018 at PuneAmit Siddhartha
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignLalit Kale
 
Data interchange integration, HTML XML Biological XML DTD
Data interchange integration, HTML XML Biological XML DTDData interchange integration, HTML XML Biological XML DTD
Data interchange integration, HTML XML Biological XML DTDAnushaMahmood
 
Anatomy of Autoconfig in Oracle E-Business Suite
Anatomy of Autoconfig in Oracle E-Business SuiteAnatomy of Autoconfig in Oracle E-Business Suite
Anatomy of Autoconfig in Oracle E-Business Suitevasuballa
 
Decoding and developing the online finding aid
Decoding and developing the online finding aidDecoding and developing the online finding aid
Decoding and developing the online finding aidkgerber
 
DITA Quick Start for Authors - Part I
DITA Quick Start for Authors - Part IDITA Quick Start for Authors - Part I
DITA Quick Start for Authors - Part ISuite Solutions
 
Unit iv xml dom
Unit iv xml domUnit iv xml dom
Unit iv xml domsmitha273566
 
NoSQL Endgame LWJUG 2021
NoSQL Endgame LWJUG 2021NoSQL Endgame LWJUG 2021
NoSQL Endgame LWJUG 2021Thodoris Bais
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Modelchomas kandar
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Modelchomas kandar
 
XSLT Magic Tricks with DITA and FrameMaker
XSLT Magic Tricks with DITA and FrameMakerXSLT Magic Tricks with DITA and FrameMaker
XSLT Magic Tricks with DITA and FrameMakerContrext Solutions
 
EAD Revision Progress Report, 2012-08-08
EAD Revision Progress Report, 2012-08-08EAD Revision Progress Report, 2012-08-08
EAD Revision Progress Report, 2012-08-08Michael Rush
 
DITA Quick Start Webinar Series: Getting Started with the DITA Open Toolkit
DITA Quick Start Webinar Series: Getting Started with the DITA Open ToolkitDITA Quick Start Webinar Series: Getting Started with the DITA Open Toolkit
DITA Quick Start Webinar Series: Getting Started with the DITA Open ToolkitSuite Solutions
 

Ă„hnlich wie Generate DTD and XSD from RELAX NG for DITA Shells (20)

Xml
XmlXml
Xml
 
23xml
23xml23xml
23xml
 
Jdom how it works & how it opened the java process
Jdom how it works & how it opened the java processJdom how it works & how it opened the java process
Jdom how it works & how it opened the java process
 
DFDL and Apache Daffodil(tm) Overview from Owl Cyber Defense
DFDL and Apache Daffodil(tm) Overview from Owl Cyber DefenseDFDL and Apache Daffodil(tm) Overview from Owl Cyber Defense
DFDL and Apache Daffodil(tm) Overview from Owl Cyber Defense
 
DITA-Workshop on Saturday 5 May 2018 at Pune
DITA-Workshop on Saturday 5 May 2018 at PuneDITA-Workshop on Saturday 5 May 2018 at Pune
DITA-Workshop on Saturday 5 May 2018 at Pune
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Data interchange integration, HTML XML Biological XML DTD
Data interchange integration, HTML XML Biological XML DTDData interchange integration, HTML XML Biological XML DTD
Data interchange integration, HTML XML Biological XML DTD
 
Anatomy of Autoconfig in Oracle E-Business Suite
Anatomy of Autoconfig in Oracle E-Business SuiteAnatomy of Autoconfig in Oracle E-Business Suite
Anatomy of Autoconfig in Oracle E-Business Suite
 
Decoding and developing the online finding aid
Decoding and developing the online finding aidDecoding and developing the online finding aid
Decoding and developing the online finding aid
 
DITA Quick Start for Authors - Part I
DITA Quick Start for Authors - Part IDITA Quick Start for Authors - Part I
DITA Quick Start for Authors - Part I
 
Unit iv xml dom
Unit iv xml domUnit iv xml dom
Unit iv xml dom
 
NoSQL Endgame LWJUG 2021
NoSQL Endgame LWJUG 2021NoSQL Endgame LWJUG 2021
NoSQL Endgame LWJUG 2021
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Developing dita maps
Developing dita mapsDeveloping dita maps
Developing dita maps
 
Processing XML
Processing XMLProcessing XML
Processing XML
 
Markup For Dummies (Russ Ward)
Markup For Dummies (Russ Ward)Markup For Dummies (Russ Ward)
Markup For Dummies (Russ Ward)
 
XSLT Magic Tricks with DITA and FrameMaker
XSLT Magic Tricks with DITA and FrameMakerXSLT Magic Tricks with DITA and FrameMaker
XSLT Magic Tricks with DITA and FrameMaker
 
EAD Revision Progress Report, 2012-08-08
EAD Revision Progress Report, 2012-08-08EAD Revision Progress Report, 2012-08-08
EAD Revision Progress Report, 2012-08-08
 
DITA Quick Start Webinar Series: Getting Started with the DITA Open Toolkit
DITA Quick Start Webinar Series: Getting Started with the DITA Open ToolkitDITA Quick Start Webinar Series: Getting Started with the DITA Open Toolkit
DITA Quick Start Webinar Series: Getting Started with the DITA Open Toolkit
 

Mehr von Contrext Solutions

Stupid DITA Tricks: After-The-Fact Specialization: Treating Aircraft Manuals ...
Stupid DITA Tricks:After-The-Fact Specialization: Treating Aircraft Manuals ...Stupid DITA Tricks:After-The-Fact Specialization: Treating Aircraft Manuals ...
Stupid DITA Tricks: After-The-Fact Specialization: Treating Aircraft Manuals ...Contrext Solutions
 
Loose Leaf Publishing Using Antenna House Formatter and CSS for Pagination
Loose Leaf Publishing Using Antenna House Formatter and CSS for PaginationLoose Leaf Publishing Using Antenna House Formatter and CSS for Pagination
Loose Leaf Publishing Using Antenna House Formatter and CSS for PaginationContrext Solutions
 
Definition of the DITA Glossary: Or How to Get Some Cool Glossary Tools for Free
Definition of the DITA Glossary: Or How to Get Some Cool Glossary Tools for FreeDefinition of the DITA Glossary: Or How to Get Some Cool Glossary Tools for Free
Definition of the DITA Glossary: Or How to Get Some Cool Glossary Tools for FreeContrext Solutions
 
Twisted XSL Tricks: Column Switching for FOP
Twisted XSL Tricks: Column Switching for FOPTwisted XSL Tricks: Column Switching for FOP
Twisted XSL Tricks: Column Switching for FOPContrext Solutions
 
Can I Have a Word: Managing Shared Glossaries and References to Terms With DITA
Can I Have a Word: Managing Shared Glossaries and References to Terms With DITACan I Have a Word: Managing Shared Glossaries and References to Terms With DITA
Can I Have a Word: Managing Shared Glossaries and References to Terms With DITAContrext Solutions
 
Ki, Qi, Key: The Way of DITA Harmony With Keys and Key References
Ki, Qi, Key: The Way of DITA Harmony With Keys and Key ReferencesKi, Qi, Key: The Way of DITA Harmony With Keys and Key References
Ki, Qi, Key: The Way of DITA Harmony With Keys and Key ReferencesContrext Solutions
 
Content Management on Zero Budget: DITA for Small Teams
Content Management on Zero Budget: DITA for Small TeamsContent Management on Zero Budget: DITA for Small Teams
Content Management on Zero Budget: DITA for Small TeamsContrext Solutions
 
Using CSS Paging to Render DITA Documents
Using CSS Paging to Render DITA DocumentsUsing CSS Paging to Render DITA Documents
Using CSS Paging to Render DITA DocumentsContrext Solutions
 
Locale-Aware Sorting and Text Handling in the Open Toolkit
Locale-Aware Sorting and Text Handling in the Open ToolkitLocale-Aware Sorting and Text Handling in the Open Toolkit
Locale-Aware Sorting and Text Handling in the Open ToolkitContrext Solutions
 
DITA for Small Teams Workshop (Tekom 2017)
DITA for Small Teams Workshop (Tekom 2017)DITA for Small Teams Workshop (Tekom 2017)
DITA for Small Teams Workshop (Tekom 2017)Contrext Solutions
 
Can I Have a Word: Managing Shared Glossaries and References to Terms With DITA
Can I Have a Word: Managing Shared Glossaries and References to Terms With DITACan I Have a Word: Managing Shared Glossaries and References to Terms With DITA
Can I Have a Word: Managing Shared Glossaries and References to Terms With DITAContrext Solutions
 
FrameMaker and the DITA Open Toolkit
FrameMaker and the DITA Open ToolkitFrameMaker and the DITA Open Toolkit
FrameMaker and the DITA Open ToolkitContrext Solutions
 
DITA Reuse Challenges and Response
DITA Reuse Challenges and ResponseDITA Reuse Challenges and Response
DITA Reuse Challenges and ResponseContrext Solutions
 
Managing Multiple Open Toolkit Configurations Using git Lightning Talk
Managing Multiple Open Toolkit Configurations Using git Lightning TalkManaging Multiple Open Toolkit Configurations Using git Lightning Talk
Managing Multiple Open Toolkit Configurations Using git Lightning TalkContrext Solutions
 
DITA OT Day 2015 Lightning Talk On The DITA Community Project
DITA OT Day 2015 Lightning Talk On The DITA Community ProjectDITA OT Day 2015 Lightning Talk On The DITA Community Project
DITA OT Day 2015 Lightning Talk On The DITA Community ProjectContrext Solutions
 
No Ki Magic: Managing Complex DITA Hyperdocuments
No Ki Magic: Managing Complex DITA HyperdocumentsNo Ki Magic: Managing Complex DITA Hyperdocuments
No Ki Magic: Managing Complex DITA HyperdocumentsContrext Solutions
 
Poster: Cross-Document Linking in DITA
Poster: Cross-Document Linking in DITAPoster: Cross-Document Linking in DITA
Poster: Cross-Document Linking in DITAContrext Solutions
 
Managing Deliverable-Specific Link Anchors: New Suggested Best Practice for Keys
Managing Deliverable-Specific Link Anchors: New Suggested Best Practice for KeysManaging Deliverable-Specific Link Anchors: New Suggested Best Practice for Keys
Managing Deliverable-Specific Link Anchors: New Suggested Best Practice for KeysContrext Solutions
 

Mehr von Contrext Solutions (20)

Stupid DITA Tricks: After-The-Fact Specialization: Treating Aircraft Manuals ...
Stupid DITA Tricks:After-The-Fact Specialization: Treating Aircraft Manuals ...Stupid DITA Tricks:After-The-Fact Specialization: Treating Aircraft Manuals ...
Stupid DITA Tricks: After-The-Fact Specialization: Treating Aircraft Manuals ...
 
Loose Leaf Publishing Using Antenna House Formatter and CSS for Pagination
Loose Leaf Publishing Using Antenna House Formatter and CSS for PaginationLoose Leaf Publishing Using Antenna House Formatter and CSS for Pagination
Loose Leaf Publishing Using Antenna House Formatter and CSS for Pagination
 
Definition of the DITA Glossary: Or How to Get Some Cool Glossary Tools for Free
Definition of the DITA Glossary: Or How to Get Some Cool Glossary Tools for FreeDefinition of the DITA Glossary: Or How to Get Some Cool Glossary Tools for Free
Definition of the DITA Glossary: Or How to Get Some Cool Glossary Tools for Free
 
Twisted XSL Tricks: Column Switching for FOP
Twisted XSL Tricks: Column Switching for FOPTwisted XSL Tricks: Column Switching for FOP
Twisted XSL Tricks: Column Switching for FOP
 
Can I Have a Word: Managing Shared Glossaries and References to Terms With DITA
Can I Have a Word: Managing Shared Glossaries and References to Terms With DITACan I Have a Word: Managing Shared Glossaries and References to Terms With DITA
Can I Have a Word: Managing Shared Glossaries and References to Terms With DITA
 
Ki, Qi, Key: The Way of DITA Harmony With Keys and Key References
Ki, Qi, Key: The Way of DITA Harmony With Keys and Key ReferencesKi, Qi, Key: The Way of DITA Harmony With Keys and Key References
Ki, Qi, Key: The Way of DITA Harmony With Keys and Key References
 
Content Management on Zero Budget: DITA for Small Teams
Content Management on Zero Budget: DITA for Small TeamsContent Management on Zero Budget: DITA for Small Teams
Content Management on Zero Budget: DITA for Small Teams
 
Using CSS Paging to Render DITA Documents
Using CSS Paging to Render DITA DocumentsUsing CSS Paging to Render DITA Documents
Using CSS Paging to Render DITA Documents
 
Locale-Aware Sorting and Text Handling in the Open Toolkit
Locale-Aware Sorting and Text Handling in the Open ToolkitLocale-Aware Sorting and Text Handling in the Open Toolkit
Locale-Aware Sorting and Text Handling in the Open Toolkit
 
DITA for Small Teams Workshop (Tekom 2017)
DITA for Small Teams Workshop (Tekom 2017)DITA for Small Teams Workshop (Tekom 2017)
DITA for Small Teams Workshop (Tekom 2017)
 
Can I Have a Word: Managing Shared Glossaries and References to Terms With DITA
Can I Have a Word: Managing Shared Glossaries and References to Terms With DITACan I Have a Word: Managing Shared Glossaries and References to Terms With DITA
Can I Have a Word: Managing Shared Glossaries and References to Terms With DITA
 
FrameMaker and the DITA Open Toolkit
FrameMaker and the DITA Open ToolkitFrameMaker and the DITA Open Toolkit
FrameMaker and the DITA Open Toolkit
 
DITA Reuse Challenges and Response
DITA Reuse Challenges and ResponseDITA Reuse Challenges and Response
DITA Reuse Challenges and Response
 
Managing Multiple Open Toolkit Configurations Using git Lightning Talk
Managing Multiple Open Toolkit Configurations Using git Lightning TalkManaging Multiple Open Toolkit Configurations Using git Lightning Talk
Managing Multiple Open Toolkit Configurations Using git Lightning Talk
 
DITA OT Day 2015 Lightning Talk On The DITA Community Project
DITA OT Day 2015 Lightning Talk On The DITA Community ProjectDITA OT Day 2015 Lightning Talk On The DITA Community Project
DITA OT Day 2015 Lightning Talk On The DITA Community Project
 
Why Is DITA So Hard?
Why Is DITA So Hard?Why Is DITA So Hard?
Why Is DITA So Hard?
 
No Ki Magic: Managing Complex DITA Hyperdocuments
No Ki Magic: Managing Complex DITA HyperdocumentsNo Ki Magic: Managing Complex DITA Hyperdocuments
No Ki Magic: Managing Complex DITA Hyperdocuments
 
Poster: Cross-Document Linking in DITA
Poster: Cross-Document Linking in DITAPoster: Cross-Document Linking in DITA
Poster: Cross-Document Linking in DITA
 
DITA for Small Teams
DITA for Small TeamsDITA for Small Teams
DITA for Small Teams
 
Managing Deliverable-Specific Link Anchors: New Suggested Best Practice for Keys
Managing Deliverable-Specific Link Anchors: New Suggested Best Practice for KeysManaging Deliverable-Specific Link Anchors: New Suggested Best Practice for Keys
Managing Deliverable-Specific Link Anchors: New Suggested Best Practice for Keys
 

KĂĽrzlich hochgeladen

Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy LĂłpez
 

KĂĽrzlich hochgeladen (20)

Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 

Generate DTD and XSD from RELAX NG for DITA Shells

  • 1. RELAX NG to DTD and XSD using the Open Toolkit Using RELAX NG for DITA shells and modules Eliot Kimber Contrext, LLC DITA OT Day Munich 2014 11/24/2014 Contrext, LLC 1
  • 2. About the Author • Responsible for DITA 1.3 grammar files • Independent consultant focusing on DITA analysis, design, and implementation • Doing SGML and XML for cough 30 years cough • Founding member of the DITA Technical Committee • Founding member of the XML Working Group • Co-editor of HyTime standard (ISO/IEC 10744) • Primary developer and founder of the DITA for Publishers project • Author of DITA for Practitioners, Vol 1 (XML Press) 11/24/2014 Contrext, LLC 2
  • 3. Agenda • A brief demonstration • What is RELAX NG? • RELAX NG and DITA • DITA document types and modules • Anatomy of a RELAX NG shell • See how easy: generating DTD and XSD shells 11/24/2014 Contrext, LLC 3
  • 4. Executive Summary • RELAX NG makes XML vocabulary definition much, much easier • RELAX NG is a good match to DITA requirements • Can generate conforming DITA DTD and XSD files from RELAX NG • Makes creating DITA document type shells about as easy as it can be • No more need to fight with DTD or XSD syntax 11/24/2014 Contrext, LLC 4
  • 5. Demonstration • Create a new document type shell • Create a new domain specialization • Create a new topic speicalization • Generate DTD and XSD versions of all of these grammars 11/24/2014 Contrext, LLC 5
  • 6. WHAT IS RELAX NG? 11/24/2014 Contrext, LLC 6
  • 7. RELAX NG is • A grammar (or schema) language for XML documents • An OASIS and ISO/IEC standard (ISO/IEC 19757-2) • Most like XML DTDs but easier to use • Designed to be as simple as possible • Used for other XML standards, most prominently DocBook 11/24/2014 Contrext, LLC 7
  • 8. RELAX NG Basics • RELAX NG has both an XML and character-based syntax: <grammar> <start> <ref name=“concept.element”/> </start> … </grammar> ______________________________________ grammar { start concept.element … } • The two are functionally equivalent 11/24/2014 Contrext, LLC 8
  • 9. RELAX NG Basics (cont.) • A RELAX NG grammar defines a set of “patterns” that documents must match • Patterns can have names (analagous to DTD parameter entities) • Pattern combination mechanisms are more flexible than DTD parameter entities or XSD groups • Grammars can be modularized into multiple files 11/24/2014 Contrext, LLC 9
  • 10. RELAX NG AND DITA 11/24/2014 Contrext, LLC 10
  • 11. Good Match to DITA Requirements • RELAX NG’s pattern-based approach works well with DITA’s modular vocabulary • Patterns can allow extension by other patterns • Patterns can unilaterally extend other patterns: the extending pattern names the pattern it extends • Makes combining vocabularies as easy as it could be 11/24/2014 Contrext, LLC 11
  • 12. No Added Overhead • Unlike DTDs, RELAX NG has much simpler and easier-to-use syntax • Avoids the conceptual and syntactic complexity of XSD • Close semantic match to existing DTD-defined rules 11/24/2014 Contrext, LLC 12
  • 13. Does require DTD Compatibility Feature • Base RELAX NG standard does not provide for defining attribute defaults • Companion standard RELAX NG DTD Compatibility provides attribute defaults • DITA depends on default attribute values • George Bina (oXygenXML) has implemented DTD compatibility in Java for use with Xerces XML parser (open source) 11/24/2014 Contrext, LLC 13
  • 14. Result: Everything is Awesome • RELAX NG makes DITA document type shells as easy to create as it can be • Can generate DITA-conforming DTDs and XSDs from the RELAX NG grammars • Makes it possible, if not in fact easy, for anybody to configure their own DITA document types 11/24/2014 Contrext, LLC 14
  • 15. DITA DOCUMENT TYPES AND SHELLS 11/24/2014 Contrext, LLC 15
  • 16. DITA Document Types • A DITA document type is a unique set of vocabulary and constraint modules • Modules are invariant – Every copy of a given module should be identical – You never modify modules directly • You implement DITA document types by integrating vocabulary and constraint modules using a document type shell 11/24/2014 Contrext, LLC 16
  • 17. Document Type Shells • Integrate modules to form a working document schema • Refer to the vocabulary and constraint modules of the DITA document type • Do any configuration required • Two document type shells that integrate the same same set of modules implement the same DITA document type 11/24/2014 Contrext, LLC 17
  • 18. ANATOMY OF A RELAX NG SHELL 11/24/2014 Contrext, LLC 18
  • 19. Shell for Base Topic Document Type (basetopic.rng) <grammar xmlns=http://relaxng.org/ns/structure/1.0 xmlns:dita="http://dita.oasis-open.org/architecture/2005/" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"> … <div> <a:documentation>ROOT ELEMENT DECLARATION</a:documentation> <start combine="choice"> <ref name="topic.element"/> </start> </div> <div> <a:documentation>DOMAINS ATTRIBUTE</a:documentation> <define name="domains-att"> <attribute name="domains" a:defaultValue=”(topic topic) (topic hazard-d) (topic hi-d) (topic indexing-d) (topic ut-d) (topic hazard-d)”/> </define> </div> <div> <a:documentation>MODULE INCLUSIONS</a:documentation> <include href="topicMod.rng"> <define name="topic-info-types"> <ref name="topic.element"/> </define> </include> <include href="hazardstatementDomainMod.rng"/> <include href="highlightDomainMod.rng"/> <include href="indexingDomainMod.rng"/> <include href="utilitiesDomainMod.rng"/> </div> … </grammar> 11/24/2014 Contrext, LLC 19
  • 20. Integration: Just Include the Module • All you do is include the module you want to integrate: <include href="topicMod.rng"> <define name="topic-info-types"> <ref name="topic.element"/> </define> </include> <include href="hazardstatementDomainMod.rng"/> <include href="highlightDomainMod.rng"/> <include href="indexingDomainMod.rng"/> <include href="utilitiesDomainMod.rng"/> 11/24/2014 Contrext, LLC 20
  • 21. Modules are Self Integrating • Unilaterally extend the base patterns (from highlightDomainMod.rng): <define name="hi-d-ph"> <choice> <ref name="b.element"/> <ref name="i.element"/> <ref name="sup.element"/> <ref name="sub.element"/> <ref name="tt.element"/> <ref name="u.element"/> </choice> </define> <define name="ph" combine="choice"> <ref name="hi-d-ph"/> </define> • Only need to do something special when you need to impose constraints 11/24/2014 Contrext, LLC 21
  • 22. Compare With DTD <!-- ============================================================= --> <!-- TOPIC NESTING OVERRIDE --> <!-- ============================================================= --> <!ENTITY % topic-info-types "topic" > <!-- ============================================================= --> <!-- DOMAINS ATTRIBUTE OVERRIDE --> <!-- ============================================================= --> <!ENTITY included-domains "&hazard-d-att; &hi-d-att; &indexing-d-att; &ut-d-att; " > <!-- ============================================================= --> <!-- CONTENT CONSTRAINT INTEGRATION --> <!-- ============================================================= --> <!-- ============================================================= --> <!-- TOPIC ELEMENT INTEGRATION --> <!-- ============================================================= --> <!ENTITY % topic-type SYSTEM "topic.mod" >%topic-type; <!-- ============================================================= --> <!-- DOMAIN ELEMENT INTEGRATION --> <!-- ============================================================= --> <!ENTITY % hazard-d-def SYSTEM "hazardstatementDomain.mod" >%hazard-d-def; <!ENTITY % hi-d-def SYSTEM "highlightDomain.mod" >%hi-d-def; <!ENTITY % indexing-d-def SYSTEM "indexingDomain.mod" >%indexing-d-def; <!ENTITY % ut-d-def SYSTEM "utilitiesDomain.mod" >%ut-d-def; <!-- ============================================================= --> <!-- DOMAIN ENTITY DECLARATIONS --> <!-- ============================================================= --> <!ENTITY % hazard-d-dec SYSTEM "hazardstatementDomain.ent" >%hazard-d-dec; <!ENTITY % hi-d-dec SYSTEM "highlightDomain.ent" >%hi-d-dec; <!ENTITY % indexing-d-dec SYSTEM "indexingDomain.ent" >%indexing-d-dec; <!ENTITY % ut-d-dec SYSTEM "utilitiesDomain.ent" >%ut-d-dec; <!-- ============================================================= --> <!-- DOMAIN ATTRIBUTES DECLARATIONS --> <!-- ============================================================= --> <!-- ============================================================= --> <!-- DOMAIN EXTENSIONS --> <!-- ============================================================= --> <!-- One for each extended base element, with the name of the domain(s) in which the extension was declared --> <!ENTITY % note "note | %hazard-d-note; "> <!ENTITY % ph "ph | %hi-d-ph; "> <!ENTITY % index-base "index-base | %indexing-d-index-base; "> <!ENTITY % fig "fig | %ut-d-fig; "> <!-- ============================================================= --> <!-- DOMAIN ATTRIBUTE EXTENSIONS --> <!-- ============================================================= --> <!ENTITY % props-attribute-extensions "" > <!ENTITY % base-attribute-extensions "" > 11/24/2014 Contrext, LLC 22
  • 23. SEE HOW EASY: GENERATING DTD AND XSD SHELLS 11/24/2014 Contrext, LLC 23
  • 24. RNG-to-DITA DTD and XSD Converters • Generate conforming DTD and XSD shells and modules from DITA RELAX NG modules • Require DITA-specific metadata in the shells and modules • Maintained by the DITA Community under direction of the DITA TC – Eliot writes and maintains the code, the TC determines what the code needs to do to be correct and complete. 11/24/2014 Contrext, LLC 24
  • 25. DITA OT RNG Conversion Plugin • TC currently provides: – OT plugin for DITA 1.3 grammars: org.oasis-open.dita.dita13.doctypes – OT plugin for RNG conversion: org.oasis-open.dita.rng.converter • Defines transformation types: – rng2dtd – Rng2all • Requires Saxon 9.6+ 11/24/2014 Contrext, LLC 25
  • 26. File Organization Requirements • RNG files must be organized in the same way as the TC-provided files: – Top-level directory to hold all grammars types: • doctypes/ – Directory named “rng/” for RNG grammars: • doctypes/rng – Directory for each group of grammars (e.g., one per shell): • doctypes/rng/indirector – Directory named “rng” under that: • doctypes/rng/indirectory/rng 11/24/2014 Contrext, LLC 26
  • 27. Running The DTD Generator • Use transtype “rng2dtd” • Apply transform to file in parent directory containing all RNG modules: – E.g., catalog.xml in your doctypes/rng/ directory • By default, only generates shells 11/24/2014 Contrext, LLC 27
  • 28. Plugin Parameters • generateModules=true|false – Default is “false” (only generate shells) • usePublicIDsInShell=true|false – Default is true • generateCatalogs=true|false – Default is true 11/24/2014 Contrext, LLC 28
  • 29. Resources • RELAX NG specifications: http://relaxng.org • DITA 1.3 spec: http://tools.oasis-open. org/version-control/svn/dita/spec/ • DITA RELAX NG conversion tools: http://tools.oasis-open.org/version-control/ svn/dita/doctypes/tools/relaxng/ • Me: ekimber@contrext.com, http://contrext.com 11/24/2014 Contrext, LLC 29