瀏覽代碼

dziala pos dodane

a.binder 9 年之前
父節點
當前提交
3f10937b7d

+ 11 - 12
SE/schema/ant-url_action/default_db.in7_dziennik_koresp/test-druk/IN7_MK_BAZA_DYSTRYBUCJI.dita

@@ -30,7 +30,6 @@
       </simpletable>
       </p>
     </RelatedFeature>
-    
     <p><b>podsprawy</b></p>
     <p>
       <table>
@@ -60,7 +59,7 @@
                 <entry xpath="M_DISTRIBUTOR"/>
                 <entry xpath="L_APPOITMENT_INFO"/>
               </row>
-                    <RelatedFeature xpath="ID_PROJECT" xpath_value="../ID" typeName="p5_default_db:PROBLEMS">  <!-- test sciagniecia powiazanych pism do sprawy -->
+                  <RelatedFeature xpath="ID_PROJECT" xpath_value="../ID" typeName="p5_default_db:PROBLEMS">  <!-- test sciagniecia powiazanych pism do sprawy -->
                       <simpleTypeMakeOgcFilter name="PROBLEMS">
                         <ogc:Or>
                           <ogc:PropertyIsEqualTo>
@@ -77,7 +76,7 @@
                         <entry xpath="L_APPOITMENT_INFO"/>
                       </row>
                     </RelatedFeature>
-                    <RelatedFeature xpath="ID_PROJECT" xpath_value="../ID" typeName="p5_default_db:PROBLEMS">  <!-- test sciagniecia powiazanych pism do sprawy -->
+                  <RelatedFeature xpath="ID_PROJECT" xpath_value="../ID" typeName="p5_default_db:PROBLEMS">  <!-- test sciagniecia powiazanych pism do sprawy -->
                       <simpleTypeMakeOgcFilter name="PROBLEMS">
                         <ogc:Or>
                           <ogc:PropertyIsEqualTo>
@@ -111,15 +110,15 @@
                       <entry xpath="L_APPOITMENT_INFO"/>
                     </row>
                   </RelatedFeature>
-                    <RelatedFeature xpath="ID_PROJECT" xpath_value="../ID" typeName="p5_default_db:IN7_DZIENNIK_KORESP"><!-- test sciagniecia powiazanych pism do sprawy -->
-                      <row>
-                        <entry>------pisma</entry>
-                        <entry xpath="ID" />
-                        <entry/>
-                        <entry xpath="K_DATA_OTRZYMANEJ_KORESP"/>
-                        <entry xpath="K_ZAWARTOS"/>
-                      </row>
-                    </RelatedFeature> 
+                  <RelatedFeature xpath="ID_PROJECT" xpath_value="../ID" typeName="p5_default_db:IN7_DZIENNIK_KORESP"><!-- test sciagniecia powiazanych pism do sprawy -->
+                    <row>
+                      <entry>------pisma</entry>
+                      <entry xpath="ID" />
+                      <entry/>
+                      <entry xpath="K_DATA_OTRZYMANEJ_KORESP"/>
+                      <entry xpath="K_ZAWARTOS"/>
+                    </row>
+                  </RelatedFeature> 
               <RelatedFeature xpath="P_ID" xpath_value="../ID" typeName="p5_default_db:IN7_MK_BAZA_DYSTRYBUCJI">  <!-- test sciagniecia powiazanych pism do sprawy -->
                 <row>
                   <entry>---sprawy</entry>

+ 112 - 0
SE/schema/default_db_xml_cache.public/build_ant_universal_by_xsl_match.xsl

