Модераторы: diadiavova
  

Поиск:

Ответ в темуСоздание новой темы Создание опроса
> Помогите с шаблонами... 
:(
    Опции темы
gavroshka
Дата 8.10.2015, 20:25 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Новичок



Профиль
Группа: Участник
Сообщений: 1
Регистрация: 8.10.2015

Репутация: нет
Всего: нет



Всем здрассссте...  smile 
Смысл такой, есть СРМ mawisoft. Я с ней уже и в хвост и в гриву.
Там шаблоны различных документов написаны на XML
Так вот, мне необходимо "слить" два шаблона и отсечь все лишнее... smile))
Пробовал сам, но я совсем не программист...  smile 

Вот исходник шаблона
Код

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="clients">

<workbook>
    <font id="bl" bold="true"/>
    <font id="it" italic="true"/>
    <font id="blit" bold="true" italic="true"/>
    <font id="big" size="14"/>
    <font id="small" size="8"/>

    <style id="rt" align="right"/>
    <style id="cn" align="center"/>
    <style id="c" border-left="hair" border-top="hair" border-bottom="hair"/>
    <style id="l" border-left="hair" border-bottom="hair"/>
    <style id="u" border-left="hair" border-right="hair" border-bottom="hair"/>
    <style id="p" border-left="hair" border-right="hair" border-top="hair"/>
    <style id="o" border-left="hair" border-right="hair" border-top="hair" border-bottom="hair"/>
    <style id="ort" align="right" border-left="hair" border-right="hair" border-top="hair" border-bottom="hair"/>
    <style id="ocn" align="center" border-left="hair" border-right="hair" border-top="hair" border-bottom="hair"/>
    <style id="big" fontId="big" align="center"/>
    <style id="small" fontId="small" align="right"/>
    <style id="bl" fontId="bl" nowrap="1"/>

    <sheet margin-top="10" margin-bottom="10" margin-left="10" margin-right="10" name="клиенты">
<column width="10000"/>
<column width="10000"/>
<column width="10000"/>
<column width="10000"/>
<column width="10000"/>
<column width="10000"/>
<column width="10000"/>
<column width="10000"/>
            <xsl:apply-templates select="client"/>
            
</sheet>
</workbook>
</xsl:template>

    <xsl:template match="client">
        
        <row>
        <cell><xsl:value-of select="@name"/></cell>
        <cell><xsl:value-of select="@address"/></cell>
        <cell><xsl:apply-templates select="person"/></cell>
        <cell><xsl:apply-templates select="contact"/></cell>
        <cell><xsl:value-of select="@comment"/></cell>
        <cell></cell>
        <cell></cell>
        
        </row>
    </xsl:template>
    
        

    
<xsl:template match="person"><xsl:if test="position() != 1">, </xsl:if><xsl:if test="@surname"><xsl:value-of select="@surname"/> </xsl:if><xsl:value-of select="@name"/></xsl:template>

<xsl:template match="contact"><xsl:if test="position() != 1">, </xsl:if><xsl:value-of select="."/></xsl:template>

</xsl:stylesheet>



Надо чтобы в файл по этому шаблону вываливался при наличии еще и ИНН клиента...
А как это сделать не пойму.
Вот пример шаблона в котором выводится ИНН...
Код

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:decimal-format
          name="moneyFormat"
          decimal-separator=","
          grouping-separator=" "/>

<xsl:template match="shipping">
<workbook>
<font id="#0" size="8"/>
<font id="#1" size="8"/>
<font id="#2" size="8"/>
<font id="#3" size="8"/>
<font id="#4" size="8"/>
<font id="#5" size="8"/>
<font id="#6" size="8"/>
<font id="#7" size="7"/>
<font bold="1" id="#8" size="14"/>
<font bold="1" id="#9" size="8"/>
<font id="#10" size="6"/>
<font bold="1" id="#11" size="18"/>
<font bold="1" id="#12" size="15"/>
<font bold="1" id="#13" size="13"/>
<font bold="1" id="#14" size="11"/>
<font id="#15" size="11"/>
<font id="#16" size="11"/>
<font id="#17" size="11"/>
<font id="#18" size="11"/>
<font bold="1" id="#19" size="11"/>
<font bold="1" id="#20" size="11"/>
<font id="#21" size="11"/>
<font bold="1" id="#22" size="11"/>
<font id="#23" size="11"/>
<font id="#24" italic="1" size="11"/>
<font bold="1" id="#25" size="11"/>
<font id="#26" size="11"/>
<font id="#27" size="11"/>

