677
ID | 677 |
Data | 2011-09-07 |
Symbol | 2011/09/07/677 |
Instytucja | Urząd Miasta Lubartów |
Nazwa | Wniosek o zezwolenie na przeprowadzenie imprezy masowej |
Czy Aktualny | 1 |
---|
Ustawy (1)
Pliki
Styl
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:Dokument="http://crd.gov.pl/wzor/2011/09/07/677/">
<xsl:output method="html" encoding="UTF-8"/>
<!-- klucze pozwalają na wyszukiwanie elementów po id -->
<xsl:key name="colorValue" match="colorValue" use="@id"/>
<!-- szablon zwraca styl dla danego elementu -->
<xsl:template name="get-element-style">
<xsl:param name="elem"/>
<xsl:choose>
<xsl:when test="name() = 'radioButton'">
width: 30px;
</xsl:when>
<xsl:otherwise>
width: <xsl:value-of select="$elem/@width"/>px;
</xsl:otherwise>
</xsl:choose>
height: <xsl:value-of select="$elem/@height"/>px;
<xsl:if test="$elem/@X">
left: <xsl:value-of select="$elem/@X"/>px;
</xsl:if>
<xsl:if test="$elem/@Y">
top: <xsl:value-of select="$elem/@Y"/>px;
</xsl:if>
position: absolute;
<xsl:if test="$elem/visible">
display: none;
</xsl:if>
<xsl:choose>
<xsl:when test="$elem/background/colorValue">
background: rgb(<xsl:value-of select="translate(string($elem/background/colorValue),' ',',')"/>);
</xsl:when>
<xsl:otherwise>
<xsl:if test="$elem/background/colorReference">
<xsl:variable name="colorValue">
<xsl:value-of select="key('colorValue', $elem/background/colorReference)"/>
</xsl:variable>
background: rgb(<xsl:value-of select="translate(string($colorValue),' ',',')"/>);
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="name($elem) = 'textField' or name($elem) = 'textArea'">
border: 1px dashed #CCC;
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="name($elem) = 'dropDownList'">
border: 1px solid black;
</xsl:when>
<xsl:otherwise>
border: none;
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="name($elem) = 'text'">
padding-top: 4px;
</xsl:if>
<xsl:if test="$elem/@horizontalAlignment = 'Center'">
text-align: center;
</xsl:if>
<xsl:if test="$elem/font/fontValue">
font-size: <xsl:value-of select="$elem/font/fontValue/@size"/>px;
</xsl:if>
</xsl:template>
<!-- szablon zwraca styl dla etykiety przy radioButton`ach -->
<xsl:template name="get-label-style">
<xsl:param name="elem"/>
width: <xsl:value-of select="$elem/@width - 30"/>px;
height: <xsl:value-of select="$elem/@height"/>px;
<xsl:if test="$elem/@X">
left: <xsl:value-of select="$elem/@X + 30"/>px;
</xsl:if>
<xsl:if test="$elem/@Y">
top: <xsl:value-of select="$elem/@Y"/>px;
</xsl:if>
position: absolute;
padding-top: 4px;
</xsl:template>
<!-- szablon zwraca styl dla strony (każda kolejna jest ustawiana pod poprzednią) -->
<xsl:template name="get-page-style">
<xsl:param name="page"/>
<xsl:param name="index"/>
width: <xsl:value-of select="$page/@width"/>px;
height: <xsl:value-of select="$page/@height"/>px;
position: relative;
margin-bottom: 1px;
border: 1px solid black;
</xsl:template>
<xsl:template name="get-elements">
<xsl:param name="parent"/>
<div>
<xsl:attribute name="style">
<xsl:call-template name="get-element-style">
<xsl:with-param name="elem" select="."/>
</xsl:call-template>
</xsl:attribute>
<xsl:for-each select="$parent"> <!-- pętla po elementach -->
<xsl:for-each select="items/*">
<xsl:variable name="style"> <!-- deklaracja zmiennej definiującej styl -->
<xsl:call-template name="get-element-style">
<xsl:with-param name="elem" select="."/>
</xsl:call-template>
</xsl:variable>
<div style="display: inline">
<xsl:if test="name() = 'text'">
<xsl:attribute name="style">
<xsl:copy-of select="$style"/>
</xsl:attribute>
<xsl:value-of select="caption/stringValue"/>
</xsl:if>
<xsl:if test="name() = 'textArea'">
<textarea>
<xsl:attribute name="style">
<xsl:copy-of select="$style"/>
</xsl:attribute>
<xsl:if test="value">
<xsl:attribute name="name">
<xsl:value-of select="value/*/@id"/>
</xsl:attribute>
<xsl:value-of select="value/stringValue"/>
</xsl:if>
<xsl:if test="itemContent">
<xsl:attribute name="name">
<xsl:value-of select="itemContent/*/@id"/>
</xsl:attribute>
<xsl:value-of select="itemContent/stringValue"/>
</xsl:if>
</textarea>
</xsl:if>
<xsl:if test="name() = 'textField'">
<input type="text">
<xsl:attribute name="style">
<xsl:copy-of select="$style"/>
</xsl:attribute>
<xsl:if test="value">
<xsl:attribute name="value">
<xsl:value-of select="normalize-space(value)"/>
</xsl:attribute>
<xsl:attribute name="name">
<xsl:value-of select="value/*/@id"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="itemContent">
<xsl:attribute name="value">
<xsl:value-of select="normalize-space(itemContent)"/>
</xsl:attribute>
<xsl:attribute name="name">
<xsl:value-of select="itemContent/*/@id"/>
</xsl:attribute>
</xsl:if>
</input>
</xsl:if>
<xsl:if test="name() = 'dropDownList'">
<select>
<xsl:attribute name="style">
<xsl:copy-of select="$style"/>
</xsl:attribute>
<xsl:attribute name="name">
<xsl:value-of select="value/*/@id"/>
</xsl:attribute>
<xsl:for-each select="listItems/*">
<option>
<xsl:value-of select="text()"/>
</option>
</xsl:for-each>
</select>
</xsl:if>
<xsl:if test="name() = 'checkBox'">
<input type="checkbox">
<xsl:attribute name="style">
<xsl:copy-of select="$style"/>
</xsl:attribute>
<xsl:attribute name="name">
<xsl:value-of select="value/*/@id"/>
</xsl:attribute>
<xsl:if test="value/booleanValue = true">
<xsl:attribute name="checked">checked</xsl:attribute>
</xsl:if>
</input>
</xsl:if>
<xsl:if test="name() = 'groupRadioButton'">
<div>
<xsl:attribute name="style">
<xsl:copy-of select="$style"/>
</xsl:attribute>
<xsl:variable name="value">
<xsl:value-of select="value/integerValue"/>
</xsl:variable>
<xsl:variable name="name">
<xsl:value-of select="value/*/@id"/>
</xsl:variable>
<xsl:for-each select="radioButtons/*">
<xsl:variable name="index">
<xsl:value-of select="position() - 1"/>
</xsl:variable>
<input type="radio" name="radio">
<xsl:attribute name="style">
<xsl:call-template name="get-element-style">
<xsl:with-param name="elem" select="."/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="name">
<xsl:copy-of select="$name"/>
</xsl:attribute>
<xsl:if test="$value = $index">
<xsl:attribute name="checked">checked</xsl:attribute>
</xsl:if>
<xsl:attribute name="value">
<xsl:copy-of select="$index"/>
</xsl:attribute>
</input>
<span>
<xsl:attribute name="style">
<xsl:call-template name="get-label-style">
<xsl:with-param name="elem" select="."/>
</xsl:call-template>
</xsl:attribute>
<xsl:value-of select="normalize-space(caption)"/>
</span>
</xsl:for-each>
</div>
</xsl:if>
</div>
</xsl:for-each>
<xsl:for-each select="group">
<xsl:call-template name="get-elements">
<xsl:with-param name="parent" select="."/>
</xsl:call-template>
</xsl:for-each>
</xsl:for-each>
</div>
</xsl:template>
<xsl:template match="/Dokument/TrescDokumentu">
<html>
<body style="font-family: Tahoma,sans-serif; font-size: 10px;">
<form action="" method="post">
<xsl:for-each select="page"> <!-- pętla po stronach -->
<div>
<xsl:attribute name="style">
<xsl:call-template name="get-page-style">
<xsl:with-param name="page" select="."/>
<xsl:with-param name="index" select="position()"/>
</xsl:call-template>
</xsl:attribute>
<xsl:for-each select="*"> <!-- pętla po wszystkich elementach na stronie -->
<xsl:call-template name="get-elements">
<xsl:with-param name="parent" select="."/>
</xsl:call-template>
</xsl:for-each>
</div>
</xsl:for-each>
<input type="submit" name="Przycisk.Wyslij" value="Wyślij formularz"/>
</form>
</body>
</html>
</xsl:template>
</xsl:stylesheet>