@@ -0,0 +1,112 @@
+<?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:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
+    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="match_root_element" select="'RelatedFeatureRoot'"/> <!-- to generate there project element  - e.g.RelatedFeatureRoot -->
+    <xsl:param name="match_element" required="yes"/><!-- to match element and make ant built for that instruction -->
+    <xsl:param name="antfile_prefix" required="yes"/> <!-- to keep antfile name understandable -->
+    <xsl:param name="temp" required="yes"/> <!-- to save there child ant builds -->
+    
+    <xsl:param name="basedir" required="yes"/> <!-- set basedir -->
+    <xsl:param name="antfile" required="yes"/> <!-- ant file to run -->
+    <xsl:param name="target"/> <!-- optional target in ant to run -->
+    
+    
+    
+    <xsl:param name="match_child_element" required="yes"/> <!-- to use as  property - e.g. ID -->
+    <xsl:param name="match_child_element_property_name" required="yes"/> <!-- to use as  e.g. ID  as some property name for run -->
+    
+    <xsl:param name="properties.xml"/> <!-- optional properties to include in xml -->
+    <xsl:param name="properties_override.xml"/> <!-- optional override properties to include in xml -->
+    
+    <xsl:param name="parallel" select="false()"/> <!-- if true will run in parallel using java parallel -->
+    <xsl:param name="threadCount" select="10"/>
+    
+    <xsl:template match="*">
+        <xsl:choose>
+            <xsl:when test="name()=$match_root_element">
+                <project basedir="{$basedir}" name="{$antfile_prefix}" default="{$antfile_prefix}"
+                    xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd">
+                    <target name="{$antfile_prefix}">
+                        <xsl:choose>
+                            <xsl:when test="$parallel">
+                                <parallel  failonany="true" threadCount="{$threadCount}"> <!-- threadCount="4"  -->
+                                    <xsl:apply-templates/>
+                                </parallel>
+                            </xsl:when>
+                            <xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
+                        </xsl:choose>
+                    </target>
+                </project>
+            </xsl:when>
+            <xsl:when test="name()=$match_element">
+                <xsl:choose>
+                    <xsl:when test="$parallel">
+                        <java>
+                            <xsl:attribute name="classname" select="'org.apache.tools.ant.Main'"/>
+                            <xsl:attribute name="maxmemory" select="'5512m'"/> <!-- TODO test if this is working?-->
+                            <!--<xsl:attribute name="fork" select="'true'"/>-->
+                            <xsl:attribute name="clonevm" select="'false'"/>
+                            <arg value="-buildfile"/>
+                            <arg value="{$antfile}"/>
+                            <!--<arg value="-DXmx5512m"/>--><!-- TODO test if this is working?-->
+                            <xsl:apply-templates/>
+                            <xsl:if test="$properties.xml">
+                                <xsl:for-each select="doc($properties.xml)/*/*">
+                                    <arg value="-D{@name}={@value}"/>
+                                </xsl:for-each>
+                            </xsl:if>
+                            <xsl:if test="$properties_override.xml">
+                                <xsl:for-each select="doc($properties_override.xml)/*/*">
+                                    <arg value="-D{@name}={@value}"/>
+                                </xsl:for-each>
+                            </xsl:if>
+                            <xsl:if test="$target"><arg value="{$target}"/></xsl:if>
+                        </java>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <ant>
+                        <xsl:attribute name="antfile" select="$antfile"/>
+                        <xsl:if test="$target">
+                            <xsl:attribute name="target" select="$target"/>
+                        </xsl:if>
+                        <xsl:apply-templates/>
+                            <xsl:if test="$properties_override.xml">
+                            <xsl:copy-of select="doc($properties_override.xml)/*/*"></xsl:copy-of>
+                        </xsl:if>
+                        <xsl:if test="$properties.xml">
+                            <xsl:copy-of select="doc($properties.xml)/*/*"></xsl:copy-of>
+                        </xsl:if>
+                        </ant>
+                    </xsl:otherwise>
+                </xsl:choose>
+                
+            </xsl:when>
+            <xsl:when test="name()=$match_child_element">
+                <xsl:choose>
+                    <xsl:when test="$parallel">
+                        <arg value="-D{$match_child_element_property_name}={text()}"/>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <property>
+                            <xsl:attribute name="name" select="$match_child_element_property_name"/>
+                            <xsl:attribute name="value" select="text()"/>
+                        </property>
+                    </xsl:otherwise>
+                </xsl:choose>
+            </xsl:when>
+            <xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+    
+    <xsl:template match="text()|comment()"/>
+    
+    
+</xsl:stylesheet>

+ 21 - 7
SE/schema/default_db_xml_cache.public/build_recurse_ant.xsl

@@ -68,6 +68,7 @@
     <xsl:param name="empty.xml" required="yes"/>
     <xsl:param name="simpleSchema_dir" required="yes"/>
     <xsl:param name="default_db_xml_cache.public" required="yes"/>
+    <xsl:param name="ant-launcher.jar"/>
     
     <!--<xsl:variable name="temp_current">
         <xsl:choose>
@@ -113,12 +114,17 @@
         <xsl:param name="input_obj_with_xpath" /> <!-- przekazany z template  match="RelatedFeature" mode="after_first_ant_assing_vars_childs" -->
         <xsl:param name="feature_pos"  select="1"/> <!-- przekazany z  template  match="RelatedFeature" mode="after_first_ant_assing_vars_childs"-->
         <xsl:param name="loop_path_recurs"  select="$loop_path_recurs"/> <!-- przekazany z RelatedFeatureLoop z mode="after_first_ant_assing_vars_childs"  -->
+        <xsl:if test="not(@xml_position)">
+            <xsl:message >#118 not set @xml_position </xsl:message>
+        </xsl:if>
         <xsl:choose>
             <xsl:when test="name()='RelatedFeature'">
                 <xsl:variable name="RelatedFeatureCount" select="last()"/>
-                <xsl:variable name="RelatedFeaturePos" select="position()"/>
+                <xsl:variable name="RelatedFeaturePos" select="position()"/> <!-- bylo bug @2017-04 position() -->
                 <xsl:variable name="featureID_name" select="substring-after($typeName,':')"/>
