Разработка программного продукта обеспечивающего экспорт спецификации из приложения PartList

Структура и представление информации с помощью технологий XML-XSL. Применение XSLT-инструкций для разработки шаблона XSL. Алгоритм преобразования XML. Разработка конвертера XML-представлений групповых спецификаций на сборочное изделие в PDF-формат.

Рубрика Программирование, компьютеры и кибернетика
Вид дипломная работа
Язык русский
Дата добавления 09.06.2014
Размер файла 3,6 M

Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже

Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.

<fo:block>

<xsl:value-of select="stamp/@RAZRABOTAL"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="4" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="5" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="6" border-right-style="solid">

<fo:block font-size="12pt" text-align="center">

<xsl:value-of select="stamp/@NAIMENOVANIE_1"/>

</fo:block>

</fo:table-cell>

<fo:table-cell number-columns-spanned="3" border-after-style="solid" border-right-style="solid">

<fo:block text-align="center"> Лит. </fo:block>

</fo:table-cell>

<fo:table-cell border-after-style="solid" border-right-style="solid">

<fo:block text-align="center"> Лист </fo:block>

</fo:table-cell>

<fo:table-cell border-after-style="solid" border-right-style="solid">

<fo:block text-align="center"> Листов </fo:block>

</fo:table-cell>

</fo:table-row>

<fo:table-row>

<fo:table-cell column-number="1" border-left-style="solid">

<fo:block>&#160;</fo:block>

</fo:table-cell>

<fo:table-cell column-number="2" border-start-style="solid" border-after-style="solid" border-end-style="solid">

<fo:block> Пров. </fo:block>

</fo:table-cell>

<fo:table-cell column-number="3" border-after-style="solid" border-right-style="solid">

<fo:block>

<xsl:value-of select="stamp/@PROVERIL"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="4" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="5" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="6" border-right-style="solid">

<fo:block font-size="12pt" text-align="center">

<xsl:value-of select="stamp/@NAIMENOVANIE_2"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="7" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="8" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="9" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="10" border-after-style="solid" border-right-style="solid" text-align="center">

<fo:block>

<fo:page-number/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="11" border-after-style="solid" border-right-style="solid" text-align="center">

<fo:block>

<xsl:value-of select="stamp/@kpage"/>

</fo:block>

</fo:table-cell>

</fo:table-row>

<fo:table-row>

<fo:table-cell column-number="1" border-left-style="solid">

<fo:block>&#160;</fo:block>

</fo:table-cell>

<fo:table-cell column-number="2" border-start-style="solid" border-after-style="solid" border-end-style="solid">

<fo:block> &#160; </fo:block>

</fo:table-cell>

<fo:table-cell column-number="3" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="4" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="5" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="6" border-right-style="solid">

<fo:block font-size="12pt" text-align="center">

<xsl:value-of select="stamp/@NAIMENOVANIE_3"/>

</fo:block>

</fo:table-cell>

<fo:table-cell number-columns-spanned="5" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

</fo:table-row>

<fo:table-row>

<fo:table-cell column-number="1" border-left-style="solid">

<fo:block>&#160;</fo:block>

</fo:table-cell>

<fo:table-cell column-number="2" border-start-style="solid" border-after-style="solid" border-end-style="solid">

<fo:block> Н.Контр. </fo:block>

</fo:table-cell>

<fo:table-cell column-number="3" border-after-style="solid" border-right-style="solid">

<fo:block>

<xsl:value-of select="stamp/@N_KONTROL"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="4" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="5" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="6" border-right-style="solid">

<fo:block font-size="12pt" text-align="center">

<xsl:value-of select="stamp/@NAIMENOVANIE_4"/>

</fo:block>

</fo:table-cell>

<fo:table-cell number-columns-spanned="5" border-right-style="solid">

<fo:block font-size="14pt" text-align="center" font-family="GOST_B">

<xsl:value-of select="stamp/@NAZVANIE_ORGANIZACII_1"/>

</fo:block>

</fo:table-cell>

</fo:table-row>

<fo:table-row>

<fo:table-cell column-number="1" border-left-style="solid" border-after-style="solid">

<fo:block>&#160;</fo:block>

</fo:table-cell>

<fo:table-cell column-number="2" border-start-style="solid" border-after-style="solid" border-end-style="solid">

<fo:block> Утв. </fo:block>

</fo:table-cell>

<fo:table-cell column-number="3" border-after-style="solid" border-right-style="solid">

<fo:block>

<xsl:value-of select="stamp/@UTVERDIL"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="4" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="5" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="6" border-after-style="solid" border-right-style="solid">

<fo:block font-size="12pt" text-align="center">

<xsl:value-of select="stamp/@NAIMENOVANIE_5"/>

</fo:block>

</fo:table-cell>

