|
|
@@ -138,13 +138,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
+ <xsl:include href="Benford.xsl"/>
|
|
|
<xsl:output indent="yes"/>
|
|
|
<xsl:strip-space elements="*"/>
|
|
|
|
|
|
<xsl:param name="temp" required="yes"/>
|
|
|
<xsl:param name="uuid" required="yes"/>
|
|
|
|
|
|
- <xsl:variable name="ditadir" select="concat($temp,'/',$uuid)"/>
|
|
|
+ <xsl:param name="system_cache__dita:pdf_a4_string_width" select="80"/> <!-- parameter for automate table width - how many letters fits in pdf output -->
|
|
|
+ <xsl:param name="system_cache__dita:simpletable.col.size" select="4"/><xsl:variable name="ditadir" select="concat($temp,'/',$uuid)"/>
|
|
|
|
|
|
<xsl:template mode="preprocess" match="RelatedFeatureRoot">
|
|
|
<preprocess_dita>
|
|
|
@@ -188,26 +190,40 @@
|
|
|
<xsl:template match="map" mode="ditamap_root">
|
|
|
<xsl:element name="{name()}">
|
|
|
<xsl:copy-of select="@*"/>
|
|
|
- <xsl:apply-templates mode="ditamap_root.embedded_map" />
|
|
|
+ <xsl:copy-of select="title"/><xsl:apply-templates mode="ditamap_root.embedded_map" />
|
|
|
+ <xsl:message>#196 in mode="ditamap_root" digging! </xsl:message></xsl:element>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+ <xsl:template match="topichead|xref" mode="ditamap_root.embedded_map">
|
|
|
+ <xsl:element name="{name()}">
|
|
|
+ <xsl:copy-of select="@*"/>
|
|
|
+ <xsl:apply-templates mode="ditamap_root.embedded_map" />
|
|
|
</xsl:element>
|
|
|
</xsl:template>
|
|
|
|
|
|
- <xsl:template match="topic" mode="ditamap_root.embedded_map">
|
|
|
+ <xsl:template mode="ditamap_root.embedded_map" match="@*"><xsl:copy-of select="."/></xsl:template><xsl:template match="topic" mode="ditamap_root.embedded_map">
|
|
|
<topicref href="{@id}.dita">
|
|
|
- <xsl:result-document href="{$temp}/{$uuid}/{@id}.dita">
|
|
|
+ <xsl:variable name="ditamap_root.embedded_map.body">
|
|
|
+ <xsl:apply-templates mode="ditamap_root.embedded_map.body"/>
|
|
|
+ </xsl:variable><xsl:result-document href="{$temp}/{$uuid}/{@id}.dita">
|
|
|
<xsl:element name="{name()}">
|
|
|
- <xsl:copy-of select="@*"/>
|
|
|
- <xsl:apply-templates mode="ditamap_root.embedded_map.body"/>
|
|
|
+ <xsl:apply-templates mode="ditamap_root.embedded_map" select="@*"/>
|
|
|
+ <!--<xsl:copy-of select="@*"/>-->
|
|
|
+ <xsl:apply-templates mode="Benford:ditamap_root.embedded_map.body.topic.cleanup" select="$ditamap_root.embedded_map.body"/>
|
|
|
</xsl:element>
|
|
|
</xsl:result-document>
|
|
|
- <xsl:apply-templates mode="ditamap_root.embedded_map" />
|
|
|
+ <xsl:apply-templates mode="Benford:ditamap_root.embedded_map.body.topicref.topic" select="$ditamap_root.embedded_map.body"/><xsl:apply-templates mode="ditamap_root.embedded_map" />
|
|
|
</topicref>
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
- <xsl:template match="*" mode="ditamap_root.embedded_map.body">
|
|
|
+ <xsl:template mode="ditamap_root.embedded_map.body" match="@*">
|
|
|
+ <xsl:copy-of select="."/>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+ <xsl:template mode="ditamap_root.embedded_map.body" match="@system_cache__dita:width_cols"/><xsl:template match="*" mode="ditamap_root.embedded_map.body">
|
|
|
<xsl:element name="{name()}">
|
|
|
- <xsl:copy-of select="@*"/>
|
|
|
+ <xsl:apply-templates select="@*" mode="ditamap_root.embedded_map.body"/>
|
|
|
<xsl:apply-templates mode="ditamap_root.embedded_map.body"/>
|
|
|
</xsl:element>
|
|
|
</xsl:template>
|
|
|
@@ -228,14 +244,63 @@
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
- <xsl:template match="*" mode="preprocess_root.embedded_map.simpletable">
|
|
|
+ <xsl:template match="simpletable[ count(sthead/stentry) > 6 ]" mode="ditamap_root.embedded_map.body">
|
|
|
+ <xsl:variable name="system_cache__dita:max_strings">
|
|
|
+ <xsl:call-template name="system_cache__dita:max_strings">
|
|
|
+ <xsl:with-param name="simpletable" select="."/>
|
|
|
+ </xsl:call-template>
|
|
|
+ </xsl:variable>
|
|
|
+ <!--<debug_Max>
|
|
|
+ <xsl:copy-of select="$system_cache__dita:max_strings"/>
|
|
|
+ </debug_Max>-->
|
|
|
+ <xsl:variable name="width_cols">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="@system_cache__dita:width_cols='auto'">
|
|
|
+ <xsl:call-template name="system_cache__dita:width_cols.auto">
|
|
|
+ <xsl:with-param name="simpletable" select="."/>
|
|
|
+ <xsl:with-param name="max_strings" select="$system_cache__dita:max_strings"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="@system_cache__dita:width_cols"><xsl:value-of select="@system_cache__dita:width_cols"/></xsl:when>
|
|
|
+ <xsl:otherwise><xsl:value-of select="6"/></xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:variable name="header_cols">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="@system_cache__dita:header_cols"><xsl:value-of select="@system_cache__dita:width_cols"/></xsl:when>
|
|
|
+ <xsl:otherwise><xsl:value-of select="1"/></xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:variable>
|
|
|
+ <!--<xsl:variable name="header_cols.relcolwidth">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="@system_cache__dita:header_cols.relcolwidth"><xsl:value-of select="@system_cache__dita:header_cols.relcolwidth"/></xsl:when>
|
|
|
+ <xsl:otherwise><xsl:value-of select="'2*'"/></xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:variable>-->
|
|
|
+ <xsl:variable name="table_cut">
|
|
|
+ <xsl:apply-templates select="." mode="table_cut">
|
|
|
+ <xsl:with-param name="width_cols" select="xs:integer($width_cols)"/>
|
|
|
+ <xsl:with-param name="header_cols" select="xs:integer($header_cols)"/>
|
|
|
+ <xsl:with-param name="start_row" select="1"/>
|
|
|
+ <xsl:with-param name="start_col" select="1"/>
|
|
|
+ <!--<xsl:with-param name="header_cols.relcolwidth" select="$header_cols.relcolwidth"/>-->
|
|
|
+ <xsl:with-param name="max_strings" select="$system_cache__dita:max_strings"/>
|
|
|
+ </xsl:apply-templates>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:message>#308 debug @topic.id=<xsl:value-of select="../../../@id"/> ;</xsl:message>
|
|
|
+ <xsl:apply-templates mode="table_cut.local_xref" select="$table_cut">
|
|
|
+ <xsl:with-param name="header_cols" select="xs:integer($header_cols)"/>
|
|
|
+ <xsl:with-param name="topic.id" select="../../../@id"/>
|
|
|
+ </xsl:apply-templates>
|
|
|
+ <!--<xsl:copy-of select="$table_cut"/>-->
|
|
|
+ </xsl:template><xsl:template match="*" mode="preprocess_root.embedded_map.simpletable">
|
|
|
<xsl:element name="{name()}">
|
|
|
<xsl:copy-of select="@*"/>
|
|
|
<xsl:apply-templates mode="preprocess_root.embedded_map.simpletable"/>
|
|
|
</xsl:element>
|
|
|
</xsl:template>
|
|
|
<xsl:template match="@*" mode="preprocess_root.embedded_map.simpletable">
|
|
|
- <xsl:copy-of select="@*"/>
|
|
|
+ <xsl:copy-of select="."/>
|
|
|
</xsl:template>
|
|
|
|
|
|
<xsl:template match=" text()" mode="preprocess_root.embedded_map.simpletable">
|
|
|
@@ -277,8 +342,407 @@
|
|
|
|
|
|
|
|
|
|
|
|
- <xsl:template match="*|text()|comment()" mode="ditamap_root.embedded_map"/>
|
|
|
+ <xsl:template mode="table_cut" match="simpletable">
|
|
|
+ <xsl:param name="width_cols" select="6"/>
|
|
|
+ <xsl:param name="header_cols" select="1"/>
|
|
|
+ <xsl:param name="start_row" select="1"/>
|
|
|
+ <xsl:param name="start_col" select="1"/>
|
|
|
+ <!--<xsl:param name="header_cols.relcolwidth" required="yes"/>-->
|
|
|
+ <xsl:param name="max_strings" required="yes"/>
|
|
|
+ <xsl:variable name="simpletable" select="."/>
|
|
|
+ <xsl:variable name="to" select="ceiling((count(sthead/stentry) - $header_cols ) div ( $width_cols + $header_cols ) )"/>
|
|
|
+ <xsl:variable name="to" >
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="count(sthead/stentry) mod $width_cols = 1">
|
|
|
+ <xsl:value-of select="$to"/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="count(sthead/stentry) mod $width_cols > 1">
|
|
|
+ <xsl:value-of select="$to "/> <!-- + 1 -->
|
|
|
+ <!--<xsl:message>#383 table @id=<xsl:value-of select="@id"/> count(sthead/stentry) mod $width_cols > 1</xsl:message>-->
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise><xsl:value-of select="$to"/></xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:message>#306 strip table @id=<xsl:value-of select="@id"/>; 1 to <xsl:value-of select="$to"/>; (width_cols = <xsl:value-of select="$width_cols"/>) ; count(sthead/stentry)=<xsl:value-of select="count(sthead/stentry)"/>; </xsl:message>
|
|
|
+
|
|
|
+ <xsl:for-each select="1 to xs:integer($to) ">
|
|
|
+ <xsl:if test="xs:integer($to) > 1">
|
|
|
+ Tabela podzielona - część <xsl:value-of select="position()"/>/<xsl:value-of select="xs:integer($to)"/>.
|
|
|
+ </xsl:if>
|
|
|
+ <xsl:apply-templates mode="table_cut.strow" select="$simpletable">
|
|
|
+ <xsl:with-param name="width_cols" select="$width_cols"/>
|
|
|
+ <xsl:with-param name="header_cols" select="$header_cols"/>
|
|
|
+ <xsl:with-param name="start_row" select="$start_row"/>
|
|
|
+ <xsl:with-param name="start_col" select="current() * $width_cols - $width_cols + 1"/>
|
|
|
+ <!--<xsl:with-param name="header_cols.relcolwidth" select="$header_cols.relcolwidth"/>-->
|
|
|
+ <xsl:with-param name="position" select="position()"/>
|
|
|
+ <xsl:with-param name="max_strings" select="$max_strings"/>
|
|
|
+ </xsl:apply-templates>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+ <xsl:template mode="table_cut" match="@id">
|
|
|
+ <xsl:param name="start_col" required="yes"/>
|
|
|
+ <xsl:attribute name="id" select=" concat(.,'_',$start_col)"/>
|
|
|
+ </xsl:template>
|
|
|
+ <xsl:template mode="table_cut" match="@*">
|
|
|
+ <xsl:copy-of select="."/>
|
|
|
+ </xsl:template>
|
|
|
|
|
|
+ <xsl:template mode="table_cut" match="@system_cache__dita:width_cols" />
|
|
|
+ <xsl:template mode="table_cut" match="@system_cache__dita:bypass_rows_with_zero" />
|
|
|
+ <xsl:template mode="table_cut" match="@system_cache__dita:bypass_rows_empty" />
|
|
|
+ <xsl:template mode="table_cut.local_xref" match="@system_cache__dita:position"/>
|
|
|
+ <xsl:template mode="table_cut.local_xref" match="@*"><xsl:copy-of select="."/></xsl:template>
|
|
|
+
|
|
|
+ <xsl:template name="system_cache__dita:header_cols.relcolwidth" >
|
|
|
+ <xsl:param name="cols_count" required="yes"/>
|
|
|
+ <xsl:param name="header_cols" required="yes"/>
|
|
|
+ <xsl:param name="max_strings" required="yes"/>
|
|
|
+ <xsl:param name="system_cache__dita:header_cols.relcolwidth"/> <!-- to be set from attribute optionaly -->
|
|
|
+ <xsl:message>#372 @id=<xsl:value-of select=".././@id"/> @system_cache__dita:header_cols.relcolwidth run. $cols_count=<xsl:value-of select="$cols_count"/>; $header_cols=<xsl:value-of select="$header_cols"/>;</xsl:message>
|
|
|
+ <xsl:attribute name="relcolwidth">
|
|
|
+ <!--<xsl:value-of select="concat($cols_count,'_',.)"/>-->
|
|
|
+ <xsl:for-each select="1 to $cols_count">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test=" current() <= $header_cols and $system_cache__dita:header_cols.relcolwidth">
|
|
|
+ <xsl:value-of select="$system_cache__dita:header_cols.relcolwidth"/><xsl:text> </xsl:text>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:value-of select="concat(ceiling($max_strings//stentry[@pos = current()]/@max.string.ph.len.max),'*')"/>
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="current() = $cols_count"></xsl:when>
|
|
|
+ <xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:attribute>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+ <xsl:template mode="table_cut" match="@system_cache__dita:header_cols.relcolwidth" >
|
|
|
+ <xsl:param name="cols_count" required="yes"/>
|
|
|
+ <xsl:param name="header_cols" required="yes"/>
|
|
|
+ <xsl:param name="max_strings" required="yes"/>
|
|
|
+ <xsl:call-template name="system_cache__dita:header_cols.relcolwidth">
|
|
|
+ <xsl:with-param name="max_strings" select="$max_strings"/>
|
|
|
+ <xsl:with-param name="header_cols" select="$header_cols"/>
|
|
|
+ <xsl:with-param name="cols_count" select="$cols_count"/>
|
|
|
+ <xsl:with-param name="system_cache__dita:header_cols.relcolwidth" select="@system_cache__dita:header_cols.relcolwidth"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ </xsl:template>
|
|
|
|
|
|
|
|
|
-</xsl:stylesheet>
|
|
|
+ <xsl:template mode="table_cut.strow" match="simpletable">
|
|
|
+ <xsl:param name="width_cols" required="yes"/>
|
|
|
+ <xsl:param name="header_cols" required="yes"/>
|
|
|
+ <xsl:param name="start_row" required="yes"/>
|
|
|
+ <xsl:param name="start_col" required="yes"/>
|
|
|
+ <!--<xsl:param name="header_cols.relcolwidth" required="yes"/>-->
|
|
|
+ <xsl:param name="position" required="yes"/>
|
|
|
+ <xsl:param name="max_strings" required="yes"/>
|
|
|
+ <xsl:variable name="simpletable" select="."/>
|
|
|
+ <xsl:variable name="simpletable.id" select="concat($uuid,'_',@id,'_',$start_col)"/>
|
|
|
+ <xsl:message>#325 starting $start_col=<xsl:value-of select="$start_col"/>;</xsl:message>
|
|
|
+ <xsl:variable name="add_to_once" select="$position">
|
|
|
+ <!--<xsl:choose>
|
|
|
+ <xsl:when test="$start_col = 1"><xsl:value-of select="xs:integer(0)"/></xsl:when>
|
|
|
+ <xsl:otherwise><xsl:value-of select="xs:integer(1)"/></xsl:otherwise>
|
|
|
+ </xsl:choose>-->
|
|
|
+ </xsl:variable>
|
|
|
+
|
|
|
+ <xsl:variable name="cols_count" > <!-- select="$header_cols - 1 + $start_col + $header_cols - $start_col + $header_cols + $width_cols" -->
|
|
|
+ <!--<xsl:choose>
|
|
|
+ <xsl:when test="count(sthead/stentry) <= $width_cols"><xsl:value-of select="count(sthead/stentry)"/></xsl:when>
|
|
|
+ <xsl:when test="count(sthead/stentry) <= $width_cols"><xsl:value-of select="count(sthead/stentry)"/></xsl:when>
|
|
|
+ </xsl:choose>-->
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="count(sthead/stentry) <= $width_cols"><!-- mniejsza tabela niz width -->
|
|
|
+ <xsl:message>#386a mniejsza tabela niz width - set <xsl:value-of select="count(sthead/stentry)"/></xsl:message>
|
|
|
+ <xsl:value-of select="count(sthead/stentry)"/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="$start_col = 1 and count(sthead/stentry) >= $width_cols "> <!-- poczatek duzej tabeli -->
|
|
|
+ <xsl:message>#386d $width_cols=<xsl:value-of select="$width_cols"/>; $start_col=<xsl:value-of select="$start_col"/>; cnt<xsl:value-of select="count(sthead/stentry)"/>; poczatek duzej tabeli - set <xsl:value-of select="$header_cols + $width_cols + 1"/></xsl:message>
|
|
|
+ <xsl:value-of select="$header_cols + $width_cols + 1"/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="count(sthead/stentry) - $start_col + $position <= $width_cols + $position "> <!-- koncowka duzej tabeli -->
|
|
|
+ <xsl:message>#386c $width_cols=<xsl:value-of select="$width_cols"/>; $start_col=<xsl:value-of select="$start_col"/>; cnt<xsl:value-of select="count(sthead/stentry)"/>; koncowka duzej tabeli - set <xsl:value-of select="count(sthead/stentry) - $start_col - $position + $header_cols "/></xsl:message>
|
|
|
+ <xsl:value-of select="count(sthead/stentry) - $start_col - $position + $header_cols "/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="count(sthead/stentry) - $start_col > $width_cols "> <!-- srodek duzej tabeli -->
|
|
|
+ <xsl:message>#386b $width_cols=<xsl:value-of select="$width_cols"/>; $start_col=<xsl:value-of select="$start_col"/>; cnt<xsl:value-of select="count(sthead/stentry)"/>; srodek duzej tabeli - set <xsl:value-of select="$width_cols + $header_cols "/></xsl:message>
|
|
|
+ <xsl:value-of select="$width_cols + $header_cols + 1"/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:message terminate="yes">#386c $width_cols=<xsl:value-of select="$width_cols"/>; $start_col=<xsl:value-of select="$start_col"/>; cnt<xsl:value-of select="count(sthead/stentry)"/>; blad warunku tabeli </xsl:message>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:variable>
|
|
|
+
|
|
|
+ <xsl:element name="{name()}">
|
|
|
+ <xsl:attribute name="system_cache__dita:position" select="$position"/>
|
|
|
+ <xsl:apply-templates mode="table_cut" select="@*">
|
|
|
+ <xsl:with-param name="header_cols" select="$header_cols"/>
|
|
|
+ <xsl:with-param name="start_col" select="$start_col"/>
|
|
|
+ <!--<xsl:with-param name="header_cols.relcolwidth" select="$header_cols.relcolwidth"/>-->
|
|
|
+ <xsl:with-param name="max_strings" select="$max_strings"/>
|
|
|
+ <xsl:with-param name="cols_count" select="$cols_count" />
|
|
|
+ </xsl:apply-templates>
|
|
|
+ <xsl:if test="not(@system_cache__dita:header_cols.relcolwidth)"><!-- force to use auto relcolwidth -->
|
|
|
+ <xsl:call-template name="system_cache__dita:header_cols.relcolwidth">
|
|
|
+ <xsl:with-param name="max_strings" select="$max_strings"/>
|
|
|
+ <xsl:with-param name="cols_count" select="$cols_count" />
|
|
|
+ <xsl:with-param name="header_cols" select="$header_cols"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ </xsl:if>
|
|
|
+ <xsl:if test="$start_row = 1">
|
|
|
+ <sthead>
|
|
|
+ <xsl:for-each select="1 to $header_cols"><!-- naglowki -->
|
|
|
+ <stentry><xsl:value-of select="$simpletable/sthead/stentry[ position() = current()]"/></stentry>
|
|
|
+ </xsl:for-each>
|
|
|
+ <xsl:for-each select="$start_col + $header_cols + xs:integer($add_to_once) to $start_col + $header_cols + $width_cols + xs:integer($add_to_once)">
|
|
|
+ <xsl:if test="$simpletable/sthead/stentry[ position() = current()]">
|
|
|
+ <stentry><xsl:value-of select="$simpletable/sthead/stentry[ position() = current()]"/></stentry>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:for-each>
|
|
|
+ </sthead>
|
|
|
+ </xsl:if>
|
|
|
+ <xsl:variable name="strow_test.root">
|
|
|
+ <xsl:for-each select="strow">
|
|
|
+ <xsl:variable name="strow" select="."/>
|
|
|
+ <xsl:variable name="simpletable.id" select="concat($simpletable.id,'_h_',position())"/>
|
|
|
+
|
|
|
+ <xsl:variable name="strow_test">
|
|
|
+ <strow>
|
|
|
+ <xsl:attribute name="id" select="$simpletable.id"/>
|
|
|
+ <!--<xsl:for-each select="1 to $header_rows"><!-\- wart -\->
|
|
|
+ <stentry><xsl:value-of select="$strow/strow[ position() = current()]"/></stentry>
|
|
|
+ </xsl:for-each>-->
|
|
|
+ <xsl:for-each select="1 to $header_cols">
|
|
|
+ <xsl:if test="$strow/stentry[ position() = current()]">
|
|
|
+ <stentry id="{$simpletable.id}_h{position()}"><xsl:value-of select="$strow/stentry[ position() = current()]/text()"/></stentry>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:for-each>
|
|
|
+ <xsl:for-each select="$start_col + $header_cols + xs:integer($add_to_once) to $start_col + $header_cols + $width_cols + xs:integer($add_to_once)">
|
|
|
+ <xsl:if test="$simpletable/sthead/stentry[ position() = current()]">
|
|
|
+ <stentry id="{$simpletable.id}_e{position()}"><xsl:value-of select="$strow/stentry[ position() = current()]/text()"/>
|
|
|
+ <xsl:copy-of select="$strow/stentry[ position() = current()]/Benford:table_analys_exceed"/>
|
|
|
+ <xsl:copy-of select="$strow/stentry[ position() = current()]/Benford:table"/>
|
|
|
+ <xsl:copy-of select="$strow/stentry[ position() = current()]/topic"/>
|
|
|
+ </stentry>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:for-each>
|
|
|
+ </strow>
|
|
|
+ </xsl:variable>
|
|
|
+ <!-- handle system_cache__dita:bypass_rows_with_zero="true" system_cache__dita:bypass_rows_empty="true" -->
|
|
|
+
|
|
|
+ <!--<xsl:message>#547 $simpletable/@system_cache__dita:bypass_rows_with_zero - <xsl:value-of select="$simpletable/@system_cache__dita:bypass_rows_with_zero"/> ; <xsl:value-of select="$strow_test/stentry[ position() > $header_cols and not( text()='0')]"/></xsl:message>-->
|
|
|
+
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$simpletable/@system_cache__dita:bypass_rows_empty and $simpletable/@system_cache__dita:bypass_rows_with_zero and $strow_test//stentry[ position() > $header_cols and ( text() and not( text()='0') )]">
|
|
|
+ <xsl:comment>#549c not ignored @system_cache__dita:bypass_rows_empty and @system_cache__dita:bypass_rows_with_zero </xsl:comment>
|
|
|
+ <xsl:message>#549c not ignored @system_cache__dita:bypass_rows_empty and @system_cache__dita:bypass_rows_with_zero </xsl:message>
|
|
|
+ <xsl:copy-of select="$strow_test"/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="$simpletable/@system_cache__dita:bypass_rows_with_zero and not($simpletable/@system_cache__dita:bypass_rows_empty) and $strow_test//stentry[ position() > $header_cols and not( text()='0' ) ]">
|
|
|
+ <xsl:comment>#549a not ignored @system_cache__dita:bypass_rows_with_zero </xsl:comment>
|
|
|
+ <xsl:message>#549a not ignored @system_cache__dita:bypass_rows_with_zero <xsl:value-of select="$strow_test//stentry[ position() > $header_cols and not( text()='0')]"/> </xsl:message>
|
|
|
+ <xsl:copy-of select="$strow_test"/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="$simpletable/@system_cache__dita:bypass_rows_empty and not($simpletable/@system_cache__dita:bypass_rows_with_zero ) and $strow_test//stentry[ position() > $header_cols and text() ]">
|
|
|
+ <xsl:comment>#549b not ignored @system_cache__dita:bypass_rows_empty </xsl:comment>
|
|
|
+ <xsl:message>#549b not ignored @system_cache__dita:bypass_rows_empty <xsl:value-of select="$strow_test//stentry[ position() > $header_cols and text() ]"/> </xsl:message>
|
|
|
+ <xsl:copy-of select="$strow_test"/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="$simpletable/@system_cache__dita:bypass_rows_with_zero or $simpletable/@system_cache__dita:bypass_rows_empty"> <!-- or $simpletable/@system_cache__dita:bypass_rows_with_zero -->
|
|
|
+ <xsl:comment>#549d ignored @system_cache__dita:bypass_rows_empty </xsl:comment>
|
|
|
+ <xsl:message>#549d ignored @system_cache__dita:bypass_rows_empty </xsl:message>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise><xsl:copy-of select="$strow_test"/></xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$strow_test.root//strow">
|
|
|
+ <xsl:copy-of select="$strow_test.root"/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <strow>
|
|
|
+ <xsl:for-each select="strow[1]">
|
|
|
+ <xsl:variable name="strow" select="."/>
|
|
|
+ <xsl:variable name="simpletable.id" select="concat($simpletable.id,'_h_',position())"/>
|
|
|
+ <xsl:for-each select="1 to $header_cols">
|
|
|
+ <xsl:if test="$strow/stentry[ position() = current()]">
|
|
|
+ <stentry id="{$simpletable.id}_h{position()}">(pominięto)</stentry>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:for-each>
|
|
|
+ <xsl:for-each select="$start_col + $header_cols + xs:integer($add_to_once) to $start_col + $header_cols + $width_cols + xs:integer($add_to_once)">
|
|
|
+ <xsl:if test="$simpletable/sthead/stentry[ position() = current()]">
|
|
|
+ <stentry id="{$simpletable.id}_e{position()}">0</stentry>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:for-each>
|
|
|
+ </strow>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:element>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+ <xsl:template name="system_cache__dita:max_strings">
|
|
|
+ <xsl:param name="simpletable" required="yes"/>
|
|
|
+ <xsl:variable name="max_strings">
|
|
|
+ <max_strings>
|
|
|
+ <xsl:for-each select="$simpletable/sthead/stentry">
|
|
|
+ <stentry>
|
|
|
+ <xsl:attribute name="pos" select="position()"/>
|
|
|
+ <xsl:attribute name="len" select="string-length( text())"/>
|
|
|
+ <xsl:attribute name="string.ph.len.max" select="system_cache__dita:string.ph.len.max( text())"/>
|
|
|
+ </stentry>
|
|
|
+ <xsl:variable name="pos" select="position()"/>
|
|
|
+ <xsl:for-each select="$simpletable/strow">
|
|
|
+ <xsl:for-each select="stentry[ position() = $pos]">
|
|
|
+ <stentry>
|
|
|
+ <xsl:attribute name="pos" select="$pos"/>
|
|
|
+ <xsl:attribute name="stentry" select="'tak'"/>
|
|
|
+ <xsl:attribute name="len" select="string-length( text())"/>
|
|
|
+ <xsl:attribute name="string.ph.len.max" select="system_cache__dita:string.ph.len.max( text())"/>
|
|
|
+ </stentry>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:for-each>
|
|
|
+ </max_strings>
|
|
|
+ </xsl:variable>
|
|
|
+
|
|
|
+ <xsl:variable name="max_strings">
|
|
|
+ <max_strings><!--<xsl:comment><xsl:copy-of select="$max_strings"/></xsl:comment>-->
|
|
|
+ <xsl:for-each-group select="$max_strings//stentry" group-by="@pos">
|
|
|
+ <stentry>
|
|
|
+ <xsl:attribute name="pos" select="@pos"/>
|
|
|
+ <xsl:attribute name="max.len" select="max( current-group()/@len )"/>
|
|
|
+ <xsl:attribute name="max.string.ph.len.max" select="max( current-group()/@string.ph.len.max )"/>
|
|
|
+ </stentry>
|
|
|
+ </xsl:for-each-group>
|
|
|
+ </max_strings>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:copy-of select="$max_strings"/>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+
|
|
|
+ <xsl:template name="system_cache__dita:width_cols.auto">
|
|
|
+ <xsl:param name="simpletable" required="yes"/><!-- detect optimal table width_cols -->
|
|
|
+ <xsl:param name="max_strings" required="yes"/>
|
|
|
+ <xsl:variable name="sum_width" select="sum($max_strings//@max.string.ph.len.max) + $system_cache__dita:simpletable.col.size * count($max_strings//stentry) "/>
|
|
|
+ <xsl:variable name="screens_div_sum" select="$system_cache__dita:pdf_a4_string_width div $sum_width"/>
|
|
|
+ <xsl:variable name="system_cache__dita:width_cols.auto.cols" select="count($simpletable/sthead/stentry) * $screens_div_sum"/>
|
|
|
+ <xsl:variable name="system_cache__dita:width_cols.auto.div" select=" ceiling(count($simpletable/sthead/stentry) div $system_cache__dita:width_cols.auto.cols)"/>
|
|
|
+ <xsl:variable name="system_cache__dita:width_cols.auto" select="round(count($simpletable/sthead/stentry) div $system_cache__dita:width_cols.auto.div )"/>
|
|
|
+ <xsl:message>#506 system_cache__dita:width_cols.auto $sum_width=<xsl:value-of select="$sum_width"/> $screens_div_sum = <xsl:value-of select="$screens_div_sum"/> ; $system_cache__dita:width_cols.auto.cols=<xsl:value-of select="$system_cache__dita:width_cols.auto.cols"/>; $system_cache__dita:width_cols.auto.div=<xsl:value-of select="$system_cache__dita:width_cols.auto.div"/>; <xsl:value-of select="$system_cache__dita:width_cols.auto"/> </xsl:message>
|
|
|
+ <xsl:value-of select="$system_cache__dita:width_cols.auto"/>
|
|
|
+ </xsl:template><xsl:template match="*|text()|comment()" mode="ditamap_root.embedded_map"/>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+<xsl:template mode="system_cache__dita:xref.topic.result-document" match="@*"><xsl:copy-of select="."/></xsl:template>
|
|
|
+
|
|
|
+ <xsl:template match="*" mode="system_cache__dita:xref.topic.result-document">
|
|
|
+ <topicref href="{@id}.dita">
|
|
|
+ <xsl:result-document href="{system_cache__dita:xref_result-document(@id)}">
|
|
|
+ <xsl:element name="{name()}">
|
|
|
+ <xsl:apply-templates select="@*" mode="system_cache__dita:xref.topic.result-document"/>
|
|
|
+ <!--<xsl:copy-of select="@*"/>-->
|
|
|
+ <xsl:copy-of select="*"/>
|
|
|
+ </xsl:element>
|
|
|
+ </xsl:result-document>
|
|
|
+ </topicref>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+
|
|
|
+ <xsl:template match="simpletable" mode="table_cut.local_xref">
|
|
|
+ <xsl:param name="header_cols" required="yes"/>
|
|
|
+ <xsl:param name="topic.id" required="yes"/>
|
|
|
+ <xsl:element name="{name()}">
|
|
|
+ <xsl:apply-templates mode="table_cut.local_xref" select="@*"/>
|
|
|
+ <xsl:apply-templates mode="table_cut.local_xref">
|
|
|
+ <xsl:with-param name="header_cols" select="$header_cols"/>
|
|
|
+ <xsl:with-param name="topic.id" select="$topic.id"/>
|
|
|
+ </xsl:apply-templates>
|
|
|
+ </xsl:element>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+ <xsl:template match="sthead" mode="table_cut.local_xref">
|
|
|
+ <xsl:copy-of select="."/>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+ <xsl:template match="strow" mode="table_cut.local_xref">
|
|
|
+ <xsl:param name="header_cols" required="yes"/>
|
|
|
+ <xsl:param name="topic.id" required="yes"/>
|
|
|
+ <xsl:element name="{name()}">
|
|
|
+ <xsl:copy-of select="@*"/>
|
|
|
+ <xsl:for-each select="stentry [ position() = 1 ]">
|
|
|
+ <xsl:element name="{name()}">
|
|
|
+ <xsl:copy-of select="@*"/>
|
|
|
+ <xsl:variable name="position" select="../../@system_cache__dita:position"/>
|
|
|
+ <!--Pos simpletable="<xsl:value-of select="$position"/>"
|
|
|
+ next="<xsl:value-of select="../../../simpletable[@system_cache__dita:position > $position]/@system_cache__dita:position"/>"-->
|
|
|
+ <xsl:variable name="next_id" select="../../../simpletable[ @system_cache__dita:position > $position ][1]/strow/stentry[ position() = 1 and text()= current()]/@id"/>
|
|
|
+ <xsl:variable name="prev_id" select="../../../simpletable[ @system_cache__dita:position < $position and max(@system_cache__dita:position) ][1]/strow/stentry[ position() = 1 and text()= current()]/@id"/>
|
|
|
+
|
|
|
+ <xsl:if test="$next_id">
|
|
|
+ <xref href="#{$topic.id}/{$next_id}" format="dita">v</xref>
|
|
|
+ </xsl:if>
|
|
|
+ <xsl:if test="$prev_id">
|
|
|
+ <xref href="#{$topic.id}/{$prev_id}" format="dita">^</xref>
|
|
|
+ </xsl:if>
|
|
|
+ <!--<xref href="#{$topic_id}/{$prev_id}" format="dita">^</xref>-->
|
|
|
+ <xsl:value-of select="text()"/>
|
|
|
+ </xsl:element>
|
|
|
+ </xsl:for-each>
|
|
|
+ <xsl:for-each select="stentry [ position() > 1 ]">
|
|
|
+ <xsl:copy-of select="."/>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:element>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+ <xsl:function name="system_cache__dita:string.ph.len.max">
|
|
|
+ <xsl:param name="string"/>
|
|
|
+ <xsl:variable name="max_det">
|
|
|
+ <max_det>
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="contains($string,' ')">
|
|
|
+ <xsl:for-each select="tokenize($string,' ')">
|
|
|
+ <max><xsl:value-of select="string-length(.)"/></max>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <max><xsl:value-of select="string-length($string)"/></max>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </max_det>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:value-of select="max($max_det//max)"/>
|
|
|
+ </xsl:function>
|
|
|
+
|
|
|
+ <xsl:function name="system_cache__dita:xref_2_topc">
|
|
|
+ <xsl:param name="topic.id"/>
|
|
|
+ <!--<xref href="#topic_ghxf_rum_os_d1e1/simpgletablesss_inaaz_fwf_d1e1_1" format="dita">asd</xref>-->
|
|
|
+ <xref href="{$topic.id}.dita"/>
|
|
|
+ </xsl:function>
|
|
|
+
|
|
|
+ <xsl:function name="system_cache__dita:xref_2_topc">
|
|
|
+ <xsl:param name="topic.id"/>
|
|
|
+ <xsl:param name="desc"/>
|
|
|
+ <!--<xref href="#topic_ghxf_rum_os_d1e1/simpgletablesss_inaaz_fwf_d1e1_1" format="dita">asd</xref>-->
|
|
|
+ <xref href="{$topic.id}.dita"><xsl:value-of select="$desc"/></xref>
|
|
|
+ </xsl:function>
|
|
|
+
|
|
|
+ <xsl:function name="system_cache__dita:xref_result-document">
|
|
|
+ <xsl:param name="id"/>
|
|
|
+ <xsl:value-of select="concat($temp,'/',$uuid,'/',$id,'.dita')"/>
|
|
|
+ </xsl:function>
|
|
|
+
|
|
|
+ <xsl:function name="system_cache__dita:Benford.simpletable.strow.id">
|
|
|
+ <xsl:param name="Benford:year"/>
|
|
|
+ <xsl:param name="Benford:subject"/>
|
|
|
+ <!--<xref href="#topic_ghxf_rum_os_d1e1/simpgletablesss_inaaz_fwf_d1e1_1" format="dita">asd</xref>-->
|
|
|
+ <xsl:value-of select="concat($Benford:subject,'_',$Benford:year)"/>
|
|
|
+ </xsl:function></xsl:stylesheet>
|