<font id="big" size="14"/>

<style fontId="#0" id="#0" nowrap="1" vertical-align="bottom"/>
<style fontId="#0" id="#1" nowrap="1" vertical-align="bottom"/>
<style fontId="#0" id="#2" nowrap="1" vertical-align="bottom"/>
<style fontId="#0" id="#3" nowrap="1" vertical-align="bottom"/>
<style fontId="#0" id="#4" nowrap="1" vertical-align="bottom"/>
<style fontId="#0" id="#5" nowrap="1" vertical-align="bottom"/>
<style fontId="#0" id="#6" nowrap="1" vertical-align="bottom"/>
<style fontId="#0" id="#7" nowrap="1" vertical-align="bottom"/>
<style fontId="#0" id="#8" nowrap="1" vertical-align="bottom"/>
<style fontId="#0" id="#9" nowrap="1" vertical-align="bottom"/>
<style fontId="#0" id="#10" nowrap="1" vertical-align="bottom"/>
<style fontId="#0" id="#11" nowrap="1" vertical-align="bottom"/>
<style fontId="#0" id="#12" nowrap="1" vertical-align="bottom"/>
<style fontId="#0" id="#13" nowrap="1" vertical-align="bottom"/>
<style fontId="#0" id="#14" nowrap="1" vertical-align="bottom"/>
<style align="left" fontId="#6" id="#15" nowrap="1" vertical-align="bottom"/>
<style fontId="#27" id="#16" nowrap="1" vertical-align="bottom"/>
<style fontId="#27" id="#17" nowrap="1" vertical-align="bottom"/>
<style fontId="#27" id="#18" nowrap="1" vertical-align="bottom"/>
<style fontId="#27" id="#19" nowrap="1" vertical-align="bottom"/>
<style fontId="#27" id="#20" nowrap="1" vertical-align="bottom"/>
<style fontId="#27" id="#21" nowrap="1" vertical-align="bottom"/>
<style fontId="#27" id="#22" nowrap="1" vertical-align="bottom"/>
<style fontId="#27" id="#23" nowrap="1" vertical-align="bottom"/>
<style fontId="#27" id="#24" nowrap="1" vertical-align="bottom"/>
<style fontId="#27" id="#25" nowrap="1" vertical-align="bottom"/>
<style fontId="#27" id="#26" nowrap="1" vertical-align="bottom"/>
<style fontId="#27" id="#27" nowrap="1" vertical-align="bottom"/>
<style fontId="#26" id="#28" nowrap="1" vertical-align="bottom"/>
<style fontId="#26" id="#29" nowrap="1" vertical-align="bottom"/>
<style fontId="#26" id="#30" nowrap="1" vertical-align="bottom"/>
<style fontId="#26" id="#31" nowrap="1" vertical-align="bottom"/>
<style fontId="#26" id="#32" nowrap="1" vertical-align="bottom"/>
<style fontId="#26" id="#33" nowrap="1" vertical-align="bottom"/>
<style fontId="#26" id="#34" nowrap="1" vertical-align="bottom"/>
<style fontId="#26" id="#35" nowrap="1" vertical-align="bottom"/>
<style fontId="#26" id="#36" nowrap="1" vertical-align="bottom"/>
<style fontId="#26" id="#37" nowrap="1" vertical-align="bottom"/>
<style fontId="#26" id="#38" nowrap="1" vertical-align="bottom"/>
<style fontId="#26" id="#39" nowrap="1" vertical-align="bottom"/>
<style fontId="#16" id="#40" nowrap="1" vertical-align="bottom"/>
<style border-bottom="thin" border-left="thin" border-right="thin" border-top="thin" fontId="#20" id="#41" nowrap="1" vertical-align="bottom"/>
<style fontId="#22" id="#42" nowrap="1" vertical-align="bottom"/>
<style fontId="#24" id="#43" nowrap="1" vertical-align="bottom"/>
<style fontId="#15" id="#44" nowrap="1" vertical-align="bottom"/>
<style border-bottom="thick" fontId="#12" id="#45" nowrap="1" vertical-align="bottom"/>
<style border-bottom="thick" fontId="#13" id="#46" nowrap="1" vertical-align="bottom"/>
<style border-bottom="medium" fontId="#14" id="#47" nowrap="1" vertical-align="bottom"/>
<style fontId="#14" id="#48" nowrap="1" vertical-align="bottom"/>
<style border-bottom="thin" border-left="thin" border-right="thin" border-top="thin" fontId="#18" id="#49" nowrap="1" vertical-align="bottom"/>
<style fontId="#21" id="#50" nowrap="1" vertical-align="bottom"/>
<style fontId="#17" id="#51" nowrap="1" vertical-align="bottom"/>
<style border-bottom="thin" border-left="thin" border-right="thin" border-top="thin" fontId="#5" id="#52" nowrap="1" vertical-align="bottom"/>
<style border-bottom="thin" border-left="thin" border-right="thin" border-top="thin" fontId="#19" id="#53" nowrap="1" vertical-align="bottom"/>
<style fontId="#11" id="#54" nowrap="1" vertical-align="bottom"/>
<style border-top="thin" fontId="#25" id="#55" nowrap="1" vertical-align="bottom"/>
<style fontId="#23" id="#56" nowrap="1" vertical-align="bottom"/>
<style align="center" fontId="#8" id="#57" nowrap="1" vertical-align="top"/>
<style align="right" fontId="#9" id="#58" nowrap="1" vertical-align="top"/>
<style align="left" fontId="#6" id="#59" nowrap="1" vertical-align="top"/>
<style align="left" border-bottom="thin" fontId="#9" id="#60" nowrap="1" vertical-align="bottom"/>
<style align="left" border-bottom="thin" border-left="thin" fontId="#9" id="#61" nowrap="1" vertical-align="bottom"/>
<style align="left" border-bottom="thin" fontId="#6" id="#62" nowrap="1" vertical-align="bottom"/>
<style align="left" border-bottom="thin" fontId="#6" id="#63" nowrap="1" vertical-align="bottom"/>
<style align="right" fontId="#6" id="#64" vertical-align="bottom"/>
<style fontId="#10" id="#65" vertical-align="top"/>
<style border-bottom="thin" fontId="#6" id="#66" nowrap="1" vertical-align="bottom"/>
<style align="right" fontId="#7" id="#67" vertical-align="top"/>
<style align="left" fontId="#6" id="#68" vertical-align="bottom"/>
<style align="center" border-bottom="thin" border-left="thin" border-top="thin" fontId="#6" id="#69" vertical-align="center"/>
<style align="center" border-bottom="thin" border-left="thin" border-right="thin" border-top="thin" fontId="#6" id="#70" vertical-align="center"/>
<style align="center" border-bottom="thin" border-left="thin" fontId="#7" format-string="0" formatId="1" id="#71" nowrap="1" vertical-align="center"/>
<style align="center" border-bottom="thin" border-left="thin" border-right="thin" fontId="#7" format-string="0" formatId="1" id="#72" nowrap="1" vertical-align="center"/>
<style align="left" border-bottom="thin" border-left="thin" border-right="thin" border-top="thin" fontId="#6" id="#73" vertical-align="top"/>
<style align="center" border-bottom="thin" border-left="thin" border-right="thin" border-top="thin" fontId="#6" id="#74" nowrap="1" vertical-align="top"/>
<style align="right" border-bottom="thin" border-left="thin" border-right="thin" border-top="thin" fontId="#6" format-string="0.000" formatId="164" id="#75" nowrap="1" vertical-align="top"/>
<style align="right" border-bottom="thin" border-left="thin" border-right="thin" border-top="thin" fontId="#6" format-string="#,##0.00" formatId="4" id="#76" nowrap="1" vertical-align="top"/>
<style align="right" border-bottom="thin" border-left="thin" border-right="thin" border-top="thin" fontId="#6" id="#77" nowrap="1" vertical-align="top"/>
<style align="center" border-bottom="thin" border-left="thin" border-right="thin" border-top="thin" fontId="#6" format-string="0&quot;%&quot;" formatId="165" id="#78" nowrap="1" vertical-align="top"/>
<style align="right" border-bottom="thin" border-left="thin" border-right="thin" border-top="thin" fontId="#6" format-string="0.00" formatId="2" id="#79" nowrap="1" vertical-align="top"/>
<style align="right" border-bottom="thin" border-left="thin" border-right="thin" border-top="thin" fontId="#6" format-string="#,##0.00" formatId="4" id="#80" nowrap="1" vertical-align="bottom"/>
<style align="left" border-bottom="thin" fontId="#6" id="#81" nowrap="1" vertical-align="bottom"/>
<style align="center" fontId="#10" id="#82" nowrap="1" vertical-align="top"/>
<style align="right" fontId="#6" id="#83" vertical-align="bottom"/>
<style align="center" fontId="#10" id="#84" nowrap="1" vertical-align="top"/>
<style align="left" fontId="#7" id="#85" vertical-align="top"/>