<fo:table-cell number-columns-spanned="5" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

</fo:table-row>

</fo:table-body>

</fo:table>

</fo:static-content>

<!--_________________________________________________________________________-->

<!--Создаём потоковый объект, который будет включать в себе выводимый текст-->

<fo:flow flow-name="xsl-region-body">

<xsl:apply-templates select="*[12>position()]"/>

</fo:flow>

</fo:page-sequence>

<!-- ********************************************************************** -->

<fo:page-sequence master-reference="page2">

<!--ШАПКА ТАБЛИЦЫ И ШТАМПА -->

<fo:static-content flow-name="xsl-region-before">

<fo:table>

<fo:table-column column-number="1" column-width="35mm"/>

<fo:table-column column-number="2" column-width="35mm"/>

<fo:table-column column-number="3" column-width="20mm"/>

<fo:table-column column-number="4" column-width="20mm"/>

<fo:table-column column-number="5" column-width="35mm"/>

<fo:table-column column-number="6" column-width="22mm"/>

<fo:table-column column-number="7" column-width="60mm"/>

<fo:table-column column-number="8" column-width="60mm"/>

<fo:table-body font-family="GOST_B" font-size="10pt" text-align="center">

<fo:table-row line-height="5.75mm" >

<fo:table-cell column-number="1" border-style="solid">

<fo:block> Инв. № подл. </fo:block>

</fo:table-cell>

<fo:table-cell column-number="2" border-before-style="solid" border-after-style="solid" border-right-style="solid">

<fo:block> Подп. и дата </fo:block>

</fo:table-cell>

<fo:table-cell column-number="3" border-before-style="solid" border-after-style="solid" border-right-style="solid">

<fo:block> Взам. инв. № </fo:block>

</fo:table-cell>

<fo:table-cell column-number="4" border-before-style="solid" border-after-style="solid" border-right-style="solid">

<fo:block> Инв. № дубл </fo:block>

</fo:table-cell>

<fo:table-cell column-number="5" border-before-style="solid" border-after-style="solid" border-right-style="solid">

<fo:block> Подп. и дата </fo:block>

</fo:table-cell>

<fo:table-cell column-number="6" border-right-style="dashed">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="7" border-before-style="dashed" border-right-style="dashed">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="8" border-before-style="dashed" border-right-style="dashed">

<fo:block></fo:block>

</fo:table-cell>

</fo:table-row>

<fo:table-row line-height="5.75mm">

<fo:table-cell column-number="1" border-after-style="solid" border-left-style="solid" border-right-style="solid">

<fo:block> &#160; </fo:block>

</fo:table-cell>

<fo:table-cell column-number="2" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="3" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="4" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="5" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="6" border-after-style="solid" border-right-style="dashed">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="7" border-after-style="solid" border-right-style="dashed">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="8" border-after-style="solid" border-right-style="dashed">

<fo:block></fo:block>

</fo:table-cell>

</fo:table-row>

</fo:table-body>

</fo:table>

<fo:table table-layout="fixed" width="287mm">

<fo:table-column column-number="1" column-width="7.5mm"/>

<fo:table-column column-number="2" column-width="7.5mm"/>

<fo:table-column column-number="3" column-width="10mm"/>

<fo:table-column column-number="4" column-width="60mm"/>

<fo:table-column column-number="5" column-width="60mm"/>

<fo:table-column column-number="6" column-width="10mm"/>

<fo:table-column column-number="7" column-width="10mm"/>

<fo:table-column column-number="8" column-width="10mm"/>

<fo:table-column column-number="9" column-width="10mm"/>

<fo:table-column column-number="10" column-width="10mm"/>

<fo:table-column column-number="11" column-width="10mm"/>

<fo:table-column column-number="12" column-width="10mm"/>

<fo:table-column column-number="13" column-width="10mm"/>

<fo:table-column column-number="14" column-width="10mm"/>

<fo:table-column column-number="15" column-width="10mm"/>

<fo:table-column column-number="16" column-width="42mm"/>

<fo:table-body line-height="5mm" font-family="GOST_B">

<fo:table-row>

<fo:table-cell column-number="1" border-left-style="solid" border-right-style="solid">

<fo:block-container line-height="7.5mm" top="1mm" position="absolute" reference-orientation="90">

<fo:block text-align="right" font-size="12pt">

Формат

</fo:block>

</fo:block-container>

</fo:table-cell>

<fo:table-cell column-number="2" border-right-style="solid">

<fo:block-container line-height="7.5mm" top="2mm" position="absolute" reference-orientation="90">

<fo:block text-align="right" font-size="12pt">

Зона

</fo:block>

</fo:block-container>

</fo:table-cell>

<fo:table-cell column-number="3" border-right-style="solid">