-                <xsl:message>#58 bylo $loop_xpath=<xsl:value-of select="$loop_xpath"/>; $basedir=<xsl:value-of select="$basedir"/>; </xsl:message>
+                <xsl:message>#58 bylo $loop_xpath=<xsl:value-of select="$loop_xpath"/>; $basedir=<xsl:value-of select="$basedir"/>;
+                    $RelatedFeaturePos=<xsl:value-of select="position()"/> while @xml_position=<xsl:value-of select="@xml_position"/>
+                </xsl:message>
                 <xsl:variable name="loop_xpath_real" select="$loop_xpath"/>
                 <xsl:variable name="loop_xpath">
                     <xsl:choose>
@@ -141,8 +147,8 @@
                 <!--<xsl:variable name="wfs_output" select="concat($uuid,'.',$loop_xpath,'_x2f_',$featureID_name)"/>-->
                 <xsl:variable name="wfs_output" select="concat($uuid,'.',$loop_xpath)"/>
                 <!--<xsl:variable name="wfs_output.xml" select="concat($wfs_output,'.',position(),'.xml')"/>-->
-                <xsl:variable name="wfs_output.xml" select="concat($wfs_output,'.',position(),'.',$feature_pos,'.xml')"/>
-                <xsl:variable name="wfs_output.dita" select="concat($wfs_output,'.',position(),'.',$feature_pos,'.dita.xml')"/>
+                <xsl:variable name="wfs_output.xml" select="concat($wfs_output,'.',position(),'.',$feature_pos,'.xml')"/> <!-- bylo bug @2017-04 position() -->
+                <xsl:variable name="wfs_output.dita" select="concat($wfs_output,'.',position(),'.',$feature_pos,'.dita.xml')"/> <!-- bylo bug @2017-04 position() -->
                 <!--<xsl:variable name="wfs_output.dita" select="concat($wfs_output,'.',position(),'.','.dita.xml')"/>-->
                 <!-- dane z oczekiwanego template .dita -->
                 <xsl:variable name="xpath_dita">
@@ -246,6 +252,7 @@
                     <property name="default_db_xml_cache.public" value="{$default_db_xml_cache.public}"/>
                     
                     <property name="temp" value="{$temp}"/>
+                    <property name="ant-launcher.jar" value="{$ant-launcher.jar}"/>
                     
                     <xsl:comment>
                         #224 Important variables:
@@ -338,8 +345,9 @@
                         </xsl:element>
                         <xsl:element name="echoxml">
                             <xsl:attribute name="file" select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita.xml}')"/>
-                            <xsl:element name="{$featureID_name_dita}"><xsl:attribute name="position" select="position()"/></xsl:element>
-                        </xsl:element>
+                            <xsl:element name="{$featureID_name_dita}">
+                                <xsl:attribute name="position" select="position()"/></xsl:element><!-- bylo bug @2017-04 position() -->
+                            </xsl:element>
                         <xsl:element name="tempfile">
                             <xsl:attribute name="property" select="concat($temp,'-',$wfs_output.xml,'__test_featureID_name_dita_out.xml')"/>
                             <xsl:attribute name="deleteonexit" select="'no'"/>
@@ -599,6 +607,8 @@
                         <xsl:attribute name="value" select="concat($recurse_ant_basedir.temp,$loop_path_recurs)"/>
                     </xsl:element>
                     
+                    <property name="ant-launcher.jar" value="{$ant-launcher.jar}"/>
+                    
                     <xsl:comment>
                         #555 Important variables:
                         typeName=<xsl:value-of select="$typeName"/>;
@@ -877,6 +887,7 @@
             <param name="xpath_query" expression="{$xpath_query}"/> <!-- limit related TODO -->
             <!--<param name="xpath_query.xsl" expression="{$xpath_query.xsl}"/>-->
             <param name="featureID_name_dita" expression="{$featureID_name_dita}"/>
+            <param name="ant-launcher.jar" expression="{$ant-launcher.jar}"/>
             <classpath location="/opt/local/share/java/saxon9he.jar"/>
         </xsl:element>
         <!--<ant antfile="{$temp}/{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.1.xml" dir="."/>-->
@@ -986,6 +997,7 @@
             <param name="xpath_query" expression="{$xpath_query}"/>
             <!--<param name="xpath_query.xsl" expression="{$xpath_query.xsl}"/>-->
             <param name="featureID_name_dita" expression="{$featureID_name_dita}"/>
+            <param name="ant-launcher.jar" expression="{$ant-launcher.jar}"/>
             <classpath location="/opt/local/share/java/saxon9he.jar"/>
         </xsl:element>
         
@@ -1196,6 +1208,7 @@
                                             <param name="empty.xml" expression="{$empty.xml}"/>
                                             <param name="simpleSchema_dir" expression="{$simpleSchema_dir}"/>
                                             <param name="default_db_xml_cache.public" expression="{$default_db_xml_cache.public}"/>
+                                            <param name="ant-launcher.jar" expression="{$ant-launcher.jar}"/>
                                     </xslt>
                             </xsl:element>
                         <!-- zapisujemy wynik naszego biezacego przetwarzania dita element nizej do kolejnego przejechania z ant wyniku dla podstawienia danych  -->