<style align="left" fontId="big" id="blt" nowrap="1" vertical-align="top"/>
<style align="right" fontId="big" id="brt" nowrap="1" vertical-align="top"/>
<style align="center" fontId="big" id="buc" nowrap="1" vertical-align="top" border-bottom="thin"/>

<sheet margin-top="10" margin-bottom="10" margin-left="10" margin-right="10" name="Счет-Фактура" landscape="yes" page-format="A4" scale="85">
<row height="755">
<cell colspan="24" styleId="#67">Приложение № 1
к постановлению Правительства
Российской Федерации
от 26.12.2011 № 1137</cell>
</row>
<row height="375">
<cell styleId="#57" colspan="24">Счет-фактура № <xsl:value-of select="factura/@number"/> от <xsl:value-of select="factura/@date-script"/> г.</cell>
</row>

<row height="375">
<cell/>
<cell/>
<cell/>
<cell/>
<cell/>
<cell/>
<cell/>
<cell/>
<cell/>
<cell styleId="brt">Исправление №</cell>
<cell styleId="buc">-</cell>
<cell/>
<cell styleId="brt">от "</cell>
<cell styleId="buc">-</cell>
<cell styleId="blt">"</cell>
<cell styleId="buc" colspan="2">---</cell>
</row>

<row height="237">
<cell colspan="24" styleId="#68">Продавец: <xsl:value-of select="seller/firm-name-full"/></cell>
</row>
<row height="237">
<cell colspan="24" styleId="#68">Адрес: <xsl:value-of select="seller/address"/></cell>
</row>
<row height="237">
<cell colspan="24" styleId="#68">ИНН/КПП продавца: <xsl:value-of select="seller/inn"/>/<xsl:value-of select="seller/kpp"/></cell>
</row>
<row height="237">
<cell colspan="24" styleId="#68">Грузоотправитель и его адрес: <xsl:choose>
<xsl:when test="act">-</xsl:when>
<xsl:otherwise><xsl:value-of select="seller/firm-name-full"/>, <xsl:value-of select="seller/address"/></xsl:otherwise>
</xsl:choose></cell>
</row>
<row height="237">
<cell colspan="24" styleId="#68">Грузополучатель и его адрес: <xsl:choose>
<xsl:when test="act">-</xsl:when>
<xsl:otherwise><xsl:choose><xsl:when test="consignee/firm-name-full!=''"><xsl:value-of select="consignee/firm-name-full"/></xsl:when>
<xsl:otherwise><xsl:value-of select="consignee/firm-name"/></xsl:otherwise></xsl:choose>, <xsl:value-of select="consignee/address"/></xsl:otherwise>
</xsl:choose></cell>
</row>
<row height="237">
<cell colspan="24" styleId="#68">К платежно-расчетному документу <xsl:choose>
<xsl:when test="invoice">
<xsl:variable name="payments" select="document(concat('/salescontrol/xml/payments.jsp?invoiceId=', invoice/@id))/payments"/>
<xsl:apply-templates select="$payments/payment[@future=0]"/>
</xsl:when>
<xsl:otherwise>________ от ________</xsl:otherwise>
</xsl:choose></cell>
</row>
<row height="237">
<cell colspan="24" styleId="#68">Покупатель: <xsl:choose><xsl:when test="customer/firm-name-full!=''"><xsl:value-of select="customer/firm-name-full"/></xsl:when>
<xsl:otherwise><xsl:value-of select="customer/firm-name"/></xsl:otherwise></xsl:choose></cell>
</row>
<row height="237">
<cell colspan="24" styleId="#68">Адрес: <xsl:value-of select="customer/address"/></cell>
</row>
<row height="237">
<cell colspan="24" styleId="#68">ИНН/КПП покупателя: <xsl:value-of select="customer/inn"/> / <xsl:value-of select="customer/kpp"/></cell>
</row>
<row height="237">
<cell colspan="24" styleId="#68">Валюта: наименование, код: <xsl:value-of select="./@currency"/><xsl:if test="@currency-code">, <xsl:value-of select="./@currency-code"/></xsl:if></cell>
</row>
<row height="225">
<cell/>
</row>
<row height="439">
<cell colspan="2" rowspan="2" styleId="#69">Наименование товара (описание выполненных работ, оказанных услуг), имущественного права</cell>
<cell colspan="2" styleId="#69">Единица измерения</cell>
<cell colspan="3" rowspan="2" styleId="#69">Коли- чество (объем)</cell>
<cell colspan="2" rowspan="2" styleId="#69">Цена (тариф) за единицу измерения</cell>
<cell colspan="2" rowspan="2" styleId="#69">Стоимость товаров (работ, услуг), имущественных прав без налога - всего</cell>
<cell colspan="2" rowspan="2" styleId="#69">В том числе сумма акциза</cell>
<cell colspan="2" rowspan="2" styleId="#69">Нало-
говая
ставка</cell>
<cell colspan="2" rowspan="2" styleId="#69">Сумма
налога,
предъяв-
ляемая
покупателю</cell>
<cell colspan="3" rowspan="2" styleId="#70">Стоимость товаров
(работ, услуг),
имущественных прав
с налогом - всего</cell>
<cell colspan="2" styleId="#70">Страна происхождения
товара</cell>
<cell colspan="2" rowspan="2" styleId="#70">Номер
таможенной
декларации</cell>
</row>