<fo:block-container line-height="10mm" top="1mm" position="absolute" reference-orientation="90">

<fo:block text-align="right" font-size="12pt">

Позиция

</fo:block>

</fo:block-container>

</fo:table-cell>

<fo:table-cell column-number="4" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="5" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell number-columns-spanned="10" column-number="6" border-right-style="solid" border-after-style="solid">

<fo:block font-size="14pt">

Кол. на исполнение

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="16" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

</fo:table-row>

</fo:table-body>

<fo:table-body line-height="5mm" font-family="GOST_B">

<fo:table-row >

<fo:table-cell column-number="1" border-left-style="solid" border-right-style="solid">

<fo:block-container line-height="7.5mm" top="1mm" position="absolute" reference-orientation="90">

<fo:block></fo:block>

</fo:block-container>

</fo:table-cell>

<fo:table-cell column-number="2" border-right-style="solid">

<fo:block-container line-height="7.5mm" top="2mm" position="absolute" reference-orientation="90">

<fo:block></fo:block>

</fo:block-container>

</fo:table-cell>

<fo:table-cell column-number="3" border-right-style="solid">

<fo:block-container line-height="10mm" top="1mm" position="absolute" reference-orientation="90">

<fo:block ></fo:block>

</fo:block-container>

</fo:table-cell>

<fo:table-cell column-number="4" border-right-style="solid">

<fo:block font-size="16pt" text-align="center">

Обозначение

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="5" border-right-style="solid">

<fo:block font-size="16pt" text-align="center">

Наименование

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="6" border-right-style="solid">

<fo:block-container line-height="10mm" position="absolute" text-align="center">

<fo:block>

-

</fo:block>

</fo:block-container>

</fo:table-cell>

<fo:table-cell column-number="7" border-right-style="solid">

<fo:block-container line-height="10mm" position="absolute" text-align="center">

<fo:block>

01

</fo:block>

</fo:block-container>

</fo:table-cell>

<fo:table-cell column-number="8" border-right-style="solid">

<fo:block-container line-height="10mm" position="absolute" text-align="center">

<fo:block>

02

</fo:block>

</fo:block-container>

</fo:table-cell>

<fo:table-cell column-number="9" border-right-style="solid">

<fo:block-container line-height="10mm" position="absolute" text-align="center">

<fo:block>

03

</fo:block>

</fo:block-container>

</fo:table-cell>

<fo:table-cell column-number="10" border-right-style="solid">

<fo:block-container line-height="10mm" position="absolute" text-align="center">

<fo:block>

04

</fo:block>

</fo:block-container>

</fo:table-cell>

<fo:table-cell column-number="11" border-right-style="solid">

<fo:block-container line-height="10mm" position="absolute" text-align="center">

<fo:block>

05

</fo:block>

</fo:block-container>

</fo:table-cell>

<fo:table-cell column-number="12" border-right-style="solid">

<fo:block-container line-height="10mm" position="absolute" text-align="center">

<fo:block>

06

</fo:block>

</fo:block-container>

</fo:table-cell>

<fo:table-cell column-number="13" border-right-style="solid">

<fo:block-container line-height="10mm" position="absolute" text-align="center">

<fo:block>

07

</fo:block>

</fo:block-container>

</fo:table-cell>

<fo:table-cell column-number="14" border-right-style="solid">

<fo:block-container line-height="10mm" position="absolute" text-align="center">

<fo:block>

08

</fo:block>

</fo:block-container>

</fo:table-cell>

<fo:table-cell column-number="15" border-right-style="solid">

<fo:block-container line-height="10mm" position="absolute" text-align="center">

<fo:block>

09

</fo:block>

</fo:block-container>

</fo:table-cell>

<fo:table-cell column-number="16" border-right-style="solid" text-align="center">

<fo:block font-size="16pt">

Примечание

</fo:block>

</fo:table-cell>

</fo:table-row>

</fo:table-body>

<fo:table-body line-height="5mm" font-family="GOST_B">

<fo:table-row>

<fo:table-cell column-number="1" border-after-style="solid" border-start-style="solid" border-right-style="solid">

<fo:block>

&#160;

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="2" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="3" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="4" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="5" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="6" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="7" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="8" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="9" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="10" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="11" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="12" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="13" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="14" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="15" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="16" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

</fo:table-row>

</fo:table-body>

</fo:table>

</fo:static-content>

<!-- _______________________________________________________________ -->

<!--Нижняя область штампа, 2й и последующих страниц-->

<fo:static-content flow-name="xsl-region-after">

<fo:table>

<fo:table-column column-number="1" column-width="102mm"/>

<fo:table-column column-number="2" column-width="8mm"/>

<fo:table-column column-number="3" column-width="12mm"/>

<fo:table-column column-number="4" column-width="20mm"/>

