Mike писал(а):
Основная цель - сделать в ней не только LOGIN (id номер), но и алиас (символьный login).
наиглухая бета версия файлика card_inet.xsl, но делает в аккурат то что Вам надо, а именно - выводит все алиасы с их паролями в одной табличке:
Код:
<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
<!ENTITY copy "©">
<!ENTITY reg "®">
<!ENTITY trade "™">
<!ENTITY mdash "—">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY pound "£">
<!ENTITY yen "¥">
<!ENTITY euro "€">
]>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:svg="http://www.w3.org/2000/svg"
version="1.0">
<xsl:output method="xml" encoding="windows-1251"/>
<xsl:attribute-set name="text">
<xsl:attribute name="font-family">arial</xsl:attribute>
<xsl:attribute name="text-align">left</xsl:attribute>
<xsl:attribute name="font-size">12pt</xsl:attribute>
<xsl:attribute name="start-indent">0.1cm</xsl:attribute>
<xsl:attribute name="end-indent">0.1cm</xsl:attribute>
<xsl:attribute name="text-decoration">none</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="text11_bold">
<xsl:attribute name="font-family">arial</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="text-align">left</xsl:attribute>
<xsl:attribute name="font-size">11pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="text_underlined">
<xsl:attribute name="text-decoration">underline</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="text_ban">
<xsl:attribute name="text-align">right</xsl:attribute>
<xsl:attribute name="font-size">6pt</xsl:attribute>
<xsl:attribute name="start-indent">0.1cm</xsl:attribute>
<xsl:attribute name="end-indent">0.1cm</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="text_bold">
<xsl:attribute name="text-align">left</xsl:attribute>
<xsl:attribute name="font-family">arial</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="font-size">12pt</xsl:attribute>
<xsl:attribute name="start-indent">0.1cm</xsl:attribute>
<xsl:attribute name="end-indent">0.1cm</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="text_title">
<xsl:attribute name="text-align">center</xsl:attribute>
<xsl:attribute name="font-size">14pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="start-indent">0.1cm</xsl:attribute>
<xsl:attribute name="end-indent">0.1cm</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="text_italic">
<xsl:attribute name="text-align">left</xsl:attribute>
<xsl:attribute name="font-size">12pt</xsl:attribute>
<xsl:attribute name="start-indent">0.1cm</xsl:attribute>
<xsl:attribute name="end-indent">0.1cm</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="cell_border">
<xsl:attribute name="border-width">0.7pt</xsl:attribute>
<xsl:attribute name="border-top-style">solid</xsl:attribute>
<xsl:attribute name="border-bottom-style">solid</xsl:attribute>
<xsl:attribute name="border-left-style">solid</xsl:attribute>
<xsl:attribute name="border-right-style">solid</xsl:attribute>
<xsl:attribute name="padding-top">0.1cm</xsl:attribute>
<xsl:attribute name="padding-top">0.1cm</xsl:attribute>
</xsl:attribute-set>
<xsl:template match="/card">
<xsl:variable name="familija" select="parameters/parameter[@pid=2]/@value" />
<xsl:variable name="imja" select="parameters/parameter[@pid=3]/@value" />
<xsl:variable name="otchestvo" select="parameters/parameter[@pid=4]/@value" />
<xsl:variable name="inet_mid" select="'1'" />
<fo:root>
<fo:layout-master-set>
<fo:simple-page-master master-name="first" page-width="21cm" page-height="29.7cm" margin-top="1cm" margin-right="1cm" margin-bottom="1cm" margin-left="1cm">
<fo:region-body margin-top="0.0cm" margin-bottom="0.0cm" />
<fo:region-before extent="0.0cm" />
<fo:region-after extent="0.0cm" />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="first">
<!-- footer -->
<!--
<fo:static-content flow-name="xsl-region-after">
<fo:block font-size="10pt"
text-align="end" xsl:use-attribute-sets="text">
Страница
<fo:page-number />
</fo:block>
</fo:static-content>
-->
<!-- footer -->
<fo:flow flow-name="xsl-region-body">
<!-- заголовок -->
<fo:block xsl:use-attribute-sets="text_title" space-after="0.5cm">Карта регистрации</fo:block>
<!-- заголовок -->
<fo:table table-layout="fixed">
<fo:table-column column-width="6.5cm"/>
<fo:table-column column-width="proportional-column-width(1)"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block xsl:use-attribute-sets="text">Фамилия:</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block xsl:use-attribute-sets="text_bold" text-align="left">
<xsl:value-of select="$familija"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block xsl:use-attribute-sets="text">Имя:</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block xsl:use-attribute-sets="text_bold" text-align="left">
<xsl:value-of select="$imja"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block xsl:use-attribute-sets="text">Отчество:</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block xsl:use-attribute-sets="text_bold" text-align="left">
<xsl:value-of select="$otchestvo"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<!-- таблица логинов / -->
<xsl:call-template name="access_table"></xsl:call-template>
<!-- / таблица логинов -->
<!-- примечание -->
<fo:block xsl:use-attribute-sets="text_bold">
Примечание: _______________________________________________________
</fo:block>
<!-- примечание -->
<!-- печать -->
<xsl:call-template name="stamp"/>
<!-- печать -->
<!-- линия отреза -->
<fo:table table-layout="fixed" space-before="0.7cm" space-after="0.7cm">
<fo:table-column column-width="proportional-column-width(1)"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell border-bottom-style="solid" border-bottom-width="0.02cm">
<fo:block/>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<!-- линия отреза -->
<!-- заголовок -->
<fo:block xsl:use-attribute-sets="text_title">Карта регистрации</fo:block>
<!-- заголовок -->
<fo:table table-layout="fixed">
<fo:table-column column-width="6.5cm"/>
<fo:table-column column-width="proportional-column-width(1)"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block xsl:use-attribute-sets="text">Фамилия:</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block xsl:use-attribute-sets="text_bold" text-align="left">
<xsl:value-of select="$familija"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block xsl:use-attribute-sets="text">Имя:</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block xsl:use-attribute-sets="text_bold" text-align="left">
<xsl:value-of select="$imja"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block xsl:use-attribute-sets="text">Отчество:</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block xsl:use-attribute-sets="text_bold" text-align="left">
<xsl:value-of select="$otchestvo"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<!-- таблица логинов / -->
<xsl:call-template name="access_table"></xsl:call-template>
<!-- / таблица логинов -->
<fo:block xsl:use-attribute-sets="text" space-after="0.5cm">Электронный адрес (e-mail) <fo:inline xsl:use-attribute-sets="text_bold">blah@example.net</fo:inline></fo:block>
<!-- примечание -->
<fo:block xsl:use-attribute-sets="text" space-after="0.3cm"><fo:inline xsl:use-attribute-sets="text_underlined">Техническая поддержка (круглосуточно)</fo:inline>: 322-223-322, <fo:inline xsl:use-attribute-sets="text_underlined">support@example.net</fo:inline></fo:block>
<fo:block xsl:use-attribute-sets="text">Информация о наработке и состоянии Вашего лицевого счета, статистика подключений</fo:block>
<!-- примечание -->
<!-- печать -->
<xsl:call-template name="stamp"/>
<!-- печать -->
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<!-- таблица логинов / -->
<xsl:template name="access_table">
<xsl:for-each select="module">
<xsl:variable name="mid"><xsl:value-of select="@id"/></xsl:variable>
<!-- Dial-UP / -->
<xsl:if test="@name='dialup'">
<fo:table table-layout="fixed" space-before="0.5cm" space-after="0.5cm">
<fo:table-column column-width="proportional-column-width(1)" />
<fo:table-column column-width="proportional-column-width(1)" />
<fo:table-header>
<fo:table-row>
<fo:table-cell xsl:use-attribute-sets="cell_border" start-indent="1cm">
<fo:block xsl:use-attribute-sets="text" text-align="center">Логин:</fo:block>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="cell_border">
<fo:block xsl:use-attribute-sets="text" text-align="center">Пароль:</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<xsl:for-each select="./*[name()=concat('user_login_', $mid)]">
<xsl:variable name="lid" select="@id" />
<fo:table-row>
<fo:table-cell xsl:use-attribute-sets="cell_border">
<fo:block xsl:use-attribute-sets="text_bold" text-align="center">
<xsl:for-each select="../*[name()=concat('user_alias_', $mid) and @login_id=$lid]">
<xsl:value-of select="@login_alias" />
</xsl:for-each>
</fo:block>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="cell_border">
<fo:block xsl:use-attribute-sets="text_bold" text-align="center">
<xsl:value-of select="@pswd" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</xsl:if>
<!-- / Dial-UP -->
<!-- IPN / -->
<!-- / IPN / -->
</xsl:for-each>
</xsl:template>
<!-- / таблица логинов -->
<!-- печать / -->
<xsl:template name="stamp">
<fo:table table-layout="fixed" space-before="0.5cm" start-indent="0.5cm">
<fo:table-column column-width="proportional-column-width(1)"/>
<fo:table-column column-width="proportional-column-width(1)"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block xsl:use-attribute-sets="text11_bold">Оператор</fo:block>
<fo:block xsl:use-attribute-sets="text11_bold" space-before="0.3cm">Директор</fo:block>
<fo:block xsl:use-attribute-sets="text11_bold">«мега-пупер-оператор»</fo:block>
<fo:block space-before="0.25cm" space-after="0.25cm"/>
<fo:block xsl:use-attribute-sets="text11_bold">______________ / И.И. Иванов</fo:block>
<fo:block space-before="0.25cm" space-after="0.25cm"/>
<fo:block xsl:use-attribute-sets="text11_bold">«____» _______________ 200__г.</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block xsl:use-attribute-sets="text11_bold">Абонент</fo:block>
<fo:block xsl:use-attribute-sets="text11_bold" space-before="0.3cm"> </fo:block>
<fo:block xsl:use-attribute-sets="text11_bold">______________________________</fo:block>
<fo:block space-before="0.25cm" space-after="0.25cm"/>
<fo:block xsl:use-attribute-sets="text11_bold">__________ / _________________</fo:block>
<fo:block space-before="0.25cm" space-after="0.25cm"/>
<fo:block xsl:use-attribute-sets="text11_bold">«____» _______________ 200__г.</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:template>
<!-- / печать -->
</xsl:stylesheet>