Project

Profile

Help

Bug #5443 ยป error-message.xsl

Ken Holman, 2022-04-03 20:02

 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:c="test"
xmlns:x="test2"
exclude-result-prefixes="xs c x"
version="2.0">

<xsl:variable name="c:base" as="document-node()">
<xsl:variable name="raw">
<c:a>a</c:a>
<c:b>b</c:b>
<c:c>c</c:c>
</xsl:variable>
<xsl:sequence select="c:massageRawFormattingDefinitions($raw)"/>
</xsl:variable>
<xsl:variable name="c:isDraft" select="false()"/>

<xsl:variable name="c:coversInDraft" select="()"/>
<xsl:variable name="c:coversInBW" as="element()">
<hello/>
</xsl:variable>

<xsl:template match="/">
<xsl:message select="'working'"/>
<xsl:call-template name="c:MainFrontCoverContent">
<xsl:with-param name="c:f" as="document-node()+" tunnel="yes"
select="$c:base"/>
<xsl:with-param name="c:inColour" as="xs:boolean" tunnel="yes"
select="true()"/>
</xsl:call-template>
</xsl:template>

<xsl:template name="c:MainFrontCoverContent">
<xsl:param name="c:f" as="document-node()+" tunnel="yes"/>
<xsl:param name="c:inColour" as="xs:boolean" tunnel="yes"/>
<wrapper x:h="div*cover-page">
<!--FRONT COVER PAGE(S)-->

<!--Set colour palette to use-->
<xsl:variable name="c:colourBase" as="element()" select="
if ($c:isDraft) then
$c:coversInDraft
else
if ($c:inColour) then
$c:f/c:missing
else
$c:coversInBW"/>

<!--Top background with photo/image if applicable. The same
photo/image can be used on front and back covers or a separate
photo/image can be used for each cover according to the name.-->
<block-container absolute-position="fixed" left="10mm" right="10mm" top="10mm"
bottom="175mm" margin="0mm" padding="0mm"
background-color="{$c:colourBase/@c:topBackground}" z-index="0">
</block-container>
</wrapper>
</xsl:template>

<xsl:function name="c:massageRawFormattingDefinitions" as="document-node()">
<xsl:param name="raw" as="document-node()"/>
<xsl:document>
<xsl:for-each select="$raw/*">
<xsl:copy>
<xsl:attribute name="x:{local-name()}"/>
<xsl:copy-of select="@*,node()"/>
</xsl:copy>
</xsl:for-each>
</xsl:document>
</xsl:function>

</xsl:stylesheet>
    (1-1/1)