2018-10-29 09:55:19 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
|
|
<xsl:output method="html"/>
|
|
|
|
|
2018-10-30 17:07:16 +00:00
|
|
|
<!-- ********************************
|
|
|
|
Javascript logic goes here
|
|
|
|
Please dont polute xslt with it
|
|
|
|
******************************** -->
|
|
|
|
|
2018-10-30 16:11:38 +00:00
|
|
|
<xsl:variable name="global_script">
|
|
|
|
<script type='text/javascript'>
|
|
|
|
var more_txt = "▼ more";
|
|
|
|
var less_txt = "▲ less";
|
|
|
|
$(document).ready(function() {
|
|
|
|
$(".morelessbutton").click(function() {
|
2018-10-30 17:07:16 +00:00
|
|
|
var examples_div = $(this).parent().parent().find('.hideable').first();
|
2018-10-30 16:11:38 +00:00
|
|
|
console.log(examples_div.is(":visible"));
|
|
|
|
if(examples_div.is(":hidden")) {
|
|
|
|
$(this).text(less_txt);
|
|
|
|
} else {
|
|
|
|
$(this).text(more_txt);
|
|
|
|
}
|
|
|
|
examples_div.slideToggle();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</xsl:variable>
|
|
|
|
|
2018-10-30 17:07:16 +00:00
|
|
|
<!-- ********************************
|
|
|
|
Here go css styles
|
|
|
|
Please dont polute xslt with it
|
|
|
|
******************************** -->
|
|
|
|
|
|
|
|
<xsl:variable name="global_style">
|
2018-10-31 10:55:23 +00:00
|
|
|
<style type="text/css">
|
|
|
|
:root {
|
|
|
|
--light-gray: #999999;
|
2018-10-31 13:49:01 +00:00
|
|
|
--dark-gray: #666666;
|
|
|
|
--light-red: #dd8899;
|
2018-10-31 10:55:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.xslt-clanek {
|
2018-10-30 17:07:16 +00:00
|
|
|
font-family: Verdana, sans-serif;
|
|
|
|
font-size: 1rem;
|
|
|
|
line-height: 1.5em;
|
|
|
|
}
|
2018-10-31 10:55:23 +00:00
|
|
|
.xslt-iztocnica {
|
2018-10-30 17:07:16 +00:00
|
|
|
font-size: 1.15em;
|
|
|
|
color: #cc3366;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
2018-10-31 10:55:23 +00:00
|
|
|
.xslt-besedna-vrsta {
|
|
|
|
color: var(--dark-gray);
|
2018-10-30 17:07:16 +00:00
|
|
|
font-style: italic;
|
|
|
|
}
|
2018-10-31 10:55:23 +00:00
|
|
|
.xslt-pomen-top {
|
|
|
|
border-top: 1px dotted var(--light-gray);
|
|
|
|
padding-top: 0.5em;
|
|
|
|
margin-top: 0.5em;
|
|
|
|
}
|
|
|
|
.xslt-pomen-number {
|
|
|
|
float: left;
|
|
|
|
margin-left: 0.5em;
|
|
|
|
color: var(--light-gray);
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
2018-10-31 13:49:01 +00:00
|
|
|
.xslt-indicator {
|
|
|
|
color: var(--light-gray);
|
|
|
|
font-style: italic;
|
|
|
|
text-transform: uppercase;
|
|
|
|
}
|
|
|
|
.xslt-zgledi {
|
|
|
|
list-style-type: circle;
|
|
|
|
float: left;
|
|
|
|
margin-left: 0em;
|
|
|
|
color: var(--dark-gray);
|
|
|
|
margin: 0.5em 0;"
|
|
|
|
}
|
|
|
|
.xslt-zgled-highlight {
|
|
|
|
color: var(--light-red);
|
|
|
|
}
|
2018-10-31 14:07:56 +00:00
|
|
|
.xslt-morelessbutton-div {
|
|
|
|
padding-left: 2em;
|
|
|
|
display: inline;
|
|
|
|
}
|
|
|
|
.xslt-podpomen {
|
|
|
|
margin: 0.5em 0.5em;
|
|
|
|
}
|
2018-10-31 10:55:23 +00:00
|
|
|
|
2018-10-31 13:49:01 +00:00
|
|
|
.xslt-clear {
|
|
|
|
clear:both;
|
|
|
|
font-size:0;
|
|
|
|
}
|
2018-10-30 17:07:16 +00:00
|
|
|
</style>
|
2018-10-31 11:43:42 +00:00
|
|
|
</xsl:variable>
|
|
|
|
|
|
|
|
<!-- ********************************
|
|
|
|
Pomen/podpomen logic
|
|
|
|
******************************** -->
|
|
|
|
|
|
|
|
<xsl:template name="pomen_podpomen_logic">
|
2018-10-31 13:49:01 +00:00
|
|
|
<xsl:apply-templates select="indikator | oznaka | pomenska_shema"/>
|
2018-10-31 14:07:56 +00:00
|
|
|
<div class="xslt-morelessbutton-div">
|
2018-10-31 11:43:42 +00:00
|
|
|
<a class="morelessbutton" href="javascript:void(null)">▼ more</a>
|
|
|
|
</div>
|
2018-10-31 13:49:01 +00:00
|
|
|
<div class="hideable" style="display: none; ">
|
2018-10-31 11:43:42 +00:00
|
|
|
<xsl:apply-templates select="skladenjske_skupine"/>
|
|
|
|
</div>
|
|
|
|
</xsl:template>
|
2018-10-30 17:07:16 +00:00
|
|
|
|
|
|
|
<!-- ********************************
|
|
|
|
Here are all of xslt rules
|
|
|
|
Please dont polute xslt with it
|
|
|
|
******************************** -->
|
2018-10-31 11:23:32 +00:00
|
|
|
|
|
|
|
<!-- Tags to skip -->
|
|
|
|
|
|
|
|
<xsl:template match="zapis | korpusi | korpus | frek_lemma | opombe |
|
|
|
|
pomenska_shema | definicija1 | definicija2 | struktura"/>
|
|
|
|
|
|
|
|
<!-- Tags to convert to insert space before -->
|
|
|
|
|
2018-10-31 13:49:01 +00:00
|
|
|
<xsl:template match="kolokacije//p | kolokacije//i">
|
2018-10-31 11:23:32 +00:00
|
|
|
<xsl:text xml:space="preserve"> </xsl:text>
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
</xsl:template>
|
2018-10-30 16:11:38 +00:00
|
|
|
|
2018-10-31 10:55:23 +00:00
|
|
|
<!-- root tag, includes global script and tag -->
|
|
|
|
|
2018-10-29 09:55:19 +00:00
|
|
|
<xsl:template match="clanek">
|
2018-10-30 16:11:38 +00:00
|
|
|
<xsl:copy-of select="$global_script" />
|
2018-10-30 17:07:16 +00:00
|
|
|
<xsl:copy-of select="$global_style" />
|
|
|
|
|
|
|
|
<div class="xslt-clanek">
|
2018-10-29 09:55:19 +00:00
|
|
|
<xsl:apply-templates/>
|
|
|
|
</div>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="glava">
|
|
|
|
<div>
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
</div>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="iztocnica">
|
|
|
|
<xsl:text xml:space="preserve"> </xsl:text>
|
2018-10-30 17:07:16 +00:00
|
|
|
<span class="xslt-iztocnica">
|
2018-10-29 09:55:19 +00:00
|
|
|
<xsl:apply-templates/>
|
|
|
|
</span>
|
|
|
|
<xsl:text xml:space="preserve"> </xsl:text>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="besedna_vrsta">
|
|
|
|
<xsl:text xml:space="preserve"> </xsl:text>
|
2018-10-30 17:07:16 +00:00
|
|
|
<span class="xslt-besedna-vrsta">
|
2018-10-29 09:55:19 +00:00
|
|
|
<xsl:apply-templates/>
|
|
|
|
</span>
|
|
|
|
<xsl:text xml:space="preserve"> </xsl:text>
|
2018-10-31 11:23:32 +00:00
|
|
|
</xsl:template>
|
2018-10-29 09:55:19 +00:00
|
|
|
|
2018-10-31 10:55:23 +00:00
|
|
|
<!-- END of HEAD (glava), go to BODY (geslo) -->
|
2018-10-29 09:55:19 +00:00
|
|
|
|
|
|
|
<xsl:template match="pomen">
|
2018-10-31 10:55:23 +00:00
|
|
|
<div class="xslt-pomen-top">
|
|
|
|
<div class="xslt-pomen-number">
|
|
|
|
<xsl:number />
|
2018-10-29 09:55:19 +00:00
|
|
|
</div>
|
|
|
|
<div style="margin-left: 2em;">
|
2018-10-31 11:43:42 +00:00
|
|
|
<xsl:call-template name="pomen_podpomen_logic"/>
|
|
|
|
<xsl:apply-templates select="podpomen"/>
|
2018-10-29 09:55:19 +00:00
|
|
|
</div>
|
|
|
|
<div style="clear: left;"></div>
|
|
|
|
</div>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="podpomen">
|
2018-10-30 17:07:16 +00:00
|
|
|
<xsl:variable name="pomenNum">
|
|
|
|
<xsl:number count="pomen" level="any"/>
|
|
|
|
</xsl:variable>
|
|
|
|
|
2018-10-31 14:07:56 +00:00
|
|
|
<div class="xslt-podpomen">
|
2018-10-30 17:07:16 +00:00
|
|
|
<xsl:value-of select="$pomenNum"/>.<xsl:number/>
|
2018-10-31 11:43:42 +00:00
|
|
|
<xsl:call-template name="pomen_podpomen_logic"/>
|
2018-10-29 09:55:19 +00:00
|
|
|
</div>
|
|
|
|
</xsl:template>
|
|
|
|
|
2018-10-31 10:55:23 +00:00
|
|
|
<xsl:template match="skladenjska_struktura">
|
2018-10-29 09:55:19 +00:00
|
|
|
<div style="margin: 0.5em 0; border-left: 8px solid #eeeeee; padding: 0 0 0 0.75em;">
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
</div>
|
|
|
|
</xsl:template>
|
|
|
|
|
2018-10-31 10:55:23 +00:00
|
|
|
<xsl:template match="kolokacija | r_kolokacija">
|
2018-10-29 09:55:19 +00:00
|
|
|
<xsl:text xml:space="preserve"> </xsl:text>
|
|
|
|
<span style="color: #cc3366;">
|
2018-10-31 13:49:01 +00:00
|
|
|
<xsl:apply-templates select="ks | p | i"/>
|
2018-10-29 09:55:19 +00:00
|
|
|
</span>
|
|
|
|
<xsl:text xml:space="preserve"> </xsl:text>
|
2018-10-31 13:49:01 +00:00
|
|
|
<xsl:apply-templates select="zgledi"/>
|
2018-10-29 09:55:19 +00:00
|
|
|
</xsl:template>
|
2018-10-30 14:18:04 +00:00
|
|
|
|
2018-10-29 16:58:54 +00:00
|
|
|
<xsl:template match="kolokacije//ks">
|
2018-10-30 14:18:04 +00:00
|
|
|
<xsl:text xml:space="preserve"> (</xsl:text>
|
2018-10-29 16:58:54 +00:00
|
|
|
<xsl:apply-templates/>
|
|
|
|
<xsl:text xml:space="preserve">) </xsl:text>
|
|
|
|
</xsl:template>
|
2018-10-29 09:55:19 +00:00
|
|
|
|
2018-10-29 16:58:54 +00:00
|
|
|
<xsl:template match="k[not(position()=last())]">
|
2018-10-29 09:55:19 +00:00
|
|
|
<xsl:apply-templates/>
|
2018-10-29 16:58:54 +00:00
|
|
|
<xsl:text xml:space="preserve">, </xsl:text>
|
2018-10-29 09:55:19 +00:00
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="indikator | oznaka">
|
|
|
|
<xsl:text xml:space="preserve"> </xsl:text>
|
2018-10-31 13:49:01 +00:00
|
|
|
<span class="xslt-indicator">
|
2018-10-29 09:55:19 +00:00
|
|
|
<xsl:apply-templates/>
|
|
|
|
</span>
|
|
|
|
<xsl:text xml:space="preserve"> </xsl:text>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="zgledi">
|
2018-10-31 13:49:01 +00:00
|
|
|
<ul class="xslt-zgledi" >
|
2018-10-29 09:55:19 +00:00
|
|
|
<xsl:apply-templates/>
|
2018-10-31 13:49:01 +00:00
|
|
|
</ul>
|
|
|
|
<div class="xslt-clear"></div>
|
2018-10-29 09:55:19 +00:00
|
|
|
</xsl:template>
|
2018-10-31 11:23:32 +00:00
|
|
|
|
|
|
|
<xsl:template match="zgled">
|
2018-10-31 13:49:01 +00:00
|
|
|
<li><xsl:apply-templates/></li>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="zgled//i | zgled//k | zgled//l">
|
|
|
|
<xsl:text xml:space="preserve"> </xsl:text>
|
|
|
|
<span class="xslt-zgled-highlight"><xsl:apply-templates/></span>
|
|
|
|
</xsl:template>
|
|
|
|
|
2018-10-29 09:55:19 +00:00
|
|
|
</xsl:stylesheet>
|