ИНФОСИСТЕМЫ / МИКРОРАЗМЕТКА СТАТЬИ

Заметка создана: 11 января 2025 г.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:hostcms="http://www.hostcms.ru/"
    exclude-result-prefixes="hostcms">
    
    <xsl:output xmlns="http://www.w3.org/TR/xhtml1/strict" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" encoding="utf-8" indent="yes" method="html" omit-xml-declaration="no" version="1.0" media-type="text/xml"/>
    
    <!-- ФинансыНовость -->
    
    <xsl:template match="/">
        <xsl:apply-templates select="/informationsystem/informationsystem_item"/>
    </xsl:template>
    
    <xsl:template match="informationsystem_item">
        <section class="main-home" itemscope="itemscope" itemtype="http://schema.org/BlogPosting">
            
            <link itemprop="mainEntityOfPage" itemscope="itemscope" href="{/informationsystem/http}{url}" />
            <div itemprop="publisher" itemscope="itemscope" itemtype="https://schema.org/Organization">
                <meta itemprop="name" content="Геми 22" />
                <meta itemprop="address" content="г.Москва, Загородное ш., дом, 11" />
                <meta itemprop="telephone" content="+74957829118" />
            </div>

            <xsl:variable name="month_year" select="substring-after(date, '.')"/>
            <xsl:variable name="year" select="substring-after($month_year, '.')"/>
            <xsl:variable name="month" select="substring-before($month_year, '.')"/>
            <xsl:variable name="datePublished">
                    <xsl:value-of select="$year"/>-<xsl:value-of select="$month"/>-<xsl:value-of select="substring-before(date, '.')"/>
            </xsl:variable>

            <meta itemprop="datePublished" content="{$datePublished}" />
            <meta itemprop="dateModified" content="{$datePublished}" />
            <span itemprop="author" itemscope="itemscope" itemtype="http://schema.org/Person">
                <span class="hidden" itemprop="name">Геми 22</span>
            </span>
            
            <div itemprop="articleBody">
                <div class="container">
                    <header>
                        <h2 itemprop="headline"><xsl:value-of select="name"/></h2>
                        <div class="news-date">
                            <xsl:call-template name="date_to_str">
                                <xsl:with-param name="date" select="date" />
                            </xsl:call-template>
                        </div>
                    </header>
                    
                    <div class="separator-small"></div>
                    <div class="sub-heading" itemprop="description"><xsl:value-of disable-output-escaping="yes" select="text"/></div>
                    
                </div>
            </div>
        </section>
    </xsl:template>
    
    <!-- Вывод даты с месяцем на русском -->
    <xsl:template name="date_to_str">
        <xsl:param name="date" select="date"/>
        
        <xsl:variable select="substring-after($date, '.')" name="month_postfixDate" />
        <xsl:variable select="substring-before($month_postfixDate, '.')" name="month" />
        
        <xsl:value-of select="substring-before($date, '.')"/>&#160;<xsl:choose>
            <xsl:when test="$month = 1">января</xsl:when>
            <xsl:when test="$month = 2">февраля</xsl:when>
            <xsl:when test="$month = 3">марта</xsl:when>
            <xsl:when test="$month = 4">апреля</xsl:when>
            <xsl:when test="$month = 5">мая</xsl:when>
            <xsl:when test="$month = 6">июня</xsl:when>
            <xsl:when test="$month = 7">июля</xsl:when>
            <xsl:when test="$month = 8">августа</xsl:when>
            <xsl:when test="$month = 9">сентября</xsl:when>
            <xsl:when test="$month = 10">октября</xsl:when>
            <xsl:when test="$month = 11">ноября</xsl:when>
            <xsl:otherwise>декабря</xsl:otherwise>
        </xsl:choose>&#160;<xsl:value-of select="substring-after($month_postfixDate, '.')"/>
    </xsl:template>
</xsl:stylesheet>