<row height="789">
<cell styleId="#69"/><cell styleId="#69"/>
<cell styleId="#69">к
о
д</cell>
<cell styleId="#69">условное обозначение (национальное)</cell>
<cell styleId="#69"/><cell styleId="#69"/><cell styleId="#69"/>
<cell styleId="#69"/><cell styleId="#69"/>
<cell styleId="#69"/><cell styleId="#69"/>
<cell styleId="#69"/><cell styleId="#69"/>
<cell styleId="#69"/><cell styleId="#69"/>
<cell styleId="#69"/><cell styleId="#69"/>
<cell styleId="#70"/><cell styleId="#70"/><cell styleId="#70"/>
<cell styleId="#70">цифро-
вой
код</cell>
<cell styleId="#70">краткое
наименование</cell>
<cell styleId="#70"/><cell styleId="#70"/>
</row>

<row height="225">
<cell colspan="2" styleId="#71" type="numeric">1.0</cell>
<cell styleId="#71" type="numeric">2.0</cell>
<cell styleId="#71">2а</cell>
<cell colspan="3" styleId="#71" type="numeric">3.0</cell>
<cell colspan="2" styleId="#71" type="numeric">4.0</cell>
<cell colspan="2" styleId="#71" type="numeric">5.0</cell>
<cell colspan="2" styleId="#71" type="numeric">6.0</cell>
<cell colspan="2" styleId="#71" type="numeric">7.0</cell>
<cell colspan="2" styleId="#71" type="numeric">8.0</cell>
<cell colspan="3" styleId="#72" type="numeric">9.0</cell>
<cell styleId="#71" type="numeric">10.0</cell>
<cell styleId="#71">10а</cell>
<cell colspan="2" styleId="#72" type="numeric">11.0</cell>
</row>
        <xsl:apply-templates select="item"/>

