diff --git a/Doc/Ref/src/Dtd/book/v5/book.xsd b/Doc/Ref/src/Dtd/book/v5/book.xsd index 29215a90f454cf18073340b58ba8fd362ca028c7..73135729bdfe8d762ac0e314ec8c1ddeeda40578 100644 --- a/Doc/Ref/src/Dtd/book/v5/book.xsd +++ b/Doc/Ref/src/Dtd/book/v5/book.xsd @@ -1,21 +1,86 @@ -<!ENTITY % table.mod SYSTEM "table.mod" > -%table.mod; +<?xml version="1.0" encoding="UTF-8"?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" + vc:minVersion="1.0" vc:maxVersion="1.1"> + + <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd" /> + + + <xs:include schemaLocation="table.xsd"/> -<!ELEMENT book (title, chapter+)> -<!ATTLIST book lang (en|fr|de|it|es) #IMPLIED > -<!ELEMENT chapter (title, (para|itemizedlist|table)+)> -<!ATTLIST chapter - id ID #IMPLIED > -<!ELEMENT title (#PCDATA)> -<!ELEMENT para (#PCDATA|emphasis|link)*> -<!ATTLIST para - id ID #IMPLIED > -<!ELEMENT emphasis (#PCDATA)> -<!ELEMENT link (#PCDATA)> -<!ATTLIST link - linkend IDREF #REQUIRED > + <!-- Type definitions --> + <xs:simpleType name="languageType"> + <xs:restriction base="xs:string"> + <xs:enumeration value="en"/> + <xs:enumeration value="fr"/> + <xs:enumeration value="de"/> + <xs:enumeration value="it"/> + <xs:enumeration value="es"/> + </xs:restriction> + </xs:simpleType> + -<!ELEMENT itemizedlist (listitem+)> -<!ATTLIST itemizedlist - id ID #IMPLIED > -<!ELEMENT listitem ((para|itemizedlist)+)> \ No newline at end of file + <!-- Elements having no inner structure --> + <xs:element name="emphasis" type="xs:string"/> + <xs:element name="title" type="xs:string"/> + <xs:element name="link"> + <xs:complexType mixed="true"> + <xs:attribute name="linkend" type="xs:IDREF" use="required"/> + </xs:complexType> + </xs:element> + + <!-- Starting the game ... --> + <xs:element name="book"> + <xs:complexType> + <xs:sequence> + <xs:element ref="title"/> + <xs:element ref="chapter" minOccurs="1" maxOccurs="unbounded"/> + </xs:sequence> + <xs:attribute name="lang" type="languageType" use="optional"/> + </xs:complexType> + </xs:element> + + <xs:element name="chapter"> + <xs:complexType> + <xs:sequence> + <xs:element ref="title"/> + <xs:choice minOccurs="1" maxOccurs="unbounded"> + <xs:element ref="para"/> + <xs:element ref="itemizedlist"/> + <xs:element ref="table"/> + </xs:choice> + </xs:sequence> + <xs:attribute name="id" type="xs:ID" use="optional"/> + <xs:attribute ref="xml:base"/> <!-- This allows for <xi:include ...> --> + </xs:complexType> + </xs:element> + + <xs:element name="para"> + <xs:complexType mixed="true"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element ref="emphasis"/> + <xs:element ref="link"/> + </xs:choice> + <xs:attribute name="id" type="xs:ID" use="optional"/> + </xs:complexType> + </xs:element> + + <xs:element name="itemizedlist"> + <xs:complexType> + <xs:sequence> + <xs:element ref="listitem" minOccurs="1" maxOccurs="unbounded"/> + </xs:sequence> + <xs:attribute name="id" type="xs:ID" use="optional"/> + </xs:complexType> + </xs:element> + + <xs:element name="listitem"> + <xs:complexType> + <xs:choice minOccurs="1" maxOccurs="unbounded"> + <xs:element ref="para"/> + <xs:element ref="itemizedlist"/> + </xs:choice> + </xs:complexType> + </xs:element> + +</xs:schema> diff --git a/Doc/Ref/src/Dtd/book/v5/chap1.xml b/Doc/Ref/src/Dtd/book/v5/chap1.xml index 2ed7bef15cb623dff26f0802f51882c60e685f0a..e4053646b02dd96396cf3c32a78eaf59d430a189 100644 --- a/Doc/Ref/src/Dtd/book/v5/chap1.xml +++ b/Doc/Ref/src/Dtd/book/v5/chap1.xml @@ -1,5 +1,15 @@ <?xml version="1.0" encoding="UTF-8"?> -<chapter id="firstChapter"> +<!-- +<chapter> <title>This is the first chapter</title> <para>We add some text here.</para> </chapter> + +--> +<chapter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="book.xsd" id="firstChapter"> + <title>This is the first chapter</title> + <para>We add some text here.</para> +</chapter> + + diff --git a/Doc/Ref/src/Dtd/book/v5/chap2.xml b/Doc/Ref/src/Dtd/book/v5/chap2.xml index 5568ef1901203f9fbe65cdfb90a985e61967f345..85effcbf0c8118b0b262cbe04efffb325b75af51 100644 --- a/Doc/Ref/src/Dtd/book/v5/chap2.xml +++ b/Doc/Ref/src/Dtd/book/v5/chap2.xml @@ -1,5 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> -<chapter> + +<chapter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="book.xsd" > <title>This is the second chapter</title> <para>This is a <link linkend="firstChapter">reference</link>.</para> -</chapter> \ No newline at end of file +</chapter> diff --git a/Doc/Ref/src/Dtd/book/v5/java.xml b/Doc/Ref/src/Dtd/book/v5/java.xml index 8ab5c617bce9937eb10df528ad1f9137acb1bfb7..2f7859529c9e08c7a2778e79d58b798c2af96572 100644 --- a/Doc/Ref/src/Dtd/book/v5/java.xml +++ b/Doc/Ref/src/Dtd/book/v5/java.xml @@ -1,31 +1,32 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE book SYSTEM "book.dtd"> -<book lang="en"> - <title>Introduction to Java</title> - <chapter id="introJava"> - <title>Java types</title> - <table border="1"> - <caption>A table caption</caption> - <tr> - <td rowspan="2">A cell spanning two columns</td> - <td>a single cell</td> - </tr> - <tr><td>another single cell</td></tr> - <tr><td colspan="2">A cell spanning two rows</td></tr> - </table> - <para id="p">A paragraph with id attribute.</para> - </chapter> - <chapter> - <title>Advanced topics</title> - <itemizedlist> - <listitem><para>Point A</para></listitem> - <listitem> + +<book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="book.xsd" lang="en"> + <title>Introduction to Java</title> + <chapter id="introJava"> + <title>Java types</title> + <table border="1"> + <caption>A table caption</caption> + <tr> + <td rowspan="2">A cell spanning two columns</td> + <td>a single cell</td> + </tr> + <tr><td>another single cell</td></tr> + <tr><td colspan="2">A cell spanning two rows</td></tr> + </table> + <para id="p">A paragraph with id attribute.</para> + </chapter> + <chapter> + <title>Advanced topics</title> <itemizedlist> - <listitem><para>Point B 1</para></listitem> - <listitem><para>Point B 2</para></listitem> + <listitem><para>Point A</para></listitem> + <listitem> + <itemizedlist> + <listitem><para>Point B 1</para></listitem> + <listitem><para>Point B 2</para></listitem> + </itemizedlist> + </listitem> </itemizedlist> - </listitem> - </itemizedlist> - <para>Documentation on <link linkend="introJava">types</link>. We also reference another <link linkend="p">paragraph</link></para> - </chapter> + <para>Documentation on <link linkend="introJava">types</link>. We also reference another <link linkend="p">paragraph</link></para> + </chapter> </book> \ No newline at end of file diff --git a/Doc/Ref/src/Dtd/book/v5/master.xml b/Doc/Ref/src/Dtd/book/v5/master.xml index b6b93b46f0a34d44cc4084917ff2b38247b7d90b..5681e1a3b79dcf77fb5939e9bae86cccfb0fb553 100644 --- a/Doc/Ref/src/Dtd/book/v5/master.xml +++ b/Doc/Ref/src/Dtd/book/v5/master.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE book SYSTEM "book.dtd"[ - <!ENTITY chap1 SYSTEM "chap1.xml"> - <!ENTITY chap2 SYSTEM "chap2.xml"> -]> -<book> +<book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="book.xsd" lang="en" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>Master document example</title> - &chap1; - &chap2; -</book> \ No newline at end of file + + <xi:include href="chap1.xml"/> + <xi:include href="chap2.xml"/> + +</book> diff --git a/Doc/Ref/src/Dtd/book/v5/table.xsd b/Doc/Ref/src/Dtd/book/v5/table.xsd index c71b35a61803b1cb6e04977af6d30757ddc0bf9b..ff67ac7952137a99371635af2a14eb730cab6cd5 100644 --- a/Doc/Ref/src/Dtd/book/v5/table.xsd +++ b/Doc/Ref/src/Dtd/book/v5/table.xsd @@ -1,10 +1,31 @@ <?xml version="1.0" encoding="UTF-8"?> -<!ELEMENT table (caption, tr+)> -<!ATTLIST table - border NMTOKEN #IMPLIED > -<!ELEMENT caption (#PCDATA) > -<!ELEMENT tr (td+) > -<!ELEMENT td (#PCDATA) > -<!ATTLIST td - colspan NMTOKEN #IMPLIED - rowspan NMTOKEN #IMPLIED > \ No newline at end of file +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" +xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" +vc:minVersion="1.0" vc:maxVersion="1.1"> + + <xs:element name="table"> + <xs:complexType> + <xs:sequence> + <xs:element name="caption" type="xs:string"/> + <xs:element ref="tr" minOccurs="1" maxOccurs="unbounded"/> + </xs:sequence> + <xs:attribute name="border"/> + </xs:complexType> + </xs:element> + + <xs:element name="tr"> + <xs:complexType> + <xs:sequence> + <xs:element ref="td" minOccurs="1" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="td"> + <xs:complexType mixed="true"> + <xs:attribute name="colspan" type="xs:positiveInteger" use="optional"/> + <xs:attribute name="rowspan" type="xs:positiveInteger" use="optional"/> + </xs:complexType> + </xs:element> + +</xs:schema>