Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Initial commit
  • Loading branch information
tommorris committed May 14, 2008
0 parents commit 4ee781d
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
35 changes: 35 additions & 0 deletions 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 changes: 45 additions & 0 deletions 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.