<row height="237">
<cell styleId="#61">Всего к оплате</cell>
<cell styleId="#60"/>
<cell styleId="#62"/>
<cell styleId="#62"/>
<cell styleId="#62"/>
<cell styleId="#62"/>
<cell styleId="#62"/>
<cell styleId="#62"/>
<cell styleId="#62"/>
<cell colspan="2" styleId="#80" type="numeric"><xsl:value-of select="@sum - @vat"/></cell>
<cell colspan="4" styleId="#78">Х</cell>
<xsl:choose>
    <xsl:when test="@vat='0.00000'"><cell colspan="2" styleId="#78">Без НДС</cell></xsl:when>
    <xsl:otherwise><cell colspan="2" styleId="#80" type="numeric"><xsl:value-of select="@vat"/></cell></xsl:otherwise>
</xsl:choose>

<cell colspan="3" styleId="#80" type="numeric"><xsl:value-of select="@sum"/></cell>
<cell/>
<cell/>
</row>
<row/>
<row height="425">
<cell styleId="#64">Руководитель организации
или иное уполномоченное лицо:</cell>
<cell styleId="#62"/>
<cell styleId="#62"/>
<cell styleId="#62"/>
<cell styleId="#62"/>
<cell/>
<cell colspan="4" styleId="#81"><xsl:value-of select="seller-user/@abbr"/></cell>
<cell styleId="#64" colspan="6">Главный бухгалтер
или иное уполномоченное лицо:</cell>
<cell styleId="#62"/>
<cell styleId="#62"/>
<cell/>
<cell styleId="#62"><xsl:value-of select="seller/bookkeeper/@abbr"/></cell>
<cell styleId="#62"/>
<cell styleId="#62"/>
</row>
<row height="225">
<cell/>
<cell colspan="4" styleId="#82">(подпись)</cell>
<cell/>
<cell colspan="4" styleId="#82">(ф.и.о.)</cell>
<cell/>
<cell/>
<cell/>
<cell/>
<cell/>
<cell/>
<cell styleId="#82" colspan="2">(подпись)</cell>
<cell/>
<cell colspan="4" styleId="#82">(ф.и.о.)</cell>
<cell/>
</row>
<row height="225"/>
<row height="458">
<cell styleId="#83">
Индивидуальный предприниматель</cell>
<cell styleId="#62"/>
<cell styleId="#62"/>
<cell styleId="#62"/>
<cell styleId="#62"/>
<cell/>
<cell colspan="4" styleId="#81">--</cell>
<cell/>
<cell/>
<cell styleId="#66">--</cell>
<cell styleId="#66"/>
<cell styleId="#66"/>
<cell styleId="#66"/>
<cell styleId="#66"/>
<cell styleId="#66"/>
<cell styleId="#66"/>
<cell styleId="#66"/>
<cell styleId="#66"/>
<cell styleId="#66"/>
<cell styleId="#66"/>
</row>
<row height="338">
<cell/>
<cell colspan="4" styleId="#82">(подпись)</cell>
<cell/>
<cell colspan="4" styleId="#82">(ф.и.о.)</cell>
<cell/>
<cell/>
<cell colspan="11" styleId="#84">(реквизиты свидетельства о государственной регистрации индивидуального предпринимателя)</cell>
<cell/>
</row>

