| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <?xml version="1.0" encoding="UTF-8"?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:default_db__x3A__IN7_DZIENNIK_KORESP="https://biuro.biall-net.pl/wfs/default_db/table/IN7_DZIENNIK_KORESP.xsd"
- xmlns:p5_default_db="https://biuro.biall-net.pl/wfs/default_db"
- xmlns:wfs="http://www.opengis.net/wfs"
- xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
- xmlns:gml="http://www.opengis.net/gml"
- xmlns:exsl="http://exslt.org/common"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:default_db="https://biuro.biall-net.pl/wfs/default_db"
- exclude-result-prefixes="xs"
- version="2.0">
-
- <xsl:output indent="yes" />
- <xsl:strip-space elements="*"/>
-
- <!--<xsl:include href="../../WPS_Functions/DownloadProcesToDita/PROCES_INCLUDE.xsl"/>-->
-
- <!--<xsl:include href="PROCES_INCLUDE.xsl"/>-->
-
- <xsl:param name="dita_task_template_file_param" select="'main.dita'"/><!--dita template file -->
- <xsl:variable name="dita_task_template_file" select="doc($dita_task_template_file_param)"/><!--first level data associated to main.dita template $(dita_task_template_file_param)-->
-
-
- <!-- przetwarzamy pierwszy otrzymany obiekt z API - pojedynczy feature - czy nie powinnismy pierw przeleciec druk aby z niego sie dowiedziec co pobrac? -->
-
- <xsl:template match="wfs:FeatureCollection|gml:featureMember">
- <xsl:apply-templates/>
- </xsl:template>
-
-
- <!-- glowny punkt dzialania -->
- <xsl:template match="IN7_DZIENNIK_KORESP|default_db__x3A__IN7_DZIENNIK_KORESP:IN7_DZIENNIK_KORESP|p5_default_db:IN7_DZIENNIK_KORESP|default_db:in7_dziennik_koresp"> <!-- default_db__x3A__IN7_DZIENNIK_KORESP:IN7_DZIENNIK_KORESP|p5_default_db:IN7_DZIENNIK_KORESP| -->
- <!--<xsl:param name="dita_task_template_file"/>-->
-
- <xsl:variable name="input_obj_with_xpath">
- <xsl:apply-templates mode="system_cache__appinfo:add_xpath_path_to_elements" select=".">
- <xsl:with-param name="system_cache__appinfo:curr_xpath" select="name()"/>
- </xsl:apply-templates>
- </xsl:variable>
-
- <xsl:result-document href="IN7_DZIENNIK_KORESP.dita_input_obj_with_xpath.xml">
- <xsl:copy-of select="$input_obj_with_xpath"/>
- </xsl:result-document>
-
- <xsl:variable name="template_with_fit_vars">
- <xsl:apply-templates mode="Procesy5_dita_assingn_values_x_path" select="$dita_task_template_file"> <!-- exslt:node-set($-->
- <xsl:with-param name="parent_obj" select="$input_obj_with_xpath"/>
- </xsl:apply-templates>
- <!--<xsl:copy-of select="$dita_task_template_file"/>-->
- </xsl:variable>
- <xsl:copy-of select="$template_with_fit_vars"/>
- </xsl:template>
-
- <xsl:template match="*">
- <!--Nie przeszlo!
- <xsl:value-of select="name()" />-->
- </xsl:template>
-
- <xsl:template match="topic" mode="Procesy5_dita_assingn_values_x_path">
- <xsl:param name="parent_obj" />
- <topic>
- <xsl:copy-of select="@*"/>
- <xsl:attribute name="xsi:noNamespaceSchemaLocation" select="'urn:oasis:names:tc:dita:xsd:task.xsd'"/>
-
- <xsl:apply-templates mode="Procesy5_dita_assingn_values_x_path">
- <xsl:with-param name="parent_obj" select="$parent_obj"/>
- </xsl:apply-templates>
- </topic>
- </xsl:template>
-
-
- <xsl:template mode="Procesy5_dita_assingn_values_x_path" match="*"><!-- testowe do przeniesienia do glow.repo - do podstawienia wartosci z elementow w druku DITA -->
- <xsl:param name="parent_obj" /><!-- glowny obiekt z ktorego beda brane wartosci do podstawiania -->
- <xsl:for-each select=".">
- <xsl:choose>
- <!--<xsl:when test="node()='topic'">asdad</xsl:when>-->
- <xsl:when test="name()='RelatedFeature'">
- <xsl:for-each select="data/apiname[@base='PROCES_INCLUDE']">
- <xsl:apply-templates mode="PROCES_INCLUDE">
- <xsl:with-param name="ID_PROCES" select="text()"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="name()='data-about'">
- <xsl:for-each select="data/apiname[@base='PROCES_INCLUDE']">
- <xsl:apply-templates mode="PROCES_INCLUDE">
- <xsl:with-param name="ID_PROCES" select="text()"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="{name()}">
- <!--<xsl:copy-of select="namespace::node()"/>-->
- <xsl:for-each select="@*">
- <xsl:choose>
- <xsl:when test="name()='xpath'">
- <xsl:variable name="xpath" select="."/>
- <!--<xsl:attribute name="xpath_parsed" select="."/>-->
- <!--1:<xsl:value-of select="$parent_obj//node()[@system_cache__appinfo:xpath=$xpath]/text()"/>-->
- <!--<xsl:value-of select="$parent_obj//node()[local-name()=$xpath]/text()"/>-->
- <!--V:<xsl:value-of select="$xpath"/>-->
- <xsl:copy-of select="$parent_obj//node()[local-name()=$xpath]/text()"/>
- </xsl:when>
- <xsl:otherwise><xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute></xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:value-of select="text()"/>
- <xsl:apply-templates mode="Procesy5_dita_assingn_values_x_path">
- <xsl:with-param name="parent_obj" select="$parent_obj"/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
-
- <xsl:template match="text()" mode="Procesy5_dita_assingn_values_x_path"/>
-
-
-
-
- <xsl:template mode="system_cache__appinfo:add_xpath_path_to_elements" match="*">
- <xsl:param name="system_cache__appinfo:curr_xpath"/>
- <xsl:variable name="system_cache__appinfo:curr_xpath_tmpl">
- <xsl:choose>
- <xsl:when test="$system_cache__appinfo:curr_xpath=''">
- <xsl:value-of select="name()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($system_cache__appinfo:curr_xpath,'/',name())"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!--<xsl:variable name="curr_xpath_tmpl" select="'asdf'"/>-->
- <xsl:element name="{name()}">
- <xsl:attribute name="xpath"><xsl:value-of select="$system_cache__appinfo:curr_xpath_tmpl"/></xsl:attribute>
- <xsl:for-each select="@*">
- <xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute>
- </xsl:for-each>
- <xsl:value-of select="text()"/>
- <xsl:apply-templates mode="system_cache__appinfo:add_xpath_path_to_elements">
- <xsl:with-param name="system_cache__appinfo:curr_xpath" select="$system_cache__appinfo:curr_xpath_tmpl"/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:template>
-
-
- <xsl:template match="text()" mode="system_cache__appinfo:add_xpath_path_to_elements"/>
-
- </xsl:stylesheet>
|