@@ -1249,7 +1262,7 @@
         <xsl:param name="simpleTypeMakeOgcFilter" required="yes"/>
         <xsl:param name="xpath_dita" required="yes"/>
         <xsl:param name="xpath_value_dita" required="yes"/>
-        <xsl:param name="RelatedFilter"/>&amp;Filter=&lt;ogc:Filter&gt;&lt;ogc:And&gt;<xsl:choose><xsl:when test="$RelatedFilter"><xsl:message>#406 we are enabling RelatedFilter <xsl:copy-of select="$RelatedFilter" copy-namespaces="no"/></xsl:message>&lt;ogc:And&gt;&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="$xpath_dita"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="$xpath_value_dita"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;<xsl:for-each select="$RelatedFilter">&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="@xpath"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="@xpath_value"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;</xsl:for-each>&lt;/ogc:And&gt;</xsl:when><xsl:otherwise>&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="$xpath_dita"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="$xpath_value_dita"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;</xsl:otherwise></xsl:choose><xsl:if test="$simpleTypeMakeOgcFilter">&lt;ogc:Or&gt;<!--<xsl:if test="count($simpleTypeMakeOgcFilter/ogc:Or/ogc:PropertyIsEqualTo) &gt; 1">&lt;ogc:Or&gt;</xsl:if>--><xsl:for-each select="$simpleTypeMakeOgcFilter/ogc:Or/ogc:PropertyIsEqualTo">&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="ogc:PropertyName/text()"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="ogc:Literal/text()"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;</xsl:for-each>&lt;/ogc:Or&gt;<!--<xsl:if test="count($simpleTypeMakeOgcFilter/ogc:Or/ogc:PropertyIsEqualTo) &gt; 1">&lt;/ogc:Or&gt;</xsl:if>--></xsl:if>&lt;/ogc:And&gt;&lt;/ogc:Filter&gt;</xsl:template>
+        <xsl:param name="RelatedFilter"/>&amp;Filter=&lt;ogc:Filter&gt;<xsl:if test="$RelatedFilter and $simpleTypeMakeOgcFilter/ogc:Or">&lt;ogc:And&gt;</xsl:if><xsl:choose><xsl:when test="$RelatedFilter"><xsl:message>#406 we are enabling RelatedFilter <xsl:copy-of select="$RelatedFilter" copy-namespaces="no"/></xsl:message>&lt;ogc:And&gt;&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="$xpath_dita"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="$xpath_value_dita"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;<xsl:for-each select="$RelatedFilter">&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="@xpath"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="@xpath_value"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;</xsl:for-each>&lt;/ogc:And&gt;</xsl:when><xsl:otherwise>&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="$xpath_dita"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="$xpath_value_dita"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;</xsl:otherwise></xsl:choose><xsl:if test="$simpleTypeMakeOgcFilter">&lt;ogc:Or&gt;<!--<xsl:if test="count($simpleTypeMakeOgcFilter/ogc:Or/ogc:PropertyIsEqualTo) &gt; 1">&lt;ogc:Or&gt;</xsl:if>--><xsl:for-each select="$simpleTypeMakeOgcFilter/ogc:Or/ogc:PropertyIsEqualTo">&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="ogc:PropertyName/text()"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="ogc:Literal/text()"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;</xsl:for-each>&lt;/ogc:Or&gt;<!--<xsl:if test="count($simpleTypeMakeOgcFilter/ogc:Or/ogc:PropertyIsEqualTo) &gt; 1">&lt;/ogc:Or&gt;</xsl:if>--></xsl:if><xsl:if test="$RelatedFilter and $simpleTypeMakeOgcFilter/ogc:Or">&lt;/ogc:And&gt;</xsl:if>&lt;/ogc:Filter&gt;</xsl:template>
     
     <!-- second step from local ant leaf -->
     <xsl:template match="RelatedFeature" mode="after_first_ant_assing_vars">
@@ -1477,6 +1490,7 @@
                     <xsl:copy-of select="@*"/>
                     <xsl:attribute name="featureID_name" select="$featureID_name"/>
                     <xsl:attribute name="loop_xpath" select="$loop_xpath"/>
+                    <xsl:attribute name="feature_pos" select="$feature_pos"/>
                 </xsl:element>
             </xsl:when>
             <xsl:otherwise>

+ 29 - 6
SE/schema/default_db_xml_cache.public/build_recurse_ant_merge_dita_from_temp.xsl

@@ -120,10 +120,24 @@
         <!--<xsl:param name="dita_with_id" select="."/>--> <!-- TODO  jest błąd - z RelatedFeatureLoop trzeba wziac mape lokalna obiektu -->
         <xsl:param name="dita.map"/> <!-- if set we will output many files in topics -->
         <xsl:variable name="xml_id" select="@xml_id"/>
