Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:fo="http://www.w3.org/1999/XSL/Format">
- <xsl:template match="/">
- <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
- <!-- Layout Master -->
- <fo:layout-master-set>
- <fo:simple-page-master master-name="titlePage"
- page-height="297mm" page-width="210mm"
- margin="20mm">
- <fo:region-body margin-top="20mm" background-image="obrazy/bodybg.png" background-repeat="no-repeat"/>
- </fo:simple-page-master>
- <fo:simple-page-master master-name="otherPages"
- page-height="297mm" page-width="210mm"
- margin="20mm">
- <fo:region-body/>
- <fo:region-after/>
- </fo:simple-page-master>
- <fo:page-sequence-master master-name="order">
- <fo:repeatable-page-master-alternatives>
- <fo:conditional-page-master-reference page-position="first" master-reference="titlePage"/>
- <fo:conditional-page-master-reference page-position="rest" master-reference="otherPages"/>
- </fo:repeatable-page-master-alternatives>
- </fo:page-sequence-master>
- </fo:layout-master-set>
- <!-- Page sequences -->
- <fo:page-sequence master-reference="titlePage">
- <fo:flow flow-name="xsl-region-body">
- <fo:block text-align="center" font-size="40pt"
- font-weight="bold" space-after="10mm">
- Tatry
- </fo:block>
- <fo:table table-layout="fixed" width="100%">
- <fo:table-column column-width="proportional-column-width(1)"/>
- <fo:table-column column-width="50mm"/>
- <fo:table-column column-width="50mm"/>
- <fo:table-column column-width="proportional-column-width(1)"/>
- <fo:table-body>
- <fo:table-row>
- <fo:table-cell column-number="2">
- <fo:block>
- <fo:external-graphic width="50mm" height="41mm" content-height="scale-to-fit" content-width="scale-to-fit">
- <xsl:attribute name="src">
- url("<xsl:value-of select="tatry/child::*[1]/zdjecie/@src"/>")
- </xsl:attribute>
- </fo:external-graphic>
- </fo:block>
- </fo:table-cell>
- <fo:table-cell column-number="3">
- <fo:block>
- <fo:external-graphic width="50mm" height="41mm" content-height="scale-to-fit" content-width="scale-to-fit">
- <xsl:attribute name="src">
- url("<xsl:value-of select="tatry/child::*[2]/zdjecie/@src"/>")
- </xsl:attribute>
- </fo:external-graphic>
- </fo:block>
- </fo:table-cell>
- </fo:table-row>
- <fo:table-row>
- <fo:table-cell column-number="2">
- <fo:block>
- <fo:external-graphic width="50mm" height="41mm" content-height="scale-to-fit" content-width="scale-to-fit">
- <xsl:attribute name="src">
- url("<xsl:value-of select="tatry/child::*[3]/zdjecie/@src"/>")
- </xsl:attribute>
- </fo:external-graphic>
- </fo:block>
- </fo:table-cell>
- <fo:table-cell column-number="3">
- <fo:block>
- <fo:external-graphic width="50mm" height="41mm" content-height="scale-to-fit" content-width="scale-to-fit">
- <xsl:attribute name="src">
- url("<xsl:value-of select="tatry/child::*[4]/zdjecie/@src"/>")
- </xsl:attribute>
- </fo:external-graphic>
- </fo:block>
- </fo:table-cell>
- </fo:table-row>
- </fo:table-body>
- </fo:table>
- </fo:flow>
- </fo:page-sequence>
- <fo:page-sequence master-reference="otherPages">
- <fo:static-content flow-name="xsl-region-after">
- <fo:block text-align="right"><fo:page-number/></fo:block>
- </fo:static-content>
- <fo:flow flow-name="xsl-region-body">
- <xsl:apply-templates/>
- </fo:flow>
- </fo:page-sequence>
- </fo:root>
- </xsl:template>
- <!-- Object templates -->
- <xsl:template match="szczyt">
- <fo:block page-break-before="always" font-size="25pt"><xsl:value-of select="nazwa"/></fo:block>
- <fo:block>Szczyt <xsl:value-of select="@przynaleznosc"/>.</fo:block>
- <fo:block>
- <fo:external-graphic width="50mm" height="41mm" content-height="scale-to-fit" content-width="scale-to-fit">
- <xsl:attribute name="src">
- url("<xsl:value-of select="zdjecie/@src"/>")
- </xsl:attribute>
- </fo:external-graphic>
- </fo:block>
- <fo:block font-family="Times New Roman">Wysokość:</fo:block>
- <fo:block font-family="Times New Roman" margin-left="2mm">Względna: <xsl:value-of select="wysokosc/wzgledna"/>m.</fo:block>
- <fo:block font-family="Times New Roman" margin-left="2mm">Bezwzględna: <xsl:value-of select="wysokosc/bezwzgledna"/>m.</fo:block>
- <xsl:call-template name="opis_template"/>
- </xsl:template>
- <xsl:template match="roślina | zwierze">
- <fo:block page-break-before="always" font-family="Times New Roman" font-size="25pt">
- <xsl:value-of select="nazwa[@jezyk = 'polska']"/>
- </fo:block>
- <fo:block><xsl:value-of select="nazwa[@jezyk = 'łacińska']"/></fo:block>
- <fo:block>
- <fo:external-graphic width="50mm" height="41mm" content-height="scale-to-fit" content-width="scale-to-fit">
- <xsl:attribute name="src">
- url("<xsl:value-of select="zdjecie/@src"/>")
- </xsl:attribute>
- </fo:external-graphic>
- </fo:block>
- <fo:table table-layout="fixed" width="100%" border="2px solid #69b900">
- <fo:table-column column-width="23mm"/>
- <fo:table-column column-width="34mm"/>
- <fo:table-header background-color="#8AFF5A">
- <fo:table-row>
- <fo:table-cell number-columns-spanned="2" text-align="center">
- <fo:block font-weight="bold">Systematyka</fo:block>
- </fo:table-cell>
- </fo:table-row>
- </fo:table-header>
- <fo:table-body background-color="#CAFF85">
- <xsl:apply-templates select="systematyka"/>
- <xsl:if test="wystepowanie">
- <fo:table-row>
- <fo:table-cell background-color="#8AFF5A" number-columns-spanned="2" text-align="center">
- <fo:block font-weight="bold" font-family="Times New Roman">Występowanie</fo:block>
- </fo:table-cell>
- </fo:table-row>
- <xsl:apply-templates select="wystepowanie"/>
- </xsl:if>
- </fo:table-body>
- </fo:table>
- <xsl:call-template name="opis_template"/>
- </xsl:template>
- <!-- Opis template -->
- <xsl:template name="opis_template">
- <fo:list-block space-before="3mm">
- <xsl:apply-templates select="opis/podpunkt"/>
- </fo:list-block>
- <fo:block space-before="5mm" font-family="Times New Roman">
- Informacje zaczerpnięte z:
- <fo:basic-link color="blue">
- <xsl:attribute name="external-destination">
- url("<xsl:value-of select="odnosnik[1]/@href"/>")
- </xsl:attribute>
- Wikipedii
- </fo:basic-link>
- </fo:block>
- </xsl:template>
- <!-- Podpunkt template -->
- <xsl:template match="podpunkt">
- <fo:list-item>
- <fo:list-item-label>
- <fo:block><xsl:number value="position()"/>:</fo:block>
- </fo:list-item-label>
- <fo:list-item-body>
- <fo:block font-family="Times New Roman" margin-left="5mm">
- <fo:inline font-weight="bold"><xsl:value-of select="@o_czym"/>: </fo:inline>
- <xsl:value-of select="."/>
- </fo:block>
- </fo:list-item-body>
- <xsl:value-of select="."/>
- </fo:list-item>
- </xsl:template>
- <!-- Systematyka template -->
- <xsl:template match="systematyka/child::*">
- <fo:table-row>
- <fo:table-cell border="1px solid #69b900">
- <fo:block><xsl:value-of select="name(.)"/></fo:block>
- </fo:table-cell>
- <fo:table-cell border="1px solid #69b900" font-family="Times New Roman">
- <fo:block><xsl:value-of select="."/></fo:block>
- </fo:table-cell>
- </fo:table-row>
- </xsl:template>
- <!-- Wystepowanie template -->
- <xsl:template match="kraj">
- <fo:table-row>
- <fo:table-cell border="1px solid #69b900">
- <fo:block>
- <xsl:choose>
- <xsl:when test="string-length(normalize-space(.)) > 9">
- <xsl:value-of select="substring(normalize-space(.), 1, 9)"/>...
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </fo:block>
- </fo:table-cell>
- <fo:table-cell border="1px solid #69b900">
- <fo:block><xsl:value-of select="liczebnosc/@ile"/></fo:block>
- </fo:table-cell>
- </fo:table-row>
- </xsl:template>
- </xsl:transform>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement