Переглянути джерело

merged func dita druki and func

a.binder 8 роки тому
батько
коміт
0ec258acfe
25 змінених файлів з 3499 додано та 214 видалено
  1. 3 3
      SE/schema/WPS_Functions/BI_audit/build_BI_audit.xml
  2. 20 25
      SE/schema/WPS_Functions/build_WPS_Functions.xml
  3. 4 3
      SE/schema/WPS_Functions/default_db/CRM_PROCES_tree/build_CRM_PROCES_tree.xml
  4. 3 3
      SE/schema/WPS_Functions/default_db/check_java_process_count/build_check_java_process_count.xml
  5. 16 8
      SE/schema/WPS_Functions/default_db/recurse_ant/build_recurse_ant.xml
  6. 4 2
      SE/schema/WPS_Functions/get_wfs/build_get_wfs.xml
  7. 3 2
      SE/schema/WPS_Functions/mapserver_gml_to_png/build_mapserver_gml_to_png.xml
  8. 3 0
      SE/schema/WPS_Functions/mapserver_gml_to_png/mapserver_gml_to_png.xsl
  9. 0 3
      SE/schema/WPS_Functions/object_install_se_ant_object/build_object_install_se_ant_object.xml
  10. 216 15
      SE/schema/WPS_Functions/object_install_se_ant_object/build_object_install_se_ant_object.xsl
  11. 4 2
      SE/schema/WPS_Functions/object_modeling/build_object_modeling.xml
  12. 4 4
      SE/schema/WPS_Functions/object_modeling_build_infrastructure/build_object_modeling_build_infrastructure.xml
  13. 3 6
      SE/schema/WPS_Functions/object_modeling_by_default_db_xml_schema/build_object_modeling_by_default_db_xml_schema.xml
  14. 124 0
      SE/schema/WPS_Functions/stock_optimize_calculations_raszczyk/build_stock_optimize_calculations_raszczyk.xml
  15. 976 0
      SE/schema/WPS_Functions/stock_optimize_calculations_raszczyk/stock_optimize_calculations_raszczyk.xsl
  16. 7 1
      SE/schema/default_db_xml_cache.public/build_ant_universal_by_xsl_match.xsl
  17. 1379 0
      SE/schema/default_db_xml_cache.public/build_object_install_se_ant_object.xsl
  18. 6 2
      SE/schema/default_db_xml_cache.public/build_recurse_ant.xsl
  19. 499 87
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_tree_to_dita.xsl
  20. 4 2
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.xsl
  21. 101 0
      SE/schema/default_db_xml_cache.public/default_db/tree_to_dita.xsl
  22. 10 0
      SE/schema/default_db_xml_cache.public/get_all_xsd.xsl
  23. 20 1
      SE/schema/default_db_xml_cache.public/system_cache__appinfo/external_schema_targetNamespace.xsl
  24. 83 21
      SE/schema/default_db_xml_cache.public/xlsx.xsl
  25. 7 24
      SE/schema/default_db_xml_cache.public/xml-schema-primitives.xsl

+ 3 - 3
SE/schema/WPS_Functions/BI_audit/build_BI_audit.xml

@@ -76,16 +76,16 @@ require("${bootstrap.php}");
         <property name="barchart.png" value="${graph_gnuplot_basedir.temp}/graph_to_image/${uuid}/barchart.${fileindex}.png"/>-->
        
         <echo>
-            BI_audit  
+            BI_audit  TODO integrate
         </echo>
         
         
         
         <!--<exec executable="${gnuplot}" dir="${graph_gnuplot_basedir.temp}/graph_to_image/${uuid}">-->
-        <exec executable="php" dir="${BI_audit_basedir.temp}">
+        <!--<exec executable="php" dir="${BI_audit_basedir.temp}">
             <arg line="${BI_audit:1_import_kw_person_and_optimize_db.php}"/>
             
-        </exec>
+        </exec>-->
         
         
     </target>    

+ 20 - 25
SE/schema/WPS_Functions/build_WPS_Functions.xml

@@ -4,24 +4,22 @@
   
   
   <!-- TODO config/licence/to handle params  - in procesy5 there is SE/schema/WPS_Functions folder - so we need to tell it is in one more root folder ../-->
-    <property name="bootstrap.php" location="${basedir}/../se-lib/bootstrap.php"/>
+    <property name="bootstrap.php" location="${basedir}/../se-lib/bootstrap.php"/> 
   
     <!-- parent properties -->
     <property name="build_root.xml" location="${basedir}/build.xml"/>
     <property name="build_properties" location="${basedir}/.build_properties" />
+    <property name="public_html" location="${basedir}" /> <!-- in some modules needed - to be removed -->
+
   
     <!-- modules WPS_Functions - to be copied to any module needed -->
-    <property name="public_html" location="${basedir}" />
     <property name="WPS_Functions" location="${basedir}/WPS_Functions"/>
     <property name="WPS_Functions.temp" location="${WPS_Functions}/temp"/>
     <property name="WPS_Functions.childproperties" location="${WPS_Functions}/.build_WPS_Functions.childproperties"/>
     <property name="WPS_Functions.childproperties.builds.xml" location="${WPS_Functions.childproperties}/WPS_Functions.builds.xml"/>
-    <property name="build_WPS_Functions.childproperties.builds.xml" location="${WPS_Functions.temp}/build_WPS_Functions.childproperties.builds.xml"/><property name="build_WPS_Functions.xml" location="${WPS_Functions}/build_WPS_Functions.xml"/> <!-- call it to get properties -->
+    <property name="build_WPS_Functions.childproperties.builds.xml" location="${WPS_Functions.temp}/build_WPS_Functions.childproperties.builds.xml"/>
+    <property name="build_WPS_Functions.xml" location="${WPS_Functions}/build_WPS_Functions.xml"/> <!-- call it to get properties -->
     <property name="build_WPS_Functions.xsl" location="${WPS_Functions}/build_WPS_Functions.xsl"/>
-    <!-- eof modules WPS_Functions  -->
-  
-  <!-- modules properties copied / controlled references -->
-    
     <property name="build_WPS_Functions.xml.properties" location="${WPS_Functions}/.build_WPS_Functions.xml.properties"/>
     
     <!-- eof modules WPS_Functions  -->
@@ -35,7 +33,9 @@
     
     
     <!-- modules properties copied / controlled references -->
-    <property name="object_install_se_ant_object" location="${basedir}/WPS_Functions/object_install_se_ant_object/build_object_install_se_ant_object.xml"/><property name="object_modeling_basedir" location="${basedir}/WPS_Functions/object_modeling"  />
+    <property name="object_install_se_ant_object" location="${basedir}/WPS_Functions/object_install_se_ant_object/build_object_install_se_ant_object.xml"/>
+  
+    <property name="object_modeling_basedir" location="${basedir}/WPS_Functions/object_modeling"  />
     <property name="object_modeling_build" location="${object_modeling_basedir}/build_object_modeling.xml"  />
     <property name="object_modeling_new_basedir" location="${basedir}/WPS_Functions/object_modeling_new"  />
     <property name="object_modeling_by_default_db_xml_schema_basedir" location="${basedir}/WPS_Functions/object_modeling_by_default_db_xml_schema"  />
@@ -55,7 +55,8 @@
     <property name="get_wfs" location="${get_wfs_basedir}/build_get_wfs.xml"/><!-- to ordinary retrieve wfs data  -->
     
     <property name="object_modeling_build_infrastructure" location="${basedir}/WPS_Functions/object_modeling_build_infrastructure/build_object_modeling_build_infrastructure.xml"/>
-    <property name="object_modeling_new" location="${basedir}/WPS_Functions/object_modeling_new/build_object_modeling_new.xml"/><property  name="object_modeling_new.xsl" location="${basedir}/default_db_xml_cache.public/object_modeling_new.xsl"/>
+    <property name="object_modeling_new" location="${basedir}/WPS_Functions/object_modeling_new/build_object_modeling_new.xml"/>
+    <property  name="object_modeling_new.xsl" location="${basedir}/default_db_xml_cache.public/object_modeling_new.xsl"/>
     <property  name="object_modeling.xsl" location="${basedir}/default_db_xml_cache.public/object_modeling.xsl"/>
     <property name="object_modeling_new_by_xml_schema.xsl" value="${basedir}/default_db_xml_cache.public/object_modeling_new_by_xml_schema.xsl"/>
     
@@ -78,21 +79,13 @@
     
     <property name="build_object_modeling_by_default_db_xml_schema.xml" value="${WPS_Functions}/object_modeling_by_default_db_xml_schema/build_object_modeling_by_default_db_xml_schema.xml"/>
     
-    <!-- EOF modules properties copied / controlled references -->
-    
-    
- 
-    
-   <!-- <property name="wfs_output.xml" location="${get_wfs_basedir.temp}/${uuid}.wfs_output.xml"/>
-    <property name="wfs_result.xml" location="${get_wfs_basedir.temp}/${uuid}.wfs_result.xml"/>
-    <property name="wfs_error.xml" location="${get_wfs_basedir.temp}/${uuid}.wfs_error.xml"/>
-    <property name="wfs_timestamp.xml" location="${get_wfs_basedir.temp}/${uuid}.wfs_timestamp.xml"/>
-    -->
+    <property name="get_wfs_recurse_xsl.xsl" location="${basedir}/default_db_xml_cache.public/get_wfs_recurse_xsl.xsl"/>
     
     
-  
-    <property name="get_wfs_recurse_xsl.xsl" location="${basedir}/default_db_xml_cache.public/get_wfs_recurse_xsl.xsl"/>
+    <property name="build_csv2xml.local_path" value="WPS_Functions/csv2xml"/> <!-- To be implemented in other modules to install xsl stylesheets correctly -->
+    <property name="build_csv2xml" location="${basedir}/${build_csv2xml.local_path}/build_csv2xml.xml"/>
     
+    <property name="csv2xml" location="/opt/local/bin/csv2xml"/>
     <!-- EOF modules properties copied / controlled references -->
     
     
@@ -136,8 +129,9 @@
             <param name="WPS_Functions" expression="${WPS_Functions}"/>
         </xslt>
         <ant antfile="${build_WPS_Functions.childproperties.builds.xml}" inheritall="yes" inheritrefs="yes"/>
+        
     </target>
-    
+  
     <target name="save_build_properties" > <!-- todo nie wiem czy trzymac properties tu i tam - do optymalziacji-->
         <!-- ${uuid} -->
         <ant antfile="${build_root.xml}"  target="save_build_properties"/>
@@ -155,8 +149,7 @@
         <echoproperties destfile="${build_WPS_Functions.xml.properties}" />
     </target>
   
-  
-<target name="clean" description="to clean modules dependent temporary files and its outputs">
+    <target name="clean" description="to clean modules dependent temporary files and its outputs">
         <ant antfile="${default_db:recurse_ant}" target="clean"/>
         <ant antfile="${get_wfs}" target="clean"/>
         <ant antfile="${build_CRM_PROCES_tree}" target="clean"/>
@@ -164,4 +157,6 @@
         <ant antfile="${object_modeling_build_infrastructure}" target="clean"/>
         <ant antfile="${object_modeling_new}" target="clean"/>
       
-    </target></project>
+    </target>
+  
+</project>

+ 4 - 3
SE/schema/WPS_Functions/default_db/CRM_PROCES_tree/build_CRM_PROCES_tree.xml

@@ -18,6 +18,7 @@
     <property name="CRM_PROCES_tree_basedir.temp" location="${CRM_PROCES_tree_basedir}/temp"  />
     
     <property name="build_CRM_PROCES_tree.childproperties" location="${WPS_Functions.childproperties}/build_CRM_PROCES_tree.properties"/>
+    
     <property name="set_parallel_java_process_max_aviable" value="40"/> <!-- override property for  -->
     
     <!-- eof local module individual properties -->
@@ -40,15 +41,15 @@
     </target>
     <!-- eof WPS_Function  -->
     
-    
-    
     <target name="write_child_props_to_config_dir" depends="read_build_properties">
         <echoproperties destfile="${build_CRM_PROCES_tree.childproperties}"/>
     </target>
     
     <target name="clean" description="Clean all output and temp files">
         <delete dir="${CRM_PROCES_tree_basedir.temp}" failonerror="false"/>
-    </target><target name="default_db:CRM_PROCES:tree" depends="read_build_properties" description="builds process tree finishing to PROCES_INIT without it ">
+    </target>
+    
+    <target name="default_db:CRM_PROCES:tree" depends="read_build_properties" description="builds process tree finishing to PROCES_INIT without it ">
         <ant antfile="${default_db:recurse_ant}"  target="clean_temp_dir">
             <property name="uuid" value="CRM_PROCES_tree"/>
         </ant>

+ 3 - 3
SE/schema/WPS_Functions/default_db/check_java_process_count/build_check_java_process_count.xml

@@ -8,6 +8,7 @@
     <property name="build_WPS_Functions.xml" location="${WPS_Functions}/build_WPS_Functions.xml"/> <!-- call it to get properties -->
     <property name="build_WPS_Functions.xml.properties" location="${build_WPS_Functions.xml}.properties"/>
     
+    
     <property name="build_check_java_process_count.childproperties" location="${WPS_Functions.childproperties}/build_check_java_process_count.properties"/>
     <property name="build_check_java_process_count.xml"  value="${WPS_Functions}/default_db/check_java_process_count/build_check_java_process_count.xml"/>
     
@@ -20,12 +21,11 @@
     
     <!-- eof modules WPS_Functions  -->
   
-  
     <target name="write_child_props_to_config_dir">
         <echoproperties destfile="${builds_to_ant_set_parallel_java_process_max.childproperties}"/>
     </target>
-
-     <target  name="check_java_process_count" >
+  
+    <target  name="check_java_process_count" >
         <exec executable="bash" dir="." outputproperty="check_java_process_count" >
             <arg  value="-c" />
             <arg value="ps ax|grep ant |grep -v grep |wc -l |tr -d [:blank:]"/>

+ 16 - 8
SE/schema/WPS_Functions/default_db/recurse_ant/build_recurse_ant.xml

@@ -40,6 +40,7 @@
     <property name="default_db:recurse_ant" value="${default_db:recurse_ant_basedir}/build_recurse_ant.xml"/>
     <property name="default_db:recurse_ant_basedir.recurse_cache" location="${default_db:recurse_ant_basedir}/recurse_cache"/>
      
+    <!--<property name="build_recurse_ant.childproperties" location="${WPS_Functions.childproperties}/build_recurse_ant.properties"/>--><!-- TODO UNKNOWN -->
     
     <property name="out" value="out"/> <!-- output ready files like pdf -->
     <property name="p5_tr_map_dir" location="${basedir}/../../../default_db.instance.xml/p5_tr_map" />
@@ -113,11 +114,13 @@
     
     <property name="dita.dir" location="/Library/Server/Web/Data/Sites/Default/SE/stuff/dita-ot-2.3.3/bin/dita"/>
     
+    
     <target name="write_child_props_to_config_dir" depends="install_folders">
         <!--<echoproperties destfile="${build_recurse_ant.childproperties}"/>-->
         <echo> TODO #120 - module is to be updated to provide properties - he dont know where is WPS_Functions - to fix. Bypassed properties</echo>
     </target>
-
+    
+    
     <target name="uuid_cond">
         <condition property="uuid_set" taskname="uuid_check">
             <or>
@@ -408,7 +411,7 @@
             &lt;br&gt;Wygenerowano wyjsciowy plik XML - sciagnij go &lt;a href=&quot;${webRootUrl}/${out_task.dita.final_with_RelatedFeatureLoop_no_path}.xml&quot; target=&quot;_blank&quot;&gt; &quot;${webRootUrl}/${out_task.dita.final_with_RelatedFeatureLoop_no_path}.xml&lt;/a&gt;&lt;/br&gt; 
         </echo>-->
         <echo>
-            &lt;br&gt;# Wygenerowano wyjsciowy plik XML - sciagnij go &lt;a href=&quot;${webRootUrl}/${out}/${uuid}.pdf&quot; target=&quot;_blank&quot;&gt; &quot;${webRootUrl}/${out}/${uuid}.pdf&lt;/a&gt;&lt;/br&gt; 
+            &lt;br&gt;# Wygenerowano wyjsciowy plik PDF - sciagnij go &lt;a href=&quot;${webRootUrl}/${out}/${uuid}.pdf&quot; target=&quot;_blank&quot;&gt; &quot;${webRootUrl}/${out}/${uuid}.pdf&lt;/a&gt;&lt;/br&gt; 
         </echo>
         <echo message="OUTPUT__END"/>
     </target>
@@ -455,7 +458,7 @@
     </target>
     
     <target name="check_set_default_db_xml_cache.public_local" depends="set_default_db_xml_cache.public_local" if="${set_default_db_xml_cache.public_local}">
-        <!--<echo> testujemy czy jest dita</echo>-->
+        <echo> #475 A Ustawiamy - testujemy czy jest dita</echo>
         <property name="default_db_xml_cache.public" value="default_db_xml_cache.public"/>
         <property name="build_recurse_ant.xsl" value="${default_db_xml_cache.public}/build_recurse_ant.xsl"/>
         <property name="build_recurse_ant_merge_dita_from_temp.xsl" value="${default_db_xml_cache.public}/build_recurse_ant_merge_dita_from_temp.xsl"/>
@@ -465,10 +468,11 @@
         <property name="recurse_ant_to_html.xsl" value="${default_db_xml_cache.public}/recurse_ant_to_html.xsl"/>
         <property name="build_recurse_ant_cache_control.xsl" value="${default_db_xml_cache.public}/build_recurse_ant_cache_control.xsl"/>
         <property name="get_wfs_recurse_xsl.xsl" value="${default_db_xml_cache.public}/get_wfs_recurse_xsl.xsl"/>
+        <property name="external_schema_table.path" value="${default_db_xml_cache.public}/../external_schema_table"/>
     </target>
     
     <target name="check_default_db_xml_cache.public_default" depends="set_default_db_xml_cache.public_local" unless="${set_default_db_xml_cache.public_local}">
-        <echo> Ustawiamy ${basedir}/../../../default_db_xml_cache.public</echo>
+        <echo>#475 B Ustawiamy ${basedir}/../../../default_db_xml_cache.public</echo>
         <property name="default_db_xml_cache.public" value="${basedir}/../../../default_db_xml_cache.public"/>
         <property name="build_recurse_ant.xsl" value="${default_db_xml_cache.public}/build_recurse_ant.xsl"/>
         <property name="build_recurse_ant_merge_dita_from_temp.xsl" value="${default_db_xml_cache.public}/build_recurse_ant_merge_dita_from_temp.xsl"/>
@@ -478,12 +482,14 @@
         <property name="recurse_ant_to_html.xsl" value="${default_db_xml_cache.public}/recurse_ant_to_html.xsl"/>
         <property name="build_recurse_ant_cache_control.xsl" value="${default_db_xml_cache.public}/build_recurse_ant_cache_control.xsl"/>
         <property name="get_wfs_recurse_xsl.xsl" value="${default_db_xml_cache.public}/get_wfs_recurse_xsl.xsl"/>
+        <property name="external_schema_table.path" value="${default_db_xml_cache.public}/../external_schema_table"/>
     </target>
     
     
    
     <target name="main_build_recurse_ant.dita_with_id"  if="${test_if_dita}">
-            <xslt basedir="${default_db:recurse_ant_basedir}" style="${main_build_recurse_ant.dita_with_id.xsl}" in="${main_build_recurse_ant.dita}"  destdir="./" out="${main_build_recurse_ant.dita_with_id}" >
+        <echo>#490 debug external_schema_table.path ${external_schema_table.path} - is it correct?</echo>    
+        <xslt basedir="${default_db:recurse_ant_basedir}" style="${main_build_recurse_ant.dita_with_id.xsl}" in="${main_build_recurse_ant.dita}"  destdir="./" out="${main_build_recurse_ant.dita_with_id}" >
             <factory name="net.sf.saxon.TransformerFactoryImpl">    
                 <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
             </factory>
@@ -491,6 +497,7 @@
             <param name="detect_resource_type_dir" expression="${detect_resource_type_dir}"/>
             <param name="build_complexType_dir" expression="${build_complexType_dir}"/>
             <param name="typeName" expression="${typeName_tested}"/> <!-- do przekazania glownego elementu do wykrycia glownie buildComplexType dla filtrow, w kolejnych zaglebieniach jada po @ref -->
+            <param name="external_schema_table.path" expression="${external_schema_table.path}"/>
             <classpath location="/opt/local/share/java/saxon9he.jar"/>
         </xslt>
     </target>
@@ -513,7 +520,7 @@
         <antcall target="clean_temp_dir"/>
         <delete dir="${out}" failonerror="false"/>
     </target>
-
+   
     <target name="clean_temp_dir" description="URL_TASK Wyczyść cache modułu ">
         <!--<delete includeemptydirs="yes" failonerror="false">
             <fileset dir="${default_db:recurse_ant_basedir.temp}"/>
@@ -596,6 +603,7 @@
             <param name="simpleSchema_dir" expression="${simpleSchema_dir}"/>
             <param name="typeName" expression="${typeName}"/>
             <param name="namespace_prefix_p5_tr_map" expression="${namespace_prefix_p5_tr_map}"/>
+            <param name="external_schema_table.path" expression="${external_schema_table.path}"/>
         </xslt>
     </target>
     
@@ -672,6 +680,7 @@
             <param name="build_recurse_ant_cache_control.xsl" expression="${build_recurse_ant_cache_control.xsl}"/>
             <param name="typeNameRoot" expression="${typeName_tested}"/> <!-- to cache purpose - to allow child elements cache created to be named from this typeNameRoot -->
             <param name="input_obj_fid_forced" expression="${input_obj_fid_forced}"/>
+            <param name="external_schema_table.path" expression="${external_schema_table.path}"/>
         </xslt>
         <!--<import file="${build_recurse_ant.xml}"/>-->
         <!--<record action="stop" name="ant.log"/>-->
@@ -827,7 +836,6 @@
         </echo>
         <echo message="OUTPUT__END"/>
     </target>   
-     
     
     <target name="buildpdf_recursed_xsl" depends="install_folders,uuid_check,typeName_check,xpath_check,xpath_value_check,set_dita"  description="retrieve and build object from api using just XSL calls - needed username and password">
         
@@ -876,7 +884,7 @@
         </echo>
         <echo message="OUTPUT__END"/>
     </target>
-
+    
     <target name="buildpdf_recursed_html5" depends="install_folders,uuid_check,typeName_check,xpath_check,xpath_value_check,passwordBase64Basic_check,php_session_id_check,check_dita" if="${test_if_dita}" description="URL_TASK Pobierz Wersję HTML">
         <property name="dita.dir" location="/Library/Server/Web/Data/Sites/Default/SE/stuff/dita-ot-2.3.3/bin/dita"/>
         <exec executable="${dita.dir}" dir=".">

+ 4 - 2
SE/schema/WPS_Functions/get_wfs/build_get_wfs.xml

@@ -28,7 +28,9 @@
     <property name="get_wfs_basedir" location="${basedir}/WPS_Functions/get_wfs"/><!-- to ordinary retrieve wfs data  -->
     <property name="get_wfs_basedir.temp" location="${get_wfs_basedir}/temp"/>
     <property name="get_wfs" location="${get_wfs_basedir}/build_get_wfs.xml"/><!-- to ordinary retrieve wfs data  -->
+    
     <property name="build_get_wfs.childproperties" location="${WPS_Functions.childproperties}/build_get_wfs.properties"/>
+    
     <property name="uuid" value="${uuid}"/>
     
     <property name="wfs_output.xml" location="${get_wfs_basedir.temp}/${uuid}.wfs_output.xml"/>
@@ -62,11 +64,11 @@
             passwordBase64Basic=${passwordBase64Basic}
         </echo>
     </target>
-
+    
     <target name="clean" description="Clean all output and temp files">
         <delete dir="${get_wfs_basedir.temp}" failonerror="false"/>
     </target>
-    
+
     <target name="http_first_input">
         <echo message="FETCHING '${url}' ..."/>
         <exec executable="curl" outputproperty="wfs_output" errorproperty="wfs_error" resultproperty="wfs_result">

+ 3 - 2
SE/schema/WPS_Functions/mapserver_gml_to_png/build_mapserver_gml_to_png.xml

@@ -13,10 +13,11 @@
     <property name="mapserver_gml_to_png" location="${basedir}/WPS_Functions/mapserver_gml_to_png/build_mapserver_gml_to_png.xml"/>
     <property name="mapserver_gml_to_png_basedir" location="${basedir}/WPS_Functions/mapserver_gml_to_png"  />                         
     <property name="mapserver_gml_to_png_basedir.temp" location="${mapserver_gml_to_png_basedir}/temp"  />
+    <property name="build_mapserver_gml_to_png.childproperties" location="${WPS_Functions.childproperties}/build_mapserver_gml_to_png.properties"/>
+    
     <!-- eof shared local module individual properties -->
     
     <!-- local individual module properties -->
-    <property name="build_mapserver_gml_to_png.childproperties" location="${WPS_Functions.childproperties}/build_mapserver_gml_to_png.properties"/>
     <property name="genpng2.sh" location="${mapserver_gml_to_png_basedir}/map/genpng2.sh"/>
     <property name="shp2img" value="/opt/local/bin/shp2img"/>
     <!--<property name="PATH_ADD" value="/opt/local/bin:/usr/bin:/bin"/>-->
@@ -39,7 +40,7 @@
     <target name="write_child_props_to_config_dir" depends="read_build_properties">
         <echoproperties destfile="${build_mapserver_gml_to_png.childproperties}"/>
     </target>
-
+    
     <target name="read_build_properties" depends="mapserver_gml_to_png:create_tempdir">
         <ant antfile="${build_WPS_Functions.xml}" target="save_build_properties"/>
         <loadproperties srcfile="${build_WPS_Functions.xml.properties}"/>

+ 3 - 0
SE/schema/WPS_Functions/mapserver_gml_to_png/mapserver_gml_to_png.xsl

@@ -8,6 +8,9 @@
     <xsl:output indent="yes"/>
     <xsl:strip-space elements="*"/>
     
+    <!-- SCRIPT IS DISABLED AND NOT NEEDED AT THIS MOMENT -->
+    
+    
     <!-- template to generate mapfile for mapserver for use from build_mapserver_gml_to_png.xml-->
     <!-- MAP
 

+ 0 - 3
SE/schema/WPS_Functions/object_install_se_ant_object/build_object_install_se_ant_object.xml

@@ -35,9 +35,6 @@
     
     
     
-    
-    
-    
    <!-- <property name="table.local" location="${public_html}/table"/>
     
     <property name="transformed.local" location="${default_db.instance.xml}/transformed"/>

+ 216 - 15
SE/schema/WPS_Functions/object_install_se_ant_object/build_object_install_se_ant_object.xsl

@@ -16,7 +16,7 @@
     
     <xsl:param name="NamespaceBinding.xml" required="yes"/> <!-- to set propery install prefix -->
     <xsl:param name="vrtfNamespaces.xml" required="yes"/>
-    <xsl:param name="external_schema_table.path" required="yes"/>
+    <!--<xsl:param name="external_schema_table.path" required="yes"/>-->
     
     
     <xsl:variable name="NamespaceBinding" select="doc($NamespaceBinding.xml)"/>
@@ -97,20 +97,24 @@
                     
                     <!-- namespaces all referenced  -->
                     <xsl:for-each-group select="$system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables//generate_tables_from_external_root.required_by.path_init[@prefix]" group-by="@targetNamespace" xpath-default-namespace="">
-                        <xsl:namespace name="{@prefix}" select="@targetNamespace"/>
+                        <xsl:namespace name="{@prefix}" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace_final(@targetNamespace)"/>
                     </xsl:for-each-group>
                     
+                    <xsl:namespace name="{$schema.prefix}" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace_final($schema.targetNamespace)"/>
+                    
                     <xsl:namespace name="system_cache__appinfo" select="'http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd'"/>
-                    <xsl:attribute name="targetNamespace" select="concat(@system_cache__appinfo:namespace_uri,'/',@generate_tables_from_external_root.path.last_token)"/>
-                        <xsl:copy-of select="@*"/>
+                    <xsl:namespace name="p5Type" select="'http://biuro.biall-net.pl/p5/schema/types'"/>
+                    <xsl:attribute name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace_final(@targetNamespace)"/> <!-- system_cache__appinfo:object_install_se_ant_object.create_targetNamespace_final(concat(@targetNamespace,'/',@generate_tables_from_external_root.path.last_token)) -->
+                        <!--<xsl:copy-of select="@*"/>-->
+                        <xsl:apply-templates select="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables_schema"/>
                     <xsl:attribute name="system_cache__appinfo:document-uri-orig" select="$system_cache__appinfo:document-uri-orig"/>
                     <xsl:comment>#92 including</xsl:comment>
                     <!--<generate_tables_from_external_root.required_by.path_init>
                         <xsl:copy-of select=" current-group()/generate_tables_from_external_root.required_by.path_init/*" xpath-default-namespace=""/>
                     </generate_tables_from_external_root.required_by.path_init>-->
-                    <xsl:for-each-group select="current-group()/generate_tables_from_external_root.required_by.path_init/*[@prefix]" group-by="@targetNamespace" xpath-default-namespace="">
+                    <xsl:for-each-group select="current-group()/generate_tables_from_external_root.required_by.path_init/*[@prefix and not(@prefix = current()/@prefix) ]" group-by="@targetNamespace" xpath-default-namespace="">
                         <xsl:element name="import" namespace="http://www.w3.org/2001/XMLSchema">
-                            <xsl:attribute name="namespace" select="@targetNamespace"/>
+                            <xsl:attribute name="namespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace_final(@targetNamespace)"/>
                             <xsl:attribute name="schemaLocation" select="concat(@prefix,'.xsd')"/>
                         </xsl:element>
                     </xsl:for-each-group>
@@ -130,12 +134,51 @@
             <xsl:result-document href="{ concat($external_schema_table.path,'/',$system_cache__appinfo:document-uri-orig,'/',$schema.prefix,'.xsd')}">
                 <xsl:copy-of select="$schema"/>
             </xsl:result-document>
+            
+            <xsl:message>#135 ant-object install - todo dependency, than install </xsl:message>
+            <xsl:for-each select="$schema/schema/element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+                <xsl:variable name="ant-obj-save-path" select="system_cache__appinfo:object_install_se_ant_object.save_to_ant-object-path($system_cache__appinfo:document-uri-orig,$schema.prefix,@name)"/>
+                <xsl:message >#138 $ant-obj-save-path element/@name=<xsl:value-of select="@name"/> <xsl:value-of select="$ant-obj-save-path"/></xsl:message>
+                
+                <xsl:result-document href="{$ant-obj-save-path}">
+                    <xsl:apply-templates select="../../."  mode="system_cache__appinfo:object_install_se_ant_object.ant-object.unique_element">
+                        <xsl:with-param name="name" select="@name"/>
+                    </xsl:apply-templates>
+                </xsl:result-document>
+                <xsl:result-document href="{system_cache__appinfo:object_install_se_ant_object.save_to_ant-object-path.build_xml( $system_cache__appinfo:document-uri-orig,$schema.prefix,@name)}">
+                    <empty/>
+                </xsl:result-document>
+            </xsl:for-each>
         </xsl:for-each-group>
         
         
         
     </xsl:template>
     
+    <xsl:template match="schema" mode="system_cache__appinfo:object_install_se_ant_object.ant-object.unique_element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" >
+        <xsl:param name="name" required="yes"/>
+        <xsl:element name="{name()}"  namespace="http://www.w3.org/2001/XMLSchema">
+            <xsl:copy-of select="namespace::node()"/>
+            <xsl:copy-of select="@*"/>
+            <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.ant-object.unique_element">
+                <xsl:with-param name="name" select="$name"/>
+            </xsl:apply-templates>
+        </xsl:element>
+    </xsl:template>
+    
+    <xsl:template match="element[@name]" mode="system_cache__appinfo:object_install_se_ant_object.ant-object.unique_element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" >
+        <xsl:param name="name" required="yes"/>
+        <xsl:choose>
+            <xsl:when test="@name=$name">
+                <xsl:copy-of select="."/>
+            </xsl:when>
+        </xsl:choose>
+    </xsl:template>
+    
+    <xsl:template match="complexType|simpleType|import" mode="system_cache__appinfo:object_install_se_ant_object.ant-object.unique_element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" >
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
     <!--<xsl:template match="schema[ not(@targetNamespace = 'external_schema__ksiegi_wieczyste__zsin_1013.xsd')]" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
         <xsl:comment>#67 temporary bypased : <xsl:value-of select="@targetNamespace"/> ;  to analyze one schema scenario!</xsl:comment>
     </xsl:template>-->
@@ -170,6 +213,10 @@
             <xsl:comment>#139 to include <xsl:value-of select=".//@generate_tables_from_external_root.required_by.path"/></xsl:comment>
         </xsl:template>
          
+        <xsl:template match="@targetNamespace|@generate_tables_from_external_root.name|@generate_tables_from_external_root.path|@prefix|@generate_tables_from_external_root.path.last_token" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_schema"/>
+            
+        
+         
          <xsl:template match="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_schema">
              <xsl:copy-of select="."/>
          </xsl:template>
@@ -408,7 +455,7 @@
             <xsl:attribute name="targetNamespace" select="$targetNamespace"/>
             <xsl:comment>#374 root CT without @type - ? maybe force element? or should be forced from another leafes? </xsl:comment>
             <xsl:element name="{name()}">
-                <xsl:copy-of select="@*"></xsl:copy-of>
+                <xsl:copy-of select="@*"/>
                 <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child">
                     <xsl:with-param name="generate_tables_from_external_root.path" select="concat($generate_tables_from_external_root.path,'/',$generate_tables_from_external_root.name)"/>
                     <xsl:with-param name="prefix" select="$prefix"/>
@@ -565,6 +612,21 @@
         
     </xsl:template>
     
+    <xsl:template match="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root_element_force_type_element">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    <xsl:template match="@type" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root_element_force_type_element">
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <!-- <xsl:attribute name="debug_422_prefix" select="$prefix"/>
+        <xsl:attribute name="debug_422_current" select=" current()"/>-->
+        <xsl:attribute name="type" select=" concat($prefix,':', system_cache__appinfo:clean_object_prefix(current() ))"/>
+        
+    </xsl:template>
+    
     <xsl:template match="element[@type]" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
         <xsl:param name="generate_tables_from_external_root.name" select="@type"/>
         <xsl:param name="generate_tables_from_external_root.path" select="@name"/>
@@ -572,11 +634,21 @@
         <xsl:param name="prefix" required="yes"/>
         <xsl:param name="prefix_root"  required="yes"/>
         <xsl:param name="targetNamespace_root" required="yes"/>
+        <xsl:variable name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace,@name)"/>
+        <xsl:variable name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix,@name)"/>
         <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
             <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
             <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
             <xsl:element name="{name()}">
-                <xsl:copy-of select="@*"/>
+                <!--<xsl:copy-of select="@*"/>-->
+                <xsl:apply-templates select="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root_element_force_type_element">
+                    <xsl:with-param name="generate_tables_from_external_root.path" select="concat($generate_tables_from_external_root.path,'/',$generate_tables_from_external_root.name)"/>
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+                <xsl:attribute name="targetNamespace" select="$targetNamespace"/>
                 <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child">
                     <xsl:with-param name="generate_tables_from_external_root.path" select="concat($generate_tables_from_external_root.path,'/',$generate_tables_from_external_root.name)"/>
                     <xsl:with-param name="prefix" select="$prefix"/>
@@ -674,6 +746,7 @@
                         <generate_tables_from_external_root.required_by.path_init>
                                 <xsl:attribute name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix_root, system_cache__appinfo:object_install_se_ant_object.root_complextype(element,@ref))"/>
                             <xsl:attribute name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace, system_cache__appinfo:object_install_se_ant_object.root_complextype(element,@ref))"/>
+                            <xsl:attribute name="debug" select="'#749A element[@ref] system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child'"/>
                         </generate_tables_from_external_root.required_by.path_init>
                     </xsl:when>
                     <xsl:otherwise><!-- jest ref tylko do roota -->
@@ -686,17 +759,79 @@
                         <generate_tables_from_external_root.required_by.path_init>
                             <xsl:attribute name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix_root, system_cache__appinfo:clean_object_prefix(@ref))"/>
                             <xsl:attribute name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace_root, system_cache__appinfo:clean_object_prefix(@ref))"/>
+                            <xsl:attribute name="debug" select="'#749B element[@ref] system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child'"/>
                         </generate_tables_from_external_root.required_by.path_init>
                     </xsl:otherwise>
                 </xsl:choose>
-                
-                
                 <xsl:comment>#191 element[@ref] on child - should not be more transformed</xsl:comment>
                     <!--<xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child"/>-->
-                
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.annotation">
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
             </xsl:element>
     </xsl:template>
     
+    <xsl:template match="*|text()|comment()" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.annotation" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
+    
+    <xsl:template match="annotation|appinfo" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.annotation" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <!--<xsl:variable name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace,@name)"/>
+        <xsl:variable name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix,@name)"/>-->
+            <xsl:element name="{name()}">
+                <xsl:copy-of select="@*"/>
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.annotation">
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+            </xsl:element>
+    </xsl:template>
+    
+    <xsl:template match="flat_relation_cache" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.annotation" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" >
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <!--<xsl:variable name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace,@name)"/>
+        <xsl:variable name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix,@name)"/>-->
+        <system_cache__appinfo:flat_relation_cache>
+            <system_cache__appinfo:source>
+                <xsl:apply-templates select="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.annotation">
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+            </system_cache__appinfo:source>
+        </system_cache__appinfo:flat_relation_cache>
+    </xsl:template>
+    
+    
+    
+    <xsl:template match="@system_cache__appinfo:name" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.annotation">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    <xsl:template match="@system_cache__appinfo:xpath" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.annotation">
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        
+        <xsl:variable name="remote_name_obj" select=" system_cache__appinfo:clean_object_prefix(substring-before(.,'/'))"/>
+        <xsl:variable name="remote_name_fld" select=" substring-after(.,'/')"/>
+        <xsl:variable name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace,$remote_name_obj)"/>
+        <xsl:variable name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix,$remote_name_obj)"/>
+        <xsl:attribute name="{name()}" select=" concat($prefix,':',$remote_name_obj,'/',$remote_name_fld)"/>
+    </xsl:template>
+    
     
     <xsl:template match="element[@name and complexType and not(@type)]" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
         <xsl:param name="generate_tables_from_external_root.name" select="@name"/>
@@ -721,6 +856,7 @@
             <generate_tables_from_external_root.required_by.path_init>
                 <xsl:attribute name="prefix" select="$prefix"/>
                 <xsl:attribute name="targetNamespace" select="$targetNamespace"/>
+                <xsl:attribute name="debug" select="'#320A  element[@name and complexType and not(@type)] system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child'"/>
             </generate_tables_from_external_root.required_by.path_init>
             <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
                 <xsl:attribute name="debug_579_root_complextype" select="system_cache__appinfo:object_install_se_ant_object.root_complextype( complexType,@name)"/>
@@ -808,7 +944,7 @@
         <xsl:param name="targetNamespace_root" required="yes"/>
             <xsl:element name="{name()}">
                 <xsl:choose>
-                    <xsl:when test="system_cache__appinfo:targetNamespace_from_prefix($system_cache__appinfo:vrtfNamespaces, system_cache__appinfo:get_prefix_from_element(@type)) = 'http://www.w3.org/2001/XMLSchema'">
+                    <xsl:when test="system_cache__appinfo:targetNamespace_from_prefix($system_cache__appinfo:vrtfNamespaces, system_cache__appinfo:get_prefix_from_element(@type)) = 'http://www.w3.org/2001/XMLSchema' or system_cache__appinfo:targetNamespace_from_prefix($system_cache__appinfo:vrtfNamespaces, system_cache__appinfo:get_prefix_from_element(@type)) = 'http://biuro.biall-net.pl/p5/schema/types'">
                         <xsl:copy-of select="@*"/>
                         <xsl:comment>#203a - type typu xs:</xsl:comment>
                         <!--<xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_force_refered_element" select="."/>-->
@@ -847,6 +983,10 @@
             </xsl:element>
     </xsl:template>
     
+    <xsl:template match="annotation" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_force_refered_complexType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:comment>suppressed annotation <xsl:copy-of select=".//text()"/></xsl:comment>
+    </xsl:template>
+    
     <xsl:template match="complexType" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_force_refered_complexType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
         <xsl:param name="name" required="yes"/>
         <xsl:param name="generate_tables_from_external_root.name" select="$name"/>
@@ -907,6 +1047,7 @@
             <xsl:element name="{name()}" >
                 <xsl:copy-of select="@*"/>
                 <xsl:attribute name="name" select="$name"/>
+                <xsl:attribute name="debug" select="'#939'"/>
                 <xsl:comment>#359C -  parsing - CT is local leaf</xsl:comment>
                 <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child">
                     <xsl:with-param name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
@@ -988,11 +1129,68 @@
         <xsl:comment>#166 ignored child to be set root </xsl:comment>
     </xsl:template>
     
-    <xsl:template match="*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables">
+    <xsl:template match="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    <xsl:template match="@id|@targetNamespace" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables"/>
+        
+    <xsl:template match="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables_schema">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    <xsl:template match="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables.sequence">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    <xsl:template match="@name" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables.sequence"/>
+        
+    
+    
+    <xsl:template match="@type|@targetNamespace|@id|@name|@generate_tables_from_external_root.path.last_token|@generate_tables_from_external_root.name|@generate_tables_from_external_root.path|@prefix" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables_schema"/>
+        
+    
+    <xsl:template match="annotation" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+       <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    <xsl:template match="sequence" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
         <xsl:param name="generate_tables_from_external_root.required_by.path_init"/>
         <xsl:element name="{name()}">
+            <xsl:apply-templates select="../@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables.sequence"/>
             <xsl:copy-of select="@*"/>
+            <!--<xsl:apply-templates select="../@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables"/>-->
+            <xsl:choose>
+                <xsl:when test="../@generate_tables_from_external_root.path">
+                    <xsl:variable name="generate_tables_from_external_root.path.last" select="../@generate_tables_from_external_root.path"/>
+                    <xsl:variable name="generate_tables_from_external_root.path.last_token" select="tokenize($generate_tables_from_external_root.path.last,'/')[ count(tokenize($generate_tables_from_external_root.path.last,'/'))]"/>
+                    <xsl:attribute name="generate_tables_from_external_root.path.last_token" select="$generate_tables_from_external_root.path.last_token"/>
+                    <!--<xsl:attribute name="generate_tables_from_external_root.path.last" select="tokenize(.././@generate_tables_from_external_root.path,'/')[ count(tokenize(../@generate_tables_from_external_root.path,'/'))]"/>-->
+                </xsl:when>
+            </xsl:choose>
+            <xsl:choose>
+                <xsl:when test="$generate_tables_from_external_root.required_by.path_init">
+                    <generate_tables_from_external_root.required_by.path_init>
+                        <xsl:for-each select=".//*[@prefix]">
+                            <generate_tables_from_external_root.required_by.path_init>
+                                <xsl:attribute name="generate_tables_from_external_root.required_by.path" select="@generate_tables_from_external_root.required_by.path"/>
+                                <xsl:attribute name="prefix" select="@prefix"/>
+                                <xsl:attribute name="targetNamespace" select="@targetNamespace"/>
+                            </generate_tables_from_external_root.required_by.path_init>
+                        </xsl:for-each>
+                    </generate_tables_from_external_root.required_by.path_init>
+                </xsl:when>
+            </xsl:choose>
+            <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables"/>
+        </xsl:element>
+    </xsl:template>
+    
+    <xsl:template match="*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables">
+        <xsl:param name="generate_tables_from_external_root.required_by.path_init"/>
+        <xsl:element name="{name()}">
             <xsl:copy-of select="../@*"/>
+            <xsl:copy-of select="@*"/>
+            <!--<xsl:apply-templates select="../@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables"/>-->
             <xsl:choose>
                 <xsl:when test="../@generate_tables_from_external_root.path">
                     <xsl:variable name="generate_tables_from_external_root.path.last" select="../@generate_tables_from_external_root.path"/>
@@ -1042,9 +1240,11 @@
         <xsl:attribute name="ref" select="."/>
     </xsl:template>
     
-    <xsl:template match="import|group|attributeGroup|include|annotation" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external">
+    <xsl:template match="import|group|attributeGroup|include|annotation" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external"/>
+    
+    
         
-    </xsl:template>
+    
     <xsl:template match="*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external">
         <error_unantended><xsl:attribute name="name" select="name()"/></error_unantended>
     </xsl:template>
@@ -1098,6 +1298,7 @@
     
     <xsl:template match="sequence" mode="system_cache__appinfo:object_install_se_ant_object.list_external_tables_complexType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
         <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.list_external_tables_complexType_sequence"/>
+        <xsl:message terminate="yes">#1130 unexpected</xsl:message>
     </xsl:template>
     
     <xsl:template match="element" mode="system_cache__appinfo:object_install_se_ant_object.list_external_tables_complexType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">

+ 4 - 2
SE/schema/WPS_Functions/object_modeling/build_object_modeling.xml

@@ -12,8 +12,9 @@
     <!-- eof modules WPS_Functions  -->
     
     <property name="object_modeling_basedir" location="${basedir}/WPS_Functions/${ant.project.name}"  />
-    
     <property name="build_object_modeling.childproperties" location="${WPS_Functions.childproperties}/build_object_modeling.properties"/>
+    
+    
     <property name="public_html" location="${basedir}" />
     <property name="root_build.xml" location="${public_html}/build.xml"/>
     <!--<property name="build_properties.xml" location="${public_html}/build_properties.xml" />-->
@@ -27,10 +28,11 @@
     <property name="transformed.local" location="${default_db.instance.xml}/transformed"/>
     <property name="procesy5_system_schema.xml" value="${transformed.local}/procesy5_system_schema.xml"/>
     -->
+    
     <target name="write_child_props_to_config_dir" depends="read_build_properties">
         <echoproperties destfile="${build_object_modeling.childproperties}"/>
     </target>
-
+    
     <target name="read_build_properties">
        <!-- <ant antfile="${root_build.xml}" target="save_build_properties"/>
         <loadproperties srcfile="${build_properties}"/>-->

+ 4 - 4
SE/schema/WPS_Functions/object_modeling_build_infrastructure/build_object_modeling_build_infrastructure.xml

@@ -12,12 +12,11 @@
     <property name="build_WPS_Functions.xml.properties" location="${build_WPS_Functions.xml}.properties"/>
     <!-- eof modules WPS_Functions  -->
     
-    
     <property name="object_modeling_build_infrastructure" location="${basedir}/WPS_Functions/object_modeling_build_infrastructure/build_object_modeling_build_infrastructure.xml"/>
     <property name="object_modeling_build_infrastructure_basedir" location="${basedir}/WPS_Functions/object_modeling_build_infrastructure"  />
     <property name="object_modeling_build_infrastructure_basedir.temp" location="${object_modeling_build_infrastructure_basedir}/temp"  />
-    
     <property name="build_object_modeling_build_infrastructure.childproperties" location="${WPS_Functions.childproperties}/build_object_modeling_build_infrastructure.properties"/>
+    
     <property name="public_html" location="${basedir}" />
     <property name="root_build.xml" location="${public_html}/build.xml"/>
     <!--<property name="build_properties.xml" location="${public_html}/build_properties.xml" />-->
@@ -32,10 +31,12 @@
     <property name="transformed.local" location="${default_db.instance.xml}/transformed"/>
     <property name="procesy5_system_schema.xml" value="${transformed.local}/procesy5_system_schema.xml"/>
     -->
+    
     <target name="write_child_props_to_config_dir" depends="read_build_properties">
         <echoproperties destfile="${build_object_modeling_build_infrastructure.childproperties}"/>
     </target>
-
+    
+    
     <target name="read_build_properties">
         <ant antfile="${build_WPS_Functions.xml}" target="save_build_properties"/>
         <loadproperties srcfile="${build_WPS_Functions.xml.properties}"/>
@@ -44,7 +45,6 @@
         <property name="new_object_by_prototype.xml" value="${transformed.local}/system_cache__appinfo/new_object_by_prototype.xml"/>
     </target>
     
-    
     <target name="clean" description="Clean all output and temp files">
         <delete dir="${object_modeling_build_infrastructure_basedir.temp}" failonerror="false"/>
     </target>

+ 3 - 6
SE/schema/WPS_Functions/object_modeling_by_default_db_xml_schema/build_object_modeling_by_default_db_xml_schema.xml

@@ -16,12 +16,10 @@
     
     <property name="object_modeling_by_default_db_xml_schema_basedir" location="${basedir}/WPS_Functions/${ant.project.name}"  />
     <property name="object_modeling_by_default_db_xml_schema_basedir.temp" location="${object_modeling_by_default_db_xml_schema_basedir}/temp"  />
-    
-    
-    
     <property name="build_object_modeling_by_default_db_xml_schema.childproperties" location="${WPS_Functions.childproperties}/build_object_modeling_by_default_db_xml_schema.properties"/>
     
-<target name="read_build_properties">
+    
+    <target name="read_build_properties">
         <!--<ant antfile="${root_build.xml}" target="save_build_properties.xml"/>-->
         <!--<ant antfile="${root_build.xml}" target="read_build_properties.xml"/>-->
         <!--<loadproperties srcfile="${build_properties.xml}"  />-->
@@ -30,11 +28,10 @@
         <echo>We try to refresh ${default_db.xml} or ${detect_objects_parent_relations.xsl}</echo>
     </target>
     
-    
     <target name="write_child_props_to_config_dir" depends="read_build_properties">
         <echoproperties destfile="${build_object_modeling_by_default_db_xml_schema.childproperties}"/>
     </target>
-
+    
     <target name="system_cache__appinfo:default_db_get_xml_schema_if_not_exists_check" depends="read_build_properties">
         <condition property="default_db_get_xml_schema_if_not_exists_check" taskname="system_cache__appinfo:default_db_get_xml_schema_if_not_exists">
             <available file="${default_db.xml}"/>

+ 124 - 0
SE/schema/WPS_Functions/stock_optimize_calculations_raszczyk/build_stock_optimize_calculations_raszczyk.xml

@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project 
+    xmlns:build_stock_optimize_calculations_raszczyk="build_stock_optimize_calculations_raszczyk"
+    basedir="../../." name="build_stock_optimize_calculations_raszczyk" default="stock_optimize_calculations_raszczyk">
+    <description> na potrzeby raszczyk do optymalizacji dostaw towarow do sklepow oraz w celu analizy danych poszczegolnych sklepow</description>
+    
+    <!-- modules WPS_Functions - to be copied to any module needed -->
+    <property name="WPS_Functions" location="${basedir}/WPS_Functions"/>
+    <property name="build_WPS_Functions.xml" location="${WPS_Functions}/build_WPS_Functions.xml"/> <!-- call it to get properties -->
+    <property name="build_WPS_Functions.xml.properties" location="${build_WPS_Functions.xml}.properties"/>
+    <!-- eof modules WPS_Functions  -->
+    
+    
+    <!-- local shared module individual properties should contain ${project.name} basedir ant its .temp -->
+    <property name="build_stock_optimize_calculations_raszczyk.local_path" value="WPS_Functions/stock_optimize_calculations_raszczyk"/> <!-- To be implemented in other modules to install xsl stylesheets correctly -->
+    <property name="build_stock_optimize_calculations_raszczyk" location="${basedir}/${build_stock_optimize_calculations_raszczyk.local_path}/build_stock_optimize_calculations_raszczyk.xml"/>
+    <property name="build_stock_optimize_calculations_raszczyk.basedir" location="${basedir}/${build_stock_optimize_calculations_raszczyk.local_path}"/>
+    <property name="build_stock_optimize_calculations_raszczyk.basedir.temp" location="${basedir}/${build_stock_optimize_calculations_raszczyk.local_path}/temp"/>
+    <property name="build_stock_optimize_calculations_raszczyk.childproperties" location="${WPS_Functions.childproperties}/build_stock_optimize_calculations_raszczyk.properties"/>
+    
+    
+    
+    <property name="uuid" value="analizasklepowam_fix"/>
+    
+    <property name="stock_optimize_calculations_raszczyk.xsl" location="${build_stock_optimize_calculations_raszczyk.basedir}/stock_optimize_calculations_raszczyk.xsl"/>
+    
+    <property name="build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow" location="${basedir}/${build_stock_optimize_calculations_raszczyk.local_path}/analiza_sklepow"/>
+    <property name="build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow.xslx" location="${build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow}/analizasklepowam.xlsx"/>
+    <property name="build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow.xml" location="${build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow}/analizasklepowam.xml"/>
+    <property name="build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow_fix.xml" location="${build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow}/${uuid}.out_task.dita.final_with_RelatedFeatureLoop.xml"/>
+    
+    <property name="build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow.koszty_wytworzenia.csv" location="${build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow}/KosztyWytworzeniaRaszczyk.csv"/>
+    <property name="build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow.koszty_wytworzenia.xml" location="${build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow}/KosztyWytworzeniaRaszczyk.xml"/>
+    
+    <!-- eof shared local module individual properties -->
+    
+    <!-- important temp files -->
+    <property name="build_stock_optimize_calculations_raszczyk.properties" value="${build_stock_optimize_calculations_raszczyk.basedir.temp}/build_stock_optimize_calculations_raszczyk.properties"/>
+    
+    
+    
+  
+    <target name="read_build_properties">
+        <ant antfile="${build_WPS_Functions.xml}" target="save_build_properties"/>
+        <loadproperties srcfile="${build_WPS_Functions.xml.properties}"/>
+    </target>
+    
+    <target name="system_cache__appinfo:build_stock_optimize_calculations_raszczyk.create_tempdir">
+        <mkdir dir="${build_stock_optimize_calculations_raszczyk.basedir.temp}"/>
+    </target>
+  
+    <target name="write_child_props_to_config_dir" depends="read_build_properties,system_cache__appinfo:build_stock_optimize_calculations_raszczyk.create_tempdir">
+        <echoproperties destfile="${build_stock_optimize_calculations_raszczyk.childproperties}"/>
+    </target>
+  
+    
+  
+    <target name="clean" description="Clean all output and temp files">
+        <delete dir="${build_stock_optimize_calculations_raszczyk.basedir.temp}" failonerror="false"/>
+    </target>
+  
+    <target name="from_csv_2_xml" depends="clean,read_build_properties,system_cache__appinfo:build_stock_optimize_calculations_raszczyk.create_tempdir" description="optionally import from csv files">
+        <ant antfile="${build_csv2xml}" target="csv2xml_dir">
+            <property name="input" value="${build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow}"/>
+            <property name="output" value="${build_stock_optimize_calculations_raszczyk.basedir.temp}"/>
+        </ant>
+    </target>
+    
+    <target name="build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow.koszty_wytworzenia.xml" depends="clean,read_build_properties,system_cache__appinfo:build_stock_optimize_calculations_raszczyk.create_tempdir" description="import from csv files koszty wytworzenia">
+        <loadfile encoding="utf-8" property="build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow.koszty_wytworzenia.csv.content" srcfile="${build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow.koszty_wytworzenia.csv}"/>
+        <echoxml file="${build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow.koszty_wytworzenia.xml}" namespacepolicy="all">
+            <koszty_wytworzenia.csv xmlns="build_stock_optimize_calculations_raszczyk">
+                ${build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow.koszty_wytworzenia.csv.content}
+            </koszty_wytworzenia.csv>
+        </echoxml>
+    </target>
+    
+    <target name="from_xsl_2_xml" depends="clean,read_build_properties,system_cache__appinfo:build_stock_optimize_calculations_raszczyk.create_tempdir" description="optionally import from csv files">
+        <exec executable="unzip" >
+            <arg value="-q"/>
+            <arg value="${build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow.xslx}"/>
+            <arg value="-d"/>
+            <arg value="${build_stock_optimize_calculations_raszczyk.basedir.temp}"/>
+        </exec>
+        
+        <xslt basedir="${basedir}" style="${xlsx.xsl}" in="${empty.xml}" destdir="${build_stock_optimize_calculations_raszczyk.basedir.temp}"  out="${build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow.xml}" force="true" >
+            <factory name="net.sf.saxon.TransformerFactoryImpl">    
+                <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
+                <attribute name="http://saxon.sf.net/feature/initialTemplate" value="{https://biuro.biall-net.pl/wfs/default_db/Types/xlsx.xsd}main"/>
+            </factory>
+            <classpath location="/opt/local/share/java/saxon9he.jar"/>
+            <!--<param name="it" expression="Types__x3A__xlsx__x3A__maina"/>-->
+            <param name="Types__x3A__xlsx__x3A__unzipped_xlsx" expression="${build_stock_optimize_calculations_raszczyk.basedir.temp}"/>
+            <!--<param name="Types__x3A__xlsx__x3A__unzipped_xlsx" expression="${basedir}/${poprawione_obszary_xml_dir}"/>-->
+        </xslt>
+        
+    </target>
+    
+  
+    <!-- depends="from_xsl_2_xml" -->
+  
+    <target name="stock_optimize_calculations_raszczyk"  depends="read_build_properties,build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow.koszty_wytworzenia.xml" description="to be moved to ant moving txt file surrounding with xml">
+        
+        
+        <xslt basedir="${build_stock_optimize_calculations_raszczyk.basedir.temp}" style="${stock_optimize_calculations_raszczyk.xsl}" in="${build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow.xml}"   out="${build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow_fix.xml}" force="true" >
+            <factory name="net.sf.saxon.TransformerFactoryImpl">    
+                <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
+                <!--<attribute name="http://saxon.sf.net/feature/initialTemplate" value="{https://biuro.biall-net.pl/wfs/default_db/Types/xlsx.xsd}main"/>-->
+            </factory>
+            <classpath location="/opt/local/share/java/saxon9he.jar"/>
+            <param name="{build_stock_optimize_calculations_raszczyk}koszty_wytworzenia.csv" expression="${build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow.koszty_wytworzenia.xml}"/>
+            <!--<param name="it" expression="Types__x3A__xlsx__x3A__maina"/>-->
+            <!--<param name="Types__x3A__xlsx__x3A__unzipped_xlsx" expression="${build_stock_optimize_calculations_raszczyk.basedir.temp}"/>-->
+            <!--<param name="Types__x3A__xlsx__x3A__unzipped_xlsx" expression="${basedir}/${poprawione_obszary_xml_dir}"/>-->
+        </xslt>
+        
+        
+        <move file="${build_stock_optimize_calculations_raszczyk.basedir.analiza_sklepow_fix.xml}" todir="${default_db:recurse_ant_basedir.out}" overwrite="true"/>
+        
+        
+    </target>
+
+  
+</project>

+ 976 - 0
SE/schema/WPS_Functions/stock_optimize_calculations_raszczyk/stock_optimize_calculations_raszczyk.xsl

@@ -0,0 +1,976 @@
+<?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:Types__x3A__xlsx="https://biuro.biall-net.pl/wfs/default_db/Types/xlsx.xsd"
+    xmlns:build_stock_optimize_calculations_raszczyk="build_stock_optimize_calculations_raszczyk"
+    exclude-result-prefixes="xs"
+    version="2.0">
+    
+    
+    <xsl:output indent="yes"/>
+    <xsl:strip-space elements="*"/>
+    <!-- do parsowania xslx z naszej stajni -->
+    
+    <xsl:param name="build_stock_optimize_calculations_raszczyk:koszty_wytworzenia.csv" required="yes"/> <!-- it is csv file to be parsed -->
+    
+    <xsl:variable name="build_stock_optimize_calculations_raszczyk:koszty_wytworzenia.csv.xml" select="doc($build_stock_optimize_calculations_raszczyk:koszty_wytworzenia.csv)"/>
+    
+    <xsl:variable name="build_stock_optimize_calculations_raszczyk:koszty_wytworzenia.xml">
+        <xsl:apply-templates mode="build_stock_optimize_calculations_raszczyk:koszty_wytworzenia.xml" select="$build_stock_optimize_calculations_raszczyk:koszty_wytworzenia.csv.xml"/>
+    </xsl:variable>
+    
+    
+    <xsl:template match="Types__x3A__xlsx:main">
+        
+        <RelatedFeatureRoot>
+            <map title="raport przetwarzania Procesy5 A.Binder"
+                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:map.xsd"
+                anchorref="http://procesy5.pl">
+                
+                <!--<xsl:copy-of select="$build_stock_optimize_calculations_raszczyk:koszty_wytworzenia.xml"/>-->
+                
+                 <xsl:variable name="raszczyk_row_prod">
+                     <raszczyk_row_prod>
+                         <xsl:apply-templates/>
+                     </raszczyk_row_prod>
+                 </xsl:variable>
+                
+                
+                <xsl:variable name="raszczyk_row_prod_local_sum">
+                    <raszczyk_row_prod_local_sum>
+                        <xsl:apply-templates select="$raszczyk_row_prod" mode="raszczyk_row_prod_local_sum"/>
+                    </raszczyk_row_prod_local_sum>
+                </xsl:variable>
+                
+                 <!--<xsl:copy-of select="$raszczyk_row_prod"/>-->
+                <!--<xsl:copy-of select="$raszczyk_row_prod_local_sum"/>-->
+                 
+                <xsl:apply-templates mode="raszczyk_row_prod_local_sum.errors" select="$raszczyk_row_prod_local_sum"/>
+                 
+                <topic id="topic_tabele_efektywnosci_4bb{generate-id()}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                    xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
+                    <title>Sklepy efektywność tabela porownawcza</title>
+                    <body>
+                        <p>
+                            
+                        </p>
+                    </body>
+                    <xsl:apply-templates mode="SKLEPY_EFEKTYWNOSC_TABELE" select="$raszczyk_row_prod_local_sum"/>
+                </topic>
+                 
+                 <topic id="topic_x5j_mrk_4bb{generate-id()}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                     xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
+                     <title>Sklepy efektywność wykresy</title>
+                     <body>
+                         <p>
+                             
+                         </p>
+                     </body>
+                     <xsl:apply-templates mode="SKLEPY_EFEKTYWNOSC" select="$raszczyk_row_prod_local_sum"/>
+                 </topic>
+            
+            
+                <topic id="topic_x5j_mrk_4baab{generate-id()}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                    xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
+                    <title>Całość rapor wykresy</title>
+                    <body>
+                        <p>
+                            
+                        </p>
+                    </body>
+                    <xsl:apply-templates mode="CALOSC" select="$raszczyk_row_prod_local_sum"/>
+                </topic>
+            
+            </map>
+        </RelatedFeatureRoot>
+    </xsl:template>
+    
+    
+    <xsl:template match="row[ Nazwa = Grupa ]" mode="raszczyk_row_prod_local_sum">
+        <xsl:message>#77 group ignored <xsl:value-of select="Grupa"/> = <xsl:value-of select="Nazwa"/></xsl:message>
+    </xsl:template> <!-- ignore groups -->
+    
+    
+    
+    <xsl:template match="raszczyk_row_prod_local_sum" mode="raszczyk_row_prod_local_sum.errors">
+        <topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            id="topic_Bledy_w_produktach_{ generate-id()}"
+            xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
+            <title>Brakujące ceny składników</title>
+            <body>
+                <p>
+                    <simpletable frame="all" relcolwidth="1* 5* 1*" id="simpletabsle_brakii_{ generate-id()}">
+                        <sthead>
+                            <stentry>Nazwa</stentry>
+                            <stentry>Sklepy</stentry>
+                            <stentry>Możliwe zakłocenie raportu (wart sprzed)</stentry>
+                        </sthead>
+                        
+                            <xsl:for-each-group select="row[ koszt_wytworzenia='']" group-by="Nazwa">
+                                <xsl:sort select="sum(current-group()/Sprzed)" order="descending"/>
+                               <strow>
+                                  <stentry>
+                                      <xsl:value-of select="Nazwa"/>
+                                  </stentry>
+                                  <stentry>
+                                      <xsl:for-each select="current-group()/@sheet_name">
+                                          <xsl:value-of select="."/>,<xsl:text> </xsl:text>
+                                      </xsl:for-each>
+                                  </stentry>
+                                   <stentry>
+                                       <xsl:value-of select="round(sum( current-group()/Sprzed))"/> pln
+                                   </stentry>
+                                </strow>
+                            </xsl:for-each-group>      
+                        <strow>
+                            <stentry>suma:</stentry>
+                            <stentry> - </stentry>
+                            <stentry><xsl:value-of select=" round(sum(row[ koszt_wytworzenia='']/Sprzed))"/> pln</stentry>
+                        </strow>
+                    </simpletable>
+                </p>
+            </body>
+        </topic>
+    </xsl:template>
+    
+    
+    
+    
+    <xsl:template match="row" mode="raszczyk_row_prod_local_sum">
+        <row><xsl:copy-of select="@*"/>
+        <xsl:apply-templates mode="raszczyk_row_prod_local_sum"/>
+        <xsl:element name="wynik">
+            <xsl:value-of select="( Sprzed *  Cena ) - ( Il_zw * build_stock_optimize_calculations_raszczyk:koszt_wytworzenia(Nazwa) )  "/>
+        </xsl:element>
+        <xsl:element name="koszt_zwrotu">
+            <xsl:value-of select="Il_zw * build_stock_optimize_calculations_raszczyk:koszt_wytworzenia(Nazwa)  "/>
+        </xsl:element>
+            <xsl:element name="koszt_wytworzenia">
+                <xsl:value-of select="build_stock_optimize_calculations_raszczyk:koszt_wytworzenia(Nazwa)  "/>
+            </xsl:element>
+        </row>
+    </xsl:template>
+    
+    <xsl:template match="raszczyk_row_prod" mode="raszczyk_row_prod_local_sum">
+            <xsl:apply-templates mode="raszczyk_row_prod_local_sum"/>
+    </xsl:template>
+    
+    <xsl:template match="*" mode="raszczyk_row_prod_local_sum">
+            <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    
+    <xsl:template match="raszczyk_row_prod_local_sum" mode="CALOSC">
+        <xsl:for-each-group select="row" group-by="Grupa">
+            
+            <topic id="topic_xaa5j_{generate-id()}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
+                <title>Dla Grupy <xsl:value-of select="Grupa"/></title>
+                <body>
+                    
+                    <p><simpletable frame="all" relcolwidth="1* 1* 1* 1*" id="simpletabsle_56_{ generate-id()}">
+                        <sthead>
+                            <stentry>Grupa</stentry>
+                            <stentry>Nazwa</stentry>
+                            <stentry>JM</stentry>
+                            <stentry>Waga</stentry>
+                        </sthead>
+                        <strow>
+                            <stentry>wszystkie</stentry>
+                            <stentry>wszystkie</stentry>
+                            <stentry>wszystkie</stentry>
+                            <stentry>wszystkie</stentry>
+                        </strow>
+                    </simpletable>
+                    </p>
+                    
+                    
+                    
+                    <p>1 - Sprzed_przed</p>
+                    <p>2 - Sprzed_po</p>
+                    
+                    <p>3 - Waga_sprzed_przed</p>
+                    <p>4 - Waga_sprzed_po</p>
+                    
+                    <p>5 - Wart_sprzed_przed</p>
+                    <p>6- Wart_sprzed_po</p>
+                    
+                 <!--   <p>7 - Waga_zw_przed </p>
+                    <p>8 - Waga_zw_po</p>
+                    -->
+                    <p>9 - Wart_zw_przed</p>
+                    <p>10 - Wart_zw_po</p>
+                    
+                    <p>11 - Sprz_fakt_przed</p>
+                    <p>12 - Sprz_fakt_po</p>
+                    
+                    
+                    
+                    <p>
+                        
+                        <simpletable frame="all" relcolwidth="1* 1* 1* 1* 1*" id="GRAPH_simpleaaaatable_77_{generate-id()}">
+                            <!--<sthead>
+                            <stentry>Sprzed_przed</stentry>
+                            <stentry>Sprzed_po</stentry>
+                            
+                            <stentry>Waga_sprzed_przed</stentry>
+                            <stentry>Waga_sprzed_po</stentry>
+                            
+                            <stentry>Wart_sprzed_przed</stentry>
+                            <stentry>Wart_sprzed_po</stentry>
+                            
+                            
+                            <stentry>Waga_zw_przed </stentry>
+                            <stentry>Waga_zw_po</stentry>
+                            
+                            <stentry>Wart_zw_przed</stentry>
+                            <stentry>Wart_zw_po</stentry>
+                            
+                            <stentry>Sprz_fakt_przed</stentry>
+                            <stentry>Sprz_fakt_po</stentry>
+                        </sthead>-->
+                            <sthead>
+                                <stentry>1</stentry>
+                                <stentry>2</stentry>
+                                
+                                <stentry>3</stentry>
+                                <stentry>4</stentry>
+                                
+                                <stentry>5</stentry>
+                                <stentry>6</stentry>
+                                
+                                
+                                <!--<stentry>7 </stentry>
+                                <stentry>8</stentry>-->
+                                
+                                <stentry>9</stentry>
+                                <stentry>10</stentry>
+                                
+                                <stentry>11</stentry>
+                                <stentry>12</stentry>
+                            </sthead>
+                            
+                            <xsl:variable name="compare">
+                                <compare>
+                                    <xsl:for-each-group select="current-group()" group-by="@miesiac">
+                                        <strow>
+                                            <xsl:attribute name="nazwa" select="Grupa"/>
+                                            <xsl:attribute name="row_month" select="@miesiac"/>
+                                            <xsl:variable name="sumy">
+                                                <xsl:apply-templates mode="sumy" >
+                                                    <xsl:with-param name="current-group" select="current-group()"/>
+                                                </xsl:apply-templates>
+                                            </xsl:variable>
+                                            <xsl:copy-of select="$sumy"/>
+                                        </strow>
+                                    </xsl:for-each-group>
+                                </compare>
+                            </xsl:variable>
+                            <!--<xsl:copy-of select="$compare"/>-->
+                            <strow>
+                                <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Sprzed)"/></stentry>
+                                <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Sprzed)"/></stentry>
+                                
+                                <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Waga_sprzed)"/></stentry>
+                                <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Waga_sprzed)"/></stentry>
+                                
+                                <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Waga_zw)"/></stentry>
+                                <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Waga_zw)"/></stentry>
+                                
+                                <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Wart_zw)"/></stentry>
+                                <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Wart_zw)"/></stentry>
+                                
+                                <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Wart_zw)"/></stentry>
+                                <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Wart_zw)"/></stentry>
+                                
+                                <stentry><xsl:value-of select="$compare/compare/strow[1]/round(wynik)"/></stentry>
+                                <stentry><xsl:value-of select="$compare/compare/strow[2]/round(wynik)"/></stentry>
+                                
+                            </strow>
+                            
+                        </simpletable>
+                    </p>
+                    
+                    
+                    
+                    
+                    <p>1 - Sprzed_przed</p>
+                    <p>2 - Sprzed_po</p>
+                    
+                    <p>3 - Waga_sprzed_przed</p>
+                    <p>4 - Waga_sprzed_po</p>
+                    
+                    <p>5 - Wart_sprzed_przed</p>
+                    <p>6- Wart_sprzed_po</p>
+                  <!--  
+                    <p>7 - Waga_zw_przed </p>
+                    <p>8 - Waga_zw_po</p>
+                    -->
+                    <p>9 - Wart_zw_przed</p>
+                    <p>10 - Wart_zw_po</p>
+                    
+                    <p>11 - wynik_przed</p>
+                    <p>12 - wynik_po</p>
+                    
+                    <xsl:for-each-group select=" current-group()" group-by="Nazwa">
+                        
+                        <simpletable frame="all" relcolwidth="1* 1* 1* 1* 1* 1*" id="simpletable_simsdapletable_130_{ generate-id()}">
+                            <sthead>
+                                <stentry>Grupa</stentry>
+                                <stentry>Nazwa</stentry>
+                                <stentry>JM</stentry>
+                                <stentry>Waga</stentry>
+                            </sthead>
+                            <strow>
+                                <stentry><xsl:value-of select="Grupa"/></stentry>
+                                <stentry><xsl:value-of select="Nazwa"/></stentry>
+                                <stentry><xsl:value-of select="JM"/></stentry>
+                                <stentry><xsl:value-of select="Waga"/></stentry>
+                                
+                            </strow>
+                        </simpletable>
+                        <simpletable frame="all" relcolwidth="1* 1* 1* 1* 1*" id="GRAPH_simssspletable_145_{generate-id()}">
+                            <!--<sthead>
+                                            <stentry>Sprzed_przed</stentry>
+                                            <stentry>Sprzed_po</stentry>
+                                            
+                                            <stentry>Waga_sprzed_przed</stentry>
+                                            <stentry>Waga_sprzed_po</stentry>
+                                            
+                                            <stentry>Wart_sprzed_przed</stentry>
+                                            <stentry>Wart_sprzed_po</stentry>
+                                            
+                                            
+                                            <stentry>Waga_zw_przed </stentry>
+                                            <stentry>Waga_zw_po</stentry>
+                                            
+                                            <stentry>Wart_zw_przed</stentry>
+                                            <stentry>Wart_zw_po</stentry>
+                                            
+                                            <stentry>Sprz_fakt_przed</stentry>
+                                            <stentry>Sprz_fakt_po</stentry>
+                                        </sthead>-->
+                            <sthead>
+                                <stentry>1</stentry>
+                                <stentry>2</stentry>
+                                
+                                <stentry>3</stentry>
+                                <stentry>4</stentry>
+                                
+                                <stentry>5</stentry>
+                                <stentry>6</stentry>
+                                
+                                
+                            <!--    <stentry>7 </stentry>
+                                <stentry>8</stentry>-->
+                                
+                                <stentry>9</stentry>
+                                <stentry>10</stentry>
+                                
+                                <stentry>11</stentry>
+                                <stentry>12</stentry>
+                            </sthead>
+                            
+                            <xsl:variable name="compare">
+                                <compare>
+                                    <xsl:for-each-group select="current-group()" group-by="@miesiac">
+                                        <strow>
+                                            <xsl:attribute name="nazwa" select="Nazwa"/>
+                                            <xsl:attribute name="row_month" select="@miesiac"/>
+                                            <xsl:variable name="sumy">
+                                                <xsl:apply-templates mode="sumy" >
+                                                    <xsl:with-param name="current-group" select="current-group()"/>
+                                                </xsl:apply-templates>
+                                            </xsl:variable>
+                                            <xsl:copy-of select="$sumy"/>
+                                        </strow>
+                                    </xsl:for-each-group>
+                                </compare>
+                            </xsl:variable>
+                            <!--<xsl:copy-of select="$compare"/>-->
+                            <strow>
+                                <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Sprzed)"/></stentry>
+                                <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Sprzed)"/></stentry>
+                                
+                                <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Waga_sprzed)"/></stentry>
+                                <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Waga_sprzed)"/></stentry>
+                                
+                                <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Waga_zw)"/></stentry>
+                                <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Waga_zw)"/></stentry>
+                                
+                                <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Wart_zw)"/></stentry>
+                                <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Wart_zw)"/></stentry>
+                                
+                               <!-- <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Wart_zw)"/></stentry>
+                                <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Wart_zw)"/></stentry>-->
+                                
+                                <stentry><xsl:value-of select="$compare/compare/strow[1]/round(wynik)"/></stentry>
+                                <stentry><xsl:value-of select="$compare/compare/strow[2]/round(wynik)"/></stentry>
+                                
+                            </strow>
+                            
+                        </simpletable>
+                    </xsl:for-each-group>
+                    
+                    
+                    
+                </body>
+            </topic>
+            
+            
+            
+        </xsl:for-each-group>
+    </xsl:template>
+    
+    
+    
+    <xsl:template match="raszczyk_row_prod_local_sum" mode="SKLEPY_EFEKTYWNOSC_TABELE">
+       
+            
+            <topic id="topic_x5j_{generate-id()}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
+                <title>Tabela wyników dla produktów/sklepów (dla dwóch miesięcy na raz - todo rozdzielenie)  </title>
+                <body>
+                    
+                  <xsl:variable name="Grupy">
+                      <Grupy>
+                            <xsl:for-each-group select="row[wynik/text()]" group-by="Grupa">
+                                <xsl:copy-of select="Grupa"/>
+                            </xsl:for-each-group>
+                      </Grupy>
+                  </xsl:variable>
+                    
+                    <!--<xsl:copy-of select="$Grupy"/>-->
+                    
+                    <p><simpletable frame="all" id="simplet_sklep_able_56_{ generate-id()}">
+                        
+                        <sthead>
+                            <stentry>Sklep</stentry>
+                            <xsl:for-each select="$Grupy/Grupy/Grupa" >
+                                <stentry>
+                                    <xsl:value-of select="."/>
+                                </stentry>
+                            </xsl:for-each>
+                            <stentry>suma</stentry>
+                        </sthead>
+                        
+                         <xsl:for-each-group select="row" group-by="@sheet_name">
+                             <strow>
+                                    <stentry>
+                                        <xsl:value-of select="@sheet_name"/>
+                                    </stentry>
+                                    <xsl:variable name="sheet_name" select="current-group()"/>
+                                    <xsl:for-each select="$Grupy/Grupy/Grupa">
+                                       <stentry>
+                                           <xsl:value-of select="round(sum($sheet_name/wynik[ ../Grupa = current() and text()]))"/> <!-- [ ../Grupa = current()] -->
+                                       </stentry>
+                                    </xsl:for-each>
+                                       <stentry>
+                                           <xsl:value-of select="round(sum($sheet_name/wynik [text()]))"/>
+                                       </stentry>
+                             </strow>
+                            </xsl:for-each-group>
+                        <strow>
+                            <stentry></stentry>
+                            <xsl:for-each select="$Grupy/Grupy/Grupa" >
+                                <stentry>
+                                </stentry>
+                            </xsl:for-each>
+                            <stentry><xsl:value-of select="format-number(sum(row/wynik [text()]),'#.####') "/></stentry>
+                        </strow>
+                        
+                        
+                    </simpletable>
+                    </p>
+                    
+                    
+                    
+                    
+                    
+                </body>
+            </topic>
+            
+            
+            
+        
+    </xsl:template>
+    
+    
+    <xsl:template match="raszczyk_row_prod_local_sum" mode="SKLEPY_EFEKTYWNOSC">
+        <xsl:for-each-group select="row" group-by="@sheet_name">
+            
+            <topic id="topic_x5j_{generate-id()}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
+                <title>Dla sklepu <xsl:value-of select="@sheet_name"/></title>
+                <body>
+                  
+                    <p><simpletable frame="all" relcolwidth="1* 1* 1* 1*" id="simpletable_56_{ generate-id()}">
+                        <sthead>
+                            <stentry>Grupa</stentry>
+                            <stentry>Nazwa</stentry>
+                            <stentry>JM</stentry>
+                            <stentry>Waga</stentry>
+                        </sthead>
+                        <strow>
+                            <stentry>wszystkie</stentry>
+                            <stentry>wszystkie</stentry>
+                            <stentry>wszystkie</stentry>
+                            <stentry>wszystkie</stentry>
+                        </strow>
+                    </simpletable>
+                    </p>
+                    
+                    
+                        
+                            <p>1 - Sprzed_przed</p>
+                            <p>2 - Sprzed_po</p>
+                            
+                            <p>3 - Waga_sprzed_przed</p>
+                            <p>4 - Waga_sprzed_po</p>
+                           
+                            <p>5 - Wart_sprzed_przed</p>
+                            <p>6- Wart_sprzed_po</p>
+                           
+                         <!--   <p>7 - Waga_zw_przed </p>
+                            <p>8 - Waga_zw_po</p>-->
+                            
+                            <p>9 - Wart_zw_przed</p>
+                            <p>10 - Wart_zw_po</p>
+                            
+                            <p>11 - wynik_przed</p>
+                            <p>12 - wynik_po</p>
+                        
+                    
+                    
+                    <p>
+                      
+                    <simpletable frame="all" relcolwidth="1* 1* 1* 1* 1*" id="GRAPH_simpletable_77_{generate-id()}">
+                        <!--<sthead>
+                            <stentry>Sprzed_przed</stentry>
+                            <stentry>Sprzed_po</stentry>
+                            
+                            <stentry>Waga_sprzed_przed</stentry>
+                            <stentry>Waga_sprzed_po</stentry>
+                            
+                            <stentry>Wart_sprzed_przed</stentry>
+                            <stentry>Wart_sprzed_po</stentry>
+                            
+                            
+                            <stentry>Waga_zw_przed </stentry>
+                            <stentry>Waga_zw_po</stentry>
+                            
+                            <stentry>Wart_zw_przed</stentry>
+                            <stentry>Wart_zw_po</stentry>
+                            
+                            <stentry>Sprz_fakt_przed</stentry>
+                            <stentry>Sprz_fakt_po</stentry>
+                        </sthead>-->
+                        <sthead>
+                            <stentry>1</stentry>
+                            <stentry>2</stentry>
+                            
+                            <stentry>3</stentry>
+                            <stentry>4</stentry>
+                            
+                            <stentry>5</stentry>
+                            <stentry>6</stentry>
+                            
+                           <!-- 
+                            <stentry>7 </stentry>
+                            <stentry>8</stentry>
+                            -->
+                            <stentry>9</stentry>
+                            <stentry>10</stentry>
+                            
+                            <stentry>11</stentry>
+                            <stentry>12</stentry>
+                        </sthead>
+                        
+                        <xsl:variable name="compare">
+                            <compare>
+                                <xsl:for-each-group select="current-group()" group-by="@miesiac">
+                                    <strow>
+                                        <xsl:attribute name="nazwa" select="Grupa"/>
+                                        <xsl:attribute name="row_month" select="@miesiac"/>
+                                        <xsl:variable name="sumy">
+                                            <xsl:apply-templates mode="sumy" >
+                                                <xsl:with-param name="current-group" select="current-group()"/>
+                                            </xsl:apply-templates>
+                                        </xsl:variable>
+                                        <xsl:copy-of select="$sumy"/>
+                                    </strow>
+                                </xsl:for-each-group>
+                            </compare>
+                        </xsl:variable>
+                        <!--<xsl:copy-of select="$compare"/>-->
+                        <strow>
+                            <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Sprzed)"/></stentry>
+                            <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Sprzed)"/></stentry>
+                            
+                            <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Waga_sprzed)"/></stentry>
+                            <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Waga_sprzed)"/></stentry>
+                            
+                            <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Wart_sprzed)"/></stentry>
+                            <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Wart_sprzed)"/></stentry>
+                            
+                            <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Waga_zw)"/></stentry>
+                            <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Waga_zw)"/></stentry>
+                            
+                        <!--    <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Wart_zw)"/></stentry>
+                            <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Wart_zw)"/></stentry>-->
+                            
+                            <stentry><xsl:value-of select="$compare/compare/strow[1]/round(wynik)"/></stentry>
+                            <stentry><xsl:value-of select="$compare/compare/strow[2]/round(wynik)"/></stentry>
+                            
+                        </strow>
+                        
+                    </simpletable>
+                  </p>
+                  
+
+                                
+                                
+                    <p>1 - Sprzed_przed</p>
+                    <p>2 - Sprzed_po</p>
+                    
+                    <p>3 - Waga_sprzed_przed</p>
+                    <p>4 - Waga_sprzed_po</p>
+                    
+                    <p>5 - Wart_sprzed_przed</p>
+                    <p>6- Wart_sprzed_po</p>
+                   <!-- 
+                    <p>7 - Waga_zw_przed </p>
+                    <p>8 - Waga_zw_po</p>
+                    -->
+                    <p>9 - Wart_zw_przed</p>
+                    <p>10 - Wart_zw_po</p>
+                    
+                    <p>11 - wynik_przed</p>
+                    <p>12 - wynik_po</p>
+                                
+                                <xsl:for-each-group select=" current-group()" group-by="Grupa">
+                                    
+                                    <simpletable frame="all" relcolwidth="1* 1* 1* 1* 1* 1*" id="simpletable_simpletable_130_{ generate-id()}">
+                                        <sthead>
+                                            <stentry>Grupa</stentry>
+                                            <stentry>Nazwa</stentry>
+                                            <stentry>JM</stentry>
+                                            <stentry>Waga</stentry>
+                                        </sthead>
+                                        <strow>
+                                            <stentry><xsl:value-of select="Grupa"/></stentry>
+                                            <stentry><xsl:value-of select="Nazwa"/></stentry>
+                                            <stentry><xsl:value-of select="JM"/></stentry>
+                                            <stentry><xsl:value-of select="Waga"/></stentry>
+                                            
+                                        </strow>
+                                    </simpletable>
+                                    <simpletable frame="all" relcolwidth="1* 1* 1* 1* 1*" id="GRAPH_simpletable_145_{generate-id()}">
+                                        <!--<sthead>
+                                            <stentry>Sprzed_przed</stentry>
+                                            <stentry>Sprzed_po</stentry>
+                                            
+                                            <stentry>Waga_sprzed_przed</stentry>
+                                            <stentry>Waga_sprzed_po</stentry>
+                                            
+                                            <stentry>Wart_sprzed_przed</stentry>
+                                            <stentry>Wart_sprzed_po</stentry>
+                                            
+                                            
+                                            <stentry>Waga_zw_przed </stentry>
+                                            <stentry>Waga_zw_po</stentry>
+                                            
+                                            <stentry>Wart_zw_przed</stentry>
+                                            <stentry>Wart_zw_po</stentry>
+                                            
+                                            <stentry>Sprz_fakt_przed</stentry>
+                                            <stentry>Sprz_fakt_po</stentry>
+                                        </sthead>-->
+                                        <sthead>
+                                            <stentry>1</stentry>
+                                            <stentry>2</stentry>
+                                            
+                                            <stentry>3</stentry>
+                                            <stentry>4</stentry>
+                                            
+                                            <stentry>5</stentry>
+                                            <stentry>6</stentry>
+                                            
+                                            
+                                          <!--  <stentry>7 </stentry>
+                                            <stentry>8</stentry>-->
+                                            
+                                            <stentry>9</stentry>
+                                            <stentry>10</stentry>
+                                            
+                                            <stentry>11</stentry>
+                                            <stentry>12</stentry>
+                                        </sthead>
+                                        
+                                        <xsl:variable name="compare">
+                                            <compare>
+                                                <xsl:for-each-group select="current-group()" group-by="@miesiac">
+                                                    <strow>
+                                                        <xsl:attribute name="nazwa" select="Grupa"/>
+                                                        <xsl:attribute name="row_month" select="@miesiac"/>
+                                                        <xsl:variable name="sumy">
+                                                            <xsl:apply-templates mode="sumy" >
+                                                                <xsl:with-param name="current-group" select="current-group()"/>
+                                                            </xsl:apply-templates>
+                                                        </xsl:variable>
+                                                        <xsl:copy-of select="$sumy"/>
+                                                    </strow>
+                                                </xsl:for-each-group>
+                                            </compare>
+                                        </xsl:variable>
+                                            <!--<xsl:copy-of select="$compare"/>-->
+                                        <strow>
+                                            <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Sprzed)"/></stentry>
+                                            <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Sprzed)"/></stentry>
+                                            
+                                            <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Waga_sprzed)"/></stentry>
+                                            <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Waga_sprzed)"/></stentry>
+                                            
+                                            <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Waga_zw)"/></stentry>
+                                            <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Waga_zw)"/></stentry>
+                                            
+                                            <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Wart_zw)"/></stentry>
+                                            <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Wart_zw)"/></stentry>
+                                            
+                                          <!--  <stentry><xsl:value-of select="$compare/compare/strow[1]/round(Wart_zw)"/></stentry>
+                                            <stentry><xsl:value-of select="$compare/compare/strow[2]/round(Wart_zw)"/></stentry>
+                                            -->
+                                            <stentry><xsl:value-of select="$compare/compare/strow[1]/round(wynik)"/></stentry>
+                                            <stentry><xsl:value-of select="$compare/compare/strow[2]/round(wynik)"/></stentry>
+                                            
+                                        </strow>
+                                        
+                                    </simpletable>
+                                </xsl:for-each-group>
+                           
+                        
+                    
+                </body>
+            </topic>
+            
+               
+            
+        </xsl:for-each-group>
+    </xsl:template>
+    
+    
+    <xsl:template match="*" mode="sumy">
+        <xsl:param name="current-group" required="yes"/>
+        
+            <xsl:choose>
+                <xsl:when test="name()='JM' or name()='Grupa' or name()='Nazwa' or name()='Waga' or name()='wynik'"><!--<xsl:element name="{name()}"><xsl:value-of select="."/></xsl:element>--></xsl:when>
+                <xsl:otherwise>
+                    <xsl:element name="{name()}">
+                    <!--<xsl:attribute name="suma" select="'suma'"/>-->
+                    <!--name:<xsl:value-of select="$current-group/node()[ name() = current()/name()]/name()"/> sum-->  <!--<xsl:value-of select="$current-group/node()[ name() = current()/name()]"/>-->
+                    <xsl:value-of select=" sum( $current-group/node()[ name() = current()/name()]/number(text()))"/>
+                    </xsl:element>
+                </xsl:otherwise>
+            </xsl:choose>
+            
+        
+    </xsl:template>
+    
+    <xsl:template match="workbook">
+        <xsl:apply-templates />        
+    </xsl:template>
+    
+    
+    
+    <xsl:template match="sheetData">
+            
+            <xsl:variable name="row_month" select="row[c[v='wrzesień']]/@r"/>
+            
+            <xsl:variable name="detect_sheet_format">
+                <xsl:call-template name="detect_sheet_format">
+                    <xsl:with-param name="row_1" select="row[ position() = 1]"/>
+                </xsl:call-template>
+            </xsl:variable>
+            
+                <xsl:apply-templates mode="raszczyk_row_prod">
+                    <xsl:with-param name="detect_sheet_format" select="$detect_sheet_format"/>
+                    <xsl:with-param name="sheet_name" select="@sheet_name"/>
+                    <xsl:with-param name="row_month" select="$row_month"/>
+                </xsl:apply-templates>
+        
+        
+    </xsl:template>
+    
+    
+    <xsl:template match="row[ position() = 1]" mode="raszczyk_row_prod"/>
+        
+        
+        
+    <xsl:template match="row" mode="raszczyk_row_prod">
+        <xsl:param name="detect_sheet_format" required="yes"/>
+        <xsl:param name="sheet_name" required="yes"/>
+        <xsl:param name="row_month" required="yes"/>
+        <xsl:choose>
+            <xsl:when test="$row_month = @r or ( $row_month + 1 ) = @r">
+                <xsl:comment>#101 bypased row with month sign <xsl:value-of select="@r"/></xsl:comment>
+            </xsl:when>
+            <xsl:otherwise>
+                <row>
+                    <xsl:attribute name="sheet_name" select=" normalize-space($sheet_name)"/>
+                    <xsl:choose>
+                        <xsl:when test="@r &lt; $row_month">
+                            <xsl:attribute name="miesiac" select="'biezacy'"/>
+                        </xsl:when>
+                        <xsl:otherwise><xsl:attribute name="miesiac" select="'poprzedni'"/></xsl:otherwise>
+                    </xsl:choose>
+                    <xsl:attribute name="row_month" select="$row_month"/>
+                    <xsl:attribute name="r" select="@r"/>
+                    <xsl:variable name="c" select="c"/>
+                    <xsl:for-each select="$detect_sheet_format/detect_sheet_format/*">
+                        <xsl:element name="{name()}">
+                            <!--<xsl:value-of select="$c/c[2]"/>-->
+                            <xsl:value-of select=" normalize-space($c[@col = current()/@col])"/>
+                        </xsl:element>
+                    </xsl:for-each>
+                </row>
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+    
+    
+    <xsl:template name="detect_sheet_format">
+        <xsl:param name="row_1"/>
+        <detect_sheet_format>
+            <xsl:for-each select="$row_1/c">
+                <xsl:choose>
+                    <xsl:when test="v/text() = 'Grupa'">
+                        <Grupa>
+                            <xsl:attribute name="col" select="@col"/>
+                        </Grupa>
+                    </xsl:when>
+                    <xsl:when test="v/text() = 'Nazwa wyrobu'">
+                        <Nazwa>
+                            <xsl:attribute name="col" select="@col"/>
+                        </Nazwa>
+                    </xsl:when>
+                    <xsl:when test="v/text() = 'Cena'">
+                        <Cena>
+                            <xsl:attribute name="col" select="@col"/>
+                        </Cena>
+                    </xsl:when>
+                    <xsl:when test="v/text() = 'Waga j.'">
+                        <Waga>
+                            <xsl:attribute name="col" select="@col"/>
+                        </Waga>
+                    </xsl:when>
+                    <xsl:when test="v/text() = 'JM'">
+                        <JM>
+                            <xsl:attribute name="col" select="@col"/>
+                        </JM>
+                    </xsl:when>
+                    <xsl:when test="v/text() = 'Il.sp.'">
+                        <Sprzed>
+                            <xsl:attribute name="col" select="@col"/>
+                        </Sprzed>
+                    </xsl:when>
+                    <xsl:when test="v/text() = 'Waga sp.'">
+                        <Waga_sprzed>
+                            <xsl:attribute name="col" select="@col"/>
+                        </Waga_sprzed>
+                    </xsl:when>
+                    <xsl:when test="v/text() = 'Wart.sp.'">
+                        <Wart_sprzed>
+                            <xsl:attribute name="col" select="@col"/>
+                        </Wart_sprzed>
+                    </xsl:when>
+                    <xsl:when test="v/text() = 'Waga Zw.'">
+                        <Waga_zw>
+                            <xsl:attribute name="col" select="@col"/>
+                        </Waga_zw>
+                    </xsl:when>
+                    <xsl:when test="v/text() = 'Wart.Zw.'">
+                        <Wart_zw>
+                            <xsl:attribute name="col" select="@col"/>
+                        </Wart_zw>
+                    </xsl:when>
+                    <xsl:when test="v/text() = 'Il.Zw.'">
+                        <Il_zw>
+                            <xsl:attribute name="col" select="@col"/>
+                        </Il_zw>
+                    </xsl:when>
+                    <xsl:when test="v/text() = 'Sprzedaż faktyczna= il.sp.-il.zw'">
+                        <Sprz_fakt>
+                            <xsl:attribute name="col" select="@col"/>
+                        </Sprz_fakt>
+                    </xsl:when>
+                    <xsl:when test="v/text() = 'koszt wytworzenia produktu'">
+                        <Koszt_Produktu>
+                            <xsl:attribute name="col" select="@col"/>
+                        </Koszt_Produktu>
+                    </xsl:when>
+                </xsl:choose>
+            </xsl:for-each>
+                
+            
+        </detect_sheet_format>
+        
+    </xsl:template>
+    
+    
+    
+    <!--<xsl:template mode="product_groups">
+        
+        
+    </xsl:template>-->
+    <xsl:function name="build_stock_optimize_calculations_raszczyk:koszt_wytworzenia">
+        <xsl:param name="Nazwa"/>
+            <xsl:choose>
+                <xsl:when test=" count($build_stock_optimize_calculations_raszczyk:koszty_wytworzenia.xml//row[Nazwa = $Nazwa]) &gt; 1">
+                    <xsl:message>#789A PODWOJNA CENA KOSZTU DLA <xsl:value-of select="$Nazwa"/></xsl:message>
+                    <xsl:value-of select="$build_stock_optimize_calculations_raszczyk:koszty_wytworzenia.xml//row[Nazwa = $Nazwa][1]/KOSZTYSUROWCA"/>
+                </xsl:when>
+                <xsl:when test="$build_stock_optimize_calculations_raszczyk:koszty_wytworzenia.xml//row[Nazwa = $Nazwa]/KOSZTYSUROWCA">
+                    <xsl:value-of select="$build_stock_optimize_calculations_raszczyk:koszty_wytworzenia.xml//row[Nazwa = $Nazwa]/KOSZTYSUROWCA"/>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:message>#789 Nie znany produkt <xsl:value-of select="$Nazwa"/></xsl:message>
+                </xsl:otherwise>
+            </xsl:choose>
+    </xsl:function>
+    
+    
+    <xsl:template match="koszty_wytworzenia.csv" mode="build_stock_optimize_calculations_raszczyk:koszty_wytworzenia.xml" xpath-default-namespace="build_stock_optimize_calculations_raszczyk">
+        <koszty_wytworzenia.xml>
+            <xsl:for-each select=" tokenize( text(),'\n')">
+                <row>
+                <xsl:for-each select="tokenize(.,';')">
+                    <xsl:choose>
+                        <xsl:when test=" position()=1">
+                            <Nazwa><xsl:value-of select="."/></Nazwa>
+                        </xsl:when>
+                        <xsl:when test=" position()=2">
+                            <JM><xsl:value-of select="."/></JM>
+                        </xsl:when>
+                        <xsl:when test=" position()=3">
+                            <KOSZTYSUROWCA><xsl:value-of select="."/></KOSZTYSUROWCA>
+                        </xsl:when>
+                        <xsl:when test=" position()=4">
+                            <KOSZTPRACY><xsl:value-of select="."/></KOSZTPRACY>
+                        </xsl:when>
+                        <xsl:otherwise><col><xsl:value-of select="."/></col></xsl:otherwise>
+                    </xsl:choose>
+                    
+                </xsl:for-each>
+                </row>
+            </xsl:for-each>
+        </koszty_wytworzenia.xml>
+    </xsl:template>
+    
+    
+    
+    <xsl:template match="*"/>
+    
+    <xsl:template match="text()|comment()"/>
+    
+</xsl:stylesheet>

+ 7 - 1
SE/schema/default_db_xml_cache.public/build_ant_universal_by_xsl_match.xsl

@@ -29,7 +29,7 @@
     <xsl:param name="parallel" select="false()"/> <!-- if true will run in parallel using java parallel -->
     <xsl:param name="threadCount" select="10"/>
     <xsl:param name="ant-launcher.jar" required="yes"/>
-    
+    <!--<xsl:param name="external_schema_table.path" required="yes"/>-->
     
     
     <xsl:template mode="build_element_complexType.xml build_tr_map.xml" match="system_cache__appinfo:element_complexType"> <!-- for type generate in main build.xml mode -->
@@ -85,6 +85,9 @@
             <param name="procesy5_system_schema_file" >
                 <xsl:attribute name="expression" select="'${procesy5_system_schema.xml}'"/>
             </param>
+            <param name="external_schema_table.path" >
+                <xsl:attribute name="expression" select="'${external_schema_table.path}'"/>
+            </param>
             <classpath location="/opt/local/share/java/saxon9he.jar"/>
         </xslt>
             <delete>
@@ -133,6 +136,9 @@
                 <param name="procesy5_system_schema_file" >
                     <xsl:attribute name="expression" select="'${procesy5_system_schema.xml}'"/>
                 </param>
+                <param name="external_schema_table.path" >
+                    <xsl:attribute name="expression" select="'${external_schema_table.path}'"/>
+                </param>
                 <classpath location="/opt/local/share/java/saxon9he.jar"/>
             </xslt>
             <delete>

+ 1379 - 0
SE/schema/default_db_xml_cache.public/build_object_install_se_ant_object.xsl