-        <xsl:variable name="RelatedFeaturePos" select="position()"/>
+        <xsl:variable name="RelatedFeaturePos"><!-- position() - TODO error inaczej podchodzi do tego wezla recurse_ant - zawsze ma 1 -->
+            <xsl:choose>
+                <xsl:when test="$with_RelatedFeatureLoop"><xsl:value-of select="position()"/></xsl:when>
+                <xsl:otherwise><xsl:value-of select="1"/></xsl:otherwise><!-- bylo bug @2017-04 position() -->
+            </xsl:choose>
+        </xsl:variable> 
+        
+        <xsl:variable name="feature_pos_child"><!-- bylo bug @2017-04 position() -->
+            <xsl:choose>
+                <xsl:when test="@feature_pos"><xsl:value-of select="@feature_pos"/></xsl:when>
+                <xsl:otherwise><xsl:value-of select="$feature_pos_child"/></xsl:otherwise>
+            </xsl:choose>
+        </xsl:variable>
+        
+        <xsl:message>#129 xml_position=<xsl:value-of select="@xml_position"/> while position()=<xsl:value-of select="position()"/></xsl:message>
         <xsl:variable name="featureID_name" select="substring-after(@typeName,':')"/>
         <xsl:variable name="loop_xpath" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>
-        <xsl:message>#26 odpalam $feature_pos_child=<xsl:value-of select="$feature_pos_child"/>; loop_xpath=<xsl:value-of select="$loop_xpath"/>.dita.xml.vals.dita;</xsl:message>
+        <xsl:message>#26 odpalam $RelatedFeaturePos=<xsl:value-of select="$RelatedFeaturePos"/>; $feature_pos_child=<xsl:value-of select="$feature_pos_child"/>; loop_xpath=<xsl:value-of select="$loop_xpath"/>.dita.xml.vals.dita;</xsl:message>
         <!--<debug26>
             Will try to put file=<xsl:value-of select="concat($uuid,'.',$loop_xpath,$featureID_name,'.',$RelatedFeaturePos,'.dita.xml.vals.dita')"/>;
         </debug26>-->
@@ -135,11 +149,20 @@
                     <xsl:copy-of select="doc(concat($temp,'/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita'))"/>
                 </xsl:when>
                 <xsl:otherwise>
-                    <xsl:comment>#78 INFO no Related leaf xml file <xsl:value-of select="concat($temp,'/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita')"/>;</xsl:comment>
-                    <xsl:message>#78 INFO no Related leaf xml file <xsl:value-of select="concat($temp,'/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita')"/></xsl:message>
+                    <!--<xsl:comment>#78 NO!! INFO  Related leaf xml file <xsl:value-of select="concat($temp,'/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita')"/>;</xsl:comment>-->
+                    <xsl:message>#78 NO!! INFO  Related leaf xml file <xsl:value-of select="concat($temp,'/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita')"/></xsl:message>
                 </xsl:otherwise>
             </xsl:choose>
         </xsl:variable>
+        
+        <xsl:choose>
+            <xsl:when test=" doc-available(concat($temp,'/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita'))">
+                <xsl:comment>#97 INFO  Related leaf xml file <xsl:value-of select="concat($temp,'/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita')"/>;</xsl:comment>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:comment>#78 NO!! INFO  Related leaf xml file <xsl:value-of select="concat($temp,'/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita')"/>;</xsl:comment>
+            </xsl:otherwise>
+        </xsl:choose>
         <!--<xsl:variable name="dita_fragment" select="doc(concat($basedir,'/temp/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita'))"/>-->
         <!--<xsl:variable name="dita_fragment">
             <xsl:call-template name="get_childs_rows">
@@ -351,7 +374,7 @@
             </xsl:when>
             <xsl:otherwise>
                 <xsl:element name="{local-name()}" inherit-namespaces="yes">
-                    <xsl:copy-of select="namespace::node()"/>
+                    <!--<xsl:copy-of select="namespace::node()"/>-->
                     <!--<xsl:copy-of select="@*"/>-->
                     <xsl:apply-templates select="@*"/>
                     <xsl:apply-templates mode="RelatedFeatureChild">
@@ -393,7 +416,7 @@
                 </xsl:apply-templates>
             </xsl:when>
             <xsl:otherwise>
-                <xsl:element name="{name()}">
+                <xsl:element name="{name()}" >
                     <!--<xsl:copy-of select="@*"/>-->
                     <xsl:apply-templates select="@*"/>
                     <xsl:apply-templates>

+ 11 - 7
SE/schema/default_db_xml_cache.public/builds_to_ant.xsl

@@ -18,6 +18,8 @@
     <xsl:param name="xpath_query_test.xml"/>
     <!--<xsl:param name="recurse_ant_basedir" required="yes"/>-->
     <!--<xsl:param name="temp_current" required="yes"/>-->
+    <xsl:param name="ant-launcher.jar"/>
+    
     
     <xsl:variable name="xpath_query_test">
         <xsl:choose>
@@ -76,17 +78,18 @@
                             #
                             #
                         </echo>
-                        <parallel  failonany="true"> <!-- threadCount="4"  -->
+                        <parallel threadCount="4"  failonany="true"> <!-- threadCount="4"  -->
                             <xsl:for-each select="tokenize(.,';')">
                                 <java>
