Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/recipe-books.git

Added premable parameter to XSLT. Added parsing for recipe-book tags.

AuthorDave Jarvis <email>
Date2013-02-02 20:16:10 GMT-0800
Commit49633200526236ab65d79e99987388440b5ed3f1
Parent5a55533
example-book.xml
<created format="YYYY-MM-DD">2013-02-02</created>
<photo use="front-cover">
- <url>http://i.imgur.com/p71y6mq.jpg</url>
+ <uri>http://i.imgur.com/p71y6mq.jpg</uri>
</photo>
</book>
<recipe>
<description>
<title>Thai-Style Roast Duck</title>
<photo use="recipe-inset">
- <url>http://www.templeofthai.com/images/recipes/duck-curry-1000x665-Pangfolio-shutterstock.jpg</url>
+ <uri>http://www.templeofthai.com/images/recipes/duck-curry-1000x665-Pangfolio-shutterstock.jpg</uri>
</photo>
</description>
<title>Orange Juice Chicken</title>
<photo use="recipe-inset">
- <url>http://3.bp.blogspot.com/-CBO-ehbIwbc/T5oslwe_gFI/AAAAAAAACTw/LoC-NP1e5fw/s1600/orange+chicken+and+peach+cobbler+120.JPG</url>
+ <uri>http://3.bp.blogspot.com/-CBO-ehbIwbc/T5oslwe_gFI/AAAAAAAACTw/LoC-NP1e5fw/s1600/orange+chicken+and+peach+cobbler+120.JPG</uri>
</photo>
</description>
<title>Pizza Dough</title>
<photo use="recipe-inset">
- <url>http://warmvanillasugar.files.wordpress.com/2010/10/pizza_dough_main.jpg</url>
+ <uri>http://warmvanillasugar.files.wordpress.com/2010/10/pizza_dough_main.jpg</uri>
</photo>
</description>
xsl/latex.xsl
<xsl:import href="string-utilities.xsl" />
-<xsl:import href="constants.xsl" />
-<xsl:import href="footer.xsl" />
<xsl:output method="text" encoding="utf-8"/>
<xsl:strip-space elements="*" />
+
+<!-- LaTeX premable inserted at the top of the document as text. -->
+<xsl:param name="preamble" />
<xsl:template match="/" >
- <xsl:apply-templates select="*" />
+ <xsl:apply-templates />
</xsl:template>
-<xsl:template match="*" />
+<xsl:template match="recipe-book">
+ <xsl:apply-templates />
+</xsl:template>
+<xsl:template match="book">
+ <xsl:apply-templates />
+</xsl:template>
<xsl:template match="recipe">
<xsl:text>\begin{recipe}{</xsl:text>
<xsl:value-of select="normalize-space(string:capitalize-words(description/title))" />
<xsl:text>}&#xa;</xsl:text>
<xsl:apply-templates select="*"/>
<xsl:text>\end{recipe}&#xa;&#xa;</xsl:text>
</xsl:template>
-
<xsl:template match="preparation">
<xsl:text>.&#xa;</xsl:text>
</xsl:template>
+
+<xsl:template match="*" />
</xsl:stylesheet>
+
+
Delta18 lines added, 9 lines removed, 9-line increase