Pārlūkot izejas kodu

Use XML scheme for description elements info

Kandrashin Denis 13 gadi atpakaļ
vecāks
revīzija
db762830dd

+ 655 - 0
3rdparty/fb2/FictionBook2.1.xsd

@@ -0,0 +1,655 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XML Spy v4.4 U (http://www.xmlspy.com) by GribUser (Moscow) -->
+<xs:schema targetNamespace="http://www.gribuser.ru/xml/fictionbook/2.0" xmlns:genre="http://www.gribuser.ru/xml/fictionbook/2.0/genres" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.gribuser.ru/xml/fictionbook/2.0" elementFormDefault="qualified" attributeFormDefault="unqualified">
+	<xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="FictionBookLinks.xsd"/>
+	<xs:import namespace="http://www.gribuser.ru/xml/fictionbook/2.0/genres" schemaLocation="FictionBookGenres.xsd"/>
+	<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="FictionBookLang.xsd"/>
+	<xs:element name="FictionBook">
+		<xs:annotation>
+			<xs:documentation>Root element</xs:documentation>
+		</xs:annotation>
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="stylesheet" minOccurs="0" maxOccurs="unbounded">
+					<xs:annotation>
+						<xs:documentation>This element contains an arbitrary stylesheet that is intepreted by a some processing programs, e.g. text/css stylesheets can be used by XSLT stylesheets to generate better looking html</xs:documentation>
+					</xs:annotation>
+					<xs:complexType>
+						<xs:simpleContent>
+							<xs:extension base="xs:string">
+								<xs:attribute name="type" type="xs:string" use="required"/>
+							</xs:extension>
+						</xs:simpleContent>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="description">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="title-info" type="title-infoType">
+								<xs:annotation>
+									<xs:documentation>Generic information about the book</xs:documentation>
+								</xs:annotation>
+							</xs:element>
+							<xs:element name="src-title-info" type="title-infoType" minOccurs="0">
+								<xs:annotation>
+									<xs:documentation>Generic information about the original book (for translations) </xs:documentation>
+								</xs:annotation>
+							</xs:element>
+							<xs:element name="document-info">
+								<xs:annotation>
+									<xs:documentation>Information about this particular (xml) document</xs:documentation>
+								</xs:annotation>
+								<xs:complexType>
+									<xs:sequence>
+										<xs:element name="author" type="authorType" maxOccurs="unbounded">
+											<xs:annotation>
+												<xs:documentation>Author(s) of this particular document</xs:documentation>
+											</xs:annotation>
+										</xs:element>
+										<xs:element name="program-used" type="textFieldType" minOccurs="0">
+											<xs:annotation>
+												<xs:documentation>Any software used in preparation of this document, in free format</xs:documentation>
+											</xs:annotation>
+										</xs:element>
+										<xs:element name="date" type="dateType">
+											<xs:annotation>
+												<xs:documentation>Date this document was created, same guidelines as in the &lt;title-info&gt; section apply</xs:documentation>
+											</xs:annotation>
+										</xs:element>
+										<xs:element name="src-url" type="xs:string" minOccurs="0" maxOccurs="unbounded">
+											<xs:annotation>
+												<xs:documentation>Source URL if this document is a conversion of some other (online) document</xs:documentation>
+											</xs:annotation>
+										</xs:element>
+										<xs:element name="src-ocr" type="textFieldType" minOccurs="0">
+											<xs:annotation>
+												<xs:documentation>Author of the original (online) document, if this is a conversion</xs:documentation>
+											</xs:annotation>
+										</xs:element>
+										<xs:element name="id" type="xs:token">
+											<xs:annotation>
+												<xs:documentation>this is a unique identifier for a document. this must not change</xs:documentation>
+											</xs:annotation>
+										</xs:element>
+										<xs:element name="version" type="xs:float">
+											<xs:annotation>
+												<xs:documentation>Document version, in free format, should be incremented if the document is changed and re-released to the public</xs:documentation>
+											</xs:annotation>
+										</xs:element>
+										<xs:element name="history" type="annotationType" minOccurs="0">
+											<xs:annotation>
+												<xs:documentation>Short description for all changes made to this document, like "Added missing chapter 6", in free form.</xs:documentation>
+											</xs:annotation>
+										</xs:element>
+									</xs:sequence>
+								</xs:complexType>
+							</xs:element>
+							<xs:element name="publish-info" minOccurs="0">
+								<xs:annotation>
+									<xs:documentation>Information about some paper/outher published document, that was used as a source of this xml document</xs:documentation>
+								</xs:annotation>
+								<xs:complexType>
+									<xs:sequence>
+										<xs:element name="book-name" type="textFieldType" minOccurs="0">
+											<xs:annotation>
+												<xs:documentation>Original (paper) book name</xs:documentation>
+											</xs:annotation>
+										</xs:element>
+										<xs:element name="publisher" type="textFieldType" minOccurs="0">
+											<xs:annotation>
+												<xs:documentation>Original (paper) book publisher</xs:documentation>
+											</xs:annotation>
+										</xs:element>
+										<xs:element name="city" type="textFieldType" minOccurs="0">
+											<xs:annotation>
+												<xs:documentation>City where the original (paper) book was published</xs:documentation>
+											</xs:annotation>
+										</xs:element>
+										<xs:element name="year" type="xs:gYear" minOccurs="0">
+											<xs:annotation>
+												<xs:documentation>Year of the original (paper) publication</xs:documentation>
+											</xs:annotation>
+										</xs:element>
+										<xs:element name="isbn" type="textFieldType" minOccurs="0"/>
+										<xs:element name="sequence" type="sequenceType" minOccurs="0" maxOccurs="unbounded"/>
+									</xs:sequence>
+								</xs:complexType>
+							</xs:element>
+							<xs:element name="custom-info" minOccurs="0" maxOccurs="unbounded">
+								<xs:annotation>
+									<xs:documentation>Any other information about the book/document that didnt fit in the above groups</xs:documentation>
+								</xs:annotation>
+								<xs:complexType>
+									<xs:simpleContent>
+										<xs:extension base="textFieldType">
+											<xs:attribute name="info-type" type="xs:string" use="required"/>
+										</xs:extension>
+									</xs:simpleContent>
+								</xs:complexType>
+							</xs:element>
+							<xs:element name="output" type="shareInstructionType" minOccurs="0" maxOccurs="2"/>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="body" maxOccurs="unbounded">
+					<xs:annotation>
+						<xs:documentation>Main content of the book, multiple bodies are used for additional information, like footnotes, that do not appear in the main book flow. The first body is presented to the reader by default, and content in the other bodies should be accessible by hyperlinks. Name attribute should describe the meaning of this body, this is optional for the main body.</xs:documentation>
+					</xs:annotation>
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="image" type="imageType" minOccurs="0">
+								<xs:annotation>
+									<xs:documentation>Image to be displayed at the top of this section</xs:documentation>
+								</xs:annotation>
+							</xs:element>
+							<xs:element name="title" type="titleType" minOccurs="0">
+								<xs:annotation>
+									<xs:documentation>A fancy title for the entire book, should be used if the simple text version in &lt;description&gt; is not adequate, e.g. the book title has multiple paragraphs and/or character styles</xs:documentation>
+								</xs:annotation>
+							</xs:element>
+							<xs:element name="epigraph" type="epigraphType" minOccurs="0" maxOccurs="unbounded">
+								<xs:annotation>
+									<xs:documentation>Epigraph(s) for the entire book, if any</xs:documentation>
+								</xs:annotation>
+							</xs:element>
+							<xs:element name="section" type="sectionType" maxOccurs="unbounded"/>
+						</xs:sequence>
+						<xs:attribute name="name" type="xs:string" use="optional"/>
+						<xs:attribute ref="xml:lang"/>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="binary" minOccurs="0" maxOccurs="unbounded">
+					<xs:annotation>
+						<xs:documentation>Any binary data that is required for the presentation of this book in base64 format. Currently only images are used.</xs:documentation>
+					</xs:annotation>
+					<xs:complexType>
+						<xs:simpleContent>
+							<xs:extension base="xs:base64Binary">
+								<xs:attribute name="content-type" type="xs:string" use="required"/>
+								<xs:attribute name="id" type="xs:ID" use="required"/>
+							</xs:extension>
+						</xs:simpleContent>
+					</xs:complexType>
+				</xs:element>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+	<xs:complexType name="authorType">
+		<xs:annotation>
+			<xs:documentation>Information about a single author</xs:documentation>
+		</xs:annotation>
+		<xs:choice>
+			<xs:sequence>
+				<xs:element name="first-name" type="textFieldType"/>
+				<xs:element name="middle-name" type="textFieldType" minOccurs="0"/>
+				<xs:element name="last-name" type="textFieldType"/>
+				<xs:element name="nickname" type="textFieldType" minOccurs="0"/>
+				<xs:element name="home-page" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element name="email" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:sequence>
+				<xs:element name="nickname" type="textFieldType"/>
+				<xs:element name="home-page" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element name="email" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+		</xs:choice>
+	</xs:complexType>
+	<xs:complexType name="textFieldType">
+		<xs:simpleContent>
+			<xs:extension base="xs:string">
+				<xs:attribute ref="xml:lang"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="dateType">
+		<xs:annotation>
+			<xs:documentation>A human readable date, maybe not exact, with an optional computer readable variant</xs:documentation>
+		</xs:annotation>
+		<xs:simpleContent>
+			<xs:extension base="xs:string">
+				<xs:attribute name="value" type="xs:date" use="optional"/>
+				<xs:attribute ref="xml:lang"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="titleType">
+		<xs:annotation>
+			<xs:documentation>A title, used in sections, poems and body elements</xs:documentation>
+		</xs:annotation>
+		<xs:choice minOccurs="0" maxOccurs="unbounded">
+			<xs:element name="p" type="pType"/>
+			<xs:element name="empty-line"/>
+		</xs:choice>
+		<xs:attribute ref="xml:lang"/>
+	</xs:complexType>
+	<xs:complexType name="imageType">
+		<xs:annotation>
+			<xs:documentation>An empty element with an image name as an attribute</xs:documentation>
+		</xs:annotation>
+		<xs:attribute ref="xlink:type"/>
+		<xs:attribute ref="xlink:href"/>
+		<xs:attribute name="alt" type="xs:string" use="optional"/>
+		<xs:attribute name="title" type="xs:string" use="optional"/>
+		<xs:attribute name="id" type="xs:ID" use="optional"/>
+	</xs:complexType>
+	<xs:complexType name="pType" mixed="true">
+		<xs:annotation>
+			<xs:documentation>A basic paragraph, may include simple formatting inside</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent mixed="true">
+			<xs:extension base="styleType">
+				<xs:attribute name="id" type="xs:ID" use="optional"/>
+				<xs:attribute name="style" type="xs:string" use="optional"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="citeType">
+		<xs:annotation>
+			<xs:documentation>A citation with an optional citation author at the end</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:choice minOccurs="0" maxOccurs="unbounded">
+				<xs:element name="p" type="pType"/>
+				<xs:element name="poem" type="poemType"/>
+				<xs:element name="empty-line"/>
+				<xs:element name="subtitle" type="pType"/>
+				<xs:element name="table" type="tableType"/>
+			</xs:choice>
+			<xs:element name="text-author" type="pType" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+		<xs:attribute name="id" type="xs:ID" use="optional"/>
+		<xs:attribute ref="xml:lang"/>
+	</xs:complexType>
+	<xs:complexType name="poemType">
+		<xs:annotation>
+			<xs:documentation>A poem</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="title" type="titleType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Poem title</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="epigraph" type="epigraphType" minOccurs="0" maxOccurs="unbounded">
+				<xs:annotation>
+					<xs:documentation>Poem epigraph(s), if any</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="stanza" maxOccurs="unbounded">
+				<xs:annotation>
+					<xs:documentation>Each poem should have at least one stanza. Stanzas are usually separated with empty lines by user agents.</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="title" type="titleType" minOccurs="0"/>
+						<xs:element name="subtitle" type="pType" minOccurs="0"/>
+						<xs:element name="v" type="pType" maxOccurs="unbounded">
+							<xs:annotation>
+								<xs:documentation>An individual line in a stanza</xs:documentation>
+							</xs:annotation>
+						</xs:element>
+					</xs:sequence>
+					<xs:attribute ref="xml:lang"/>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="text-author" type="pType" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element name="date" type="dateType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Date this poem was written.</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+		</xs:sequence>
+		<xs:attribute name="id" type="xs:ID" use="optional"/>
+		<xs:attribute ref="xml:lang"/>
+	</xs:complexType>
+	<xs:complexType name="epigraphType">
+		<xs:annotation>
+			<xs:documentation>An epigraph</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:choice minOccurs="0" maxOccurs="unbounded">
+				<xs:element name="p" type="pType"/>
+				<xs:element name="poem" type="poemType"/>
+				<xs:element name="cite" type="citeType"/>
+				<xs:element name="empty-line"/>
+			</xs:choice>
+			<xs:element name="text-author" type="pType" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+		<xs:attribute name="id" type="xs:ID" use="optional"/>
+	</xs:complexType>
+	<xs:complexType name="annotationType">
+		<xs:annotation>
+			<xs:documentation>A cut-down version of &lt;section&gt; used in annotations</xs:documentation>
+		</xs:annotation>
+		<xs:choice minOccurs="0" maxOccurs="unbounded">
+			<xs:element name="p" type="pType"/>
+			<xs:element name="poem" type="poemType"/>
+			<xs:element name="cite" type="citeType"/>
+			<xs:element name="subtitle" type="pType"/>
+			<xs:element name="table" type="tableType"/>
+			<xs:element name="empty-line"/>
+		</xs:choice>
+		<xs:attribute name="id" type="xs:ID" use="optional"/>
+		<xs:attribute ref="xml:lang"/>
+	</xs:complexType>
+	<xs:complexType name="sectionType">
+		<xs:annotation>
+			<xs:documentation>A basic block of a book, can contain more child sections or textual content</xs:documentation>
+		</xs:annotation>
+		<xs:sequence minOccurs="0">
+			<xs:element name="title" type="titleType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Section's title</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="epigraph" type="epigraphType" minOccurs="0" maxOccurs="unbounded">
+				<xs:annotation>
+					<xs:documentation>Epigraph(s) for this section</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="image" type="imageType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Image to be displayed at the top of this section</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="annotation" type="annotationType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Annotation for this section, if any</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:choice>
+				<xs:sequence>
+					<xs:element name="section" type="sectionType" maxOccurs="unbounded">
+						<xs:annotation>
+							<xs:documentation>Child sections</xs:documentation>
+						</xs:annotation>
+					</xs:element>
+				</xs:sequence>
+				<xs:sequence>
+					<xs:choice>
+						<xs:element name="p" type="pType"/>
+						<xs:element name="poem" type="poemType"/>
+						<xs:element name="subtitle" type="pType"/>
+						<xs:element name="cite" type="citeType"/>
+						<xs:element name="empty-line"/>
+						<xs:element name="table" type="tableType"/>
+					</xs:choice>
+					<xs:choice minOccurs="0" maxOccurs="unbounded">
+						<xs:element name="p" type="pType"/>
+						<xs:element name="image" type="imageType"/>
+						<xs:element name="poem" type="poemType"/>
+						<xs:element name="subtitle" type="pType"/>
+						<xs:element name="cite" type="citeType"/>
+						<xs:element name="empty-line"/>
+						<xs:element name="table" type="tableType"/>
+					</xs:choice>
+				</xs:sequence>
+			</xs:choice>
+		</xs:sequence>
+		<xs:attribute name="id" type="xs:ID" use="optional"/>
+		<xs:attribute ref="xml:lang"/>
+	</xs:complexType>
+	<xs:complexType name="styleType" mixed="true">
+		<xs:annotation>
+			<xs:documentation>Markup</xs:documentation>
+		</xs:annotation>
+		<xs:choice minOccurs="0" maxOccurs="unbounded">
+			<xs:element name="strong" type="styleType"/>
+			<xs:element name="emphasis" type="styleType"/>
+			<xs:element name="style" type="namedStyleType"/>
+			<xs:element name="a" type="linkType"/>
+			<xs:element name="strikethrough" type="styleType"/>
+			<xs:element name="sub" type="styleType"/>
+			<xs:element name="sup" type="styleType"/>
+			<xs:element name="code" type="styleType"/>
+			<xs:element name="image" type="inlineImageType"/>
+		</xs:choice>
+		<xs:attribute ref="xml:lang"/>
+	</xs:complexType>
+	<xs:complexType name="namedStyleType" mixed="true">
+		<xs:annotation>
+			<xs:documentation>Markup</xs:documentation>
+		</xs:annotation>
+		<xs:choice minOccurs="0" maxOccurs="unbounded">
+			<xs:element name="strong" type="styleType"/>
+			<xs:element name="emphasis" type="styleType"/>
+			<xs:element name="style" type="namedStyleType"/>
+			<xs:element name="a" type="linkType"/>
+			<xs:element name="strikethrough" type="styleType"/>
+			<xs:element name="sub" type="styleType"/>
+			<xs:element name="sup" type="styleType"/>
+			<xs:element name="code" type="styleType"/>
+			<xs:element name="image" type="inlineImageType"/>
+		</xs:choice>
+		<xs:attribute ref="xml:lang" use="optional"/>
+		<xs:attribute name="name" type="xs:token" use="required"/>
+	</xs:complexType>
+	<xs:complexType name="linkType" mixed="true">
+		<xs:annotation>
+			<xs:documentation>Generic hyperlinks. Cannot be nested. Footnotes should be implemented by links referring to additional bodies in the same document</xs:documentation>
+		</xs:annotation>
+		<xs:choice minOccurs="0" maxOccurs="unbounded">
+			<xs:element name="strong" type="styleLinkType"/>
+			<xs:element name="emphasis" type="styleLinkType"/>
+			<xs:element name="style" type="styleLinkType"/>
+			<xs:element name="strikethrough" type="styleLinkType"/>
+			<xs:element name="sub" type="styleLinkType"/>
+			<xs:element name="sup" type="styleLinkType"/>
+			<xs:element name="code" type="styleLinkType"/>
+			<xs:element name="image" type="inlineImageType"/>
+		</xs:choice>
+		<xs:attribute ref="xlink:type" use="optional"/>
+		<xs:attribute ref="xlink:href" use="required"/>
+		<xs:attribute name="type" type="xs:token" use="optional"/>
+	</xs:complexType>
+	<xs:complexType name="styleLinkType" mixed="true">
+		<xs:annotation>
+			<xs:documentation>Markup</xs:documentation>
+		</xs:annotation>
+		<xs:choice minOccurs="0" maxOccurs="unbounded">
+			<xs:element name="strong" type="styleLinkType"/>
+			<xs:element name="emphasis" type="styleLinkType"/>
+			<xs:element name="style" type="styleLinkType"/>
+			<xs:element name="strikethrough" type="styleLinkType"/>
+			<xs:element name="sub" type="styleLinkType"/>
+			<xs:element name="sup" type="styleLinkType"/>
+			<xs:element name="code" type="styleLinkType"/>
+			<xs:element name="image" type="inlineImageType"/>
+		</xs:choice>
+	</xs:complexType>
+	<xs:complexType name="sequenceType">
+		<xs:annotation>
+			<xs:documentation>Book sequences</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="sequence" type="sequenceType" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+		<xs:attribute name="name" type="xs:string" use="required"/>
+		<xs:attribute name="number" type="xs:integer" use="optional"/>
+		<xs:attribute ref="xml:lang"/>
+	</xs:complexType>
+	<xs:complexType name="tableType">
+		<xs:annotation>
+			<xs:documentation>Basic html-like tables</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="tr" maxOccurs="unbounded">
+				<xs:complexType>
+					<xs:choice maxOccurs="unbounded">
+						<xs:element name="th" type="tdType"/>
+						<xs:element name="td" type="tdType"/>
+					</xs:choice>
+					<xs:attribute name="align" type="alignType" use="optional" default="left"/>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+		<xs:attribute name="style" type="xs:string" use="optional"/>
+		<xs:attribute name="id" type="xs:ID" use="optional"/>
+	</xs:complexType>
+	<xs:simpleType name="alignType">
+		<xs:annotation>
+			<xs:documentation>Align for table cells</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="left"/>
+			<xs:enumeration value="right"/>
+			<xs:enumeration value="center"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:simpleType name="vAlignType">
+		<xs:annotation>
+			<xs:documentation>Align for table cells</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="top"/>
+			<xs:enumeration value="middle"/>
+			<xs:enumeration value="bottom"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:complexType name="title-infoType">
+		<xs:annotation>
+			<xs:documentation>Book (as a book opposite a document) description</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="genre" maxOccurs="unbounded">
+				<xs:annotation>
+					<xs:documentation>Genre of this book, with the optional match percentage</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:simpleContent>
+						<xs:extension base="genre:genreType">
+							<xs:attribute name="match" type="xs:integer" use="optional" default="100"/>
+						</xs:extension>
+					</xs:simpleContent>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="author" maxOccurs="unbounded">
+				<xs:annotation>
+					<xs:documentation>Author(s) of this book</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:complexContent>
+						<xs:extension base="authorType"/>
+					</xs:complexContent>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="book-title" type="textFieldType">
+				<xs:annotation>
+					<xs:documentation>Book title</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="annotation" type="annotationType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Annotation for this book</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="keywords" type="textFieldType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Any keywords for this book, intended for use in search engines</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="date" type="dateType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Date this book was written, can be not exact, e.g. 1863-1867. If an optional attribute is present, then it should contain some computer-readable date from the interval for use by search and indexingengines</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="coverpage" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Any coverpage items, currently only images</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="image" type="inlineImageType" maxOccurs="unbounded"/>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="lang" type="xs:language">
+				<xs:annotation>
+					<xs:documentation>Book's language</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="src-lang" type="xs:language" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Book's source language if this is a translation</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="translator" type="authorType" minOccurs="0" maxOccurs="unbounded">
+				<xs:annotation>
+					<xs:documentation>Translators if this is a translation</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="sequence" type="sequenceType" minOccurs="0" maxOccurs="unbounded">
+				<xs:annotation>
+					<xs:documentation>Any sequences this book might be part of</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="shareInstructionType">
+		<xs:annotation>
+			<xs:documentation>In-document instruction for generating output free and payed documents</xs:documentation>
+		</xs:annotation>
+		<xs:choice minOccurs="0" maxOccurs="unbounded">
+			<xs:element name="part" type="partShareInstructionType"/>
+			<xs:element name="output-document-class" type="outPutDocumentType"/>
+		</xs:choice>
+		<xs:attribute name="mode" type="shareModesType" use="required"/>
+		<xs:attribute name="include-all" type="docGenerationInstructionType" use="required"/>
+		<xs:attribute name="price" type="xs:float" use="optional"/>
+		<xs:attribute name="currency" type="xs:string"/>
+	</xs:complexType>
+	<xs:simpleType name="shareModesType">
+		<xs:annotation>
+			<xs:documentation>Modes for document sharing (free|paid for now)</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="free"/>
+			<xs:enumeration value="paid"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:simpleType name="docGenerationInstructionType">
+		<xs:annotation>
+			<xs:documentation>List of instructions to process sections (allow|deny|require)</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="require"/>
+			<xs:enumeration value="allow"/>
+			<xs:enumeration value="deny"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:complexType name="partShareInstructionType">
+		<xs:annotation>
+			<xs:documentation>Pointer to cpecific document section, explaining how to deal with it</xs:documentation>
+		</xs:annotation>
+		<xs:attribute ref="xlink:type"/>
+		<xs:attribute ref="xlink:href" use="required"/>
+		<xs:attribute name="include" type="docGenerationInstructionType" use="required"/>
+	</xs:complexType>
+	<xs:complexType name="outPutDocumentType">
+		<xs:annotation>
+			<xs:documentation>Selector for output documents. Defines, which rule to apply to any specific output documents</xs:documentation>
+		</xs:annotation>
+		<xs:sequence minOccurs="0" maxOccurs="unbounded">
+			<xs:element name="part" type="partShareInstructionType"/>
+		</xs:sequence>
+		<xs:attribute name="name" type="xs:string" use="required"/>
+		<xs:attribute name="create" type="docGenerationInstructionType" use="optional"/>
+		<xs:attribute name="price" type="xs:float" use="optional"/>
+	</xs:complexType>
+	<xs:complexType name="tdType" mixed="true">
+		<xs:complexContent mixed="true">
+			<xs:extension base="styleType">
+				<xs:attribute name="id" type="xs:ID" use="optional"/>
+				<xs:attribute name="style" type="xs:string" use="optional"/>
+				<xs:attribute name="colspan" type="xs:integer" use="optional"/>
+				<xs:attribute name="rowspan" type="xs:integer" use="optional"/>
+				<xs:attribute name="align" type="alignType" use="optional" default="left"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="inlineImageType">
+		<xs:attribute ref="xlink:type"/>
+		<xs:attribute ref="xlink:href"/>
+		<xs:attribute name="alt" type="xs:string" use="optional"/>
+	</xs:complexType>
+</xs:schema>

+ 117 - 0
3rdparty/fb2/FictionBookGenres.xsd

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XML Spy v4.2 U (http://www.xmlspy.com) by * (*) -->
+<xs:schema targetNamespace="http://www.gribuser.ru/xml/fictionbook/2.0/genres" xmlns="http://www.w3.org/XML/1998/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+	<xs:simpleType name="genreType">
+		<xs:restriction base="xs:token">
+			<xs:enumeration value="sf_history"/>
+			<xs:enumeration value="sf_action"/>
+			<xs:enumeration value="sf_epic"/>
+			<xs:enumeration value="sf_heroic"/>
+			<xs:enumeration value="sf_detective"/>
+			<xs:enumeration value="sf_cyberpunk"/>
+			<xs:enumeration value="sf_space"/>
+			<xs:enumeration value="sf_social"/>
+			<xs:enumeration value="sf_horror"/>
+			<xs:enumeration value="sf_humor"/>
+			<xs:enumeration value="sf_fantasy"/>
+			<xs:enumeration value="sf"/>
+			<xs:enumeration value="det_classic"/>
+			<xs:enumeration value="det_police"/>
+			<xs:enumeration value="det_action"/>
+			<xs:enumeration value="det_irony"/>
+			<xs:enumeration value="det_history"/>
+			<xs:enumeration value="det_espionage"/>
+			<xs:enumeration value="det_crime"/>
+			<xs:enumeration value="det_political"/>
+			<xs:enumeration value="det_maniac"/>
+			<xs:enumeration value="det_hard"/>
+			<xs:enumeration value="thriller"/>
+			<xs:enumeration value="detective"/>
+			<xs:enumeration value="prose_classic"/>
+			<xs:enumeration value="prose_history"/>
+			<xs:enumeration value="prose_contemporary"/>
+			<xs:enumeration value="prose_counter"/>
+			<xs:enumeration value="prose_rus_classic"/>
+			<xs:enumeration value="prose_su_classics"/>
+			<xs:enumeration value="love_contemporary"/>
+			<xs:enumeration value="love_history"/>
+			<xs:enumeration value="love_detective"/>
+			<xs:enumeration value="love_short"/>
+			<xs:enumeration value="love_erotica"/>
+			<xs:enumeration value="adv_western"/>
+			<xs:enumeration value="adv_history"/>
+			<xs:enumeration value="adv_indian"/>
+			<xs:enumeration value="adv_maritime"/>
+			<xs:enumeration value="adv_geo"/>
+			<xs:enumeration value="adv_animal"/>
+			<xs:enumeration value="adventure"/>
+			<xs:enumeration value="child_tale"/>
+			<xs:enumeration value="child_verse"/>
+			<xs:enumeration value="child_prose"/>
+			<xs:enumeration value="child_sf"/>
+			<xs:enumeration value="child_det"/>
+			<xs:enumeration value="child_adv"/>
+			<xs:enumeration value="child_education"/>
+			<xs:enumeration value="children"/>
+			<xs:enumeration value="poetry"/>
+			<xs:enumeration value="dramaturgy"/>
+			<xs:enumeration value="antique_ant"/>
+			<xs:enumeration value="antique_european"/>
+			<xs:enumeration value="antique_russian"/>
+			<xs:enumeration value="antique_east"/>
+			<xs:enumeration value="antique_myths"/>
+			<xs:enumeration value="antique"/>
+			<xs:enumeration value="sci_history"/>
+			<xs:enumeration value="sci_psychology"/>
+			<xs:enumeration value="sci_culture"/>
+			<xs:enumeration value="sci_religion"/>
+			<xs:enumeration value="sci_philosophy"/>
+			<xs:enumeration value="sci_politics"/>
+			<xs:enumeration value="sci_business"/>
+			<xs:enumeration value="sci_juris"/>
+			<xs:enumeration value="sci_linguistic"/>
+			<xs:enumeration value="sci_medicine"/>
+			<xs:enumeration value="sci_phys"/>
+			<xs:enumeration value="sci_math"/>
+			<xs:enumeration value="sci_chem"/>
+			<xs:enumeration value="sci_biology"/>
+			<xs:enumeration value="sci_tech"/>
+			<xs:enumeration value="science"/>
+			<xs:enumeration value="comp_www"/>
+			<xs:enumeration value="comp_programming"/>
+			<xs:enumeration value="comp_hard"/>
+			<xs:enumeration value="comp_soft"/>
+			<xs:enumeration value="comp_db"/>
+			<xs:enumeration value="comp_osnet"/>
+			<xs:enumeration value="computers"/>
+			<xs:enumeration value="ref_encyc"/>
+			<xs:enumeration value="ref_dict"/>
+			<xs:enumeration value="ref_ref"/>
+			<xs:enumeration value="ref_guide"/>
+			<xs:enumeration value="reference"/>
+			<xs:enumeration value="nonf_biography"/>
+			<xs:enumeration value="nonf_publicism"/>
+			<xs:enumeration value="nonf_criticism"/>
+			<xs:enumeration value="nonfiction"/>
+			<xs:enumeration value="design"/>
+			<xs:enumeration value="religion_rel"/>
+			<xs:enumeration value="religion_esoterics"/>
+			<xs:enumeration value="religion_self"/>
+			<xs:enumeration value="religion"/>
+			<xs:enumeration value="humor_anecdote"/>
+			<xs:enumeration value="humor_prose"/>
+			<xs:enumeration value="humor_verse"/>
+			<xs:enumeration value="humor"/>
+			<xs:enumeration value="home_cooking"/>
+			<xs:enumeration value="home_pets"/>
+			<xs:enumeration value="home_crafts"/>
+			<xs:enumeration value="home_entertain"/>
+			<xs:enumeration value="home_health"/>
+			<xs:enumeration value="home_garden"/>
+			<xs:enumeration value="home_diy"/>
+			<xs:enumeration value="home_sport"/>
+			<xs:enumeration value="home_sex"/>
+			<xs:enumeration value="home"/>
+		</xs:restriction>
+	</xs:simpleType>
+</xs:schema>

+ 9 - 0
3rdparty/fb2/FictionBookLang.xsd

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XML Spy v4.4 U (http://www.xmlspy.com) by Dmitry Grobov (DDS) -->
+<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/XML/1998/namespace" elementFormDefault="qualified" attributeFormDefault="unqualified">
+	<xs:attribute name="lang" type="xs:language">
+		<xs:annotation>
+			<xs:documentation>Element content's languige</xs:documentation>
+		</xs:annotation>
+	</xs:attribute>
+</xs:schema>

+ 14 - 0
3rdparty/fb2/FictionBookLinks.xsd

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XML Spy v4.2 U (http://www.xmlspy.com) by * (*) -->
+<xs:schema targetNamespace="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/1999/xlink" elementFormDefault="qualified" attributeFormDefault="unqualified">
+	<xs:attribute name="type" type="xs:string" fixed="simple">
+		<xs:annotation>
+			<xs:documentation>link type</xs:documentation>
+		</xs:annotation>
+	</xs:attribute>
+	<xs:attribute name="href" type="xs:string">
+		<xs:annotation>
+			<xs:documentation>link target</xs:documentation>
+		</xs:annotation>
+	</xs:attribute>
+</xs:schema>

+ 9 - 0
3rdparty/fb2/fb2.qrc

@@ -0,0 +1,9 @@
+<RCC>
+    <qresource prefix="/fb2">
+        <file>FictionBook2.1.xsd</file>
+        <file>FictionBookGenres.xsd</file>
+        <file>FictionBookLang.xsd</file>
+        <file>FictionBookLinks.xsd</file>
+    </qresource>
+</RCC>
+

+ 1 - 0
CMakeLists.txt

@@ -33,6 +33,7 @@ set(FB2_DEFINITIONS "PACKAGE_NAME=\"${PACKAGE_NAME}\"; PACKAGE_VENDOR=\"${PACKAG
 set_source_files_properties( source/fb2app.cpp PROPERTIES COMPILE_DEFINITIONS "${FB2_DEFINITIONS}")
 
 set(FB2_RES
+    3rdparty/fb2/fb2.qrc
     3rdparty/gnome/gnome.qrc
     source/js/javascript.qrc
     source/res/fb2edit.qrc

+ 4 - 2
fb2edit.pro

@@ -31,7 +31,8 @@ SOURCES = \
 RESOURCES = \
     3rdparty/gnome/gnome.qrc \
     source/res/fb2edit.qrc \
-    source/js/javascript.qrc
+    source/js/javascript.qrc \
+    3rdparty/fb2/fb2.qrc
 
 TARGET = fb2edit
 
@@ -50,7 +51,8 @@ OTHER_FILES += \
     source/js/set_cursor.js \
     source/js/get_status.js \
     source/js/get_location.js \
-    source/js/insert_title.js
+    source/js/insert_title.js \
+    CMakeLists.txt
 
 if (unix) {
 

+ 97 - 2
source/fb2head.cpp

@@ -100,6 +100,7 @@ QString Fb2HeadItem::text(int col) const
     switch (col) {
         case 0: return QString("<%1> %2").arg(m_name).arg(hint());
         case 1: return value();
+        case 2: return Fb2Scheme::info(scheme());
     }
     return QString();
 }
@@ -154,6 +155,17 @@ QString Fb2HeadItem::sub(const QString &key) const
     return QString();
 }
 
+QDomElement Fb2HeadItem::scheme() const
+{
+    QDomElement parent;
+    if (m_parent) {
+        parent = m_parent->scheme();
+    } else {
+        parent = Fb2Scheme::fb2().element("FictionBook", parent);
+    }
+    return Fb2Scheme::fb2().element(m_name, parent);
+}
+
 //---------------------------------------------------------------------------
 //  Fb2HeadModel
 //---------------------------------------------------------------------------
@@ -294,6 +306,73 @@ Qt::ItemFlags Fb2HeadModel::flags(const QModelIndex &index) const
     return flags;
 }
 
+//---------------------------------------------------------------------------
+//  Fb2Scheme
+//---------------------------------------------------------------------------
+
+const Fb2Scheme & Fb2Scheme::fb2()
+{
+    static const Fb2Scheme scheme;
+    return scheme;
+}
+
+Fb2Scheme::Fb2Scheme()
+{
+    QFile file(":/fb2/FictionBook2.1.xsd");
+    if (file.open(QIODevice::ReadOnly)) {
+        doc.setContent(&file);
+    }
+}
+
+QDomElement Fb2Scheme::element(const QString &name, QDomElement parent) const
+{
+    if (parent.isNull()) parent = doc.documentElement();
+    QDomElement child = parent.firstChildElement();
+    while (!child.isNull()) {
+        QDomElement result;
+        const QString tagName = child.tagName();
+        if (tagName == "xs:element") {
+            if (child.attribute("name") == name) result = child;
+        } else if (tagName == "xs:complexType") {
+            result = element(name, child);
+        } else if (tagName == "xs:sequence") {
+            result = element(name, child);
+        } else if (tagName == "xs:choice") {
+            result = element(name, child);
+        }
+        if (!result.isNull()) return result;
+        child = child.nextSiblingElement();
+    }
+
+    QString type = parent.attribute("type");
+    if (type.isEmpty()) return QDomElement();
+
+    child = doc.firstChildElement().firstChildElement();
+    while (!child.isNull()) {
+        if (child.tagName() == "xs:complexType") {
+            QString attr = child.attribute("name");
+            if (attr == type) return element(name, child);
+            if (child.attribute("name") == type) return element(name, child);
+        }
+        child = child.nextSiblingElement();
+    }
+
+    return QDomElement();
+}
+
+QString Fb2Scheme::info(QDomElement parent)
+{
+    if (parent.isNull()) return QString();
+
+    parent = parent.firstChildElement("xs:annotation");
+    if (parent.isNull()) return QString();
+
+    parent = parent.firstChildElement("xs:documentation");
+    if (parent.isNull()) return QString();
+
+    return parent.text();
+}
+
 //---------------------------------------------------------------------------
 //  Fb2TreeView
 //---------------------------------------------------------------------------
@@ -341,10 +420,11 @@ void Fb2HeadView::updateTree()
 
 void Fb2HeadView::editCurrent()
 {
+    if (!model()) return;
     QModelIndex current = currentIndex();
     if (!current.isValid()) return;
-    Fb2HeadModel * m = static_cast<Fb2HeadModel*>(model());
-    QModelIndex index = m->index(current.row(), 1, m->parent(current));
+    QModelIndex parent = model()->parent(current);
+    QModelIndex index = model()->index(current.row(), 1, parent);
     setCurrentIndex(index);
     edit(index);
 }
@@ -352,5 +432,20 @@ void Fb2HeadView::editCurrent()
 void Fb2HeadView::activated(const QModelIndex &index)
 {
     if (index.isValid() && index.column() == 1) edit(index);
+    showStatus(index);
 }
 
+void Fb2HeadView::currentChanged(const QModelIndex &current, const QModelIndex &previous)
+{
+    QTreeView::currentChanged(current, previous);
+    showStatus(current);
+}
+
+void Fb2HeadView::showStatus(const QModelIndex &current)
+{
+    if (!model()) return;
+    if (!current.isValid()) return;
+    QModelIndex parent = model()->parent(current);
+    QModelIndex index = model()->index(current.row(), 2, parent);
+    emit status(model()->data(index).toString());
+}

+ 29 - 1
source/fb2head.hpp

@@ -2,6 +2,8 @@
 #define FB2HEAD_H
 
 #include <QAbstractItemModel>
+#include <QDomDocument>
+#include <QDomElement>
 #include <QTreeView>
 #include <QWebElement>
 #include <QWebView>
@@ -69,6 +71,7 @@ private:
     };
 
 private:
+    QDomElement scheme() const;
     void addChildren(QWebElement &parent);
     QString value() const;
     QString hint() const;
@@ -76,9 +79,9 @@ private:
 private:
     QList<Fb2HeadItem*> m_list;
     QWebElement m_element;
+    Fb2HeadItem * m_parent;
     QString m_name;
     QString m_text;
-    Fb2HeadItem * m_parent;
     QString m_id;
 };
 
@@ -110,6 +113,22 @@ private:
     Fb2HeadItem * m_root;
 };
 
+class Fb2Scheme : public QObject
+{
+    Q_OBJECT
+
+public:
+    static const Fb2Scheme & fb2();
+    explicit Fb2Scheme();
+
+public:
+    static QString info(QDomElement parent);
+    QDomElement element(const QString &name, QDomElement parent) const;
+
+private:
+    QDomDocument doc;
+};
+
 class Fb2HeadView : public QTreeView
 {
     Q_OBJECT
@@ -118,6 +137,9 @@ public:
     explicit Fb2HeadView(Fb2WebView &view, QWidget *parent = 0);
     void initToolbar(QToolBar &toolbar);
 
+signals:
+    void status(const QString &text);
+
 public slots:
     void editCurrent();
     void updateTree();
@@ -125,6 +147,12 @@ public slots:
 private slots:
     void activated(const QModelIndex &index);
 
+protected:
+    void currentChanged(const QModelIndex &current, const QModelIndex &previous);
+
+private:
+    void showStatus(const QModelIndex &current);
+
 private:
     Fb2WebView & m_view;
     QAction * actionInsert;

+ 5 - 1
source/fb2main.cpp

@@ -708,6 +708,7 @@ void Fb2MainWindow::viewHead()
 
     if (!headTree) {
         headTree = new Fb2HeadView(*textEdit, this);
+        connect(headTree, SIGNAL(status(QString)), this, SLOT(status(QString)));
     }
 
     this->setFocus();
@@ -754,4 +755,7 @@ void Fb2MainWindow::clipboardDataChanged()
     }
 }
 
-
+void Fb2MainWindow::status(const QString &text)
+{
+    statusBar()->showMessage(text);
+}

+ 1 - 0
source/fb2main.hpp

@@ -51,6 +51,7 @@ private slots:
     void viewHead();
     void viewTree();
 
+    void status(const QString &text);
     void clipboardDataChanged();
     void selectionChanged();
     void undoChanged();