ソースを参照

dodanie dzialajacej mapy

a.binder 9 年 前
コミット
a0d472cd40

+ 5 - 1
SE/schema/default_db_xml_cache.public/build_recurse_ant.xsl

@@ -8,6 +8,7 @@
     xmlns:wfs="http://www.opengis.net/wfs"
     xmlns:ogc="http://www.opengis.net/ogc"
     xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
+    xmlns:p5_tr_map="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd"
     exclude-result-prefixes="xs"
     version="2.0">
     <xsl:output indent="yes" />
@@ -17,6 +18,8 @@
     <!-- Copyright BIALL-NET sp. z o.o. 2017-03-01 by Arkadiusz Binder wszelkie prawa zastrzeżone -->
     <!-- @2017-03-01 modyfikacja dla potrzeb CRM_PROCES_tree - sa bledy-->
     
+    
+    
     <xsl:include href="escaped_html_to_xml.xsl"/>
     <!--
     <property name="url" value="${url}"/> - to point what is record/table to download
@@ -507,7 +510,8 @@
                          <xsl:attribute name="featureID_name_dita" select="$featureID_name_dita"/>
                          <echo message="OUTPUT__START"/>
                                 <echo>
-                                Current template doesnt fit the requested data - TODO search for another template!
+                                    Current template doesnt fit the requested data - TODO search for another template! string($xpath_dita)(<xsl:value-of select="$xpath_dita"/>)= string($xpath)(<xsl:value-of select="$xpath"/>) and string($featureID_name)(<xsl:value-of select="$featureID_name"/>)=string($featureID_name_dita)(<xsl:value-of select="$featureID_name_dita"/>)
+                                    
                                 </echo>
                          <echo message="OUTPUT__END"/>
                      </error>

+ 2 - 0
SE/schema/default_db_xml_cache.public/build_recurse_ant_merge_dita_from_temp.xsl

@@ -4,6 +4,8 @@
     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"
+    xmlns:p5_tr_map="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd"
+    xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
     exclude-result-prefixes="xs"
     version="2.0">
     

+ 55 - 2
SE/schema/default_db_xml_cache.public/main_build_recurse_ant.dita_with_id.xsl

@@ -1,19 +1,72 @@
 <?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:p5_tr_map="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd"
+    xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
     exclude-result-prefixes="xs"
     version="2.0">
     
+    <xsl:param name="namespace_prefix"  required="yes"/>
     <xsl:output indent="yes" />
     <xsl:strip-space elements="*"/>
     
+    <xsl:template match="p5_tr_map:go_recurse_from_root_by_build_element">
+        <RelatedFeature>
+            <xsl:attribute name="xpath" select="'ID'"/>
+                <!-- wykrycie pierwszego @local-name-name -->
+                <xsl:apply-templates mode="detect_typeName_tr_map"/>
+            
+            <xsl:apply-templates/>
+        </RelatedFeature>
+    </xsl:template>
+    
+    <xsl:template match="p5_tr_map:go_recurse_from_root_by_build_element_477">
+        <RelatedFeature>
+            <xsl:attribute name="xpath" select="'ID'"/>
+            <!-- wykrycie pierwszego @local-name-name -->
+            <xsl:apply-templates mode="detect_typeName_tr_map"/>
+            
+            <xsl:apply-templates/>
+        </RelatedFeature>
+    </xsl:template>
     
     <xsl:template match="*">
         <xsl:element name="{name()}">
-            <xsl:copy-of select="@*"/>
-            <xsl:attribute name="xml_id" select="generate-id()"/>
+            <xsl:apply-templates select="@*">
+                <xsl:with-param name="element" select="name()"/>
+            </xsl:apply-templates>
+            <xsl:choose>
+                <xsl:when test="@system_cache__appinfo:id">
+                    <xsl:attribute name="xml_id" select="@system_cache__appinfo:id"/>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:attribute name="xml_id" select="generate-id()"/>
+                </xsl:otherwise>
+            </xsl:choose>
+            <!--<xsl:attribute name="xml_id" select="generate-id()"/>-->
             <xsl:apply-templates/>
         </xsl:element>
     </xsl:template>
     
+    <xsl:template match="@create_element">
+        <xsl:attribute name="xpath" select="."/>
+    </xsl:template>
+    
+    <xsl:template match="@*">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    <xsl:template mode="detect_typeName_tr_map" match="*">
+        <xsl:choose>
+            <xsl:when test="@local-name-name">
+                <xsl:attribute name="typeName" select="concat($namespace_prefix,':',@local-name-name)"/> 
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:apply-templates mode="detect_typeName_tr_map"/>
+            </xsl:otherwise>
+        </xsl:choose>
+        
+    </xsl:template>
+    
+    
 </xsl:stylesheet>