Proposal talk:Specify intermediate format for printing Wikibooks that can be rendered with XSL-FO

Latest comment: 14 years ago by Fasten in topic Example for an xml book schema

Example for an xml book schema

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   xmlns="http://xml.wikibooks.org/2009/XMLBook"
   targetNamespace="http://xml.wikibooks.org/2009/XMLBook"
   elementFormDefault="qualified"
   attributeFormDefault="unqualified">
<xsd:annotation>
  <xsd:documentation>
  Proposal for an XSD book schema (rough sketch).
  </xsd:documentation>
</xsd:annotation>
<xsd:element name="book" type="Book"/>
<xsd:complexType name="Section">
  <xsd:sequence>
    <xsd:choice minOccurs="1" maxOccurs="unbounded">
      <xsd:element name="footnote"              type="Footnote"/>
      <xsd:element name="endnote"               type="Endnote"/>
      <xsd:element name="annotation"            type="Annotation"/>
      <xsd:element name="pageref"               type="Pageref"/>
      <xsd:element name="cite"                  type="Citation"/>
    </xsd:choice>
  </xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Frontmatter">
  <xsd:sequence>
    <xsd:choice minOccurs="1" maxOccurs="unbounded">
      <xsd:element name="section"               type="Section"/>
      <xsd:element name="imprint"               type="Imprint"/>
      <xsd:element name="toc"                   type="TableOfContents"/>
    </xsd:choice>
  </xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Mainmatter">
  <xsd:sequence>
    <xsd:choice minOccurs="1" maxOccurs="unbounded">
      <xsd:element name="part"                  type="Part"/>
      <xsd:element name="chapter"               type="Chapter"/>
      <xsd:element name="section"               type="Section"/>
      <xsd:element name="box"                   type="Box"/>
    </xsd:choice>
  </xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Backmatter">
  <xsd:sequence>
    <xsd:choice minOccurs="1" maxOccurs="unbounded">
      <xsd:element name="section"               type="Section"/>
      <xsd:element name="appendix"              type="Appendix"/>
      <xsd:element name="bibliography"          type="Bibliography"/>
    </xsd:choice>
  </xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Book">
  <xsd:annotation>
    <xsd:documentation>
    The Book type serves as the enclosing type of all data types
    in the XMLBook namespace. The Part and Chapter types at this
    level are meant to allow to create parts and chapters of books
    as independent files. 
    </xsd:documentation>
  </xsd:annotation>
  <xsd:sequence>
    <xsd:choice minOccurs="1" maxOccurs="unbounded">
      <xsd:element name="frontmatter"           type="Frontmatter"/>
      <xsd:element name="mainmatter"            type="Mainmatter"/>
      <xsd:element name="backmatter"            type="Backmatter"/>
      <xsd:element name="part"                  type="Part"/>
      <xsd:element name="chapter"               type="Chapter"/>
    </xsd:choice>
  </xsd:sequence>
</xsd:complexType>
</xsd:schema>

Wiki templates could attach a recommendation "required", "recommended" or "optional" to boxes, so the printing application could distinguish which boxes where sufficiently important for printing in order to appear in the book. An export filter should allow to modify the recommendations generated by templates. HTML style properties could also be categorized as "required", "optional" and "invalid" — invalid properties would be invalid for printing only, of course. --Fasten 15:33, 15 December 2009 (UTC)Reply

I recommend to export templates as
<wiki:template name="Template:Example">
  <wiki:param name="1" value="title"/>
  <wiki:param name="2" value="text"/>
</wiki:template>
Book authors can use XSLT to transform templates individually for each book. There is no need to standardize the layout of templates when XSLT can conveniently address this issue. This way readers may also be able to choose between quite different approaches to print the same content. --Bernhard Fastenrath 17:50, 12 April 2010 (UTC)Reply
Return to "Specify intermediate format for printing Wikibooks that can be rendered with XSL-FO" page.