-                                    <xsl:attribute name="classname" select="'org.apache.tools.ant.Main'"/>
+                                    <xsl:attribute name="jar" select="$ant-launcher.jar"/>
+                                    <!--<xsl:attribute name="classname" select="'org.apache.tools.ant.Main'"/>-->
                                     <!--<xsl:attribute name="dir" select="'${basedir}'"/>-->
-                                    <!--<xsl:attribute name="fork" select="'true'"/>-->
-                                    <xsl:attribute name="clonevm" select="'false'"/>
-                                    <!--<xsl:attribute name="failonerror" select="'true'"/>-->
+                                    <xsl:attribute name="fork" select="'true'"/>
+                                    <xsl:attribute name="clonevm" select="'true'"/>
+                                    <xsl:attribute name="failonerror" select="'true'"/>
                                     <!--<xsl:attribute name="append" select="'false'"/>-->
                                     <xsl:attribute name="resultproperty" select="concat(.,'_resprop')"/>
-                                    <xsl:attribute name="output" select="concat(.,'_out.log')"/>
+                                    <!--<xsl:attribute name="output" select="concat(.,'_out.log')"/>-->
                                     <arg value="-buildfile"/>
                                     <arg value="{$temp}/{.}"/>
                                 </java>
@@ -160,7 +163,8 @@
                         <parallel threadCount="4" failonany="true">
                             <xsl:for-each select="tokenize(.,';')">
                                 <java>
-                                    <xsl:attribute name="classname" select="'org.apache.tools.ant.Main'"/>
+                                    <xsl:attribute name="jar" select="$ant-launcher.jar"/>
+                                    <!--<xsl:attribute name="classname" select="'org.apache.tools.ant.Main'"/>-->
                                     <xsl:attribute name="dir" select="concat($temp,'/',.)"/>
                                     <xsl:attribute name="fork" select="'true'"/>
                                     <xsl:attribute name="clonevm" select="'false'"/>

+ 3 - 3
SE/schema/default_db_xml_cache.public/escaped_html_to_xml.xsl

@@ -9,7 +9,7 @@
     
     
     <xsl:function name="system_cache__appinfo:escaped_html_to_xml">
-        <xsl:param name="html" required="yes"/>
+        <xsl:param name="html" />
         <xsl:call-template name="system_cache__appinfo:escaped_html_to_xml">
             <xsl:with-param name="html" select="$html"/>
         </xsl:call-template>
@@ -17,8 +17,8 @@
     
     
     <xsl:function name="system_cache__appinfo:enter_surround_to">
-        <xsl:param name="text" required="yes"/>
-        <xsl:param name="surround_with" required="yes"/>
+        <xsl:param name="text" />
+        <xsl:param name="surround_with" />
         <xsl:choose>
             <xsl:when test=" contains(  $text,'&#10;')">
                 <xsl:for-each select="tokenize($text ,'&#10;')">

+ 10 - 10
SE/schema/default_db_xml_cache.public/get_all_xsd.xsl

@@ -17,7 +17,7 @@
     <xsl:include href="../default_db_xml_cache.public/xml-schema-primitives.xsl"/>
     
     <xsl:function name="system_cache__appinfo:clean_object_prefix">
-        <xsl:param name="name" required="yes"/>
+        <xsl:param name="name" />
         <xsl:choose>
             <xsl:when test="substring-after($name,':')">
                 <xsl:value-of select="substring-after($name,':')"/>
@@ -29,7 +29,7 @@
     </xsl:function>
     
     <xsl:function name="system_cache__appinfo:get_object_prefix">
-        <xsl:param name="name" required="yes"/>
+        <xsl:param name="name" />
         <xsl:choose>
             <xsl:when test="substring-before($name,':')">
                 <xsl:value-of select="substring-before($name,':')"/>
@@ -42,18 +42,18 @@
     
     <!-- funkcja do wyczyszczenia wyescapowenago prefixu z np. default_db__x3A__IN7_DZIENNIK_KORESP do IN7_DZIENNIK_KORESP -->
     <xsl:function name="system_cache__appinfo:clean_object_escaped_prefix">
-        <xsl:param name="name" required="yes"/>
+        <xsl:param name="name" />
     </xsl:function>
     
     <!-- funkcja do ponownego zamienienia na sredniki itp z np. default_db__x3A__IN7_DZIENNIK_KORESP do IN7_DZIENNIK_KORESP -->
     <xsl:function name="system_cache__appinfo:translate_object_escaped_prefix_from_string">
-        <xsl:param name="name" required="yes"/>
+        <xsl:param name="name" />
         <xsl:value-of select="replace(replace(replace(replace(replace(replace(replace(replace($name, '__x2F__', '/'), '__x3A__', ':'),'__x2D__','-'),'__x25__','%'),'__x28__','('),'__x29__',')'),'__x23__','#'),'__x2A__','*')"/>
     </xsl:function>
     
     <!-- funkcja do zamienienia na postac default_db__x3A__IN7_DZIENNIK_KORESP do IN7_DZIENNIK_KORESP -->
     <xsl:function name="system_cache__appinfo:escape_object_prefix_to_string">