<fo:table-column column-number="5" column-width="15mm"/>

<fo:table-column column-number="6" column-width="10mm"/>

<fo:table-column column-number="7" column-width="110mm"/>

<fo:table-column column-number="8" column-width="10mm"/>

<fo:table-body line-height="4.65mm" font-size="10pt" font-family="GOST_B" text-align="center">

<fo:table-row>

<fo:table-cell column-number="1" border-left-style="solid">

<fo:block>&#160;</fo:block>

</fo:table-cell>

<fo:table-cell column-number="2" border-after-style="solid" border-left-style="solid" border-right-style="solid">

<fo:block>&#160;</fo:block>

</fo:table-cell>

<fo:table-cell column-number="3" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="4" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="5" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="6" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="7" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="8" border-right-style="solid">

<fo:block-container line-height="7mm" position="absolute">

<fo:block border-after-style="solid">Лист</fo:block>

</fo:block-container>

</fo:table-cell>

</fo:table-row>

<fo:table-row>

<fo:table-cell column-number="1" border-left-style="solid">

<fo:block>&#160;</fo:block>

</fo:table-cell>

<fo:table-cell column-number="2" column-width="8mm" border-after-style="solid" border-left-style="solid" border-right-style="solid">

<fo:block>&#160;</fo:block>

</fo:table-cell>

<fo:table-cell column-number="3" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="4" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="5" border-after-style="solid" border-right-style="solid">

<fo:block> </fo:block>

</fo:table-cell>

<fo:table-cell column-number="6" border-after-style="solid" border-right-style="solid">

<fo:block></fo:block>

</fo:table-cell>

<fo:table-cell column-number="7" border-right-style="solid">

<fo:block text-align="center" font-size="18pt" font-family="GOST_B">

<xsl:value-of select="stamp/@OBOZNACHENIE"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="8" border-right-style="solid">

<fo:block-container top="3.5mm" position="absolute">

<fo:block>

<fo:page-number/>

</fo:block>

</fo:block-container>

</fo:table-cell>

</fo:table-row>

<fo:table-row>

<fo:table-cell column-number="1" border-left-style="solid" border-after-style="solid">

<fo:block>&#160;</fo:block>

</fo:table-cell>

<fo:table-cell column-number="2" column-width="8mm" border-bottom-style="solid" border-left-style="solid" border-right-style="solid">

<fo:block>

Изм

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="3" border-after-style="solid" border-right-style="solid">

<fo:block>

Лист

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="4" border-after-style="solid" border-right-style="solid">

<fo:block>

№ докум.

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="5" border-after-style="solid" border-right-style="solid">

<fo:block>

Подп.

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="6" border-after-style="solid" border-right-style="solid">

<fo:block>

Дата

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="7" border-after-style="solid" border-right-style="solid">

<fo:block text-align="center" font-size="18pt" font-family="GOST_B">

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="8" border-right-style="solid" border-after-style="solid" text-align="center">

<fo:block></fo:block>

</fo:table-cell>

</fo:table-row>

</fo:table-body>

</fo:table>

</fo:static-content>

<!-- _______________________________________________________________ -->

<fo:flow flow-name="xsl-region-body">

<xsl:apply-templates select="*[position()>11]" mode="page_B"/>

</fo:flow>

</fo:page-sequence>

</fo:root>

</xsl:template>

<xsl:template match="line | section">

<fo:table table-layout="fixed" width="287mm">

<fo:table-column column-number="1" column-width="7.5mm"/>

<fo:table-column column-number="2" column-width="7.5mm"/>

<fo:table-column column-number="3" column-width="10mm"/>

<fo:table-column column-number="4" column-width="60mm"/>

<fo:table-column column-number="5" column-width="60mm"/>

<fo:table-column column-number="6" column-width="10mm"/>

<fo:table-column column-number="7" column-width="10mm"/>

<fo:table-column column-number="8" column-width="10mm"/>

<fo:table-column column-number="9" column-width="10mm"/>

<fo:table-column column-number="10" column-width="10mm"/>

<fo:table-column column-number="11" column-width="10mm"/>

<fo:table-column column-number="12" column-width="10mm"/>

<fo:table-column column-number="13" column-width="10mm"/>

<fo:table-column column-number="14" column-width="10mm"/>

<fo:table-column column-number="15" column-width="10mm"/>

<fo:table-column column-number="16" column-width="42mm"/>

<fo:table-body line-height="7.64mm" font-size="12pt" font-family="GOST_B" start-indent="1mm">

<fo:table-row>

<fo:table-cell column-number="1" border-start-style="solid" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@FORM"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="2" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@ZONE"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="3" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@POZICIA"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="4" border-after-style="solid" border-end-style="solid">

<fo:block>

<xsl:value-of select="@OBOZNACHENIE"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="5" border-after-style="solid" border-end-style="solid">