@@ -0,0 +1,1379 @@
+<?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"
+    exclude-result-prefixes="xs"
+    version="2.0">
+    
+    <xsl:output indent="yes"/>
+    <xsl:strip-space elements="*"/>
+    
+    <!--<xsl:include href="system_cache__appinfo/TargetNamespaceBindings.xsl"/>-->
+    <!--<xsl:include href="system_cache__appinfo/external_schema_targetNamespace.xsl"/>-->
+    
+    <xsl:include href="../default_db_xml_cache/build_complexType.xsl"/>
+    
+    
+    <xsl:param name="NamespaceBinding.xml" required="yes"/> <!-- to set propery install prefix -->
+    <xsl:param name="vrtfNamespaces.xml" required="yes"/>
+    <!--<xsl:param name="external_schema_table.path" required="yes"/>-->
+    
+    
+    <xsl:variable name="NamespaceBinding" select="doc($NamespaceBinding.xml)"/>
+    
+    <xsl:variable name="system_cache__appinfo:vrtfNamespaces" select="doc($vrtfNamespaces.xml)"/>
+    
+    
+   
+   
+   
+    <xsl:template match="system_cache__appinfo:get_all_xsd_list" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external">
+        <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external>
+            <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external"/>
+        </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external>
+    </xsl:template>
+   
+    <xsl:template match="system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external"/>
+        
+   
+    <xsl:template match="system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external">
+        <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external">
+            <xsl:with-param name="system_cache__appinfo:document-uri-orig" select="@system_cache__appinfo:document-uri-orig"/>
+        </xsl:apply-templates>
+    </xsl:template>
+    
+    <!-- XXXXXX MAIN XXXX MAIN XXXX -->
+    <xsl:template match="schema" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="system_cache__appinfo:document-uri-orig" required="yes"/>
+        <xsl:variable name="targetNamespace" select="@targetNamespace"/>
+        <xsl:variable name="prefix" select="system_cache__appinfo:prefix_from_targetNamespace($system_cache__appinfo:vrtfNamespaces,@targetNamespace)"/>
+        <!--<prefix>
+            <xsl:attribute name="look_for" select="@targetNamespace"/>
+            <xsl:attribute name="found" select="$system_cache__appinfo:vrtfNamespaces//node()[local-name()='ns'][@uri=$targetNamespace][1]/@prefix" />
+            <!-\-<xsl:copy-of select="$vrtfNamespaces"/>-\->
+        </prefix>-->
+        <xsl:variable name="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external">
+            <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external">
+                <xsl:with-param name="prefix" select="$prefix"/>
+                <xsl:with-param name="targetNamespace" select="@targetNamespace"/>
+                <xsl:with-param name="prefix_root" select="$prefix"/>
+                <xsl:with-param name="targetNamespace_root" select="@targetNamespace"/>
+                <xsl:with-param name="system_cache__appinfo:document-uri-orig"></xsl:with-param>
+            </xsl:apply-templates>
+        </xsl:variable>
+        
+        
+        <xsl:variable name="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external">
+            <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external>
+                <xsl:copy-of select="$system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external"/>
+            </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external>
+        </xsl:variable>
+        
+        <xsl:copy-of select="$system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external"/>
+        <!--<xsl:for-each select="$system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external//system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables">
+            
+        </xsl:for-each>-->
+        <xsl:variable name="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables">
+            <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables>
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables" select="$system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external//system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root/*">
+                    <xsl:with-param name="generate_tables_from_external_root.required_by.path_init" select="1"/>
+                </xsl:apply-templates>
+             </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables>
+        </xsl:variable>
+        
+        
+        <xsl:copy-of select="$system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables"/>
+        
+        
+        
+        <xsl:for-each-group select="$system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables/system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables/*"  group-by="@targetNamespace">
+            <xsl:variable name="schema.prefix" select="@prefix"/>
+            <xsl:variable name="schema.targetNamespace" select="@targetNamespace"/>
+            <xsl:variable name="schema">
+                <xsl:element name="schema" namespace="http://www.w3.org/2001/XMLSchema">
+                    <!--<xsl:attribute name="namespace" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix,@generate_tables_from_external_root.path.last_token)"/>-->
+                    <!--<xsl:attribute name="namespace_val" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace(@system_cache__appinfo:namespace_uri,@generate_tables_from_external_root.path.last_token)"/>-->
+                    <!--<xsl:namespace name="{$schema.prefix}" select="$schema.targetNamespace"/>-->
+                    
+                    <!-- namespaces all referenced  -->
+                    <xsl:for-each-group select="$system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables//generate_tables_from_external_root.required_by.path_init[@prefix]" group-by="@targetNamespace" xpath-default-namespace="">
+                        <xsl:namespace name="{@prefix}" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace_final(@targetNamespace)"/>
+                    </xsl:for-each-group>
+                    
+                    <xsl:namespace name="{$schema.prefix}" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace_final($schema.targetNamespace)"/>
+                    
+                    <xsl:namespace name="system_cache__appinfo" select="'http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd'"/>
+                    <xsl:namespace name="p5Type" select="'http://biuro.biall-net.pl/p5/schema/types'"/>
+                    <xsl:attribute name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace_final(@targetNamespace)"/> <!-- system_cache__appinfo:object_install_se_ant_object.create_targetNamespace_final(concat(@targetNamespace,'/',@generate_tables_from_external_root.path.last_token)) -->
+                        <!--<xsl:copy-of select="@*"/>-->
+                        <xsl:apply-templates select="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables_schema"/>
+                    <xsl:attribute name="system_cache__appinfo:document-uri-orig" select="$system_cache__appinfo:document-uri-orig"/>
+                    <xsl:comment>#92 including</xsl:comment>
+                    <!--<generate_tables_from_external_root.required_by.path_init>
+                        <xsl:copy-of select=" current-group()/generate_tables_from_external_root.required_by.path_init/*" xpath-default-namespace=""/>
+                    </generate_tables_from_external_root.required_by.path_init>-->
+                    <xsl:for-each-group select="current-group()/generate_tables_from_external_root.required_by.path_init/*[@prefix and not(@prefix = current()/@prefix) ]" group-by="@targetNamespace" xpath-default-namespace="">
+                        <xsl:element name="import" namespace="http://www.w3.org/2001/XMLSchema">
+                            <xsl:attribute name="namespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace_final(@targetNamespace)"/>
+                            <xsl:attribute name="schemaLocation" select="concat(@prefix,'.xsd')"/>
+                        </xsl:element>
+                    </xsl:for-each-group>
+                    <xsl:comment>#81 now groping by type and @lat_token</xsl:comment>
+                    <xsl:for-each-group select="current-group()" group-by="concat(@targetNamespace,name())">
+                        <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_schema" select=".">
+                            <xsl:with-param name="prefix" select="$prefix"/>
+                            <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                            <xsl:with-param name="prefix_root" select="$prefix"/>
+                            <xsl:with-param name="targetNamespace_root" select="$targetNamespace"/>
+                        </xsl:apply-templates>
+                    </xsl:for-each-group>
+                </xsl:element>
+            </xsl:variable>
+            <xsl:copy-of select="$schema"/>
+            <xsl:comment>#123 saving to <xsl:value-of select="concat($external_schema_table.path,'/',$system_cache__appinfo:document-uri-orig,'/',$schema.prefix,'.xsd')"/></xsl:comment>
+            <xsl:result-document href="{ concat($external_schema_table.path,'/',$system_cache__appinfo:document-uri-orig,'/',$schema.prefix,'.xsd')}">
+                <xsl:copy-of select="$schema"/>
+            </xsl:result-document>
+            
+            <xsl:message>#135 ant-object install - todo dependency, than install </xsl:message>
+            <xsl:for-each select="$schema/schema/element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+                <xsl:variable name="ant-obj-save-path" select="system_cache__appinfo:object_install_se_ant_object.save_to_ant-object-path($system_cache__appinfo:document-uri-orig,$schema.prefix,@name)"/>
+                <xsl:message >#138 $ant-obj-save-path element/@name=<xsl:value-of select="@name"/> <xsl:value-of select="$ant-obj-save-path"/></xsl:message>
+                
+                <xsl:result-document href="{$ant-obj-save-path}">
+                    <xsl:apply-templates select="../../."  mode="system_cache__appinfo:object_install_se_ant_object.ant-object.unique_element">
+                        <xsl:with-param name="name" select="@name"/>
+                    </xsl:apply-templates>
+                </xsl:result-document>
+                <xsl:result-document href="{system_cache__appinfo:object_install_se_ant_object.save_to_ant-object-path.build_xml( $system_cache__appinfo:document-uri-orig,$schema.prefix,@name)}">
+                    <empty/>
+                </xsl:result-document>
+            </xsl:for-each>
+        </xsl:for-each-group>
+        
+        
+        
+    </xsl:template>
+    
+    <xsl:template match="schema" mode="system_cache__appinfo:object_install_se_ant_object.ant-object.unique_element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" >
+        <xsl:param name="name" required="yes"/>
+        <xsl:element name="{name()}"  namespace="http://www.w3.org/2001/XMLSchema">
+            <xsl:copy-of select="namespace::node()"/>
+            <xsl:copy-of select="@*"/>
+            <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.ant-object.unique_element">
+                <xsl:with-param name="name" select="$name"/>
+            </xsl:apply-templates>
+        </xsl:element>
+    </xsl:template>
+    
+    <xsl:template match="element[@name]" mode="system_cache__appinfo:object_install_se_ant_object.ant-object.unique_element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" >
+        <xsl:param name="name" required="yes"/>
+        <xsl:choose>
+            <xsl:when test="@name=$name">
+                <xsl:copy-of select="."/>
+            </xsl:when>
+        </xsl:choose>
+    </xsl:template>
+    
+    <xsl:template match="complexType|simpleType|import" mode="system_cache__appinfo:object_install_se_ant_object.ant-object.unique_element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" >
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    <!--<xsl:template match="schema[ not(@targetNamespace = 'external_schema__ksiegi_wieczyste__zsin_1013.xsd')]" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:comment>#67 temporary bypased : <xsl:value-of select="@targetNamespace"/> ;  to analyze one schema scenario!</xsl:comment>
+    </xsl:template>-->
+            
+    
+    <!-- EOF XXXXXX MAIN XXXX MAIN XXXX -->
+    
+    
+    <!-- (((( SCHEMA PARSERS PREFIX NAMESPACES ))) -->
+         <xsl:template match="*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_schema">
+             <xsl:param name="targetNamespace" required="yes"/>
+             <xsl:param name="prefix" required="yes"/>
+             <xsl:param name="prefix_root"  required="yes"/>
+             <xsl:param name="targetNamespace_root" required="yes"/>
+             <xsl:element name="{name()}">
+                 <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_schema" select="@*">
+                     <xsl:with-param name="generate_tables_from_external_root.path.last_token" select="@generate_tables_from_external_root.path.last_token"/>
+                     <xsl:with-param name="prefix" select="$prefix"/>
+                     <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                     <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                 </xsl:apply-templates>
+                 <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_schema">
+                     <xsl:with-param name="prefix" select="$prefix"/>
+                     <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                     <xsl:with-param name="prefix_root" select="$prefix"/>
+                     <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                 </xsl:apply-templates>
+             </xsl:element>
+         </xsl:template>
+    
+        <xsl:template match="generate_tables_from_external_root.required_by.path_init" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_schema">
+            <xsl:comment>#139 to include <xsl:value-of select=".//@generate_tables_from_external_root.required_by.path"/></xsl:comment>
+        </xsl:template>
+         
+        <xsl:template match="@targetNamespace|@generate_tables_from_external_root.name|@generate_tables_from_external_root.path|@prefix|@generate_tables_from_external_root.path.last_token" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_schema"/>
+            
+        
+         
+         <xsl:template match="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_schema">
+             <xsl:copy-of select="."/>
+         </xsl:template>
+         
+         <!--<xsl:template match="@type|@ref" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_schema">
+             <!-\-<xsl:param name="targetNamespace" required="yes"/>-\->
+             <xsl:param name="prefix" required="yes"/>
+             <xsl:param name="generate_tables_from_external_root.path.last_token" required="yes"/>
+             <xsl:param name="prefix_root"  required="yes"/>
+             <xsl:param name="targetNamespace_root" required="yes"/>
+             <xsl:choose>
+                 <xsl:when test="system_cache__appinfo:targetNamespace_from_prefix($system_cache__appinfo:vrtfNamespaces, system_cache__appinfo:get_prefix_from_element(.)) = 'http://www.w3.org/2001/XMLSchema'">
+                     <xsl:attribute name="{name()}" select="."/>
+                 </xsl:when>
+                 <xsl:otherwise>
+                     <xsl:attribute name="{name()}" select="concat( system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix,$generate_tables_from_external_root.path.last_token),':', current()  )"/>
+                 </xsl:otherwise>   
+             </xsl:choose>
+             
+         </xsl:template>-->
+        
+    
+    <!-- (((( EOF SCHEMA PARSERS PREFIX NAMESPACES ))) -->
+    
+    
+    
+    
+    
+    <xsl:template match="element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external">
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <xsl:variable name="element" select="@name"/>
+        <xsl:variable name="element-filename" >
+            <xsl:choose>
+                <xsl:when test="$prefix">
+                    <xsl:value-of select="system_cache__appinfo:escape_object_prefix_to_string(concat($prefix,':',$element))"/>
+                </xsl:when>
+                <xsl:when test="$targetNamespace">
+                    <xsl:value-of select="system_cache__appinfo:escape_object_prefix_to_string(concat($targetNamespace,':',$element))"/>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:value-of select="system_cache__appinfo:escape_object_prefix_to_string($element)"/>
+                </xsl:otherwise>
+            </xsl:choose>
+        </xsl:variable>
+        <xsl:variable name="prefixed_object_info">
+            <xsl:call-template name="system_cache__appinfo:prefixed_object_info">
+                <xsl:with-param name="prefixed_object" select="$element-filename"/>
+            </xsl:call-template>
+        </xsl:variable>
+        <xsl:variable name="prefix_token" select="tokenize(system_cache__appinfo:translate_object_escaped_prefix_from_string($element-filename),':')"/>
+        <xsl:variable name="translate_object_escaped_prefix_from_string" select="system_cache__appinfo:translate_object_escaped_prefix_from_string($element-filename)"/>
+        
+        <system_cache__appinfo:build_element>
+            <xsl:copy-of select="@*"/>
+            <xsl:attribute name="namespace_uri_param" select="$targetNamespace"/>
+            <xsl:attribute name="prefix" select="$prefix"/>
+            <xsl:attribute name="element-filename" select="$element-filename"/>
+            <!--<xsl:attribute name="id" select="@id"/>-->
+            <xsl:attribute name="translate_object_escaped_prefix_from_string" select="$translate_object_escaped_prefix_from_string"/>
+            <xsl:if test="$debug_level &gt; 4">
+                <prefix_token>
+                    <xsl:copy-of select="$prefix_token"/>
+                </prefix_token>
+                <prefixed_object_info>
+                    <xsl:copy-of select="$prefixed_object_info"/>
+                </prefixed_object_info>
+            </xsl:if>
+            <xsl:element name="{name()}">
+                <xsl:copy-of select="@*"/>
+                     <xsl:variable name="build_element_cache">
+                         <xsl:call-template name="system_cache__appinfo:build_element">
+                             <xsl:with-param name="element" select="@name"/>
+                             <xsl:with-param name="prefix" select="$prefix"/>
+                             <xsl:with-param name="namespace_uri_param" select="$targetNamespace"/>
+                         </xsl:call-template>
+                     </xsl:variable>
+                     <cache>
+                     <xsl:copy-of select="$build_element_cache"/>
+                     </cache>
+                     <xsl:variable name="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root">
+                         <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+                             <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root" select="$build_element_cache">
+                                 <xsl:with-param name="prefix" select="$prefix"/>
+                                 <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                                 <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                                 <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                             </xsl:apply-templates>
+                         </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+                     </xsl:variable>
+                     <!--<xsl:if test="$debug_level &gt; 4">-->
+                         <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+                             <xsl:copy-of select="$system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root"/>
+                         </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+                     <!--</xsl:if>-->
+                     <!--<system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables>
+                         <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables" select="$system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root//system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root/*"/>
+                     </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables>-->   
+            </xsl:element>
+        </system_cache__appinfo:build_element>
+    </xsl:template>
+    
+    <xsl:template match="complexType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external">
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <xsl:variable name="element" select="@name"/>
+        <xsl:variable name="element-filename" >
+            <xsl:choose>
+                <xsl:when test="$prefix">
+                    <xsl:value-of select="system_cache__appinfo:escape_object_prefix_to_string(concat($prefix,':',$element))"/>
+                </xsl:when>
+                <xsl:when test="$targetNamespace">
+                    <xsl:value-of select="system_cache__appinfo:escape_object_prefix_to_string(concat($targetNamespace,':',$element))"/>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:value-of select="system_cache__appinfo:escape_object_prefix_to_string($element)"/>
+                </xsl:otherwise>
+            </xsl:choose>
+        </xsl:variable>
+        <xsl:variable name="prefixed_object_info">
+            <xsl:call-template name="system_cache__appinfo:prefixed_object_info">
+                <xsl:with-param name="prefixed_object" select="$element-filename"/>
+            </xsl:call-template>
+        </xsl:variable>
+        <xsl:variable name="prefix_token" select="tokenize(system_cache__appinfo:translate_object_escaped_prefix_from_string($element-filename),':')"/>
+        <xsl:variable name="translate_object_escaped_prefix_from_string" select="system_cache__appinfo:translate_object_escaped_prefix_from_string($element-filename)"/>
+        <xsl:message>#186 parsing CT: <xsl:value-of select="@name"/>  ; </xsl:message>
+        
+        <system_cache__appinfo:build_complexType>
+            <xsl:copy-of select="@*"/>
+            <xsl:attribute name="namespace_uri_param" select="$targetNamespace"/>
+            <xsl:attribute name="prefix" select="$prefix"/>
+            <xsl:attribute name="element-filename" select="$element-filename"/>
+            <xsl:attribute name="translate_object_escaped_prefix_from_string" select="$translate_object_escaped_prefix_from_string"/>
+            <xsl:if test="$debug_level &gt; 4">
+             <prefix_token>
+                 <xsl:copy-of select="$prefix_token"/>
+             </prefix_token>
+             <prefixed_object_info>
+                <xsl:copy-of select="$prefixed_object_info"/>
+            </prefixed_object_info>
+            </xsl:if>
+            <xsl:variable name="build_element_cache">
+                <xsl:call-template name="system_cache__appinfo:build_complexType">
+                    <xsl:with-param name="complexType" select="@name"/>
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="namespace_uri_param" select="$targetNamespace"/>
+                </xsl:call-template>
+            </xsl:variable>
+            <cache>
+            <xsl:copy-of select="$build_element_cache"/>
+            </cache>
+            <xsl:element name="{name()}">
+                    <xsl:copy-of select="@*"/>
+                    <xsl:variable name="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root">
+                        <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+                            <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root" select="$build_element_cache">
+                                <xsl:with-param name="prefix" select="$prefix"/>
+                                <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                                <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                                <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                            </xsl:apply-templates>
+                        </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+                    </xsl:variable>
+                    <!--<xsl:if test="$debug_level &gt; -1">-->
+                            <xsl:copy-of select="$system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root"/>                
+                    <!--</xsl:if>-->  
+                    <!--<system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables>
+                        <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables" select="$system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root//system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root/*"/>
+                    </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables>-->   
+            </xsl:element>
+        </system_cache__appinfo:build_complexType>
+    </xsl:template>
+    
+    <xsl:template match="simpleType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external"/>
+        
+    
+    
+    
+    
+    
+    <xsl:template match="element" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="generate_tables_from_external_root.name" select="@name"/>
+        <xsl:param name="generate_tables_from_external_root.path" select="@name"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        
+        <xsl:variable name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace,@name)"/>
+        <xsl:variable name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix,@name)"/>
+        <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+            <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+            <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
+            <xsl:attribute name="prefix" select="$prefix"/>
+            <xsl:attribute name="targetNamespace" select="$targetNamespace"/>
+            <xsl:comment>#135 root element without @type - ...force_refered_complexType (add path) </xsl:comment>
+            <xsl:element name="{name()}">
+                <xsl:apply-templates select="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root_element_force_type">
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_force_refered_complexType">
+                    <xsl:with-param name="name" select="@name"/>
+                    <xsl:with-param name="generate_tables_from_external_root.path" select="concat($generate_tables_from_external_root.path,'/',$generate_tables_from_external_root.name)"/>
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+            </xsl:element>
+        </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+    </xsl:template>
+    
+    
+    <xsl:template match="complexType" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="generate_tables_from_external_root.name" select="@name"/>
+        <xsl:param name="generate_tables_from_external_root.path" select="@name"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        
+        <xsl:variable name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace,@name)"/>
+        <xsl:variable name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix,@name)"/>
+        <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+            <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+            <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
+            <xsl:attribute name="prefix" select="$prefix"/>
+            <xsl:attribute name="targetNamespace" select="$targetNamespace"/>
+            <xsl:comment>#374 root CT without @type - ? maybe force element? or should be forced from another leafes? </xsl:comment>
+            <xsl:element name="{name()}">
+                <xsl:copy-of select="@*"/>
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child">
+                    <xsl:with-param name="generate_tables_from_external_root.path" select="concat($generate_tables_from_external_root.path,'/',$generate_tables_from_external_root.name)"/>
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+            </xsl:element>
+        </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+    </xsl:template>
+    
+    
+    
+    
+    <xsl:template match="element" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root_child" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="generate_tables_from_external_root.name" select="@name"/>
+        <xsl:param name="generate_tables_from_external_root.path" select="@name"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+         <!--<xsl:variable name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace,@name)"/>
+        <xsl:variable name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix,@name)"/>-->
+        <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+            <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+            <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
+            <xsl:attribute name="prefix" select="$prefix"/>
+            <xsl:attribute name="targetNamespace" select="$targetNamespace"/>
+            <xsl:attribute name="debug_372_root_CT" select="system_cache__appinfo:object_install_se_ant_object.root_complextype( complexType,@name)"/>
+            <xsl:comment>#344A  TODO  fi create ? root_child element without @type - ...force_refered_complexType (not add path) </xsl:comment>
+            <xsl:element name="{name()}">
+                <xsl:apply-templates select="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root_element_force_type">
+                    <xsl:with-param name="prefix" select="$prefix"/> <!-- system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix,system_cache__appinfo:object_install_se_ant_object.root_complextype( complexType,@name)) -->
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+                <xsl:comment> #344A - was but not good - suppresed processing - type should be defined in another leaf</xsl:comment>
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_force_refered_complexType_root">
+                    <xsl:with-param name="name" select="@name"/>
+                    <xsl:with-param name="generate_tables_from_external_root.path" select="concat($generate_tables_from_external_root.path,'/',$generate_tables_from_external_root.name)"/>
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+            </xsl:element>
+        </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+    </xsl:template>
+    
+    
+    <!--<xsl:template match="element[complexType]" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root_child" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="generate_tables_from_external_root.name" select="@name"/>
+        <xsl:param name="generate_tables_from_external_root.path" select="@name"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <!-\-<xsl:variable name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace,@name)"/>
+        <xsl:variable name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix,@name)"/>-\->
+        <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+            <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+            <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
+            <xsl:attribute name="prefix" select="$prefix"/>
+            <xsl:attribute name="targetNamespace" select="$targetNamespace"/>
+            <xsl:attribute name="debug_372_root_CT" select="system_cache__appinfo:object_install_se_ant_object.root_complextype( complexType,@name)"/>
+            <xsl:comment>#344Z  RODZAJ_BUDYNKU/ </xsl:comment>
+            <xsl:element name="{name()}">
+                <xsl:apply-templates select="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root_element_force_type">
+                    <xsl:with-param name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix_root,system_cache__appinfo:object_install_se_ant_object.root_complextype( complexType,@name))"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+                <xsl:comment> #344Z RODZAJ_BUDYNKU/ </xsl:comment>
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_force_refered_complexType_root">
+                    <xsl:with-param name="name" select="@name"/>
+                    <xsl:with-param name="generate_tables_from_external_root.path" select="concat($generate_tables_from_external_root.path,'/',$generate_tables_from_external_root.name)"/>
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+            </xsl:element>
+        </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+    </xsl:template>-->
+    
+    <xsl:template match="complexType[complexType/@name]" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="generate_tables_from_external_root.name" select="@name"/>
+        <xsl:param name="generate_tables_from_external_root.path" select="@name"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        
+        <xsl:variable name="root_type" select="child::node()"/>
+        
+        <xsl:variable name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace, system_cache__appinfo:object_install_se_ant_object.root_complextype( complexType,@name) )"/>
+        <xsl:variable name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix,system_cache__appinfo:object_install_se_ant_object.root_complextype( complexType,@name))"/>
+        
+        <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+            <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+            <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
+            
+            <xsl:attribute name="prefix" select="$prefix"/>
+            <xsl:attribute name="targetNamespace" select="$targetNamespace"/>
+            <xsl:comment>#259 root complexType with complexContent/extension/@base = complexType/@name - native element - to be detected last derivation</xsl:comment>
+            <xsl:element name="{name()}">
+                <xsl:copy-of select="@*"/>
+                <xsl:element name="complexContent" namespace="http://www.w3.org/2001/XMLSchema">
+                    <xsl:element name="extension" namespace="http://www.w3.org/2001/XMLSchema" >
+                        <xsl:attribute name="base" select="complexType/@name"/>
+                        <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_force_refered_element" select=".">
+                            <xsl:with-param name="name" select="complexType/@name"/>
+                            <xsl:with-param name="generate_tables_from_external_root.path" select="concat($generate_tables_from_external_root.path,'/',$generate_tables_from_external_root.name,'/',complexType/@name)"/>
+                            <xsl:with-param name="prefix" select="$prefix"/>
+                            <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                            <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                            <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                        </xsl:apply-templates>
+                    </xsl:element>
+                </xsl:element>
+            </xsl:element>
+        </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+    </xsl:template>
+    
+    
+    <xsl:template match="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_ref_to_root">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    <xsl:template match="@ref" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_ref_to_root">
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <xsl:attribute name="{name()}" select=" concat($prefix,':', system_cache__appinfo:clean_object_prefix(current()))"/>
+    </xsl:template>
+    
+    <xsl:template match="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root_element_force_type">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    <xsl:template match="@type" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root_element_force_type"/>
+        
+    
+    <xsl:template match="@name" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root_element_force_type">
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+       <!-- <xsl:attribute name="debug_422_prefix" select="$prefix"/>
+        <xsl:attribute name="debug_422_current" select=" current()"/>-->
+        <xsl:attribute name="type" select=" concat($prefix,':', current())"/>
+        <xsl:attribute name="name" select="."/>
+        
+    </xsl:template>
+    
+    <xsl:template match="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root_element_force_type_element">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    <xsl:template match="@type" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root_element_force_type_element">
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <!-- <xsl:attribute name="debug_422_prefix" select="$prefix"/>
+        <xsl:attribute name="debug_422_current" select=" current()"/>-->
+        <xsl:attribute name="type" select=" concat($prefix,':', system_cache__appinfo:clean_object_prefix(current() ))"/>
+        
+    </xsl:template>
+    
+    <xsl:template match="element[@type]" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="generate_tables_from_external_root.name" select="@type"/>
+        <xsl:param name="generate_tables_from_external_root.path" select="@name"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <xsl:variable name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace,@name)"/>
+        <xsl:variable name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix,@name)"/>
+        <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+            <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+            <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
+            <xsl:element name="{name()}">
+                <!--<xsl:copy-of select="@*"/>-->
+                <xsl:apply-templates select="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root_element_force_type_element">
+                    <xsl:with-param name="generate_tables_from_external_root.path" select="concat($generate_tables_from_external_root.path,'/',$generate_tables_from_external_root.name)"/>
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+                <xsl:attribute name="targetNamespace" select="$targetNamespace"/>
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child">
+                    <xsl:with-param name="generate_tables_from_external_root.path" select="concat($generate_tables_from_external_root.path,'/',$generate_tables_from_external_root.name)"/>
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+            </xsl:element>
+        </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+    </xsl:template>
+    
+    <xsl:template match="complexType[@type]" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="generate_tables_from_external_root.name" select="@type"/>
+        <xsl:param name="generate_tables_from_external_root.path" select="@type"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+            <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+            <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
+            <xsl:element name="{name()}">
+                <xsl:copy-of select="@*"/>
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child">
+                    <xsl:with-param name="generate_tables_from_external_root.path" select="concat($generate_tables_from_external_root.path,'/',$generate_tables_from_external_root.name)"/>
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+            </xsl:element>
+        </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+    </xsl:template>
+    
+    <xsl:template match="complexType" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="generate_tables_from_external_root.name" select="@type"/>
+        <xsl:param name="generate_tables_from_external_root.path" select="@type"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+            <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+            <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
+            <xsl:comment>#319 complextype std from child</xsl:comment>
+            <xsl:element name="{name()}">
+                <xsl:copy-of select="@*"/>
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child">
+                    <xsl:with-param name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/> <!-- $generate_tables_from_external_root.name -->
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+            </xsl:element>
+        </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+    </xsl:template>
+    
+    <xsl:template match="sequence" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="generate_tables_from_external_root.path" required="yes"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+            <xsl:element name="{name()}">
+                <xsl:copy-of select="@*"/><xsl:comment>#295 seq in child mode</xsl:comment>
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child">
+                    <xsl:with-param name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+            </xsl:element>
+    </xsl:template>
+    
+    <xsl:template match="simpleType" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
+        
+    
+    <xsl:template match="element[@ref]" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+            <xsl:element name="{name()}">
+                <xsl:choose>
+                    <xsl:when test="system_cache__appinfo:object_install_se_ant_object.root_complextype( current(),@ref)"><!-- jest ref do czegos co ma CT -->
+                        <xsl:attribute name="debug_587_root_complextype" select="system_cache__appinfo:object_install_se_ant_object.root_complextype( current(),@ref)"/>
+                        <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_ref_to_root" select="@*">
+                            <xsl:with-param name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix_root, system_cache__appinfo:object_install_se_ant_object.root_complextype(element,@ref))"/>
+                            <xsl:with-param name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace, system_cache__appinfo:object_install_se_ant_object.root_complextype(element,@ref))"/>
+                            <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                            <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                        </xsl:apply-templates>
+                        <generate_tables_from_external_root.required_by.path_init>
+                                <xsl:attribute name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix_root, system_cache__appinfo:object_install_se_ant_object.root_complextype(element,@ref))"/>
+                            <xsl:attribute name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace, system_cache__appinfo:object_install_se_ant_object.root_complextype(element,@ref))"/>
+                            <xsl:attribute name="debug" select="'#749A element[@ref] system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child'"/>
+                        </generate_tables_from_external_root.required_by.path_init>
+                    </xsl:when>
+                    <xsl:otherwise><!-- jest ref tylko do roota -->
+                        <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_ref_to_root" select="@*">
+                            <xsl:with-param name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix_root, system_cache__appinfo:clean_object_prefix(@ref))"/>
+                            <xsl:with-param name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace, system_cache__appinfo:clean_object_prefix(@ref))"/>
+                            <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                            <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                        </xsl:apply-templates>
+                        <generate_tables_from_external_root.required_by.path_init>
+                            <xsl:attribute name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix_root, system_cache__appinfo:clean_object_prefix(@ref))"/>
+                            <xsl:attribute name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace_root, system_cache__appinfo:clean_object_prefix(@ref))"/>
+                            <xsl:attribute name="debug" select="'#749B element[@ref] system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child'"/>
+                        </generate_tables_from_external_root.required_by.path_init>
+                    </xsl:otherwise>
+                </xsl:choose>
+                <xsl:comment>#191 element[@ref] on child - should not be more transformed</xsl:comment>
+                    <!--<xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child"/>-->
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.annotation">
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+            </xsl:element>
+    </xsl:template>
+    
+    <xsl:template match="*|text()|comment()" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.annotation" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
+    
+    <xsl:template match="annotation|appinfo" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.annotation" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <!--<xsl:variable name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace,@name)"/>
+        <xsl:variable name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix,@name)"/>-->
+            <xsl:element name="{name()}">
+                <xsl:copy-of select="@*"/>
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.annotation">
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+            </xsl:element>
+    </xsl:template>
+    
+    <xsl:template match="flat_relation_cache" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.annotation" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" >
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <!--<xsl:variable name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace,@name)"/>
+        <xsl:variable name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix,@name)"/>-->
+        <system_cache__appinfo:flat_relation_cache>
+            <system_cache__appinfo:source>
+                <xsl:apply-templates select="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.annotation">
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+            </system_cache__appinfo:source>
+        </system_cache__appinfo:flat_relation_cache>
+    </xsl:template>
+    
+    
+    
+    <xsl:template match="@system_cache__appinfo:name" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.annotation">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    <xsl:template match="@system_cache__appinfo:xpath" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.annotation">
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        
+        <xsl:variable name="remote_name_obj" select=" system_cache__appinfo:clean_object_prefix(substring-before(.,'/'))"/>
+        <xsl:variable name="remote_name_fld" select=" substring-after(.,'/')"/>
+        <xsl:variable name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace,$remote_name_obj)"/>
+        <xsl:variable name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix,$remote_name_obj)"/>
+        <xsl:attribute name="{name()}" select=" concat($prefix,':',$remote_name_obj,'/',$remote_name_fld)"/>
+    </xsl:template>
+    
+    
+    <xsl:template match="element[@name and complexType and not(@type)]" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="generate_tables_from_external_root.name" select="@name"/>
+        <xsl:param name="generate_tables_from_external_root.path" select="@name"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <xsl:variable name="generate_tables_from_external_root.path_new" select="@name"/>
+        
+        <xsl:variable name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace,system_cache__appinfo:object_install_se_ant_object.root_complextype( complexType,@name))"/>
+        <xsl:variable name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix,system_cache__appinfo:object_install_se_ant_object.root_complextype( complexType,@name))"/>
+        
+        <xsl:element name="{name()}">
+            <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_CT_ref" select="@*">
+                <xsl:with-param name="prefix" select="$prefix"/>
+                <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+            </xsl:apply-templates>
+            <xsl:comment>#320A  complexContent in child - try to map to root type schema </xsl:comment>
+            <generate_tables_from_external_root.required_by.path_init>
+                <xsl:attribute name="prefix" select="$prefix"/>
+                <xsl:attribute name="targetNamespace" select="$targetNamespace"/>
+                <xsl:attribute name="debug" select="'#320A  element[@name and complexType and not(@type)] system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child'"/>
+            </generate_tables_from_external_root.required_by.path_init>
+            <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+                <xsl:attribute name="debug_579_root_complextype" select="system_cache__appinfo:object_install_se_ant_object.root_complextype( complexType,@name)"/>
+                <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+                <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path_new"/>
+                <xsl:attribute name="generate_tables_from_external_root.required_by.path" select="$generate_tables_from_external_root.path"/>
+                <xsl:attribute name="targetNamespace" select="$targetNamespace"/>
+                <xsl:attribute name="prefix" select="$prefix"/>
+                <xsl:comment>#320A complexContent in child - force to make Table with name based on current path (copy element with @ref + make CT) </xsl:comment>
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root_child" select=".">
+                    <xsl:with-param name="generate_tables_from_external_root.path" select="concat($generate_tables_from_external_root.path_new,'/',$generate_tables_from_external_root.name)"/>
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+            </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+        </xsl:element>
+    </xsl:template>
+    
+    
+    <xsl:template match="element[@name and complexType and @type]" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="generate_tables_from_external_root.name" select="@name"/>
+        <xsl:param name="generate_tables_from_external_root.path" select="@name"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <xsl:variable name="generate_tables_from_external_root.path_new" select="@name"/>
+        
+        <xsl:variable name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace_root,system_cache__appinfo:object_install_se_ant_object.root_complextype( complexType,@name))"/>
+        <xsl:variable name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix_root,system_cache__appinfo:object_install_se_ant_object.root_complextype( complexType,@name))"/>
+        
+        <xsl:element name="{name()}">
+            <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_CT_ref" select="@*">
+                <xsl:with-param name="prefix" select="$prefix"/>
+                <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+            </xsl:apply-templates>
+            <xsl:comment>#320T  complexContent with type in child - try to map to root type schema </xsl:comment>
+            <generate_tables_from_external_root.required_by.path_init>
+                <xsl:attribute name="prefix" select="$prefix"/>
+                <xsl:attribute name="targetNamespace" select="$targetNamespace"/>
+            </generate_tables_from_external_root.required_by.path_init>
+            <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+                <xsl:attribute name="debug_579_root_complextype" select="system_cache__appinfo:object_install_se_ant_object.root_complextype( complexType,@name)"/>
+                <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+                <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path_new"/>
+                <xsl:attribute name="generate_tables_from_external_root.required_by.path" select="$generate_tables_from_external_root.path"/>
+                <xsl:attribute name="targetNamespace" select="$targetNamespace"/>
+                <xsl:attribute name="prefix" select="$prefix"/>
+                <xsl:comment>#320T complexContent in child - force to make Table with name based on current path (copy element with @ref + make CT) </xsl:comment>
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root_child" select=".">
+                    <xsl:with-param name="generate_tables_from_external_root.path" select="concat($generate_tables_from_external_root.path_new,'/',$generate_tables_from_external_root.name)"/>
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+            </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+        </xsl:element>
+    </xsl:template>
+    
+    <xsl:template match="element" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="generate_tables_from_external_root.name" select="@name"/>
+        <xsl:param name="generate_tables_from_external_root.path" select="@name"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <xsl:variable name="generate_tables_from_external_root.path_new" select="@name"/>
+        <xsl:element name="{name()}">
+            <xsl:copy-of select="@*"/>
+            <xsl:attribute name="system_cache__appinfo:debug">#376 element child - not type - error? to be fixed schema!</xsl:attribute>
+        </xsl:element>
+    </xsl:template>
+    
+    <xsl:template match="element[@type and not(complexType)]" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="generate_tables_from_external_root.name" select="@type"/>
+        <xsl:param name="generate_tables_from_external_root.path" select="@type"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+            <xsl:element name="{name()}">
+                <xsl:choose>
+                    <xsl:when test="system_cache__appinfo:targetNamespace_from_prefix($system_cache__appinfo:vrtfNamespaces, system_cache__appinfo:get_prefix_from_element(@type)) = 'http://www.w3.org/2001/XMLSchema' or system_cache__appinfo:targetNamespace_from_prefix($system_cache__appinfo:vrtfNamespaces, system_cache__appinfo:get_prefix_from_element(@type)) = 'http://biuro.biall-net.pl/p5/schema/types'">
+                        <xsl:copy-of select="@*"/>
+                        <xsl:comment>#203a - type typu xs:</xsl:comment>
+                        <!--<xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_force_refered_element" select="."/>-->
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_type" select="@*">
+                            <xsl:with-param name="prefix" select="$prefix"/>
+                            <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                            <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                            <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                        </xsl:apply-templates>
+                        <xsl:comment>#203b - type innego typu niż xs: - trzeba stworzyc ten typ</xsl:comment>
+                        <!--<xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child" select="."/>-->
+                        <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+                            <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+                            <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
+                            <!--<xsl:attribute name="debug_679_targNStype" select="system_cache__appinfo:targetNamespace_from_prefix($system_cache__appinfo:vrtfNamespaces, system_cache__appinfo:get_prefix_from_element(@type))"/>-->
+                            <xsl:element name="complexType" namespace="http://www.w3.org/2001/XMLSchema">
+                                <xs:complexType name="{@name}">
+                                    <xs:complexContent>
+                                        <xs:extension base="{@type}"/>
+                                    </xs:complexContent>
+                                </xs:complexType>
+                            </xsl:element>
+                        </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+                        <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+                            <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+                            <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
+                            <xsl:element name="element">
+                                <xsl:attribute name="name" select="@name"/>
+                                <xsl:attribute name="type" select="@type"/>
+                            </xsl:element>
+                        </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+                    </xsl:otherwise>
+                </xsl:choose>
+            </xsl:element>
+    </xsl:template>
+    
+    <xsl:template match="annotation" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_force_refered_complexType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:comment>suppressed annotation <xsl:copy-of select=".//text()"/></xsl:comment>
+    </xsl:template>
+    
+    <xsl:template match="complexType" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_force_refered_complexType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="name" required="yes"/>
+        <xsl:param name="generate_tables_from_external_root.name" select="$name"/>
+        <xsl:param name="generate_tables_from_external_root.path" required="yes"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+            <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+            <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
+            <xsl:attribute name="prefix" select="$prefix"/>
+            <xsl:attribute name="targetNamespace" select="$targetNamespace"/>
+            <xsl:comment>#359A complexType forced now contintue childs</xsl:comment>
+            <xsl:element name="{name()}" >
+                <xsl:copy-of select="@*"/>
+                <xsl:attribute name="name" select="$name"/>
+                <!--<xsl:element name="complexContent" namespace="http://www.w3.org/2001/XMLSchema">
+                        <xsl:element name="extension" namespace="http://www.w3.org/2001/XMLSchema" >
+                            <xsl:attribute name="base" select="complexType/@name"/>
+                            <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_force_refered_element" select=".">
+                                <xsl:with-param name="name" select="complexType/@name"/>
+                                <xsl:with-param name="generate_tables_from_external_root.path" select="concat($generate_tables_from_external_root.path,'/',$generate_tables_from_external_root.name,'/',complexType/@name)"/>
+                                <xsl:with-param name="prefix" select="$prefix"/>
+                                <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                                <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                                <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                            </xsl:apply-templates>
+                        </xsl:element>
+                    </xsl:element>-->
+                <xsl:comment>#359A -  parsing - CT will not be supplied from another leaf</xsl:comment>
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child">
+                    <xsl:with-param name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+                    <xsl:with-param name="generate_tables_from_external_root.path" select="concat($generate_tables_from_external_root.path,'/',$generate_tables_from_external_root.name)"/>
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+            </xsl:element>
+        </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+    </xsl:template>
+    
+    <xsl:template match="complexType[ sequence and not (@type) ]" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_force_refered_complexType_root" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="name" required="yes"/>
+        <xsl:param name="generate_tables_from_external_root.name" select="$name"/>
+        <xsl:param name="generate_tables_from_external_root.path" required="yes"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+            <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+            <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
+            <xsl:attribute name="prefix" select="$prefix"/>
+            <xsl:attribute name="targetNamespace" select="$targetNamespace"/>
+            <xsl:comment>#359C complexType forced now contintue childs</xsl:comment>
+            <xsl:element name="{name()}" >
+                <xsl:copy-of select="@*"/>
+                <xsl:attribute name="name" select="$name"/>
+                <xsl:attribute name="debug" select="'#939'"/>
+                <xsl:comment>#359C -  parsing - CT is local leaf</xsl:comment>
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child">
+                    <xsl:with-param name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+                    <xsl:with-param name="generate_tables_from_external_root.path" select="concat($generate_tables_from_external_root.path,'/',$generate_tables_from_external_root.name)"/>
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+            </xsl:element>
+        </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+    </xsl:template>
+    
+    
+    <xsl:template match="complexType" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_force_refered_complexType_root" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="name" required="yes"/>
+        <xsl:param name="generate_tables_from_external_root.name" select="$name"/>
+        <xsl:param name="generate_tables_from_external_root.path" required="yes"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+            <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+            <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
+            <xsl:attribute name="prefix" select="$prefix"/>
+            <xsl:attribute name="targetNamespace" select="$targetNamespace"/>
+            <xsl:comment>#359B complexType forced now contintue childs</xsl:comment>
+            <xsl:element name="{name()}" >
+                <xsl:copy-of select="@*"/>
+                <xsl:attribute name="name" select="$name"/>
+                <xsl:element name="complexContent" namespace="http://www.w3.org/2001/XMLSchema">
+                    <xsl:element name="extension" namespace="http://www.w3.org/2001/XMLSchema" >
+                        <xsl:attribute name="base" select="concat(system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix_root,system_cache__appinfo:object_install_se_ant_object.root_complextype( current(),@name)),':',@name )"/>
+                    </xsl:element>
+                </xsl:element>
+                <xsl:comment>#359B - not parsing - CT will be supplied from another leaf</xsl:comment>
+                <!--<xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child">
+                    <xsl:with-param name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+                    <xsl:with-param name="generate_tables_from_external_root.path" select="concat($generate_tables_from_external_root.path,'/',$generate_tables_from_external_root.name)"/>
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>-->
+            </xsl:element>
+        </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+    </xsl:template>
+    
+    <xsl:template match="complexType" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_force_refered_element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="generate_tables_from_external_root.name" select="@name"/>
+        <xsl:param name="generate_tables_from_external_root.path" select="@name"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+            <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+            <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
+            <xsl:attribute name="prefix" select="$prefix"/>
+            <xsl:attribute name="targetNamespace" select="$targetNamespace"/>
+            <xsl:comment>#232 forced from ComplexType (generate_tables_from_external_root.name = <xsl:value-of select="$generate_tables_from_external_root.name"/>) </xsl:comment>
+            <xsl:element name="element" namespace="http://www.w3.org/2001/XMLSchema">
+                <xsl:copy-of select="@*"/>
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child">
+                    <xsl:with-param name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+                    <xsl:with-param name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
+                    <xsl:with-param name="prefix" select="$prefix"/>
+                    <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                    <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                    <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                </xsl:apply-templates>
+            </xsl:element>
+        </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+    </xsl:template>
+    
+    
+    <xsl:template match="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables">
+        <xsl:comment>#166 ignored child to be set root </xsl:comment>
+    </xsl:template>
+    
+    <xsl:template match="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    <xsl:template match="@id|@targetNamespace" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables"/>
+        
+    <xsl:template match="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables_schema">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    <xsl:template match="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables.sequence">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    <xsl:template match="@name" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables.sequence"/>
+        
+    
+    
+    <xsl:template match="@type|@targetNamespace|@id|@name|@generate_tables_from_external_root.path.last_token|@generate_tables_from_external_root.name|@generate_tables_from_external_root.path|@prefix" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables_schema"/>
+        
+    
+    <xsl:template match="annotation" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+       <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    <xsl:template match="sequence" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="generate_tables_from_external_root.required_by.path_init"/>
+        <xsl:element name="{name()}">
+            <xsl:apply-templates select="../@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables.sequence"/>
+            <xsl:copy-of select="@*"/>
+            <!--<xsl:apply-templates select="../@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables"/>-->
+            <xsl:choose>
+                <xsl:when test="../@generate_tables_from_external_root.path">
+                    <xsl:variable name="generate_tables_from_external_root.path.last" select="../@generate_tables_from_external_root.path"/>
+                    <xsl:variable name="generate_tables_from_external_root.path.last_token" select="tokenize($generate_tables_from_external_root.path.last,'/')[ count(tokenize($generate_tables_from_external_root.path.last,'/'))]"/>
+                    <xsl:attribute name="generate_tables_from_external_root.path.last_token" select="$generate_tables_from_external_root.path.last_token"/>
+                    <!--<xsl:attribute name="generate_tables_from_external_root.path.last" select="tokenize(.././@generate_tables_from_external_root.path,'/')[ count(tokenize(../@generate_tables_from_external_root.path,'/'))]"/>-->
+                </xsl:when>
+            </xsl:choose>
+            <xsl:choose>
+                <xsl:when test="$generate_tables_from_external_root.required_by.path_init">
+                    <generate_tables_from_external_root.required_by.path_init>
+                        <xsl:for-each select=".//*[@prefix]">
+                            <generate_tables_from_external_root.required_by.path_init>
+                                <xsl:attribute name="generate_tables_from_external_root.required_by.path" select="@generate_tables_from_external_root.required_by.path"/>
+                                <xsl:attribute name="prefix" select="@prefix"/>
+                                <xsl:attribute name="targetNamespace" select="@targetNamespace"/>
+                            </generate_tables_from_external_root.required_by.path_init>
+                        </xsl:for-each>
+                    </generate_tables_from_external_root.required_by.path_init>
+                </xsl:when>
+            </xsl:choose>
+            <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables"/>
+        </xsl:element>
+    </xsl:template>
+    
+    <xsl:template match="*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables">
+        <xsl:param name="generate_tables_from_external_root.required_by.path_init"/>
+        <xsl:element name="{name()}">
+            <xsl:copy-of select="../@*"/>
+            <xsl:copy-of select="@*"/>
+            <!--<xsl:apply-templates select="../@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables"/>-->
+            <xsl:choose>
+                <xsl:when test="../@generate_tables_from_external_root.path">
+                    <xsl:variable name="generate_tables_from_external_root.path.last" select="../@generate_tables_from_external_root.path"/>
+                    <xsl:variable name="generate_tables_from_external_root.path.last_token" select="tokenize($generate_tables_from_external_root.path.last,'/')[ count(tokenize($generate_tables_from_external_root.path.last,'/'))]"/>
+                    <xsl:attribute name="generate_tables_from_external_root.path.last_token" select="$generate_tables_from_external_root.path.last_token"/>
+                    <!--<xsl:attribute name="generate_tables_from_external_root.path.last" select="tokenize(.././@generate_tables_from_external_root.path,'/')[ count(tokenize(../@generate_tables_from_external_root.path,'/'))]"/>-->
+                </xsl:when>
+            </xsl:choose>
+            <xsl:choose>
+                <xsl:when test="$generate_tables_from_external_root.required_by.path_init">
+                    <generate_tables_from_external_root.required_by.path_init>
+                        <xsl:for-each select=".//*[@prefix]">
+                            <generate_tables_from_external_root.required_by.path_init>
+                                <xsl:attribute name="generate_tables_from_external_root.required_by.path" select="@generate_tables_from_external_root.required_by.path"/>
+                                <xsl:attribute name="prefix" select="@prefix"/>
+                                <xsl:attribute name="targetNamespace" select="@targetNamespace"/>
+                            </generate_tables_from_external_root.required_by.path_init>
+                        </xsl:for-each>
+                    </generate_tables_from_external_root.required_by.path_init>
+                </xsl:when>
+            </xsl:choose>
+            <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_mktables"/>
+        </xsl:element>
+    </xsl:template>
+    
+    
+    <xsl:template match="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_CT_ref">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    <xsl:template match="@type" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_CT_ref"/>
+        
+    
+    <xsl:template match="@name" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_CT_ref">
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        <xsl:attribute name="ref" select=" concat($prefix,':',current())"/>
+    </xsl:template>
+    
+    <xsl:template match="@*" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_type">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    <xsl:template match="@type" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_type">
+        <xsl:attribute name="ref" select="."/>
+    </xsl:template>
+    
+    <xsl:template match="import|group|attributeGroup|include|annotation" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external"/>
+    
+    
+        
+    
+    <xsl:template match="*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external">
+        <error_unantended><xsl:attribute name="name" select="name()"/></error_unantended>
+    </xsl:template>
+   
+    <xsl:template match="comment()|text()" mode="system_cache__appinfo:object_install_se_ant_object.list_external_schemas"/>
+    
+    <xsl:template match="system_cache__appinfo:get_all_xsd_list" mode="system_cache__appinfo:object_install_se_ant_object.list_external_schemas">
+        <system_cache__appinfo:object_install_se_ant_object.list_external_schemas>
+            <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.list_external_schemas"/>
+        </system_cache__appinfo:object_install_se_ant_object.list_external_schemas>
+    </xsl:template>
+    
+    <xsl:template match="system_cache__appinfo:get_all_xsd_external_schema" mode="system_cache__appinfo:object_install_se_ant_object.list_external_schemas">
+        <xsl:variable name="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace">
+            <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace"/>
+        </xsl:variable>
+        <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.list_external_objects"  xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+            <xsl:with-param name="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace" select="$system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace"/>
+        </xsl:apply-templates>
+    </xsl:template>
+    
+    <xsl:template match="schema" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" mode="system_cache__appinfo:object_install_se_ant_object.list_external_objects"><!-- root elements without types must be separate object -->
+        <xsl:param name="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace" required="yes"/>
+        <xsl:element name="{name()}">
+            <xsl:copy-of select="../@*"/>
+            <xsl:attribute name="targetNamespace" select="$system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace//@targetNamespace"/> <!-- todo targetnamespace musi byc powiazany z instalowanym API z TargetNamespaceBindings.xml + parametrem konfiguracyjnym - czyli to wstepne targetnamespace -->
+            <xsl:attribute name="targetNamespace_proposal" select="system_cache__appinfo:object_install_se_ant_object.merge_external_targetNamespace($system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace//@targetNamespace,@name)"/>
+            <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.list_external_objects">
+                <xsl:with-param name="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace" select="$system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace"/>
+            </xsl:apply-templates>
+        </xsl:element>
+    </xsl:template>
+    
+    <xsl:template match="text()|comment()" mode="system_cache__appinfo:object_install_se_ant_object.list_external_objects"/>
+    
+    
+    
+    <xsl:template match="element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" mode="system_cache__appinfo:object_install_se_ant_object.list_external_objects"><!-- root elements without types must be separate object -->
+        <xsl:param name="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace" required="yes"/>
+        <object>
+            <xsl:attribute name="name" select="@name"/>
+            <xsl:attribute name="targetNamespace" select="$system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace//@targetNamespace"/> <!-- todo targetnamespace musi byc powiazany z instalowanym API z TargetNamespaceBindings.xml + parametrem konfiguracyjnym - czyli to wstepne targetnamespace -->
+            <xsl:attribute name="targetNamespace_proposal" select="system_cache__appinfo:object_install_se_ant_object.merge_external_targetNamespace($system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace//@targetNamespace,@name)"/>
+            <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.list_external_tables"></xsl:apply-templates>
+        </object>
+    </xsl:template>
+    
+    <xsl:template match="complexType" mode="system_cache__appinfo:object_install_se_ant_object.list_external_tables" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.list_external_tables_complexType"/>
+    </xsl:template>
+    
+    <xsl:template match="sequence" mode="system_cache__appinfo:object_install_se_ant_object.list_external_tables_complexType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.list_external_tables_complexType_sequence"/>
+        <xsl:message terminate="yes">#1130 unexpected</xsl:message>
+    </xsl:template>
+    
+    <xsl:template match="element" mode="system_cache__appinfo:object_install_se_ant_object.list_external_tables_complexType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        TODO TODO need to build object natively!!! by buildComplexType!
+    </xsl:template>
+    
+    <xsl:template match="*" mode="system_cache__appinfo:object_install_se_ant_object.list_external_tables" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:comment>Unantended object <xsl:value-of select="name()"/></xsl:comment>
+    </xsl:template>
+    
+    <xsl:template match="*" mode="system_cache__appinfo:object_install_se_ant_object.list_external_tables_complexType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+       <xsl:comment>Unantended object <xsl:value-of select="name()"/></xsl:comment>
+    </xsl:template>
+    
+    <xsl:template match="text()|comment()" mode="system_cache__appinfo:object_install_se_ant_object.list_external_tables"/>
+    
+    <xsl:template match="text()|comment()" mode="system_cache__appinfo:object_install_se_ant_object.list_external_tables_complexType"/>
+    
+    <xsl:template match="system_cache__appinfo:get_all_xsd_list" mode="system_cache__appinfo:list_schema_elements">
+        <system_cache__appinfo:list_schema_elements>
+            <xsl:apply-templates mode="system_cache__appinfo:list_schema_elements"/>
+        </system_cache__appinfo:list_schema_elements>
+    </xsl:template>
+    
+    <xsl:template match="system_cache__appinfo:get_all_xsd" mode="system_cache__appinfo:list_schema_elements">
+        <xsl:apply-templates mode="system_cache__appinfo:list_schema_elements"/>
+    </xsl:template>
+    
+    <xsl:template match="xs:schema" mode="system_cache__appinfo:list_schema_elements">
+        <xsl:element name="{name()}">
+            <xsl:copy-of select="@*"/>
+            <system_cache__appinfo:prefix><xsl:value-of select="system_cache__appinfo:prefix_from_targetNamespace($system_cache__appinfo:vrtfNamespaces,@targetNamespace)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></system_cache__appinfo:prefix>
+            <system_cache__appinfo:prefix_binding><xsl:value-of select="system_cache__appinfo:get_default_db_obj_url_table_name(@targetNamespace)"/></system_cache__appinfo:prefix_binding>
+        <xsl:apply-templates mode="system_cache__appinfo:list_schema_elements"/>
+        </xsl:element>
+    </xsl:template>
+    
+    <xsl:template match="element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" mode="system_cache__appinfo:list_schema_elements">
+        <xsl:element name="{name()}">
+            <xsl:copy-of select="@*"/>
+        </xsl:element>
+    </xsl:template>
+    
+    <xsl:template match="*" mode="system_cache__appinfo:list_schema_elements"/>
+    
+    <xsl:template match="text()|comment()" mode="system_cache__appinfo:list_schema_elements"/>
+    
+    <xsl:function name="system_cache__appinfo:object_install_se_ant_object.root_complextype">
+        <xsl:param name="system_cache__appinfo:build_complexType"/>
+        <xsl:param name="force_name"/>
+        <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.root_complextype" select="$system_cache__appinfo:build_complexType">
+            <xsl:with-param name="force_name" select="$force_name"/>
+        </xsl:apply-templates>
+    </xsl:function>
+    
+    <xsl:template match="complexType" mode="system_cache__appinfo:object_install_se_ant_object.root_complextype" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="force_name"/>
+        <xsl:choose>
+            <xsl:when test="complexType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.root_complextype"/>
+            </xsl:when>
+            <xsl:when test="@name">
+                <xsl:value-of select="@name"/>
+            </xsl:when>
+            <xsl:when test="element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+                <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.root_complextype" select="element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:value-of select="$force_name"/>
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+    
+    <xsl:template match="*|text()|comment()" mode="system_cache__appinfo:object_install_se_ant_object.root_complextype" />
+        
+    
+    
+</xsl:stylesheet>