-        <xsl:param name="name" required="yes"/>
+        <xsl:param name="name" />
         <xsl:value-of select="replace(replace(replace(replace(replace(replace(replace(replace($name, '/', '__x2F__'), ':', '__x3A__'),'-','__x2D__'),'%','__x25__'), '\(', '__x28__'), '\)' ,'__x29__'),'#','__x23__'),'\*','__x2A__')"/>
     </xsl:function>
    
@@ -87,19 +87,19 @@
     
     -->
     <xsl:function name="system_cache__appinfo:prefix_from_targetNamespace">
-        <xsl:param name="system_cache__appinfo:vrtfNamespaces" required="yes"/>
-        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="system_cache__appinfo:vrtfNamespaces" />
+        <xsl:param name="targetNamespace" />
         <xsl:value-of select="$system_cache__appinfo:vrtfNamespaces/ns[@uri=$targetNamespace][1]/@prefix" xpath-default-namespace=""/>
     </xsl:function>
     <xsl:function name="system_cache__appinfo:targetNamespace_from_prefix">
-        <xsl:param name="system_cache__appinfo:vrtfNamespaces" required="yes"/>
-        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="system_cache__appinfo:vrtfNamespaces" />
+        <xsl:param name="prefix" />
         <xsl:value-of select="$system_cache__appinfo:vrtfNamespaces//ns[@prefix=$prefix][1]/@uri" xpath-default-namespace=""/>
     </xsl:function>
     
     
     <xsl:function name="system_cache__appinfo:get_default_db_obj_url_table_name"><!-- @2016-10 funkcja do wykrywania nazwy tabeli dla default db, w przypadku braku zgodnosci namespace - nic nie zwraca -->
-        <xsl:param name="parent_complexTypeNamespace" required="yes"/>
+        <xsl:param name="parent_complexTypeNamespace" />
         <xsl:variable name="uri_tokens" select="tokenize($parent_complexTypeNamespace,'/')"/>
         <xsl:variable name="uri_tokens_count" select="count($uri_tokens)"/>
         <xsl:if test="$uri_tokens[($uri_tokens_count - 1)]='table' and $uri_tokens[($uri_tokens_count - 2)]='default_db' and $uri_tokens[($uri_tokens_count - 3)]='wfs'">

+ 19 - 1
SE/schema/default_db_xml_cache.public/main_build_recurse_ant.dita_with_id.xsl

@@ -353,10 +353,28 @@
                 <xsl:with-param name="node" select="."/>
             </xsl:apply-templates>
             <xsl:attribute name="xml_id" select="generate-id()"/>
-            <xsl:apply-templates/>
+            <xsl:apply-templates/>            
         </xsl:element>
     </xsl:template>
     
+    <xsl:template match="RelatedFeature">
+        <xsl:param name="xml_position" select="0"/>
+        <xsl:variable name="element-name">
+            <xsl:value-of select="name()"/>
+        </xsl:variable>
+        <xsl:message>#225 try to name element <xsl:value-of select="$element-name"/>; @event_type = <xsl:value-of select="@event_type"/>; </xsl:message>
+        <xsl:element name="{$element-name}">
+            <xsl:apply-templates select="@*">
+                <xsl:with-param name="element" select="name()"/>
+                <xsl:with-param name="node" select="."/>
+            </xsl:apply-templates>
+            <xsl:attribute name="xml_id" select="generate-id()"/>
+            <xsl:attribute name="xml_position" select="( $xml_position + 1 )"/>
+            <xsl:apply-templates>
+                <xsl:with-param name="xml_position" select="( $xml_position + 1 )"/>
+            </xsl:apply-templates>
+        </xsl:element>
+    </xsl:template>
     
     <xsl:template match="p5_tr_map:go_recurse_from_root_by_build_element_494|p5_tr_map:go_recurse_from_root_by_build_element_4940">
         <xsl:param name="build_complexType" required="yes"/>

+ 2 - 1
SE/schema/default_db_xml_cache.public/object_modeling.xsl

@@ -183,6 +183,7 @@
             <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child"/>
         </xsl:element>
     </xsl:template>
+    
     <xsl:template match="system_cache__appinfo:flat_relation_cache" mode="system_cache__appinfo:new_object_by_prototype_schema_child">
         <xsl:copy-of select="."/>
     </xsl:template>
@@ -230,6 +231,7 @@
         <!--<xsl:attribute name="{name()}" select=" concat($prototype_NamespacePrefix,':', substring-after(.,':'),'__to__',concat($new_TargetNamespaceBindings_from_Namespace//@NamespaceDatabaseStorageDefinitionPrefix ,'__x3A__', $new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable, ':',  replace( substring-after(.,':'),$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable  )) )"/>-->
         <xsl:attribute name="{ name()}" select=" replace(., concat($prototype_NamespacePrefix,':', substring-after(.,':')),  concat($new_TargetNamespaceBindings_from_Namespace//@NamespaceDatabaseStorageDefinitionPrefix ,'__x3A__', $new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,':',  replace( substring-after(.,':'),$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable  ) )  )"/>
     </xsl:template>
