a.binder 9 سال پیش
والد
کامیت
5dcdaf7baa

+ 143 - 128
SE/schema/ant-url_action/default_db.in7_dziennik_koresp/test-druk/IN7_DZIENNIK_KORESP.xsl

@@ -1,129 +1,144 @@
-<?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:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
-    xmlns:exsl="http://exslt.org/common"
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    exclude-result-prefixes="xs"
-    version="2.0">
-    
-    <xsl:output indent="yes" />
-    <xsl:strip-space elements="*"/>
-    
-    <!--<xsl:param name="dita_task_template_file" required="yes"/>-->
-    
-    <!--<xsl:variable name="dita_task_template_file">
-        <test>
-            <var>test</var>
-        </test>
-    </xsl:variable>-->
-    
-    <!--<xsl:variable name="main_template" select="doc('IN7_DZIENNIK_KORESP.dita/main.dita')"/>-->
-   
-   <xsl:template match="root">
-       <xsl:variable name="dita_task_template_file" select="topic"/>
-       <xsl:apply-templates>
-           <xsl:with-param name="dita_task_template_file" select="$dita_task_template_file"/>
-       </xsl:apply-templates>
-   </xsl:template>
-   
-   
-    <!-- todo add prefix default_db__x3A__IN7_DZIENNIK_KORESP: -->
-    <xsl:template match="default_db__x3A__IN7_DZIENNIK_KORESP: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: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>
-        <!--<out>
-            TODO przerobic input - dodac @path, 
-            przejechac template i podstawic zmienne
-            wyzwolic XSL-FO dla template
-            Wyrzucic na output tak aby to obsluzylo cos co kuma WSDL
-        <template_with_fit_vars>
-            <xsl:copy-of select="$template_with_fit_vars"/>
-        </template_with_fit_vars>
-            <!-\-<template_with_fit_vars_xpath_check>
-                <xsl:copy-of select="$template_with_fit_vars//var"/>
-            </template_with_fit_vars_xpath_check>-\->
-            
-        <input_obj_with_xpath>
-            <xsl:copy-of select="$input_obj_with_xpath"/>
-        </input_obj_with_xpath>
-        </out>-->
-        <!--<xsl:result-document href="TO_PRINT_with_flat_values.dita">
-            <xsl:copy-of select="$template_with_fit_vars"/>
-        </xsl:result-document>-->
-        <xsl:copy-of select="$template_with_fit_vars"/>
-    </xsl:template>
-    
-    <xsl:template match="*">
-        <!--Nie przeszlo!
-        <xsl:value-of select="name()" />-->
-    </xsl:template>
-    
-    <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 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:element name="{name()}">
-                <xsl:copy-of select="namespace::node()"/>
-                <xsl:value-of select="text()"/>
-                <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()[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:apply-templates mode="Procesy5_dita_assingn_values_x_path">
-                    <xsl:with-param name="parent_obj" select="$parent_obj"/>
-                </xsl:apply-templates>
-            </xsl:element>
-         </xsl:for-each>
-    </xsl:template>
-    
-    <xsl:template match="text()" mode="Procesy5_dita_assingn_values_x_path"/>
-    <xsl:template match="text()" mode="system_cache__appinfo:add_xpath_path_to_elements"/>
-    
+<?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:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
+    xmlns:exsl="http://exslt.org/common"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    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:param name="dita_task_template_file_param" select="'main.dita'"/>
+    <xsl:variable name="dita_task_template_file" select="doc($dita_task_template_file_param)"/>
+    
+    <!--<xsl:variable name="dita_task_template_file">
+        <test>
+            <var>test</var>
+        </test>
+    </xsl:variable>-->
+    
+    <!--<xsl:variable name="main_template" select="doc('IN7_DZIENNIK_KORESP.dita/main.dita')"/>-->
+   
+   <!--<xsl:template match="root">
+       <xsl:variable name="dita_task_template_file" select="topic"/>
+       <xsl:apply-templates>
+           <xsl:with-param name="dita_task_template_file" select="$dita_task_template_file.xml"/>
+       </xsl:apply-templates>
+   </xsl:template>-->
+   
+   
+    <!-- todo add prefix default_db__x3A__IN7_DZIENNIK_KORESP: -->
+    <xsl:template match="default_db__x3A__IN7_DZIENNIK_KORESP: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: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>
+        <!--<out>
+            TODO przerobic input - dodac @path, 
+            przejechac template i podstawic zmienne
+            wyzwolic XSL-FO dla template
+            Wyrzucic na output tak aby to obsluzylo cos co kuma WSDL
+        <template_with_fit_vars>
+            <xsl:copy-of select="$template_with_fit_vars"/>
+        </template_with_fit_vars>
+            <!-\-<template_with_fit_vars_xpath_check>
+                <xsl:copy-of select="$template_with_fit_vars//var"/>
+            </template_with_fit_vars_xpath_check>-\->
+            
+        <input_obj_with_xpath>
+            <xsl:copy-of select="$input_obj_with_xpath"/>
+        </input_obj_with_xpath>
+        </out>-->
+        <!--<xsl:result-document href="TO_PRINT_with_flat_values.dita">
+            <xsl:copy-of select="$template_with_fit_vars"/>
+        </xsl:result-document>-->
+        <xsl:copy-of select="$template_with_fit_vars"/>
+    </xsl:template>
+    
+    <xsl:template match="*">
+        <!--Nie przeszlo!
+        <xsl:value-of select="name()" />-->
+    </xsl:template>
+    
+    <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 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="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()[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 match="text()" mode="system_cache__appinfo:add_xpath_path_to_elements"/>
+    
 </xsl:stylesheet>

+ 45 - 4
SE/schema/ant-url_action/default_db.in7_dziennik_koresp/test-druk/main.dita

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <topic id="untitled4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:noNamespaceSchemaLocation="../../topicProcesy5.xsd">
+  xsi:noNamespaceSchemaLocation="../../../topicProcesy5.xsd">
   <title><ph>Pismo nr </ph><ph xpath="default_db__x3A__IN7_DZIENNIK_KORESP:ID_PROJECT"/>-<ph xpath="default_db__x3A__IN7_DZIENNIK_KORESP:ID"/>
     <ph>z dnia</ph>
     <ph xpath="default_db__x3A__IN7_DZIENNIK_KORESP:K_DATA_OTRZYMANEJ_KORESP"/></title>
@@ -28,9 +28,50 @@
         </tbody>
       </tgroup>
     </table>
-    <p xpath="default_db__x3A__IN7_DZIENNIK_KORESP:K_ZAWARTOS">Treść:
-
-      <data>test  data</data>
+    <p>Druga tabela - przetwarzanie tresci z data-about/data</p>
+    <table frame="all" rowsep="1" colsep="1" id="table_uh2_3qg_vxz">
+      <title>Nagłówek</title>
+      <tgroup cols="2" align="right">
+        <colspec colname="c1" colnum="1" colwidth="2.57*"/>
+        <colspec colname="c2" colnum="2" colwidth="1*"/>
+        <thead>
+          <row>
+            <entry>Adresat</entry>
+            <entry xpath="K_OD_KOGO">
+              <data-about>
+                <data>
+                    <apiname base="SOURCE_INCLUDE"></apiname><!-- jaki xml lub dane z API sa do zainkludowania -->
+                    <apiname base="STYLE_INCLUDE"></apiname><!-- jaki styl xsl jest do zaimportowania -->
+                    <apiname base="SOURCE_NAMESPACE">https://biuro.biall-net.pl/wfs/default_db/table/IN7_DZIENNIK_KORESP.xsd</apiname><!-- -->
+                    <apiname base="XPATH_VALUE">/*/K_OD_KOGO</apiname>
+                </data>
+              </data-about>
+            </entry>
+          </row>
+        </thead>
+        <tbody>
+          <row>
+            <entry>Adres:</entry>
+            <entry xpath="default_db__x3A__IN7_DZIENNIK_KORESP:OD_KOGO_ADRES"/>
+          </row>
+          <row>
+            <entry>Wasz znak</entry>
+            <entry xpath="default_db__x3A__IN7_DZIENNIK_KORESP:K_NR_OTRZYM_KORESP"/>
+          </row>
+        </tbody>
+      </tgroup>
+    </table>
+    <p xpath="default_db__x3A__IN7_DZIENNIK_KORESP:K_ZAWARTOS">Treść: <data>test data</data>
     </p>
+    <data-about>
+      <data><apiname base="PROCES_INCLUDE">1607</apiname></data>
+    </data-about>
   </body>
+  
+  <topic id="topic_e22_jwx_yx">
+    <title>title2</title>
+    <body>
+      <p>body topic2</p>
+    </body>
+  </topic>
 </topic>