| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- <?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:import href="../ant_interface/p5ant-interface.param.xsl"/>
- <xsl:include href="p5dkp.ditafiles.wordindex.strings.merge.maximize.xsl"/>
- <xsl:include href="p5dkp.ditafiles.func.xsl"/>
-
- <xsl:output indent="yes" />
- <xsl:strip-space elements="*"/>
-
-
- <xsl:template name="p5dkp.ditafiles.wordindex.strings.merge.t.test">
- <p5dkp.ditafiles.wordindex.strings.merge.t.test>
- <xsl:variable name="t">
- <variable>
- <t count.s="1"
- count.t.p="7"
- t.p="topic/body/table/tgroup/tbody/row/entry/">
- <s>Namespace</s>
- <t.p>
- <t.p.v pos="-2" len="1">entry</t.p.v>
- <t.p.v pos="-1" len="2">row.entry</t.p.v>
- <t.p.v pos="0" len="3">tbody.row.entry</t.p.v>
- <t.p.v pos="1" len="3">tgroup.tbody.row.entry</t.p.v>
- <t.p.v pos="2" len="3">table.tgroup.tbody.row</t.p.v>
- <t.p.v pos="3" len="3">body.table.tgroup.tbody</t.p.v>
- <t.p.v pos="4" len="3">topic.body.table.tgroup</t.p.v>
- <t.p.v pos="5" len="3">topic.body.table</t.p.v>
- <t.p.v pos="6" len="2">topic.body</t.p.v>
- <t.p.v pos="7" len="1">topic</t.p.v>
- </t.p>
- <ss pos="1" len="1">Namespace</ss>
- </t>
- </variable>
- </xsl:variable>
-
- <xsl:call-template name="p5dkp:ditafiles.wordindex.strings.merge.t">
- <xsl:with-param name="t" select="$t//t"/>
- <xsl:with-param name="rem_doc" select="'/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/dita_kosztorys_projektowy/p5dkp.ditafiles.wordindex.strings.merge.xml.ignore.xml'"/>
- </xsl:call-template>
- </p5dkp.ditafiles.wordindex.strings.merge.t.test>
- </xsl:template>
-
-
- <xsl:template name="p5dkp:ditafiles.wordindex.strings.merge.t">
- <xsl:param name="rem_doc" required="yes"/>
- <xsl:param name="local_doc" select="''"/>
- <xsl:param name="t" required="yes"/>
- <xsl:param name="p5dkp:ditafiles.wordindex.xml.only_ditadir"/>
-
-
- <xsl:for-each select="$t">
- <xsl:variable name="remote.t" select="."/>
- <!--<xsl:message>#60 foreach t <xsl:value-of select="name()"/> ; $rem_doc = <xsl:value-of select="doc($rem_doc)//@p5dkp.dita_root.ditamap.dir.true"/></xsl:message>-->
- <xsl:for-each select="doc($rem_doc)//p5dkp:ditafiles.wordindex[ not(p5ant-interface:dir.filename[ text() = $local_doc ]) and ( @p5dkp.dita_root.ditamap.dir.true or not(p5ant-interface:param.if.istrue($p5dkp:ditafiles.wordindex.xml.only_ditadir)) )]"> <!-- [ not(p5ant-interface:dir.filename[ text() = $local_doc ]) and ( @p5dkp.dita_root.ditamap.dir.true or not(p5ant-interface:param.if.istrue($p5dkp:ditafiles.wordindex.xml.only_ditadir)) )] --> <!-- [ @p5dkp.dita_root.ditamap.dir.true or not($p5dkp:ditafiles.wordindex.xml.only_ditadir)] -->
- <!--<xsl:message>#62 foreach doc() <xsl:value-of select="name()"/></xsl:message>-->
- <xsl:apply-templates mode="p5dkp:ditafiles.wordindex.strings.merge.t">
- <xsl:with-param name="remote.t" select="$remote.t"/>
- <xsl:with-param name="rem_doc.file_from_fullpath" select="p5dkp:ditafiles.file_from_fullpath($rem_doc)"/>
- <xsl:with-param name="local_doc.file_from_fullpath" select="p5dkp:ditafiles.file_from_fullpath($local_doc)"/>
- <xsl:with-param name="p5ant-interface:dir.filename" select="@p5ant-interface:dir.filename"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:template>
-
-
-
-
- <xsl:template mode="p5dkp:ditafiles.wordindex.strings.merge.t" match="text()|comment()|*"/>
-
- <xsl:template mode="p5dkp:ditafiles.wordindex.strings.merge.t" match="t">
- <xsl:param name="remote.t" required="yes"/>
- <xsl:param name="rem_doc.file_from_fullpath"/>
- <xsl:param name="local_doc.file_from_fullpath"/>
- <xsl:param name="p5ant-interface:dir.filename"/>
- <xsl:variable name="local.t" select="."/>
- <xsl:variable name="HIT_ss">
- <HIT_ss>
- <xsl:for-each select="$local.t/ss">
- <xsl:variable name="local.ss" select="."/>
- <xsl:for-each select="$remote.t/ss">
- <xsl:choose>
- <xsl:when test="$local.t/number(@count.s) < 2"/>
- <xsl:when test="number(@len) < 2 "/>
- <xsl:when test="string-length(text()) < 4"/>
- <xsl:when test=" text() = $local.ss/text()">
- <HIT.ss>
- <xsl:copy-of select="@*"/>
- <xsl:attribute name="local.t__count.s" select="$local.t/@count.s"/>
- <!--<xsl:attribute name="p5ant-interface:local.dir.filename" select="$local.t/../p5ant-interface:dir.filename/text()"/>-->
- <!--<xsl:attribute name="remote.p5ant-interface:dir.filename" select="../../p5ant-interface:dir.filename/text()"/>-->
- <xsl:value-of select="text()"/>
- </HIT.ss>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xsl:for-each>
- <xsl:for-each select="$local.t/s">
- <xsl:variable name="local.s" select="."/>
- <xsl:for-each select="$remote.t/s">
- <xsl:choose>
- <xsl:when test="string-length(text()) < 3"/>
- <xsl:when test=" text() = $local.s/text()">
- <HIT.s>
- <xsl:attribute name="pos" select="position()"/>
- <!--<xsl:attribute name="p5ant-interface:local.dir.filename" select="$local.t/../p5ant-interface:dir.filename/text()"/>-->
- <!--<xsl:attribute name="remote.p5ant-interface:dir.filename" select="../../p5ant-interface:dir.filename/text()"/>-->
- <xsl:value-of select="text()"/>
- </HIT.s>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xsl:for-each>
- </HIT_ss>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$HIT_ss//(HIT.ss | HIT.s)">
- <HIT>
- <xsl:attribute name="p5ant-interface:dir.filename.remote" select="$local.t/../p5ant-interface:dir.filename/text()"/>
- <xsl:copy-of select="$local.t/@*"/>
- <xsl:copy-of select="$HIT_ss//HIT.s" copy-namespaces="no"/>
- <!--<xsl:message>#154 hit for count s=<xsl:value-of select="count($HIT_ss//HIT.s)"/>; or HIT.ss/@len=<xsl:value-of select="$HIT_ss//HIT.ss/@len"/></xsl:message>-->
- <!--<HHIIIT><xsl:copy-of select="$HIT_ss" copy-namespaces="no"/></HHIIIT>-->
- <xsl:for-each select="$HIT_ss//HIT.ss">
- <xsl:sort order="descending" select="number(@len)"/>
- <xsl:if test="position() < 3 and number(@len) > 1 ">
- <HIT.ss>
- <xsl:copy-of select="@*"/>
- <xsl:copy-of select="text()"/>
- </HIT.ss>
- </xsl:if>
- </xsl:for-each>
-
- <xsl:variable name="HIT_t">
- <HIT_t>
- <xsl:for-each select="$local.t/t.p/t.p.v">
- <xsl:variable name="local.t_t.p_t.p.v" select="."/>
- <xsl:for-each select="$remote.t/t.p/t.p.v">
- <xsl:choose>
- <xsl:when test=" text() = $local.t_t.p_t.p.v/text()">
- <HIT.t.p>
- <xsl:copy-of select="@*"/>
- <!--<xsl:attribute name="p5ant-interface:local.dir.filename" select="$local.t/../p5ant-interface:dir.filename/text()"/>-->
- <!--<xsl:attribute name="remote.p5ant-interface:dir.filename" select="../../p5ant-interface:dir.filename/text()"/>-->
- <xsl:value-of select="text()"/>
- </HIT.t.p>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xsl:for-each>
- </HIT_t>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$HIT_t//HIT.t.p">
- <xsl:for-each select="$HIT_t//HIT.t.p">
- <xsl:sort order="descending" select="number(@len)"/>
- <xsl:if test="position() < 2 and number(@len) > 1">
- <HIT.t.p>
- <xsl:copy-of select="@*"/>
- <xsl:copy-of select="text()"/>
- </HIT.t.p>
- </xsl:if>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <NOT_HIT.t.p>
- <xsl:for-each select="$local.t/t.p/t.p.v[1]">
- <xsl:sort select="number(@len)" order="descending"/>
- <xsl:copy-of select="."/>
- </xsl:for-each>
- </NOT_HIT.t.p>
- </xsl:otherwise>
- </xsl:choose>
- </HIT>
- <xsl:apply-templates mode="p5dkp:ditafiles.wordindex.strings.merge.xml.maximize.s" select="$HIT_ss">
- <xsl:with-param name="rem_doc.file_from_fullpath" select="$rem_doc.file_from_fullpath"/>
- <xsl:with-param name="local_doc.file_from_fullpath" select="$local_doc.file_from_fullpath"/>
- <xsl:with-param name="p5ant-interface:dir.filename.remote" select="$local.t/../p5ant-interface:dir.filename/text()"/>
- <xsl:with-param name="p5ant-interface:dir.filename" select="$p5ant-interface:dir.filename"/>
- </xsl:apply-templates>
- </xsl:when>
- </xsl:choose>
- <!--<xsl:copy-of select="$HIT_ss" copy-namespaces="no"/>-->
- </xsl:template>
-
-
- </xsl:stylesheet>
|