| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- <?xml version="1.0" encoding="UTF-8"?>
- <xsl:stylesheet xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:p5bws="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/WPS_Functions.xsd"
- xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
- xmlns:p5dkp="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.xsd"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:p5suis="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/system_ui_info_speech/system_ui_info_speech.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:p5xsda="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsd_asserts/p5xsda.xsd"
- xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/"
- xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
- xmlns:p5ant-interface="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/ant_interface/ant_interface.xsd"
- exclude-result-prefixes="xs ditaarch"
- version="2.0">
- <!--<xsl:include href="p5dkp.keyscope.xsl"/>-->
-
- <xsl:include href="../ant_interface/p5ant-interface.param.xsl"/>
- <xsl:include href="p5dkp.ditafiles.wordindex.strings.merge.t.xsl"/>
-
- <xsl:output indent="yes" />
- <xsl:strip-space elements="*"/>
-
- <xsl:param name="p5dkp:ditafiles.wordindex.xml.thread.count" required="yes"/> <!-- ilosc rownoleglych zapodan -->
- <xsl:param name="p5dkp:ditafiles.wordindex.xml.thread.no" required="yes"/> <!-- numer procesu -->
- <xsl:param name="p5dkp.dita_root.ditamap.dir"/>
-
- <xsl:param name="p5dkp:ditafiles.wordindex.xml.only_ditadir" /> <!-- select="true()" -->
- <xsl:param name="p5dkp.ditafiles.wordindex.strings.merge.xml.ignore.replace.s" required="yes"/>
-
-
- <!--<xsl:variable name="p5dkp.dita_root.ditamap.dir">
- <xsl:for-each select="tokenize($p5dkp.dita_root.ditamap.dir,'/')[ position() < count(tokenize($p5dkp.dita_root.ditamap.dir,'/'))]">
- <xsl:value-of select="."/><xsl:if test="not(position() = last())"><xsl:text>/</xsl:text></xsl:if>
- </xsl:for-each>
- </xsl:variable>-->
-
- <xsl:param name="p5dkp:wordindex.strings.s.size" select="4"/> <!-- to analize this sizes of string phrases -->
- <xsl:param name="p5dkp:wordindex.strings.t.p.size" select="3"/>
-
- <xsl:param name="p5dkp.ditafiles.wordindex.strings.merge.xml.ignore.xml"/>
-
-
- <xsl:template match="p5dkp:ditafiles.wordindex.xml" mode="p5dkp:wordindex.strings.xml">
- <p5dkp:wordindex.strings.xml>
- <xsl:copy-of select="namespace::*"/>
- <xsl:apply-templates mode="p5dkp:wordindex.strings"/>
- </p5dkp:wordindex.strings.xml>
- </xsl:template>
-
- <xsl:template mode="p5dkp:wordindex.strings" match="p5dkp:ditafiles.wordindex[not(@p5dkp.dita_root.ditamap.dir.true) and p5ant-interface:param.if.istrue($p5dkp:ditafiles.wordindex.xml.only_ditadir) ]">
- <xsl:comment>#101 ignored due to $p5dkp:ditafiles.wordindex.xml.only_ditadir </xsl:comment>
- </xsl:template>
-
- <xsl:template mode="p5dkp:wordindex.strings" match="p5dkp:ditafiles.wordindex|p5ant-interface:filepath.dir|p5ant-interface:filename|p5ant-interface:dir.filename">
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <xsl:copy-of select="text()"/>
- <xsl:apply-templates mode="#current"/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template mode="p5dkp:wordindex.strings" match="p5dkp:ditafiles.wordindex.audience|p5dkp:ditafiles.wordindex.audience.map.path">
- <xsl:copy-of select="." copy-namespaces="no"/>
- </xsl:template>
-
- <xsl:template mode="p5dkp:wordindex.strings" match="*">
- <!--<xsl:comment>#95 passed <xsl:value-of select="name()"/>; </xsl:comment>-->
- <xsl:apply-templates mode="#current"/>
- </xsl:template>
- <xsl:template mode="p5dkp:wordindex.strings" match="text()|comment()"/>
-
- <xsl:template mode="p5dkp:wordindex.strings" match="t[s]">
- <xsl:variable name="t">
- <variable>
- <xsl:copy copy-namespaces="no">
- <xsl:variable name="count.s" select="count(s)"/>
- <xsl:attribute name="count.s" select="$count.s"/>
- <xsl:variable name="count.t.p" select="count(ancestor::*[not(local-name()='ditafiles.wordindex') and not(local-name()='ditafiles.wordindex.xml')])"/>
- <xsl:attribute name="count.t.p" select="$count.t.p"/>
- <xsl:attribute name="t.p">
- <xsl:for-each select="ancestor::*[ not(local-name()='ditafiles.wordindex') and not(local-name()='ditafiles.wordindex.xml') ]">
- <xsl:value-of select="local-name()"/><xsl:text>/</xsl:text>
- </xsl:for-each>
- </xsl:attribute>
- <xsl:copy-of select="s" copy-namespaces="no"/>
- <t.p>
- <xsl:choose>
- <xsl:when test="number($count.t.p) < number($p5dkp:wordindex.strings.t.p.size)">
- <t.p.v>
- <xsl:attribute name="pos" select="1"/>
- <xsl:attribute name="len" select="$count.t.p"/>
- <xsl:for-each select="ancestor::*[not(local-name()='ditafiles.wordindex') and not(local-name()='ditafiles.wordindex.xml') ]">
- <!--<xsl:copy-of select="@*"/>-->
- <xsl:value-of select="local-name()"/><xsl:if test="not(position()=last())"><xsl:text>.</xsl:text></xsl:if>
- </xsl:for-each>
- </t.p.v>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="t.p" select="."/>
- <xsl:for-each select="( -1 * $p5dkp:wordindex.strings.t.p.size + 1 ) to $count.t.p">
- <t.p.v>
- <xsl:attribute name="pos" select="."/>
- <xsl:choose>
- <xsl:when test="current() < 0 ">
- <xsl:attribute name="len" select="current() + number($p5dkp:wordindex.strings.t.p.size)"/>
- </xsl:when>
- <xsl:when test="abs(current() + number($p5dkp:wordindex.strings.t.p.size) ) < number($p5dkp:wordindex.strings.t.p.size)">
- <xsl:attribute name="len" select="current()"/>
- </xsl:when>
- <xsl:when test="abs(( current() - $count.t.p )) < number($p5dkp:wordindex.strings.t.p.size)">
- <xsl:attribute name="len" select="abs(( current() - $count.t.p )) +1 "/>
- </xsl:when>
- <xsl:otherwise><xsl:attribute name="len" select="$p5dkp:wordindex.strings.t.p.size"/></xsl:otherwise>
- </xsl:choose>
- <xsl:variable name="pos.max" select="current() + number($p5dkp:wordindex.strings.t.p.size)"/>
-
- <xsl:for-each select="$t.p/ancestor::*[ not(local-name()='ditafiles.wordindex') and not(local-name()='ditafiles.wordindex.xml') and position() >= current() and position() <= $pos.max ]">
- <xsl:value-of select="local-name()"/><xsl:if test="not(position()=last())"><xsl:text>.</xsl:text></xsl:if>
- </xsl:for-each>
- </t.p.v>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
-
- </t.p>
-
- <xsl:choose>
- <xsl:when test="number($count.s) < number($p5dkp:wordindex.strings.s.size)">
- <ss>
- <xsl:attribute name="pos" select="1"/>
- <xsl:attribute name="len" select="$count.s"/>
- <xsl:for-each select="s" >
- <xsl:sort select="text()"/>
- <xsl:value-of select="text()"/><xsl:if test="not(position()=last())"><xsl:text>/</xsl:text></xsl:if>
- </xsl:for-each>
- </ss>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="s" select="."/>
- <xsl:for-each select="(-1 * $p5dkp:wordindex.strings.s.size + 1) to $count.s">
- <ss>
- <xsl:attribute name="pos" select="."/>
-
-
- <xsl:choose>
- <xsl:when test="current() < 0 ">
- <xsl:attribute name="len" select="current() + number($p5dkp:wordindex.strings.s.size)"/>
- </xsl:when>
- <xsl:when test="abs(current() + number($p5dkp:wordindex.strings.s.size) ) < number($p5dkp:wordindex.strings.s.size)">
- <xsl:attribute name="len" select="current()"/>
- </xsl:when>
- <xsl:when test="abs(( current() - $count.s )) < number($p5dkp:wordindex.strings.s.size)">
- <xsl:attribute name="len" select="abs(( current() - $count.s )) +1 "/>
- </xsl:when>
- <xsl:otherwise><xsl:attribute name="len" select="$p5dkp:wordindex.strings.s.size"/></xsl:otherwise>
- </xsl:choose>
- <xsl:variable name="pos.max" select="current() + number($p5dkp:wordindex.strings.s.size)"/>
-
- <xsl:for-each select="$s/s[ position() >= current() and position() <= $pos.max ]">
- <xsl:value-of select="normalize-space(text())"/><xsl:if test="not(position()=last())"><xsl:text>/</xsl:text></xsl:if>
- </xsl:for-each>
- </ss>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:copy>
- </variable>
- </xsl:variable>
- <xsl:variable name="HIT.ignore">
- <xsl:call-template name="p5dkp:ditafiles.wordindex.strings.merge.t">
- <xsl:with-param name="rem_doc" select="$p5dkp.ditafiles.wordindex.strings.merge.xml.ignore.xml"/>
- <xsl:with-param name="t" select="$t/variable/*"/>
- <xsl:with-param name="p5dkp:ditafiles.wordindex.xml.only_ditadir" select="$p5dkp:ditafiles.wordindex.xml.only_ditadir"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$HIT.ignore//HIT.t.p">
- <xsl:comment>#172 was ignored by $HIT.ignore check </xsl:comment>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$t/variable/*" copy-namespaces="no"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-
-
- </xsl:stylesheet>
|