Skip to content

Commit 9d5684e

Browse files
author
Sanders Kleinfeld
committed
Merge pull request #33 from oreillymedia/xmlschema
Updated mappings doc and minor schema tweaks
2 parents 9414972 + 27081cd commit 9d5684e

File tree

3 files changed

+389
-350
lines changed

3 files changed

+389
-350
lines changed

htmlbook.xsd

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?xml version="1.0"?>
22
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:svg="http://www.w3.org/2000/svg" targetNamespace="http://www.w3.org/1999/xhtml" elementFormDefault="qualified" attributeFormDefault="unqualified">
33

4+
<!-- ToDos: Indexterm data attributes; special schema for footnotes (thinking <aside class="footnote">); enumerated class for admonitions/examples on div? -->
5+
46
<xs:import namespace="http://www.w3.org/1998/Math/MathML" schemaLocation="mathml3/mathml3.xsd"/>
57
<xs:import namespace="http://www.w3.org/2000/svg" schemaLocation="svg/SVG.xsd"/>
68

@@ -36,6 +38,7 @@
3638
<xs:element ref="h1"/>
3739
<xs:element name="h2" minOccurs="0" type="subheading"/>
3840
<xs:choice maxOccurs="unbounded">
41+
<xs:element ref="nav"/>
3942
<xs:element name="section" type="bookmaindiv"/>
4043
<!-- Separate out parts, as they have specific child requirements -->
4144
<xs:element name="div" type="bookpart"/>
@@ -314,7 +317,6 @@
314317
<xs:element ref="map"/>
315318
<xs:element ref="mml:math"/>
316319
<xs:element ref="menu"/>
317-
<xs:element ref="nav"/>
318320
<xs:element ref="object"/>
319321
<xs:element ref="ol"/>
320322
<xs:element ref="p"/>
@@ -435,7 +437,8 @@
435437
<xs:group ref="headings" minOccurs="0"/>
436438
<xs:element name="ol" type="nav_doc_ol"/>
437439
</xs:sequence>
438-
<xs:attributeGroup ref="globals"/>
440+
<xs:attribute name="class" use="required" fixed="toc"/>
441+
<xs:attributeGroup ref="globals_minus_class"/>
439442
</xs:complexType>
440443
</xs:element>
441444

@@ -487,7 +490,15 @@
487490

488491
<xs:element name="p" type="inline_children_only"/>
489492

490-
<xs:element name="pre" type="inline_children_only"/>
493+
<xs:element name="pre">
494+
<xs:complexType>
495+
<xs:complexContent>
496+
<xs:extension base="inline_children_only">
497+
<xs:attribute name="data-language" type="xs:token"/>
498+
</xs:extension>
499+
</xs:complexContent>
500+
</xs:complexType>
501+
</xs:element>
491502

492503
<!-- Default global version of "section" element is for chapter-level book divisions
493504
(allows for modularization of HTML files at the chapter level),
@@ -1492,6 +1503,7 @@
14921503
<xs:enumeration value="dedication"/>
14931504
<xs:enumeration value="foreword"/>
14941505
<xs:enumeration value="glossary"/>
1506+
<xs:enumeration value="halftitlepage"/>
14951507
<xs:enumeration value="index"/>
14961508
<xs:enumeration value="introduction"/>
14971509
<xs:enumeration value="preface"/>
@@ -1712,8 +1724,7 @@
17121724
<xs:group ref="blockelements" minOccurs="0" maxOccurs="unbounded"/>
17131725
</xs:sequence>
17141726
<!-- Note: special class attr restrictions here -->
1715-
<xs:attribute name="class" use="required" fixed="sidebar"/>
1716-
<xs:attributeGroup ref="globals_minus_class"/>
1727+
<xs:attributeGroup ref="globals"/>
17171728
</xs:complexType>
17181729

17191730
<!-- Subheadings: support subtitles, author attributions, etc. -->
@@ -1820,7 +1831,6 @@
18201831
<xs:element ref="map"/>
18211832
<xs:element ref="mml:math"/>
18221833
<xs:element ref="menu"/>
1823-
<xs:element ref="nav"/>
18241834
<xs:element ref="object"/>
18251835
<xs:element ref="ol"/>
18261836
<xs:element ref="p"/>

0 commit comments

Comments
 (0)