Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial commit

  • Loading branch information...
commit 4ee781d89b971364d1c686515b93767158c5dd9d 0 parents
@tommorris authored
Showing with 80 additions and 0 deletions.
  1. +35 −0 sdf_example.html
  2. +45 −0 stylesheet.xsl
35 sdf_example.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head profile="http://tommorris.org/profiles/sdf">
+ <title>
+ <!-- title of document -->
+ </title>
+ <!-- creator -->
+ <meta name="DC.creator" content="Tom Morris"/>
+ </head>
+ <body>
+ <h1 class="title">
+ <!-- title of document -->
+ </h1>
+ <p class="abstract">
+ <!-- abstract --> As described in <a class="bibref" href="#smith2002">Smith (2002)</a>,
+ baby eating is a new and interesting phenomenon worth studying, especially when done
+ with liberal and frequent use of microformats (see <a class="bibref" href="#microformats">Microformats</a>).
+ </p>
+ <ol class="references harvard">
+ <li id="microformats">
+ <span class="creator vcard org">Microformats Community</span>
+ <cite class="title"><a href="http://microformats.org/about/">About Microformats</a></cite>
+ </li>
+ <li id="smith2002">
+ <span class="creator vcard n">
+ <span class="family-name">Smith</span>, <span class="given-name">John</span>
+ </span> (<span class="date">2002</span>)
+ <cite class="title">How to eat a baby</cite>
+ <span class="journal">Journal of American Baby Eating</span>
+ <span class="volume">1</span>: <span class="issue">3</span>
+ pp.<span class="pages">5-10</span>
+ </li>
+ </ol>
+ </body>
+</html>
45 stylesheet.xsl
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+ xmlns:h="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <xsl:output method="xml" indent="yes" />
+ <xsl:template match="h:html">
+ <fo:root>
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="A4">
+ <!-- Page template goes here -->
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="A4">
+ <fo:flow>
+ <xsl:apply-templates select="h:body" />
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </xsl:template>
+ <xsl:template match="h:h1">
+ <fo:block>
+ <!-- TODO: make text output bigger -->
+ <xsl:apply-templates />
+ </fo:block>
+ </xsl:template>
+ <xsl:template match="h:div | h:p">
+ <fo:block>
+ <xsl:apply-templates/>
+ </fo:block>
+ </xsl:template>
+ <xsl:template match="h:em | h:i">
+ <fo:inline font-variant="italic">
+ <xsl:apply-templates/>
+ </fo:inline>
+ </xsl:template>
+ <xsl:template match="h:strong | h:b">
+ <fo:inline font-weight="bold">
+ <xsl:apply-templates/>
+ </fo:inline>
+ </xsl:template>
+ <xsl:template match="text()">
+ <xsl:copy>
+ <xsl:apply-templates />
+ </xsl:copy>
+ </xsl:template>
+</xsl:stylesheet>

0 comments on commit 4ee781d

Please sign in to comment.
Something went wrong with that request. Please try again.