<row height="338">
<cell styleId="#65" colspan="11">Примечание 1. Первый экземпляр счета-фактуры, составленного на бумажном носителе - покупателю, второй экземпляр - продавцу.
2. При составлении организацией счета-фактуры в электронном виде показатель "Главный бухгалтер (подпись) (ФИО)" не формируется.
</cell>
</row>

<column width="6759"/>
<column width="1229"/>
<column width="912"/>
<column width="2990"/>
<column width="924"/>

<column width="273"/>
<column width="890"/>
<column width="1127"/>
<column width="1502"/>
<column width="1741"/>


<column width="1502"/>
<column width="410"/>
<column width="1795"/>
<column width="788"/>
<column width="795"/>

<column width="1422"/>
<column width="968"/>
<column width="2280"/>
<column width="444"/>
<column width="1224"/>

<column width="1592"/>
<column width="2789"/>
<column width="648"/>
<column width="4540"/>

</sheet>
</workbook>
</xsl:template>

<xsl:template match="item">
<row><xsl:attribute name="height"><xsl:value-of select="round(string-length(@description) div 35 + 0.5) * 237"/></xsl:attribute>
<cell colspan="2" styleId="#73"><xsl:value-of select="@description"/></cell>

<cell styleId="#74"><xsl:value-of select="@measure-unit-code"/></cell>