+    
     <!--<xsl:template match="@type" mode="system_cache__appinfo:new_object_by_prototype_schema_root">
         <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
         <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
@@ -245,7 +247,6 @@
     
     <xsl:template match="@abstract" mode="system_cache__appinfo:new_object_by_prototype_schema_root"/>
     
-    
     <xsl:template match=" text()|comment()" mode="system_cache__appinfo:new_object_by_prototype_schema_child"/>
     
     <xsl:template match=" text()|comment()" mode="system_cache__appinfo:new_object_by_prototype_schema_root"/>

+ 47 - 2
SE/schema/default_db_xml_cache.public/object_modeling_new.xsl

@@ -27,6 +27,7 @@
         </xsl:call-template>
     </xsl:variable>
     
+    
     <xsl:variable name="prototype_TargetNamespaceBindings_from_Namespace">
         <xsl:call-template name="system_cache__appinfo:TargetNamespaceBindings_from_Namespace">
             <xsl:with-param name="TargetNamespace" select="$prototype_object_namespace"/>
@@ -123,14 +124,58 @@
         <xsl:apply-templates mode="system_cache__appinfo:object_modeling_new_test_if_exists"/>
     </xsl:template>
     
-    <xsl:template mode="system_cache__appinfo:object_modeling_new_test_if_exists" match="schema[@targetNamespace=$TargetNamespace_from_Bindings]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+    <xsl:template match="system_cache__appinfo:get_all_xsd_list" mode="system_cache__appinfo:object_modeling_new_test_if_exists">
+        <system_cache__appinfo:object_modeling_new_test_if_exists>
+            <xsl:message><xsl:copy-of select="$TargetNamespace_from_Bindings//@TargetNamespace"/></xsl:message>
+            <xsl:apply-templates mode="system_cache__appinfo:object_modeling_new_test_if_exists"/>
+        </system_cache__appinfo:object_modeling_new_test_if_exists>
+    </xsl:template>
+    
+    <xsl:template match="system_cache__appinfo:get_all_xsd" mode="system_cache__appinfo:object_modeling_new_test_if_exists">
+        <xsl:apply-templates mode="system_cache__appinfo:object_modeling_new_test_if_exists"/>
+    </xsl:template>
+    
+    <xsl:template mode="system_cache__appinfo:object_modeling_new_test_if_exists" match="schema[@targetNamespace=$TargetNamespace_from_Bindings//@TargetNamespace]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
         <!-- not good - we have some objects already in this schema -->
-        <xsl:copy-of select="."/>
+        <!--<xsl:copy-of select="."/>-->
+        <ERROR>
+            Object already defined in current schema
+        </ERROR>
+        <!--<xsl:copy-of select="."/>-->
     </xsl:template>
     
     <xsl:template mode="system_cache__appinfo:object_modeling_new_test_if_exists" match="schema" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
         
     
+    
+    <xsl:template mode="system_cache__appinfo:object_modeling_new_add_new_table" match="object_modeling_new_add_new_table">
+        <system_cache__appinfo:object_modeling_new_add_new_table>
+            <TargetNamespace_from_Bindings>
+                <xsl:copy-of select="$TargetNamespace_from_Bindings"/>
+            </TargetNamespace_from_Bindings>
+            <new_TargetNamespaceBindings_from_Namespace>
+                <xsl:copy-of select="$new_TargetNamespaceBindings_from_Namespace"/>
+            </new_TargetNamespaceBindings_from_Namespace>
+            <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
+                xmlns:gml="http://www.opengis.net/gml/3.2"
+                xmlns:hfp="http://www.w3.org/2001/XMLSchema-hasFacetAndProperty"
+                xmlns:default_db__x3A__SALES_PLAN="https://biuro.biall-net.pl/wfs/default_db/table/SALES_PLAN.xsd"
+                xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd">
+                <xsl:namespace name="{$TargetNamespace_from_Bindings//@Prefix}" select="$TargetNamespace_from_Bindings//@TargetNamespace"/>
+                <xsl:attribute name="elementFormDefault" select="'qualified'"/>
+                <xsl:attribute name="targetNamespace" select="$TargetNamespace_from_Bindings//@TargetNamespace"/>
+                <xsl:attribute name="vc:minVersion" select="'1.0'"/>
+                <xsl:attribute name="vc:maxVersion" select="'1.1'"/>
+                <xs:complexType name="{$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable}">
+                    <xs:sequence />
+                </xs:complexType>
+                <xs:element name="{$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable}">
+                    <xsl:attribute name="type" select="concat($TargetNamespace_from_Bindings//@Prefix,':',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable)"/>
+                </xs:element>
+            </xs:schema>
+        </system_cache__appinfo:object_modeling_new_add_new_table>
+    </xsl:template>