<fo:block>

<fo:block text-align="center" font-style="backslant" text-decoration="underline">

<xsl:value-of select="@s_NAIMENOVANIE"/>

</fo:block>

<xsl:value-of select="@NAIMENOVANIE"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="6" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_0"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="7" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_1"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="8" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_2"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="9" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_3"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="10" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_4"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="11" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_5"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="12" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_6"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="13" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_7"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="14" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_8"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="15" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_9"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="16" border-after-style="solid" border-end-style="solid">

<fo:block>

<xsl:value-of select="@PRIMECHANIE"/>

</fo:block>

<fo:block-container line-height="3.82mm" position="absolute">

<fo:block font-size="10pt">

<xsl:value-of select="@PRIMECHANIE_1"/>

</fo:block>

</fo:block-container>

<fo:block-container top="3.82mm" line-height="3.82mm" position="absolute">

<fo:block font-size="10pt">

<xsl:value-of select="@PRIMECHANIE_2"/>

</fo:block>

</fo:block-container>

</fo:table-cell>

</fo:table-row>

</fo:table-body>

</fo:table>

</xsl:template>

<!-- page_B ///////////////////////////////////////////////////////////////-->

<xsl:template match="line | section" mode="page_B">

<fo:table table-layout="fixed" width="185mm">

<fo:table-column column-number="1" column-width="7.5mm"/>

<fo:table-column column-number="2" column-width="7.5mm"/>

<fo:table-column column-number="3" column-width="10mm"/>

<fo:table-column column-number="4" column-width="60mm"/>

<fo:table-column column-number="5" column-width="60mm"/>

<fo:table-column column-number="6" column-width="10mm"/>

<fo:table-column column-number="7" column-width="10mm"/>

<fo:table-column column-number="8" column-width="10mm"/>

<fo:table-column column-number="9" column-width="10mm"/>

<fo:table-column column-number="10" column-width="10mm"/>

<fo:table-column column-number="11" column-width="10mm"/>

<fo:table-column column-number="12" column-width="10mm"/>

<fo:table-column column-number="13" column-width="10mm"/>

<fo:table-column column-number="14" column-width="10mm"/>

<fo:table-column column-number="15" column-width="10mm"/>

<fo:table-column column-number="16" column-width="42mm"/>

<fo:table-body line-height="7.805mm" font-size="12pt" font-family="GOST_B" start-indent="1mm">

<fo:table-row>

<fo:table-cell column-number="1" border-start-style="solid" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@FORM"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="2" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@ZONE"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="3" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@POZICIA"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="4" border-after-style="solid" border-end-style="solid">

<fo:block>

<xsl:value-of select="@OBOZNACHENIE"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="5" border-after-style="solid" border-end-style="solid">

<fo:block>

<fo:block text-align="center" font-style="backslant" text-decoration="underline">

<xsl:value-of select="@s_NAIMENOVANIE"/>

</fo:block>

<xsl:value-of select="@NAIMENOVANIE"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="6" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_0"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="7" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_1"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="8" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_2"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="9" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_3"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="10" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_4"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="11" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_5"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="12" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_6"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="13" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_7"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="14" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_8"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="15" border-after-style="solid" border-end-style="solid">

<fo:block text-align="center">

<xsl:value-of select="@KOL-VO_9"/>

</fo:block>

</fo:table-cell>

<fo:table-cell column-number="16" border-after-style="solid" border-end-style="solid">

<fo:block>

<xsl:value-of select="@PRIMECHANIE"/>

</fo:block>

<fo:block-container line-height="3.82mm" position="absolute">

<fo:block font-size="10pt">

<xsl:value-of select="@PRIMECHANIE_1"/>

</fo:block>

</fo:block-container>

<fo:block-container top="3.82mm" line-height="3.82mm" position="absolute">

<fo:block font-size="10pt">

<xsl:value-of select="@PRIMECHANIE_2"/>

</fo:block>

</fo:block-container>

</fo:table-cell>

</fo:table-row>

</fo:table-body>

</fo:table>

</xsl:template>

</xsl:stylesheet>

ПРИЛОЖЕНИЕ B

КОД ФУНКЦИЙ, ПРЕОБРАЗУЮЩИХ XML В XML

bool CXMLСonverterDlg::Converting_XML_in_XML(wchar_t *sDir, wchar_t *sPartDir)