<cell styleId="#74"><xsl:value-of select="@measure-unit"/></cell>
<cell colspan="3" styleId="#75" type="numeric"><xsl:value-of select="@amount"/></cell>
<cell colspan="2" styleId="#76" type="numeric"><xsl:value-of select="price/@value-no-vat"/></cell>
<cell colspan="2" styleId="#76" type="numeric"><xsl:value-of select="summ/@value-no-vat"/></cell>
<cell colspan="2" styleId="#77">без акциза</cell>
    <xsl:choose>
        <xsl:when test="@vat-rate='0.0'">
            <cell colspan="2" styleId="#77">Без НДС</cell>
            <cell colspan="2" styleId="#77">Без НДС</cell>
        </xsl:when>
        <xsl:otherwise>
            <cell colspan="2" styleId="#78" type="numeric"><xsl:value-of select="@vat-rate"/></cell>
            <cell colspan="2" styleId="#76" type="numeric"><xsl:value-of select="summ/@vat"/></cell>
        </xsl:otherwise>
    </xsl:choose>
<cell colspan="3" styleId="#76" type="numeric"><xsl:value-of select="summ/@value"/></cell>
<cell styleId="#78"><xsl:choose>
<xsl:when test="@country-code"><xsl:value-of select="@country-code"/></xsl:when>
<xsl:otherwise>-</xsl:otherwise></xsl:choose></cell>
<cell styleId="#73"><xsl:choose>
<xsl:when test="@country"><xsl:value-of select="@country"/></xsl:when>
<xsl:otherwise>---</xsl:otherwise></xsl:choose></cell>
<cell colspan="2" styleId="#73"><xsl:choose>
<xsl:when test="@gtd"><xsl:value-of select="@gtd"/></xsl:when>
<xsl:otherwise>---</xsl:otherwise></xsl:choose></cell>
</row>
</xsl:template>

<xsl:template match="payment"><xsl:if test="position() != 1">, </xsl:if>№ <xsl:value-of select="@number"/> от <xsl:value-of select="@date"/></xsl:template>

</xsl:stylesheet>



Я очень сорри, на форуме первый день... сильно не пинайте...  smile 

Это сообщение отредактировал(а) gavroshka - 8.10.2015, 20:26
PM MAIL   Вверх
ambi
Дата 9.10.2015, 11:30 (ссылка)    |    (голосов: 0) Загрузка ... Загрузка ... Быстрая цитата Цитата


Unregistered











Для начала скажите, какой у вас опыт работы с XSL?

А потом это,
> Так вот, мне необходимо "слить" два шаблона и отсечь все лишнее.
Что вы подразумеваете под понятием слить?


Этот ответ добавлен с нового Винграда - http://vingrad.com
  Вверх
ambi
Дата 9.10.2015, 11:34 (ссылка)    |    (голосов: 0) Загрузка ... Загрузка ... Быстрая цитата Цитата


Unregistered











> Надо чтобы в файл по этому шаблону вываливался при наличии еще и ИНН клиента...

Процедура стандартная -- нужно, чтобы в исходном xml был блок с этим ИНН.
В XSL добавляете шаблон, что-то вроде этого -- <xsl:template match="inn">...</xsl:template> который будет натравливаться на блок "<inn>..</inn>" (это для примера, как у вас, всё зависит от xml). В самом шаблоне пишите логику трансформации блока с ИНН.

Этот ответ добавлен с нового Винграда - http://vingrad.com
  Вверх
  
Ответ в темуСоздание новой темы Создание опроса
Правила форума "XML/XSLT"
diadiavova

Прежде чем опубликовать вопрос, попробуйте воспользоваться поиском - возможно тема уже поднималась.

Также рекомендуем Вам зайти в раздел FAQ ,раздел дополняется и, возможно, там вы увидите готовое решение.

Для ответов на часто задаваемые вопросы существует FAQ раздела. Новости можно публиковать в разделе новостей. Для статей так же есть специальный раздел

Желаем удачи в Вашем деле!


Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, diadiavova.

 
1 Пользователей читают эту тему (1 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | XML, XSL | Следующая тема »


 




[ Время генерации скрипта: 0.1139 ]   [ Использовано запросов: 20 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.