| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- <?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:ditaarch="http://dita.oasis-open.org/architecture/2005/"
- exclude-result-prefixes="xs vc p5bws system_cache__appinfo p5suis p5dkp xsi ditaarch"
- version="2.0"> <!-- xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" -->
-
-
- <xsl:output indent="yes" method="xml" standalone="no" doctype-public="-//OASIS//DTD DITA Map//EN" doctype-system="map.dtd"/>
- <!--<xsl:output indent="yes" />-->
- <xsl:strip-space elements="*"/>
-
- <!--<xsl:variable name="debug" select="99"/>-->
-
-
-
-
- <xsl:template mode="p5dkp:fix-ditamap.wymagania" match="glossgroup" xpath-default-namespace="" exclude-result-prefixes="ditaarch">
-
- <xsl:param name="keyscope" required="yes"/>
- <xsl:param name="keydef" required="yes"/>
- <xsl:param name="map.path" required="yes"/>
- <xsl:param name="href" required="yes"/>
-
-
-
- <!--<xsl:variable name="topicref.href" select="../@href"/>-->
- <xsl:variable name="p5dkp:fix-ditamap.wymagania">
- <map>
- <xsl:variable name="context" select="."/>
- <xsl:message>#321-B TO FIX TEST for $href=<xsl:value-of select="$href"/>; p5dkp:max_keyscope.get($keyscope,p5dkp:max_keyscope.pos($keyscope))=<xsl:value-of select="p5dkp:max_keyscope.get($keyscope,p5dkp:max_keyscope.pos($keyscope))"/> <xsl:value-of select=".//@*"/> </xsl:message>
-
- <xsl:apply-templates mode="p5dkp:fix-ditamap.wymagania.child" select="$keydef" xpath-default-namespace="">
- <xsl:with-param name="keyscope" select="$keyscope"/>
- <xsl:with-param name="keydef" select="$keydef"/>
- <xsl:with-param name="context" select="$context"/>
- <xsl:with-param name="href" select="$href"/>
- </xsl:apply-templates>
-
- <!--<xsl:for-each select="$keydef">
- <xsl:variable name="keydef.keys" select="@keys"/>
- <xsl:message>#324-B checking $keydef.keys=<xsl:value-of select="$keydef.keys"/>; if is set $keydef <xsl:copy-of select="." copy-namespaces="no"/> in glossentry at $keyscope = <xsl:value-of select="$keyscope"/>;</xsl:message>
- <xsl:apply-templates mode="p5dkp:fix-ditamap.wymagania.child" select=".">
- <xsl:with-param name="keyscope" select="$keyscope"/>
- <xsl:with-param name="keydef" select="$keydef"/>
- <xsl:with-param name="context" select="$context"/>
- <xsl:with-param name="href" select="$href"/>
- </xsl:apply-templates>
- </xsl:for-each>-->
- </map>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="$p5dkp:fix-ditamap.wymagania//comment()">
- <xsl:message>#68 dita- adding fixed ditamap to <xsl:value-of select="$map.path"/>/<xsl:value-of select="$href"/>.ditamap.fixedgg ;</xsl:message>
-
- <xsl:choose>
- <xsl:when test="doc-available(concat($map.path,'/',$href,'.ditamap.fixedgg'))">
- <xsl:message>#123 DOCUMENT EXISTS - should bbefore go clean! <xsl:value-of select="$href"/>.ditamap.fixedgg !</xsl:message>
- <xsl:message>#124 count of previous hits of $href <!--<xsl:value-of select="document-uri(current())"/>-->
- <xsl:copy-of select="$keyscope" copy-namespaces="no"/>
- </xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <xsl:result-document href="{$map.path}/{$href}.ditamap.fixedgg" doctype-public="-//OASIS//DTD DITA Map//EN" doctype-system="map.dtd" ><!-- doctype-public="-//OASIS//DTD DITA Glossary Group//EN" doctype-system="glossgroup.dtd" -->
- <xsl:copy-of select="$p5dkp:fix-ditamap.wymagania"/>
- </xsl:result-document>
- </xsl:otherwise>
- </xsl:choose>
-
-
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>#68-B not fixing ditamap</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:template>
-
-
- <xsl:template mode="p5dkp:fix-ditamap.wymagania.child" match="text()|comment()">
- <xsl:copy-of select="."/>
- </xsl:template>
-
- <xsl:template mode="p5dkp:fix-ditamap.wymagania.child" match="*" xpath-default-namespace="">
- <xsl:param name="keyscope" required="yes"/>
- <xsl:param name="keydef" required="yes"/>
- <xsl:param name="context" required="yes"/>
- <xsl:param name="href" required="yes"/>
- <xsl:choose>
- <xsl:when test="local-name()='keydef'">
- <xsl:message terminate="yes">#85 uncorrect matched <xsl:value-of select="local-name()"/> - <xsl:copy-of select="." copy-namespaces="no"/></xsl:message>
- </xsl:when>
- </xsl:choose>
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates mode="p5dkp:fix-ditamap.wymagania.child" xpath-default-namespace="">
- <xsl:with-param name="keyscope" select="$keyscope"/>
- <xsl:with-param name="keydef" select="$keydef"/>
- <xsl:with-param name="context" select="$context"/>
- <xsl:with-param name="href" select="$href"/>
- </xsl:apply-templates>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template mode="p5dkp:fix-ditamap.wymagania.child" match="*[ local-name()='keydef']" xpath-default-namespace="" exclude-result-prefixes="ditaarch" priority="9">
- <xsl:param name="keyscope" required="yes"/>
- <xsl:param name="keydef" required="yes"/>
- <xsl:param name="context" required="yes"/>
- <xsl:param name="href" required="yes"/>
- <xsl:variable name="keydef.keys" select="@keys"/>
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <xsl:choose>
- <xsl:when test="@href and $context//*[@id = substring-after(current()/@href,'#')] or 1=2">
- <xsl:message>#243 @href is probably ok <xsl:value-of select="@href"/>; todo check for #</xsl:message>
- <xsl:apply-templates mode="p5dkp:fix-ditamap.wymagania.child">
- <xsl:with-param name="keyscope" select="$keyscope"/>
- <xsl:with-param name="keydef" select="$keydef"/>
- <xsl:with-param name="context" select="$context"/>
- <xsl:with-param name="href" select="$href"/>
- </xsl:apply-templates>
- </xsl:when>
- <!--<xsl:when test="$context/.//*[@keyref = concat($keyscope,'.',$keydef.keys)]">
- <xsl:message>#347-B OK is set $context/.//*[@keyref $keydef.keys]]</xsl:message>
- </xsl:when>-->
- <xsl:otherwise>
- <xsl:message terminate="no">#333-B not set in ditamap or @href and $context//*[@id = substring-after(current(@href,'#'))] = <xsl:value-of select="substring-after(current()/@href,'#')"/></xsl:message>
- <xsl:message>#389 adding missing ditamap <xsl:copy-of select="." copy-namespaces="no"/> after all nodes</xsl:message>
- <!--<xsl:comment>#389 adding missing $keydef.keys = <xsl:value-of select="$keydef.keys"/> - test1=<xsl:value-of select="count($context/.//*[@keyref = $keydef.keys])"/>; test2=<xsl:value-of select="count($context/.//*[@keyref = $keydef.keys])" xpath-default-namespace=""/> after all nodes</xsl:comment>-->
- <xsl:copy-of select="@*"/>
- <xsl:attribute name="href" select="concat($href,'#',$keydef.keys)"/>
- <xsl:comment> #392-B Wymagania uzupełnione automatycznie</xsl:comment>
- <xsl:apply-templates mode="p5dkp:fix-ditamap.wymagania.child">
- <xsl:with-param name="keyscope" select="$keyscope"/>
- <xsl:with-param name="keydef" select="$keydef"/>
- <xsl:with-param name="context" select="$context"/>
- <xsl:with-param name="href" select="$href"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:copy>
-
- </xsl:template>
-
-
-
-
-
- </xsl:stylesheet>
|