{

//---------------------------------------------------------------------

// sDir - содержит полный путь к xml-файлу

// sPartDir - содержит имя xml-файла без расширения

//---------------------------------------------------------------------

UpdateData(TRUE);

HANDLE hFile = CreateFile(sDir,GENERIC_READ,0,0,OPEN_EXISTING,0,0);

if(hFile == INVALID_HANDLE_VALUE) return true;

DWORD fileSize = GetFileSize(hFile,0);

//Выделяем память для проецирования туда содержимого файла

char *fileBuffer = new char[fileSize];

//Число реально прочитанных байт

DWORD bytesRead;

BOOL bReadWriteError = ReadFile(hFile,fileBuffer,fileSize,&bytesRead,0);

if(!bReadWriteError) return true;

CloseHandle(hFile);

CString teg;

//Позиция в файле

DWORD positionStart;

BOOL GroupSpecification = FALSE;

DWORD K = 29, T = 32;

if((m_sPattern == "ГрупСпец_Ф1_gost-B_0-9")||((m_sPattern == "ГрупСпец_Ф1_gost-\

B_10-19"))||((m_sPattern == "ГрупСпец_Ф1_gost-B_20-29")))

{

GroupSpecification = TRUE;

K = 10;

T =19;

}

//Counter_of_lines - считает количество тегов в xml-файле

DWORD counter = Counter_of_lines(fileBuffer,fileSize,K,T);

// [0] - Позиция первого символа тега section или строки располагающейся в начале //конце таблицы

// [1] - Определяет, что это секция или строка, которую необходимо перенести

// [2] - Определяет количство добавляемых строк перед объектом section

DWORD **positionSectionStart = new DWORD*[counter];

for(DWORD n=0; n<counter; n++)

positionSectionStart[n] = new DWORD[3];

DWORD *positionSectionEnd = new DWORD[counter];

DWORD positionLineEnd, positionStampBefore = 0;

DWORD section10_29 = -1, **positionSection10_29;

positionSection10_29 = new DWORD*[counter];

for(DWORD n=0; n<counter; n++)

positionSection10_29[n] = new DWORD[2];

DWORD sizeLine10_29 = 0;

DWORD kline_before = 1, kline_after = 2;

if(m_yes_kline == TRUE)

{

kline_before = m_kline_before;

kline_after = m_kline_after;

}

//Количество секций

DWORD section = 0;

DWORD line = 0, kline, nline = 0;

bool bSection = false;

bool bLine = false;

char sLine[] = "<line FORM=\"&#160;\"/>";

DWORD sizeLine = sizeof(sLine)-1; //Минус завершающий символ

//Общий размер строк добавляемых до и после разделов

DWORD sizeAllLine = 0;

for(DWORD i = 0; i<fileSize; i++)

{

if(fileBuffer[i] == '<')

{

positionStart = i;

do{

i++;

if(fileBuffer[i] != ' ')

{

if(fileBuffer[i+1] != ' ') teg += fileBuffer[i];

else

{

teg += fileBuffer[i];

if(teg == "section")

{

positionSectionStart[section][0] = positionStart;

positionSectionStart[section][1] = 0;

line++;

sizeAllLine += sizeLine *\ AddLine_BeforeAfter(positionSection10_29, \

&section10_29, &line, kline_before, kline_after, positionSectionStart,section, K, T);

bSection = true;

}

else

if(teg == "line")

{

line++;

if((line == K)||(((line-K)%T ==\ 0)&&(line > K)))

{

CString copyline;

memcpy(copyline.GetBufferSetLength(sizeLine)\

,&fileBuffer[positionStart],sizeLine);

if(CStringA(copyline) !=\ CStringA(sLine))

{

positionSectionStart[section][0] = positionStart;

positionSectionStart[section][1] = 2;

line+=2;

sizeLine10_29 += sizeLine*2;

nline++;

section++;

}

}

if((line == (K+1))||(((line-(K+1))%T == 0)&&(line > (K+1))))

{

CString copyline;

memcpy(copyline.GetBufferSetLength(sizeLine),&fileBuffer\

[positionStart],sizeLine);

if(CStringA(copyline) != CStringA(sLine))

{

positionSectionStart[section][0] = positionStart;

positionSectionStart[section][1] = 1;

line++;

nline++;

sizeLine10_29 += sizeLine;

section++;

}

}

bLine = true;

}

else

if(teg == "stamp")

{

teg = "";

do{

i++;

teg += fileBuffer[i];

if(teg == "kline_before")

{

teg = "";

do{

i++;

if((fileBuffer[i] == '\"')&&(m_yes_kline == FALSE))

kline_before = atoi(&fileBuffer[i+1]);

}while(fileBuffer[i] != '\"');

}

else

if(teg == "kline_after")

{

teg = "";

do{

i++;

if((fileBuffer[i] == '\"')&&(m_yes_kline == FALSE))

kline_after = atoi(&fileBuffer[i+1]);

}while(fileBuffer[i] != '\"');

}

if(fileBuffer[i] == ' ') teg = "";

//Ищем закрывающий символ элемента stamp

if(fileBuffer[i] == '>')

positionStampBefore = i;

}while(fileBuffer[i] != '>');

}

}

}

if((bSection == true)&&(fileBuffer[i] == '>'))

{

positionSectionEnd[section] = i+1;

section++;

}

if((bLine == true)&&(fileBuffer[i] == '>'))

positionLineEnd = i+1;

}while(fileBuffer[i] != '>');

bSection = false;

bLine = false;

teg = "";

}

}

DWORD dPage;

//Расщитываем число добавляемых строк

if(GroupSpecification)

{

if(line > 10)

{

dPage = kline = (line - 10) / 19;

kline = line - 10 - kline * 19;

kline = 19 - kline; //kline - искомое число строк

}

else kline = 10 - line;

}

else

{

//line содержит общее количество просмотренных строк

if(line > 29)

{

dPage = kline = (line - 29) / 32;

kline = line - 29 - kline * 32;

kline = 32 - kline; //kline - искомое число строк

}else kline = 29 - line;

}

DWORD sizeLine_after = sizeLine * kline_after;

char *line_after = new char[sizeLine_after];

char sTemp[7];

itoa(dPage+2,sTemp,10);

CString sKPage;

sKPage = " kpage=\""; sKPage+= sTemp; sKPage+= "\"";

for(DWORD i = 0; i<sizeLine_after; i+= sizeLine)

memcpy(&line_after[i],sLine,sizeLine);

//Расчёт размера нового файла.

//Размеры: текущего файла, добавляемых линий до и после секций,

//добавляемых строк в конце файла, параметра указывающего кол-во страниц,

//строк добавляемых для переноса line на новый лист

DWORD fileSizeNew = fileSize + sizeAllLine + kline*sizeLine+sKPage.GetLength() +\ sizeLine10_29;

//Выделение блока оперативной памяти для нового файла

char *fBuffer = new char[fileSizeNew];

memcpy(fBuffer,fileBuffer,fileSize);

//Включаем в тег stamp, атрибут kpage содержащий кол-во листов в документе

memcpy(&fBuffer[positionStampBefore1],(CStringA)sKPage.GetBuffer(),\

sKPage.GetLength());

memcpy(&fBuffer[positionStampBefore - 1 +\

sKPage.GetLength()],&fileBuffer[positionStampBefore-1],fileSize - \

positionStampBefore-1);

DWORD size3 = sKPage.GetLength();

unsigned int t = 0, k = 0;

for(DWORD j = 0; j<section; j++)

{

//Если это позиция названия раздела

if(positionSectionStart[j][1] == 0)

{

for(k = 0; k<positionSectionStart[j][2]; k++)

{

memcpy(&fBuffer[positionSectionStart[j]\

[0]+size3],sLine,sizeLine);

size3 += sizeLine;

}

if((j == positionSection10_29[t][0])&&(section10_29 != -\

1)&&((t<=section10_29)))

{

for( k = 0; k<positionSection10_29[t][1]; k++)

{

memcpy(&fBuffer[positionSectionStart[j][0]+\

size3],sLine,sizeLine);

size3 += sizeLine;

}

t++;

}

memcpy(&fBuffer[positionSectionStart[j][0]+size3],\

&fileBuffer[positionSectionStart[j][0]],fileSize - positionSectionStart[j][0]);

memcpy(&fBuffer[positionSectionEnd[j]+size3]\

,line_after,sizeLine_after);

size3 += sizeLine_after;

memcpy(&fBuffer[positionSectionEnd[j]+size3],\

&fileBuffer[positionSectionEnd[j]],fileSize - positionSectionEnd[j]);

}

else //Если это первая или последняя строка таблицы

{

for(k = 0; k<positionSectionStart[j][1]; k++)

{

memcpy(&fBuffer[positionSectionStart[j][0]+size3],\

sLine,sizeLine);

size3+=sizeLine;

}

memcpy(&fBuffer[positionSectionStart[j][0]+size3],\

&fileBuffer[positionSectionStart[j][0]],fileSize - positionSectionStart[j][0]);

}

}

//Дописываем строки в конце файла XML

for(DWORD k = 0; k < kline; k++)

{

memcpy(&fBuffer[positionLineEnd+size3],sLine,sizeLine);

size3+=sizeLine;

}

memcpy(&fBuffer[positionLineEnd+size3],&fileBuffer[positionLineEnd],\

fileSize - positionLineEnd);

//Формируем имя промежуточного файла

CString strPartDir;

strPartDir = "temp\\";

strPartDir += sPartDir;

strPartDir += "xml";

HANDLE hFileWrite = CreateFile(strPartDir,GENERIC_WRITE,0,0,CREATE_ALWAYS,0,0);

if(hFileWrite == INVALID_HANDLE_VALUE)

{

FreeBuffer(fileBuffer,fBuffer,positionSectionStart,\

positionSection10_29,line_after,counter);

return true;

}

DWORD bufferWrite;

bReadWriteError = WriteFile(hFileWrite,fBuffer,fileSizeNew,&bufferWrite,0);

if((hFileWrite == INVALID_HANDLE_VALUE)||(!bReadWriteError))

{

FreeBuffer(fileBuffer,fBuffer,positionSectionStart,\

positionSection10_29,line_after,counter);

CloseHandle(hFileWrite);

return true;

}

CloseHandle(hFileWrite);

FreeBuffer(fileBuffer,fBuffer,positionSectionStart,\

positionSection10_29,line_after,counter);

delete[] positionSectionEnd;

return false;

}

//Функция определяющая количество строк добавляемых до и после элементов //section

DWORD CXMLСonverterDlg::AddLine_BeforeAfter(DWORD **positionSection10_29, DWORD *section10_29,DWORD *line,DWORD kline_before, DWORD kline_after, DWORD **positionSectionStart,DWORD section, DWORD K, DWORD T)

{

//---------------------------------------------------------------------

// К - количество строк на первой странице спецификации

// Т - количество строк на 2й и последующих страницах спецификации

//---------------------------------------------------------------------

positionSection10_29[(*section10_29)+1][1] = -1;

bool yes = false;

for(DWORD k = 0; k < kline_before + 1; k++)

{

//Если секция может попасть на вторую строку листа, уменьшаем отступ на //необходимое кол-во строк

if(((*line) + k == 2)||((*line) + k == (K+2))||((( (*line) + k -\

(K+2))% T == 0)&&(( (*line) + k ) > (K+2))))

{

positionSectionStart[section][2] = k;

yes = true;

break;

}

}

//Если не нужно изменять количество строк, принимаем указанное число

if(!yes) positionSectionStart[section][2] = kline_before;

//Увеличиваем счётчик строк на количество добавляемых строк перед секцией

*line += positionSectionStart[section][2];

//Содержит кол-во добавляемых строк для переноса section на другой лист

DWORD nSection10_29 = 0;

for(DWORD k = 0; k < kline_after + 2; k++)

{

//Проверяем не попала ли секция в конец листа спецификации

if((((*line)+k) == K)||(((((*line)+k-K)%T) == 0)&&(((*line)+k)> K)))

{

(*section10_29)++;

positionSection10_29[*section10_29][0] = section;

positionSection10_29[*section10_29][1] = k + 2;

//Должны быть добавлены как минимум 2 строки

nSection10_29 += k + 2;

*line += k + 2;

break;

}

}

//Проверяем не попала ли секция в начало листа спецификации

if((*line == 1)||(*line == (K+1))||((((*line)+k -\

(K+1))%T==0)&&(((*line)+k)>(K+1))))

{

(*section10_29)++;

positionSection10_29[*section10_29][0] = section;

positionSection10_29[*section10_29][1] = k + 1;

nSection10_29 += k + 1;

*line += k + 1;

break;

}

//Увеличиваем счётчик строк, на количество добавляемых строк после секции

*line += kline_after;

//Возвращаем общее число добавляемых строк (до и после элемента section)

return positionSectionStart[section][2] + kline_after + nSection10_29;

}

void CXMLСonverterDlg::FreeBuffer(char *fileBuffer,char *fBuffer,\

DWORD **positionSectionStart,DWORD **positionSection10_29,char *line_after,\ DWORD counter)

{

delete[] line_after;

delete[] fileBuffer;

delete[] fBuffer;

for(DWORD n=0; n<counter; n++)

{

delete[] positionSectionStart[n];

delete[] positionSection10_29[n];

}

}

DWORD CXMLСonverterDlg::Counter_of_lines(char *fileBuffer,DWORD fileSize,\

DWORD K, DWORD T)

{

DWORD counter_line = 0;

for(DWORD i = 0; i<fileSize; i++)

{

if(fileBuffer[i] == '<')

{

counter_line++;

}

}

return counter_line;

}

ПРИЛОЖЕНИЕ С

ПЕРВАЯ СТРАНИЦА ГРУППОВОЙ СПЕЦИФИКАЦИИ, ПРЕДСТАВЛЕННОЙ В ФОРМАТЕ PDF

ПРИЛОЖЕНИЕ D

ВТОРАЯ СТРАНИЦА ГРУППОВОЙ СПЕЦИФИКАЦИИ, ПРЕДСТАВЛЕННОЙ В ФОРМАТЕ PDF

Размещено на Allbest.ru


Подобные документы

Работы в архивах красиво оформлены согласно требованиям ВУЗов и содержат рисунки, диаграммы, формулы и т.д.
PPT, PPTX и PDF-файлы представлены только в архивах.
Рекомендуем скачать работу.