1
0
Files
bagu-thesis/docs/XThesis.xsd

468 lines
16 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<!-- ===== Model Groups ===== -->
<xs:group name="paraInlineContent">
<xs:annotation>
<xs:documentation>paragraph 元素允许的内联子元素集合</xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element ref="span"/>
<xs:element ref="inlineeq"/>
<xs:element ref="b"/>
<xs:element ref="i"/>
<xs:element ref="ref"/>
<xs:element ref="cref"/>
<xs:element ref="cite"/>
</xs:choice>
</xs:group>
<xs:group name="sectionBodyContent">
<xs:annotation>
<xs:documentation>章节元素允许的通用子元素集合(不含嵌套章节)</xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element ref="paragraph"/>
<xs:element ref="equation"/>
<xs:element ref="figure"/>
<xs:element ref="table"/>
<xs:element ref="ol"/>
<xs:element ref="ul"/>
<xs:element ref="pagebreaker"/>
</xs:choice>
</xs:group>
<!-- ===== Root Element ===== -->
<xs:element name="article">
<xs:annotation>
<xs:documentation>表示一个完整的文档,是 XThesis 的根元素。其下必须且只能包含 preface、document、appendix 和 reference 四个子元素,且必须按此顺序出现。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="preface"/>
<xs:element ref="document"/>
<xs:element ref="appendix"/>
<xs:element ref="reference"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- ===== Top-level Structure Elements ===== -->
<xs:element name="preface">
<xs:annotation>
<xs:documentation>本文档的前言部分,用于放置摘要等内容。其子元素为不带数字后缀的 section 元素。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="section" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="document">
<xs:annotation>
<xs:documentation>本文档的正文部分。其子元素为 section1可逐级向下嵌套至 section9。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="section1" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="appendix">
<xs:annotation>
<xs:documentation>本文档的附录部分,用于放置致谢、附录代码等内容。其子元素为不带数字后缀的 section 元素。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="section" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="reference">
<xs:annotation>
<xs:documentation>指向参考文献 bib 文件的路径。元素的文本内容为 bib 文件路径。</xs:documentation>
</xs:annotation>
</xs:element>
<!-- ===== Section (no number, for preface/appendix) ===== -->
<xs:element name="section">
<xs:annotation>
<xs:documentation>专用于 preface 和 appendix 的章节元素,不带数字层级后缀。论文中的摘要、致谢等内容均规划为此元素,不做区分。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="sectionBodyContent"/>
</xs:choice>
<xs:attribute name="caption" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>该章节的标题</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<!-- ===== Numbered Sections (section1 ~ section9) ===== -->
<xs:element name="section9">
<xs:annotation>
<xs:documentation>第 9 级章节,是最深层的层级。不可再嵌套子章节。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="sectionBodyContent"/>
</xs:choice>
<xs:attribute name="caption" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>该章节的标题</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="section8">
<xs:annotation>
<xs:documentation>第 8 级章节。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="sectionBodyContent"/>
<xs:element ref="section9"/>
</xs:choice>
<xs:attribute name="caption" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>该章节的标题</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="section7">
<xs:annotation>
<xs:documentation>第 7 级章节。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="sectionBodyContent"/>
<xs:element ref="section8"/>
</xs:choice>
<xs:attribute name="caption" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>该章节的标题</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="section6">
<xs:annotation>
<xs:documentation>第 6 级章节。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="sectionBodyContent"/>
<xs:element ref="section7"/>
</xs:choice>
<xs:attribute name="caption" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>该章节的标题</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="section5">
<xs:annotation>
<xs:documentation>第 5 级章节。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="sectionBodyContent"/>
<xs:element ref="section6"/>
</xs:choice>
<xs:attribute name="caption" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>该章节的标题</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="section4">
<xs:annotation>
<xs:documentation>第 4 级章节。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="sectionBodyContent"/>
<xs:element ref="section5"/>
</xs:choice>
<xs:attribute name="caption" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>该章节的标题</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="section3">
<xs:annotation>
<xs:documentation>第 3 级章节。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="sectionBodyContent"/>
<xs:element ref="section4"/>
</xs:choice>
<xs:attribute name="caption" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>该章节的标题</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="section2">
<xs:annotation>
<xs:documentation>第 2 级章节,仅可为 section1 的子元素。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="sectionBodyContent"/>
<xs:element ref="section3"/>
</xs:choice>
<xs:attribute name="caption" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>该章节的标题</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="section1">
<xs:annotation>
<xs:documentation>第 1 级章节(顶级章节),仅可为 document 的子元素。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="sectionBodyContent"/>
<xs:element ref="section2"/>
</xs:choice>
<xs:attribute name="caption" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>该章节的标题</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<!-- ===== Paragraph and Inline Elements ===== -->
<xs:element name="paragraph">
<xs:annotation>
<xs:documentation>表示一个自然段。其内容由 span、inlineeq、b、i、ref、cref、cite 等内联元素组成。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="paraInlineContent"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="span">
<xs:annotation>
<xs:documentation>表示纯文本。文本内容直接作为元素的文本节点。</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="inlineeq">
<xs:annotation>
<xs:documentation>表示内联公式(行内公式)。文本内容为公式的 LaTeX 原始代码,不包含两侧的 $ 标记。</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="b">
<xs:annotation>
<xs:documentation>表示加粗文本。文本内容为需要进行加粗样式处理的文字。不能与 i 元素互相嵌套。</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="i">
<xs:annotation>
<xs:documentation>表示斜体文本。文本内容为需要进行斜体样式处理的文字。不能与 b 元素互相嵌套。</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ref">
<xs:annotation>
<xs:documentation>表示对内容的引用。文本内容为被引用对象的 label 名称,多个名称以逗号分隔。</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="cref">
<xs:annotation>
<xs:documentation>表示对内容的引用(带前缀形式)。文本内容为被引用对象的 label 名称,多个名称以逗号分隔。</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="cite">
<xs:annotation>
<xs:documentation>表示对参考文献的引用。文本内容为被引用文献的名称,多个名称以逗号分隔。</xs:documentation>
</xs:annotation>
</xs:element>
<!-- ===== Block Elements ===== -->
<xs:element name="equation">
<xs:annotation>
<xs:documentation>表示行间公式。文本内容为公式的 LaTeX 原始代码(不含 $$ 等标记)。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="label" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>该公式的唯一引用名称</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="figure">
<xs:annotation>
<xs:documentation>表示图片。文本内容为被引用图片的文件路径。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="label" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>该图片的唯一引用名称</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="caption" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>该图片的图题</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="table">
<xs:annotation>
<xs:documentation>表示表格。内部必须包含 thead 和 tbody 各一个。不包含任何样式设定,仅表示纯数据内容。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="thead"/>
<xs:element ref="tbody"/>
</xs:sequence>
<xs:attribute name="label" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>该表格的唯一引用名称</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="caption" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>该表格的表题</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="thead">
<xs:annotation>
<xs:documentation>表格的表头部分。包含多个 td 元素td 数量必须与 tbody 中每行 tr 的 td 数量一致。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="td" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="tbody">
<xs:annotation>
<xs:documentation>表格的主体内容部分。包含多个 tr 行,每行包含多个 td 单元格。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="tr" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="tr">
<xs:annotation>
<xs:documentation>表格的一行。包含多个 td 单元格。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="td" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="td">
<xs:annotation>
<xs:documentation>表格的一个单元格。文本内容为单元格中显示的文本,不包含任何样式设定(如跨列、边框等)。</xs:documentation>
</xs:annotation>
</xs:element>
<!-- ===== List Elements ===== -->
<xs:element name="ol">
<xs:annotation>
<xs:documentation>表示有序列表。内部包含多个 li 列表项。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="li" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ul">
<xs:annotation>
<xs:documentation>表示无序列表。内部包含多个 li 列表项。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="li" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="li">
<xs:annotation>
<xs:documentation>列表项,仅可为 ol 或 ul 的子元素。其内容由 span、inlineeq、b、i、ref、cref、cite 等内联元素组成。</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="paraInlineContent"/>
</xs:choice>
</xs:complexType>
</xs:element>
<!-- ===== Misc ===== -->
<xs:element name="pagebreaker">
<xs:annotation>
<xs:documentation>表示在当前位置分页。该元素为空元素。</xs:documentation>
</xs:annotation>
<xs:complexType/>
</xs:element>
</xs:schema>