home *** CD-ROM | disk | FTP | other *** search
- <xsl:stylesheet
- version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xt="http://www.jclark.com/xt">
- <xsl:output method="html"/>
- <xsl:strip-space elements="*"/>
-
-
- <xsl:variable name="st" select="document("styles.xml")/params"/>
- <xsl:variable name="startpages-st" select="$st//paramgroup[@name="startpages"]"/>
- <xsl:variable name="general-st" select="document('params.xml')//paramgroup[@name="general"]"/>
- <xsl:variable name="frame-st" select="$st//paramgroup[@name="frames"]"/>
- <xsl:variable name="uframe-st" select="$frame-st/paramgroup[@name="uframe"]"/>
- <xsl:variable name="lframe-st" select="$frame-st/paramgroup[@name="lframe"]"/>
- <xsl:variable name="index-st" select="$st//paramgroup[@name="index"]"/>
- <xsl:variable name="index-font-st" select="$index-st//paramgroup[@name="font"]"/>
- <xsl:variable name="page-st" select="$st//paramgroup[@name="page"]"/>
- <xsl:variable name="table-st" select="$st//paramgroup[@name="table"]"/>
- <xsl:variable name="row-st" select="$st//paramgroup[@name="rows"]"/>
- <xsl:variable name="row-font-st" select="$row-st/paramgroup[@name="font"]"/>
- <xsl:variable name="header-st" select="$st//paramgroup[@name="header"]"/>
- <xsl:variable name="header-font-st" select="$header-st/paramgroup[@name="font"]"/>
- <xsl:variable name="caption-st" select="$st//paramgroup[@name="caption"]"/>
- <xsl:variable name="caption-font-st" select="$caption-st/paramgroup[@name="font"]"/>
-
- <xsl:variable name="card-st" select="$st/paramgroup[@name="card"]"/>
- <xsl:variable name="title-st" select="$card-st/paramgroup[@name="title"]"/>
- <xsl:variable name="title-font-st" select="$title-st/paramgroup[@name="font"]"/>
- <xsl:variable name="author-st" select="$card-st/paramgroup[@name="author"]"/>
- <xsl:variable name="author-font-st" select="$author-st/paramgroup[@name="font"]"/>
- <xsl:variable name="pilab-st" select="$card-st/paramgroup[@name="pilab"]"/>
- <xsl:variable name="pilab-font-st" select="$pilab-st/paramgroup[@name="font"]"/>
- <xsl:variable name="pival-st" select="$card-st/paramgroup[@name="pival"]"/>
- <xsl:variable name="pival-font-st" select="$pival-st/paramgroup[@name="font"]"/>
- <xsl:variable name="desclab-st" select="$card-st/paramgroup[@name="desclab"]"/>
- <xsl:variable name="desclab-font-st" select="$desclab-st/paramgroup[@name="font"]"/>
- <xsl:variable name="desctext-st" select="$card-st/paramgroup[@name="desctext"]"/>
- <xsl:variable name="desctext-font-st" select="$desctext-st/paramgroup[@name="font"]"/>
-
- <xsl:template name="apply-bold">
- <xsl:param name="isbold"/>
- <xsl:param name="content"/>
- <xsl:choose>
- <xsl:when test="$isbold="true" or $isbold="yes"">
- <b><xsl:copy-of select="$content"/></b>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$content"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="apply-italic">
- <xsl:param name="isitalic"/>
- <xsl:param name="content"/>
- <xsl:choose>
- <xsl:when test="$isitalic="true" or $isitalic="yes"" >
- <i><xsl:copy-of select="$content"/></i>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$content"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="apply-striked">
- <xsl:param name="isstriked"/>
- <xsl:param name="content"/>
- <xsl:choose>
- <xsl:when test="$isstriked="yes" or $isstriked="true"">
- <s><xsl:copy-of select="$content"/></s>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$content"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="apply-font-styles">
- <xsl:param name="bold"/>
- <xsl:param name="italic"/>
- <xsl:param name="striked"/>
- <xsl:param name="content"/>
-
- <xsl:call-template name="apply-italic">
- <xsl:with-param name="isitalic" select="$italic"/>
- <xsl:with-param name="content">
- <xsl:call-template name="apply-bold">
- <xsl:with-param name="isbold" select="$bold"/>
- <xsl:with-param name="content">
- <xsl:call-template name="apply-striked">
- <xsl:with-param name="isstriked" select="$striked"/>
- <xsl:with-param name="content">
- <xsl:copy-of select="$content"/>
- </xsl:with-param>
- </xsl:call-template> <!-- striked -->
- </xsl:with-param>
- </xsl:call-template> <!-- bold -->
- </xsl:with-param>
- </xsl:call-template> <!-- italic -->
- </xsl:template>
-
-
- <xsl:variable name="rowsperpage" select="$table-st/param[@name='rowsperpage']/@value"/>
- <xsl:variable name="table-width" select="$table-st/param[@name='width']/@value"/>
-
- <xsl:template name="apply-font-styles-using-path">
- <xsl:param name="path"/>
- <xsl:param name="content"/>
-
- <xsl:variable name="bold"
- select="$path/paramgroup[@name="font"]/param[@name="bold"]/@value"/>
- <xsl:variable name="italic"
- select="$path/paramgroup[@name="font"]/param[@name="italic"]/@value"/>
- <xsl:variable name="striked"
- select="$path/paramgroup[@name="font"]/param[@name="striked"]/@value"/>
- <xsl:call-template name="apply-font-styles">
- <xsl:with-param name="content" select="$content"/>
- <xsl:with-param name="bold" select="$bold"/>
- <xsl:with-param name="italic" select="$italic"/>
- <xsl:with-param name="striked" select="$striked"/>
- </xsl:call-template>
- </xsl:template>
-
- <xsl:variable name="mpcolor1" select="$startpages-st/param[@name='color1']/@value"/>
- <xsl:variable name="mpcolor2" select="$startpages-st/param[@name='color2']/@value"/>
- <xsl:variable name="mpcolor3" select="$startpages-st/param[@name='color3']/@value"/>
-
- <xsl:attribute-set name="index-font-style">
- <xsl:attribute name="size"><xsl:value-of select="$index-font-st/param[@name='size']/@value"/></xsl:attribute>
- <xsl:attribute name="face"><xsl:value-of select="$index-font-st/param[@name='family']/@value"/></xsl:attribute>
- <xsl:attribute name="color"><xsl:value-of select="$index-font-st/param[@name="color"]/@value"/></xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="row-font-style">
- <xsl:attribute name="size"><xsl:value-of select="$row-font-st/param[@name='size']/@value"/></xsl:attribute>
- <xsl:attribute name="face"><xsl:value-of select="$row-font-st/param[@name='family']/@value"/></xsl:attribute>
- <xsl:attribute name="color"><xsl:value-of select="$row-font-st/param[@name="color"]/@value"/></xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="header-font-style">
- <xsl:attribute name="size"><xsl:value-of select="$header-font-st/param[@name='size']/@value"/></xsl:attribute>
- <xsl:attribute name="face"><xsl:value-of select="$header-font-st/param[@name='family']/@value"/></xsl:attribute>
- <xsl:attribute name="color"><xsl:value-of select="$header-font-st/param[@name="color"]/@value"/></xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="caption-font-style">
- <xsl:attribute name="size"><xsl:value-of select="$caption-font-st/param[@name='size']/@value"/></xsl:attribute>
- <xsl:attribute name="face"><xsl:value-of select="$caption-font-st/param[@name='family']/@value"/></xsl:attribute>
- <xsl:attribute name="color"><xsl:value-of select="$caption-font-st/param[@name="color"]/@value"/></xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="title-font-style">
- <xsl:attribute name="size"><xsl:value-of select="$title-font-st/param[@name='size']/@value"/></xsl:attribute>
- <xsl:attribute name="face"><xsl:value-of select="$title-font-st/param[@name='family']/@value"/></xsl:attribute>
- <xsl:attribute name="color"><xsl:value-of select="$title-font-st/param[@name="color"]/@value"/></xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="author-font-style">
- <xsl:attribute name="size"><xsl:value-of select="$author-font-st/param[@name='size']/@value"/></xsl:attribute>
- <xsl:attribute name="face"><xsl:value-of select="$author-font-st/param[@name='family']/@value"/></xsl:attribute>
- <xsl:attribute name="color"><xsl:value-of select="$author-font-st/param[@name="color"]/@value"/></xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="pilab-font-style">
- <xsl:attribute name="size"><xsl:value-of select="$pilab-font-st/param[@name='size']/@value"/></xsl:attribute>
- <xsl:attribute name="face"><xsl:value-of select="$pilab-font-st/param[@name='family']/@value"/></xsl:attribute>
- <xsl:attribute name="color"><xsl:value-of select="$pilab-font-st/param[@name="color"]/@value"/></xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="pival-font-style">
- <xsl:attribute name="size"><xsl:value-of select="$pival-font-st/param[@name='size']/@value"/></xsl:attribute>
- <xsl:attribute name="face"><xsl:value-of select="$pival-font-st/param[@name='family']/@value"/></xsl:attribute>
- <xsl:attribute name="color"><xsl:value-of select="$pival-font-st/param[@name="color"]/@value"/></xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="desclab-font-style">
- <xsl:attribute name="size"><xsl:value-of select="$desclab-font-st/param[@name='size']/@value"/></xsl:attribute>
- <xsl:attribute name="face"><xsl:value-of select="$desclab-font-st/param[@name='family']/@value"/></xsl:attribute>
- <xsl:attribute name="color"><xsl:value-of select="$desclab-font-st/param[@name="color"]/@value"/></xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="desctext-font-style">
- <xsl:attribute name="size"><xsl:value-of select="$desctext-font-st/param[@name='size']/@value"/></xsl:attribute>
- <xsl:attribute name="face"><xsl:value-of select="$desctext-font-st/param[@name='family']/@value"/></xsl:attribute>
- <xsl:attribute name="color"><xsl:value-of select="$desctext-font-st/param[@name="color"]/@value"/></xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:template name="decode-align">
- <xsl:param name="code"/>
-
- <xsl:choose>
- <xsl:when test="$code = 1">left</xsl:when>
- <xsl:when test="$code = 2">center</xsl:when>
- <xsl:when test="$code = 3">right</xsl:when>
- </xsl:choose>
-
- </xsl:template>
-
-
- <xsl:template name="decode-vert-align">
- <xsl:param name="code"/>
-
- <xsl:choose>
- <xsl:when test="$code = 1">top</xsl:when>
- <xsl:when test="$code = 2">bottom</xsl:when>
- </xsl:choose>
-
- </xsl:template>
-
-
- <xsl:attribute-set name="author-align">
- <xsl:attribute name="align">
- <xsl:call-template name="decode-align">
- <xsl:with-param name="code"><xsl:value-of select="$author-st/param[@name="align"]/@value"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="pilab-align">
- <xsl:attribute name="align">
- <xsl:call-template name="decode-align">
- <xsl:with-param name="code"><xsl:value-of select="$pilab-st/param[@name="align"]/@value"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="pival-align">
- <xsl:attribute name="align">
- <xsl:call-template name="decode-align">
- <xsl:with-param name="code"><xsl:value-of select="$pival-st/param[@name="align"]/@value"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="desclab-align">
- <xsl:attribute name="align">
- <xsl:call-template name="decode-align">
- <xsl:with-param name="code"><xsl:value-of select="$desclab-st/param[@name="align"]/@value"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="desctext-align">
- <xsl:attribute name="align">
- <xsl:call-template name="decode-align">
- <xsl:with-param name="code"><xsl:value-of select="$desctext-st/param[@name="align"]/@value"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="caption-align">
- <xsl:attribute name="align">
- <xsl:call-template name="decode-align">
- <xsl:with-param name="code"><xsl:value-of select="$caption-st/param[@name="horalign"]/@value"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="price-align">
- <xsl:attribute name="align">
- <xsl:call-template name="decode-align">
- <xsl:with-param name="code"><xsl:value-of select="$row-st/param[@name="pricealign"]/@value"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="title-align">
- <xsl:attribute name="align">
- <xsl:call-template name="decode-align">
- <xsl:with-param name="code"><xsl:value-of select="$row-st/param[@name="titlealign"]/@value"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="caption-vert-align">
- <xsl:attribute name="align">
- <xsl:call-template name="decode-vert-align">
- <xsl:with-param name="code"><xsl:value-of select="$caption-st/param[@name="vertalign"]/@value"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="row-style">
- <xsl:attribute name="bgcolor"><xsl:if test="position() mod 2 = 1"><xsl:value-of select="$row-st/param[@name="color1"]/@value"/>
- </xsl:if>
- <xsl:if test="position() mod 2 != 1"><xsl:value-of select="$row-st/param[@name="color2"]/@value"/>
- </xsl:if>
- </xsl:attribute>
- <xsl:attribute name="align"><xsl:value-of select="$row-st/param[@name="align"]/@value"/></xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:variable name="tablecolor1" select="$row-st/param[@name="color1"]/@value"/>
- <xsl:variable name="tablecolor2" select="$row-st/param[@name="color2"]/@value"/>
-
- <xsl:attribute-set name="header-style">
- <xsl:attribute name="bgcolor"><xsl:value-of select="$header-st/param[@name="bgcolor"]/@value"/></xsl:attribute>
- <xsl:attribute name="align"><xsl:call-template name="decode-align">
- <xsl:with-param name="code"><xsl:value-of select="$header-st/param[@name="horalign"]/@value"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:attribute>
- </xsl:attribute-set>
-
-
- <xsl:variable name="tablebgcolor"><xsl:value-of select="$table-st/param[@name="bgcolor"]/@value"/></xsl:variable>
-
- <xsl:attribute-set name="table-style">
- <xsl:attribute name="bgcolor"><xsl:value-of select="$table-st/param[@name="bgcolor"]/@value"/></xsl:attribute>
- <xsl:attribute name="align">
- <xsl:call-template name="decode-align">
- <xsl:with-param name="code"><xsl:value-of select="$table-st/param[@name="align"]/@value"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="width"><xsl:value-of select="$table-st/param[@name="width"]/@value"/></xsl:attribute>
- <xsl:attribute name="cellspacing"><xsl:value-of select="$table-st/param[@name="cellspacing"]/@value"/></xsl:attribute>
- <xsl:attribute name="cellpadding"><xsl:value-of select="$table-st/param[@name="cellpadding"]/@value"/></xsl:attribute>
- <xsl:attribute name="border"><xsl:value-of select="$table-st/param[@name="border"]/@value"/></xsl:attribute>
- <xsl:attribute name="bordersize"><xsl:value-of select="$table-st/param[@name="borderwidth"]/@value"/></xsl:attribute>
- </xsl:attribute-set>
-
-
- <xsl:variable name="pagebgcolor"><xsl:value-of select="$page-st/param[@name="bgcolor"]/@value"/></xsl:variable>
- <xsl:variable name="table-align"><xsl:call-template name="decode-align">
- <xsl:with-param name="code"><xsl:value-of select="$table-st/param[@name="align"]/@value"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:attribute-set name="page-style">
- <xsl:attribute name="bgcolor"><xsl:value-of select="$page-st/param[@name="bgcolor"]/@value"/></xsl:attribute>
- <xsl:attribute name="background"><xsl:value-of select="$page-st/param[@name="bgimage"]/@value"/></xsl:attribute>
- <xsl:attribute name="link"><xsl:value-of select="$page-st/param[@name="lcolor"]/@value"/></xsl:attribute>
- <xsl:attribute name="alink"><xsl:value-of select="$page-st/param[@name="alcolor"]/@value"/></xsl:attribute>
- <xsl:attribute name="vlink"><xsl:value-of select="$page-st/param[@name="vlcolor"]/@value"/></xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="index-style">
- <xsl:attribute name="bgcolor"><xsl:value-of select="$index-st/param[@name="bgcolor"]/@value"/></xsl:attribute>
- <xsl:attribute name="background"><xsl:value-of select="$index-st/param[@name="bgimage"]/@value"/></xsl:attribute>
- <xsl:attribute name="link"><xsl:value-of select="$index-st/param[@name="lcolor"]/@value"/></xsl:attribute>
- <xsl:attribute name="alink"><xsl:value-of select="$index-st/param[@name="alcolor"]/@value"/></xsl:attribute>
- <xsl:attribute name="vlink"><xsl:value-of select="$index-st/param[@name="vlcolor"]/@value"/></xsl:attribute>
- </xsl:attribute-set>
-
- <xsl:attribute-set name="card-style">
- <xsl:attribute name="bgcolor"><xsl:value-of select="$card-st/param[@name="bgcolor"]/@value"/></xsl:attribute>
- <xsl:attribute name="background"><xsl:value-of select="$card-st/param[@name="bgimage"]/@value"/></xsl:attribute>
- <xsl:attribute name="link"><xsl:value-of select="$card-st/param[@name="lcolor"]/@value"/></xsl:attribute>
- <xsl:attribute name="alink"><xsl:value-of select="$card-st/param[@name="alcolor"]/@value"/></xsl:attribute>
- <xsl:attribute name="vlink"><xsl:value-of select="$card-st/param[@name="vlcolor"]/@value"/></xsl:attribute>
- </xsl:attribute-set>
-
-
- <xsl:variable name="pricecol"><xsl:value-of select="document("dblinks.xml")/params/price"/></xsl:variable>
- <xsl:variable name="isbncol"><xsl:value-of select="document("dblinks.xml")/params/ISBN"/></xsl:variable>
- <xsl:variable name="titlecol"><xsl:value-of select="document("dblinks.xml")/params/Title"/></xsl:variable>
- <xsl:variable name="desccol"><xsl:value-of select="document("dblinks.xml")/params/Annot"/></xsl:variable>
- <xsl:variable name="imagecol"><xsl:value-of select="document("dblinks.xml")/params/Imagecol"/></xsl:variable>
- <xsl:variable name="authorcol"><xsl:value-of select="document("dblinks.xml")/params/Author"/></xsl:variable>
-
- <xsl:variable name="email"><xsl:value-of select="$general-st/param[@name='email']/@value"/></xsl:variable>
- <xsl:variable name="serv"><xsl:value-of select="$general-st/param[@name='serverloc']/@value"/></xsl:variable>
- <xsl:variable name="semail"><xsl:value-of select="$general-st/param[@name='semail']/@value"/></xsl:variable>
- <xsl:variable name="sendmethod"><xsl:value-of select="$general-st/param[@name='sendmethod']/@value"/></xsl:variable>
- <xsl:variable name="sendprice"><xsl:value-of select="$general-st/param[@name='sendprice']/@value"/></xsl:variable>
- <xsl:variable name="currency"><xsl:value-of select="$general-st/param[@name='currency']/@value"/></xsl:variable>
- <xsl:variable name="rate"><xsl:value-of select="$general-st/param[@name='rate']/@value"/></xsl:variable>
- <xsl:variable name="max-items"><xsl:value-of select="$general-st/param[@name='max-items']/@value"/></xsl:variable>
-
- <xsl:variable name="server">
- <xsl:if test="starts-with($serv,'http://') = false()"><xsl:value-of select="concat ('http://', $serv)"/></xsl:if>
- <xsl:if test="starts-with($serv,'http://') = true()"><xsl:value-of select="$serv"/></xsl:if>
- </xsl:variable>
-
- </xsl:stylesheet>
-