+ 6 - 2
SE/schema/default_db_xml_cache.public/build_recurse_ant.xsl

@@ -19,6 +19,7 @@
     <!-- 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="get_all_xsd.xsl"/>
     
     
     <!--<xsl:include href="escaped_html_to_xml.xsl"/>-->
@@ -310,6 +311,7 @@
                     <property name="build_recurse_ant_cache_control.xsl" value="{$build_recurse_ant_cache_control.xsl}"/>
                     <property name="typeNameRoot" value="{$typeNameRoot}"/>
                     <property name="input_obj_fid_forced" value="{$input_obj_fid/@fid}"/>
+                    <property name="external_schema_table.path" value="{$external_schema_table.path}"/>
                     <xsl:comment>
                         #224 Important variables:
                         typeName=<xsl:value-of select="$typeName"/>;
@@ -733,7 +735,7 @@
                     <property name="build_recurse_ant_cache_control.xsl" value="{$build_recurse_ant_cache_control.xsl}"/>
                     <property name="typeNameRoot" value="{$typeNameRoot}"/>
                     <property name="input_obj_fid_forced" value="{$input_obj_fid/@fid}"/>
-                    
+                    <property name="external_schema_table.path" value="{$external_schema_table.path}"/>
                     <xsl:comment>
                         #555 Important variables:
                         typeName=<xsl:value-of select="$typeName"/>;
@@ -1182,6 +1184,7 @@
                 <param name="recurse_ant_basedir.recurse_cache" expression="{$recurse_ant_basedir.recurse_cache}"/>
                 <param name="feature_pos_parent" expression="{$feature_pos_parent}"/>
                 <param name="feature_pos" expression="{$feature_pos}"/>
+                <param name="external_schema_table.path" expression="{$external_schema_table.path}"/>
                 <classpath location="/opt/local/share/java/saxon9he.jar"/>
             </xsl:element>
             <!-- delete tempfiles -->
@@ -1462,7 +1465,7 @@
                 <param name="xml_id" expression="{@xml_id}"/>
                 <param name="typeNameRoot" expression="{$typeNameRoot}"/>
                 <param name="recurse_ant_basedir.recurse_cache" expression="{$recurse_ant_basedir.recurse_cache}"/>
-                
+                <param name="external_schema_table.path" expression="{$external_schema_table.path}"/>
                 <classpath location="/opt/local/share/java/saxon9he.jar"/>
             </xsl:element>
             <xsl:if test="$debug &gt; 2"><echo> #1153 Loop executing antfile <xsl:value-of select="concat('${builds_to_ant_file.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/></echo></xsl:if>
@@ -1762,6 +1765,7 @@
                                             <param name="recurse_ant_basedir.recurse_cache" expression="{$recurse_ant_basedir.recurse_cache}"/>
                                             <param name="build_recurse_ant_cache_control.xsl" expression="{$build_recurse_ant_cache_control.xsl}"/>
                                             <param name="typeNameRoot" expression="{$typeNameRoot}"/>
+                                            <param name="external_schema_table.path" expression="{$external_schema_table.path}"/>
                                     </xslt>
                             </xsl:element>
                         <!-- zapisujemy wynik naszego biezacego przetwarzania dita element nizej do kolejnego przejechania z ant wyniku dla podstawienia danych  -->

Різницю між файлами не показано, бо вона завелика
+ 499 - 87
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_tree_to_dita.xsl


+ 4 - 2
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.xsl

@@ -64,8 +64,9 @@ plot "<xsl:value-of select="$fileindex"/>.gnuplot.dat" using 2:xtic(1) with boxe
         <xsl:result-document href="{$ditadir}/graph_to_image/{$fileindex}.gnuplot.dat" omit-xml-declaration="yes">
             <!--<system_cache__appinfo:graph_to_image.population.dat>-->
                 <!--<xsl:attribute name="local-name" select="local-name()"/>-->
-                <xsl:variable name="cols" select="count(strow[ position() = 1]/stentry)"/>
-                <xsl:variable name="strow" select="strow"/>
+            <xsl:variable name="cols" select="count(strow[ position() = 1]/stentry)"/>
+            <xsl:variable name="strow" select="(strow|sthead)"/>
+                <xsl:message>#69 graph cols <xsl:value-of select="$cols"/></xsl:message>
                 <xsl:for-each select="1 to $cols">
                     <xsl:for-each select="$strow/stentry[ position() = current()]">
                         <xsl:choose>
@@ -119,6 +120,7 @@ plot "<xsl:value-of select="$fileindex"/>.gnuplot.dat" using 2:xtic(1) with boxe
     
     <xsl:template mode="system_cache__dita:graph__write" match="*">
         <xsl:param name="fileindex" select="concat(ID,'_',local-name())"/>
+        <xsl:message>#122 system_cache__dita:graph__write <xsl:value-of select="$fileindex"/></xsl:message>
         <graph_to_image srcfile="{$ditadir}/graph_to_image/{$fileindex}.gnuplot" dstfile="{$ditadir}/graph_to_image/{$fileindex}.png.xml"  fileindex="{$fileindex}" ditadir="{$ditadir}"/> <!--  barchart.gnuplot="{$ditadir}/graph_to_image/{$fileindex}.gnuplot" population.dat.dita="{$ditadir}/{$fileindex}.dat" barchart.png.dita="{$ditadir}/{$fileindex}.png" --> 
     </xsl:template>
     

+ 101 - 0
SE/schema/default_db_xml_cache.public/default_db/tree_to_dita.xsl

@@ -155,6 +155,7 @@
             <xsl:apply-templates select="." mode="preprocess_root_BI_audit_ENERGA_RUM_KONTRAHENCI_and_BI_audit_ENERGA_RUM_UMOWY_errors"/>
             <xsl:apply-templates select="." mode="preprocess_root_BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA"/>
             <xsl:apply-templates select="." mode="postprocess_root_PROCES_INIT"/>
