瀏覽代碼

template skladajacy

a.binder 9 年之前
父節點
當前提交
2ef5a22fe4

+ 1 - 1
SE/schema/ant-url_action/default_db.in7_dziennik_koresp/test-druk/build_recurse_ant.xsl

@@ -127,7 +127,7 @@
                     <xsl:variable name="loop_xpath_child" select="concat($loop_xpath,'_x2f_',$featureID_name)"/>
                     
                     <xsl:choose>
-                        <xsl:when test=".//RelatedFeature">
+                        <xsl:when test=".//(RelatedFeature|RelatedFeatureRoot)">
                             <xsl:element name="target">
                                 <xsl:attribute name="name" select="'get_related_feature_run_child_ant'"/>
                                 <xsl:attribute name="depends" select="concat('get_related_feature.',$RelatedFeaturePos)"/>

+ 68 - 0
SE/schema/ant-url_action/default_db.in7_dziennik_koresp/test-druk/build_recurse_ant_merge_dita_from_temp.xsl

@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:xlink="http://www.w3.org/1999/xlink"
+    xmlns:p5_default_db="https://biuro.biall-net.pl/wfs/default_db"
+    xmlns:wfs="http://www.opengis.net/wfs"
+    exclude-result-prefixes="xs"
+    version="2.0">
+    
+    
+    <xsl:output indent="yes" />
+    <xsl:strip-space elements="*"/>
+    
+    <xsl:param name="uuid" required="yes"/>
+    
+    <!-- template do zlaczenia wszystkich xmli z danymi z dita 
+    description="z plikow temp/$uuid.* buduje $out_task.dita " -->
+    
+    
+    <xsl:template match="RelatedFeature">
+        <!-- podstawamy dane z xml na podstawie path -->
+        <xsl:param name="loop_xpath" select="'root'"/>
+        <xsl:variable name="RelatedFeaturePos" select="position()"/>
+        <xsl:variable name="featureID_name" select="substring-after(@typeName,':')"/>
+        <xsl:variable name="loop_xpath" select="concat($loop_xpath,'_x2f_',$featureID_name)"/>
+        <xsl:message>#26 odpalam loop_xpath=<xsl:value-of select="$loop_xpath"/>;</xsl:message>
+        <!--<debug26>
+            Will try to put file=<xsl:value-of select="concat($uuid,'.',$loop_xpath,$featureID_name,'.',$RelatedFeaturePos,'.dita.xml.vals.dita')"/>;
+        </debug26>-->
+        <xsl:variable name="dita_fragment" select="doc(concat('temp/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.dita.xml.vals.dita'))"/>
+        
+        <xsl:apply-templates mode="RelatedFeature" select="$dita_fragment/RelatedFeatureRoot/*">
+            <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
+        </xsl:apply-templates>
+    </xsl:template>
+    
+    <xsl:template mode="RelatedFeature" match="RelatedFeature">
+        <xsl:param name="loop_xpath" required="yes"/>
+        <xsl:apply-templates select=".">
+            <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
+        </xsl:apply-templates>
+    </xsl:template>
+    
+    <xsl:template mode="RelatedFeature" match="*">
+        <xsl:param name="loop_xpath" required="yes"/>
+        <xsl:element name="{name()}">
+            <xsl:copy-of select="@*"/>
+            <xsl:apply-templates mode="RelatedFeature">
+                <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
+            </xsl:apply-templates>
+        </xsl:element>
+    </xsl:template>
+    
+    
+  
+    
+    <xsl:template match="*">
+        <xsl:param name="loop_xpath"/>
+        <xsl:element name="{name()}">
+            <xsl:copy-of select="@*"/>
+            <xsl:apply-templates>
+                <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
+            </xsl:apply-templates>
+        </xsl:element>
+    </xsl:template>
+    
+    
+</xsl:stylesheet>