Skip to content

Commit

Permalink
image support added to 2x3 version
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Harviston committed Mar 6, 2012
1 parent ae35845 commit 54eec7f
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions cards-2x3.xsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<!-- vim: set ts=2: -->
<!-- vim: set ts=2:sw=2: -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
Expand Down Expand Up @@ -51,7 +51,7 @@
<xsl:template match="whitecard">
<fo:table-cell border="solid black" padding=".1in" width="2in" height="2.8in">

<fo:block><xsl:value-of select="text()"/></fo:block>
<fo:block><xsl:apply-templates/></fo:block>

<fo:block-container absolute-position="absolute" top="2.6in">
<fo:block><fo:external-graphic src="url('footer.svg')"/></fo:block>
Expand Down Expand Up @@ -92,4 +92,18 @@
</fo:table-cell>
</xsl:template>

<xsl:template match="text()">
<xsl:value-of select="."/>
</xsl:template>

<xsl:template match="img">
<fo:external-graphic content-width="1.8in" content-height="1.6in">
<xsl:attribute name="src">
<xsl:text>url('</xsl:text>
<xsl:value-of select="@src"/> <!--FIXME escape out single quotes -->
<xsl:text>')</xsl:text>
</xsl:attribute>
</fo:external-graphic>
</xsl:template>

</xsl:stylesheet>

0 comments on commit 54eec7f

Please sign in to comment.