+            <xsl:apply-templates            mode="preprocess_root.embedded_map"/>
         </preprocess_dita>
     </xsl:template>
     
@@ -180,4 +181,104 @@
     
     <xsl:template match="*" />
     
+    
+    <!-- default template for dita embedded output -->
+    
+    
+    <xsl:template match="map" mode="ditamap_root">
+        <xsl:element name="{name()}">
+            <xsl:copy-of select="@*"/>
+        <xsl:apply-templates mode="ditamap_root.embedded_map" />
+        </xsl:element>
+    </xsl:template>
+    
+    <xsl:template match="topic" mode="ditamap_root.embedded_map">
+        <topicref href="{@id}.dita">
+            <xsl:result-document href="{$temp}/{$uuid}/{@id}.dita">
+                <xsl:element name="{name()}">
+                    <xsl:copy-of select="@*"/>
+                    <xsl:apply-templates mode="ditamap_root.embedded_map.body"/>
+                </xsl:element>
+            </xsl:result-document>
+            <xsl:apply-templates mode="ditamap_root.embedded_map" />
+        </topicref>
+    </xsl:template>
+    
+    
+    <xsl:template match="*" mode="ditamap_root.embedded_map.body">
+        <xsl:element name="{name()}">
+            <xsl:copy-of select="@*"/>
+            <xsl:apply-templates mode="ditamap_root.embedded_map.body"/>
+        </xsl:element>
+    </xsl:template>
+    
+    <xsl:template match="text()" mode="ditamap_root.embedded_map.body">
+        <xsl:value-of select="."/>
+    </xsl:template>
+    
+    <xsl:template match="simpletable[ contains(@id,'GRAPH_')]" mode="ditamap_root.embedded_map.body">
+        
+        <xsl:copy-of select="."/>
+
+        <xsl:apply-templates mode="system_cache__dita:graph__read" select=".">
+            <xsl:with-param name="fileindex" select="@id"/>
+            <xsl:with-param name="width" select="700"/>
+        </xsl:apply-templates>
+        
+    </xsl:template>
+    
+    
+    <xsl:template match="*" mode="preprocess_root.embedded_map.simpletable">
+        <xsl:element name="{name()}">
+            <xsl:copy-of select="@*"/>
+            <xsl:apply-templates mode="preprocess_root.embedded_map.simpletable"/>
+        </xsl:element>
+    </xsl:template>
+    <xsl:template match="@*" mode="preprocess_root.embedded_map.simpletable">
+        <xsl:copy-of select="@*"/>
+    </xsl:template>
+    
+    <xsl:template match=" text()" mode="preprocess_root.embedded_map.simpletable">
+        <xsl:value-of select="."/>
+    </xsl:template>
+    
+    <xsl:template mode="preprocess_root.embedded_map" match="map">
+        <xsl:message terminate="no">#232 matched map!</xsl:message>
+        
+        <xsl:variable name="dita">
+            <xsl:apply-templates  mode="preprocess_root.embedded_map.simpletable"/>
+        </xsl:variable>
+        
+        <xsl:for-each select="$dita//simpletable[ contains(@id,'GRAPH_')]">
+            <xsl:apply-templates select="." mode="system_cache__dita:graph__write_dita_preprocess">
+                <xsl:with-param name="fileindex" select="@id"/>
+            </xsl:apply-templates>
+        </xsl:for-each>
+        <!--<debug>
+            <xsl:copy-of select="//simpletable[ contains(@id,'GRAPH_')]"></xsl:copy-of>
+        </debug>-->
+        
+        
+    </xsl:template>
+    
+    <!--<xsl:template mode="preprocess_root.embedded_map" match="simpletable[ contains(@id,'GRAPH_')]">
+            <xsl:apply-templates select="." mode="system_cache__dita:graph__write_dita_preprocess">
+                <xsl:with-param name="fileindex" select="@id"/>
+            </xsl:apply-templates>
+    </xsl:template>-->
+    
+    <xsl:template mode="preprocess_root.embedded_map" match="*">
+        <xsl:apply-templates  mode="preprocess_root.embedded_map"/>
+    </xsl:template>
+    
+    <xsl:template mode="preprocess_root.embedded_map" match=" text()|comment()"/>
+        
+    
+    
+  
+    
+    <xsl:template match="*|text()|comment()" mode="ditamap_root.embedded_map"/>
+    
+    
+    
 </xsl:stylesheet>

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

@@ -17,6 +17,7 @@
     <xsl:param name="external_schema" select="'/public_html/external_schema'"/>
     <xsl:param name="external_schema_id_namespace_prefix" select="'/public_html/external_schema_id_namespace_prefix'"/>
     <xsl:param name="XMLSchema_prefix" select="'xs'"/>
+    <xsl:param name="external_schema_table.path" required="yes"/>
     
     <xsl:include href="../default_db_xml_cache.public/xml-schema-primitives.xsl"/>
     <xsl:include href="system_cache__appinfo/external_schema_targetNamespace.xsl"/>
@@ -269,6 +270,8 @@
                 <xsl:when test="@targetNamespace and ( not($namespaces_cur//ns[@uri=$targetNamespace]/@prefix)  or $namespaces_cur//ns[@uri=$targetNamespace]/@prefix='' ) " xpath-default-namespace="">
                     <xsl:variable name="detect_prefix" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace_prefix($system_cache__appinfo:document-uri)"/>
                     <xsl:namespace name="{$detect_prefix}" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace(@targetNamespace)"/>
+                    <xsl:copy-of select="namespace::node()"/>
+                    <xsl:namespace name="p5Type" select="'http://biuro.biall-net.pl/p5/schema/types'"/>
                     <xsl:copy-of select="@targetNamespace"/>
                     <xsl:attribute name="vc:minVersion" select="'1.0'"/>
                     <xsl:attribute name="vc:maxVersion" select="'1.1'"/>
@@ -280,6 +283,8 @@
                 <xsl:when test="@targetNamespace">
                     <xsl:variable name="detect_prefix" select="$namespaces_cur//ns[@uri=$targetNamespace]/@prefix" xpath-default-namespace=""/>
                     <xsl:namespace name="{$detect_prefix}" select="@targetNamespace"/>
+                    <xsl:namespace name="p5Type" select="'http://biuro.biall-net.pl/p5/schema/types'"/>
+                    <xsl:copy-of select="namespace::node()"/>
                     <xsl:copy-of select="@targetNamespace"/>
                     <xsl:attribute name="vc:minVersion" select="'1.0'"/>
                     <xsl:attribute name="vc:maxVersion" select="'1.1'"/>
@@ -289,6 +294,8 @@
                 <xsl:otherwise>
                     <xsl:variable name="detect_prefix" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace_prefix($system_cache__appinfo:document-uri)"/>
                     <xsl:namespace name="{$detect_prefix}" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace($system_cache__appinfo:document-uri)"/>
+                    <xsl:copy-of select="namespace::node()"/>
+                    <xsl:namespace name="p5Type" select="'http://biuro.biall-net.pl/p5/schema/types'"/>
                     <xsl:attribute name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace($system_cache__appinfo:document-uri)"/>
                     <xsl:attribute name="vc:minVersion" select="'1.0'"/>
                     <xsl:attribute name="vc:maxVersion" select="'1.1'"/>
@@ -318,6 +325,7 @@
                 <xsl:when test="@targetNamespace and ( not($namespaces_cur//ns[@uri=$targetNamespace]/@prefix)  or $namespaces_cur//ns[@uri=$targetNamespace]/@prefix='' ) " xpath-default-namespace="">
                     <xsl:variable name="detect_prefix" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace_prefix($system_cache__appinfo:document-uri)"/>
                     <xsl:namespace name="{$detect_prefix}" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace(@targetNamespace)"/>
+                    <xsl:copy-of select="namespace::node()"/>
                     <xsl:copy-of select="@targetNamespace"/>
                     <xsl:attribute name="vc:minVersion" select="'1.0'"/>
                     <xsl:attribute name="vc:maxVersion" select="'1.1'"/>
@@ -345,6 +353,7 @@
                 <xsl:when test="@targetNamespace">
                     <xsl:variable name="detect_prefix" select="$namespaces_cur//ns[@uri=$targetNamespace]/@prefix" xpath-default-namespace=""/>
                     <xsl:namespace name="{$detect_prefix}" select="@targetNamespace"/>
+                    <xsl:copy-of select="namespace::node()"/>
                     <xsl:copy-of select="@targetNamespace"/>
                     <xsl:attribute name="vc:minVersion" select="'1.0'"/>
                     <xsl:attribute name="vc:maxVersion" select="'1.1'"/>
@@ -367,6 +376,7 @@
                 <xsl:otherwise>
                     <xsl:variable name="detect_prefix" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace_prefix($system_cache__appinfo:document-uri)"/>
                     <xsl:namespace name="{$detect_prefix}" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace($system_cache__appinfo:document-uri)"/>
+                    <xsl:copy-of select="namespace::node()"/>
                     <xsl:attribute name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace($system_cache__appinfo:document-uri)"/>
                     <xsl:attribute name="vc:minVersion" select="'1.0'"/>
                     <xsl:attribute name="vc:maxVersion" select="'1.1'"/>

+ 20 - 1
SE/schema/default_db_xml_cache.public/system_cache__appinfo/external_schema_targetNamespace.xsl

@@ -49,10 +49,29 @@
         <xsl:value-of select="concat($targetNamespace,'/',$generate_tables_from_external_root.path.last_token)"/>
     </xsl:function>
     
+    <xsl:function name="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace_final">
+        <xsl:param name="targetNamespace"/> <!-- for use in schema -->
+        <xsl:value-of select="concat($targetNamespace,'.xsd')"/>
+    </xsl:function>
+    
+    <xsl:function name="system_cache__appinfo:object_install_se_ant_object.save_to_ant-object-path">
+        <xsl:param name="system_cache__appinfo:document-uri-orig"/> <!-- for use in schema -->
+        <xsl:param name="schema.prefix"/>
+        <xsl:param name="name" /><!-- element name  -->
+        <xsl:value-of select="concat($external_schema_table.path,'/',$system_cache__appinfo:document-uri-orig,'/','ant-object','/',replace($schema.prefix,'__x3A__','.'),'/',$name,'/',$name,'.xsd')"/>
+    </xsl:function>
+    
+    <xsl:function name="system_cache__appinfo:object_install_se_ant_object.save_to_ant-object-path.build_xml">
+        <xsl:param name="system_cache__appinfo:document-uri-orig"/> <!-- for use in schema -->
+        <xsl:param name="schema.prefix"/>
+        <xsl:param name="name" /><!-- element name  -->
+        <xsl:value-of select="concat($external_schema_table.path,'/',$system_cache__appinfo:document-uri-orig,'/','ant-object','/',replace($schema.prefix,'__x3A__','.'),'/',$name,'/build.xml')"/>
+    </xsl:function>
+    
     <xsl:function name="system_cache__appinfo:object_install_se_ant_object.create_prefix">
         <xsl:param name="prefix"/> <!-- like external_schema__ksiegi_wieczyste__zsin_1013.xsd -->
         <xsl:param name="generate_tables_from_external_root.path.last_token"/> <!-- like OSOBA  -->
-        <xsl:value-of select="concat($prefix,'__x3a__',$generate_tables_from_external_root.path.last_token)"/>
+        <xsl:value-of select="system_cache__appinfo:escape_object_prefix_to_string(concat($prefix,':',$generate_tables_from_external_root.path.last_token))"/>
     </xsl:function>
     
     

+ 83 - 21
SE/schema/default_db_xml_cache.public/xlsx.xsl

@@ -8,6 +8,7 @@
     xmlns:dcterms="http://purl.org/dc/terms/" 
     xmlns:dcmitype="http://purl.org/dc/dcmitype/"
     xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     exclude-result-prefixes="xs"
     version="2.0">
     
@@ -23,12 +24,15 @@
         <xsl:message> Looking for xml doc files at <xsl:value-of select="  iri-to-uri(concat($Types__x3A__xlsx__x3A__unzipped_xlsx,'?select=*.(xml|rels);recurse=yes;on-error=warning'))"/></xsl:message>
         <xsl:value-of select="  iri-to-uri(concat($Types__x3A__xlsx__x3A__unzipped_xlsx,'?select=*.(xml|rels);recurse=yes;on-error=warning'))"/> 
     </xsl:variable>
+    
     <xsl:variable name="Types__x3A__xlsx:docs" select="collection($Types__x3A__xlsx:path)"/>
     
     
+    
     <xsl:template name="Types__x3A__xlsx:main">
         <xsl:message>Executing Types__x3A__xlsx__x3A__main</xsl:message>
         <Types__x3A__xlsx:main>
+            
         <xsl:for-each select="$Types__x3A__xlsx:docs">
             <xsl:apply-templates mode="Types__x3A__xlsx:sheets">
                 <xsl:with-param name="document-uri" select="document-uri(/)"/>
@@ -46,13 +50,29 @@
         <xsl:param name="document-uri"/>
         
         <workbook>
-            <xsl:for-each select="sheets/sheet" > <!-- xpath-default-namespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main" -->
+            <xsl:attribute name="document-uri" select="$document-uri"/>
+            
+            <xsl:copy-of select="sheets"/>
+            <!--<xsl:for-each select="sheets/sheet" > <!-\- xpath-default-namespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main" -\->
                 <xsl:apply-templates mode="Types__x3A__xlsx:sheet" select="$Types__x3A__xlsx:docs">
+                    <xsl:with-param name="document-uri" select="$document-uri"/>
                     <xsl:with-param name="name" select="@name"/>
                     <xsl:with-param name="sheetId" select="@sheetId"/>
                     <xsl:with-param name="r:id" select="@r:id"/>
+                    <xsl:with-param name="sheet_name" select="$sheet_names//sheet[@sheetId = current()/@sheetId]/@name"/>
                 </xsl:apply-templates>
-            </xsl:for-each>
+            </xsl:for-each>-->
+            
+            
+            <!--<xsl:for-each select="sheets/sheet" >--> <!-- xpath-default-namespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main" -->
+                <xsl:apply-templates mode="Types__x3A__xlsx:sheets" >
+                    <xsl:with-param name="document-uri" select="$document-uri"/>
+                    <xsl:with-param name="name" select="@name"/>
+                    <xsl:with-param name="sheetId" select="@sheetId"/>
+                    <xsl:with-param name="r:id" select="@r:id"/>
+                    <!--<xsl:with-param name="sheet_name" select="$sheet_names//sheet[@sheetId = current()/@sheetId]/@name"/>-->
+                </xsl:apply-templates>
+            <!--</xsl:for-each>-->
         </workbook>
     </xsl:template>
     
@@ -60,40 +80,79 @@
     
     <xsl:template match="*" mode="Types__x3A__xlsx:sheets Types__x3A__xlsx:sheet">
         <xsl:param name="document-uri"/>
-        <xsl:element name="{name()}">
-           <xsl:copy-of select="@*"/>
-            <name><xsl:value-of select="name()"/></name>
-            <url><xsl:value-of select="$document-uri"/></url>
-       </xsl:element>
+        <!--<bypassed_86>
+            <xsl:copy-of select="."/>
+        </bypassed_86>-->
+        <xsl:comment>#86 bypassed  <xsl:value-of select="name()"/>
+            <xsl:text> 
+            </xsl:text>
+                <xsl:element name="{name()}">
+                   <xsl:copy-of select="@*"/>
+                    <name><xsl:value-of select="name()"/></name>
+                    <url><xsl:value-of select="$document-uri"/></url>
+               </xsl:element>
+         </xsl:comment>
     </xsl:template>
     
     
-    
-    <xsl:template match="worksheet" mode="Types__x3A__xlsx:sheet" xpath-default-namespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
-        <xsl:param name="sheetId" required="yes"/>
+    <!--<xsl:template match="worksheet" mode="Types__x3A__xlsx:sheet">
+        <xsl:param name="document-uri"/>
+        <!-\-<bypassed_86>
+            <xsl:copy-of select="."/>
+        </bypassed_86>-\->
+        <xsl:comment>#86 bypassed  <xsl:value-of select="name()"/>
+            <xsl:text> 
+            </xsl:text>
+                <xsl:element name="{name()}">
+                   <xsl:copy-of select="@*"/>
+                    <name><xsl:value-of select="name()"/></name>
+                    <url><xsl:value-of select="$document-uri"/></url>
+               </xsl:element>
+         </xsl:comment>
+    </xsl:template>-->
+    
+    
+    
+    <xsl:template match="worksheet" mode="Types__x3A__xlsx:sheets" xpath-default-namespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
+        <!--<xsl:param name="sheetId" required="yes"/>-->
         <xsl:param name="name"/>
-        <xsl:choose>
-            <xsl:when test=" substring-after( document-uri(/),'worksheets/')=concat('sheet',$sheetId,'.xml')">
-                <xsl:apply-templates mode="Types__x3A__xlsx:sheetData"/>
-            </xsl:when>
+        <xsl:param name="document-uri" select="document-uri(/)"/>
+        
+        <xsl:comment>#102 worksheet <xsl:value-of select="$document-uri"/>;</xsl:comment>
+        
+        <xsl:variable name="sheet_id" select="replace(replace(substring-after(document-uri(/),'/worksheets/'),'.xml',''),'sheet','')"/>
+        <xsl:variable name="sheet_name" select="$Types__x3A__xlsx:docs/workbook/sheets/sheet[@sheetId = $sheet_id ]/@name"  xpath-default-namespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main" />
+        
+       <!-- <xsl:choose>
+            <xsl:when test=" substring-after( document-uri(/),'worksheets/')=concat('sheet',$sheetId,'.xml')">-->
+                <xsl:apply-templates mode="Types__x3A__xlsx:sheetData">
+                    <xsl:with-param name="sheet_name" select="$sheet_name"/>
+                </xsl:apply-templates>
+           <!-- </xsl:when>
             <xsl:otherwise>
-                <inny_sheet><xsl:attribute name="sheetId_param" select="$sheetId"/>
-                    <xsl:value-of select="substring-after( document-uri(/),'worksheets/')"/>
-                    <test><xsl:value-of select="concat('sheet',$sheetId,'.xml')"/></test>
-                </inny_sheet>
+                <xsl:comment>
+                        <inny_sheet><xsl:attribute name="sheetId_param" select="$sheetId"/>
+                            <xsl:value-of select="substring-after( document-uri(/),'worksheets/')"/>
+                            <test><xsl:value-of select="concat('sheet',$sheetId,'.xml')"/></test>
+                        </inny_sheet>
+                    </xsl:comment>
             </xsl:otherwise>
-        </xsl:choose>
+        </xsl:choose>-->
     </xsl:template>
     
     
     <xsl:template match="sheetData" mode="Types__x3A__xlsx:sheetData" xpath-default-namespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
+        <xsl:param name="sheet_name" required="yes"/>
         <sheetData>
+            <xsl:attribute name="sheet_name" select="$sheet_name"/>
+            <xsl:attribute name="document-uri" select="substring-after( document-uri(/),'worksheets/')"/>
            <xsl:apply-templates mode="Types__x3A__xlsx:sheetData"/>
         </sheetData>
     </xsl:template>
     
     <xsl:template match="row" mode="Types__x3A__xlsx:sheetData" xpath-default-namespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
         <row>
+            <xsl:copy-of select="@r"/>
             <xsl:apply-templates mode="Types__x3A__xlsx:sheetData"/>
         </row>
     </xsl:template>
@@ -101,8 +160,10 @@
     <xsl:template match="c[@t='s']" mode="Types__x3A__xlsx:sheetData" xpath-default-namespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
         <xsl:variable name="v" select="v/text()"/>
         <xsl:variable name="r" select="@r"/>
-        <c><xsl:copy-of select="@*"/><xsl:attribute name="v_deb_nr" select="$v"/>
-            <v><xsl:value-of select="$Types__x3A__xlsx:docs/sst/si[position()=$v]/t" exclude-result-prefixes="#all"/></v>
+        <c><xsl:copy-of select="@*"/>
+            <xsl:attribute name="v_deb_nr" select="$v"/>
+            <xsl:attribute name="col" select="  replace(@r,'([0-9])','')"/>
+            <v><xsl:value-of select="$Types__x3A__xlsx:docs/sst/si[position()=($v + 1)]/t" exclude-result-prefixes="#all"/></v>
             <!--<xsl:copy-of select="../../../hyperlinks/hyperlink"/>-->
             <xsl:apply-templates mode="Types__x3A__xlsx:Hyperlink" select="../../../hyperlinks/hyperlink[@ref=current()/@r]" xpath-default-namespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main"/>
         </c>
@@ -111,6 +172,7 @@
     <xsl:template match="c" mode="Types__x3A__xlsx:sheetData" xpath-default-namespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
         <xsl:variable name="r" select="@r"/>
         <c><xsl:copy-of select="@*"/>
+            <xsl:attribute name="col" select="  replace(@r,'([0-9])','')"/>
             <v><xsl:copy-of select="v/text()" copy-namespaces="no"/></v>
             <xsl:apply-templates mode="Types__x3A__xlsx:Hyperlink" select="../../../hyperlinks/hyperlink[@ref=current()/@r]"/>
         </c>

+ 7 - 24
SE/schema/default_db_xml_cache.public/xml-schema-primitives.xsl

@@ -18,29 +18,8 @@
            elementFormDefault="qualified"
            xml:lang="en"
            targetNamespace="http://www.w3.org/2001/XMLSchema">
-           <xs:simpleType name="string" id="string">
-              <xs:annotation>
-                 <xs:appinfo>
-                    <hfp:hasFacet name="length"/>
-                    <hfp:hasFacet name="minLength"/>
-                    <hfp:hasFacet name="maxLength"/>
-                    <hfp:hasFacet name="pattern"/>
-                    <hfp:hasFacet name="enumeration"/>
-                    <hfp:hasFacet name="whiteSpace"/>
-                    <hfp:hasFacet name="assertions"/>
-                    <hfp:hasProperty name="ordered" value="false"/>
-                    <hfp:hasProperty name="bounded" value="false"/>
-                    <hfp:hasProperty name="cardinality" value="countably infinite"/>
-                    <hfp:hasProperty name="numeric" value="false"/>
-                 </xs:appinfo>
-                 <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#string">Built-in primitive type.
-                    The string datatype represents character strings in XML.</xs:documentation>
-              </xs:annotation>
-              
-              <xs:restriction base="xs:anyAtomicType">
-                 <xs:whiteSpace value="preserve" id="string.whiteSpace"/>
-              </xs:restriction>
-           </xs:simpleType>
+           
+          
 
 
             <xs:annotation>
@@ -3889,7 +3868,11 @@ use</xs:documentation>
          <xs:simpleType name="dateTime" id="dateTime" type="xs:dateTime"/>
          <xs:simpleType name="string" id="string" type="xs:string"/>
          <xs:simpleType name="date" id="date" type="xs:date"/>
-         
+         <xs:simpleType name="text" id="text" type="xs:string"/>
+         <xs:simpleType name="decimal" id="decimal" type="xs:decimal"/>
+         <xs:simpleType name="hexBinary" id="hexBinary" type="xs:base64Binary"/>
+         <xs:simpleType name="float" id="float" type="xs:float"/>
+         <xs:simpleType name="double" id="double" type="xs:double"/>
          
       </xs:schema>
    </xsl:variable>

Деякі файли не було показано, через те що забагато файлів було змінено