Преглед изворни кода

upd xslt do bociana z dzialajacym rumem i benfordem - do przetestowania na rarporcie bzyka

a.binder пре 8 година
родитељ
комит
1bd033f46a
15 измењених фајлова са 2506 додато и 350 уклоњено
  1. 14 3
      SE/schema/WPS_Functions/object_install_se_ant_object/build_object_install_se_ant_object.xml
  2. 633 58
      SE/schema/WPS_Functions/object_install_se_ant_object/build_object_install_se_ant_object.xsl
  3. 38 1
      SE/schema/WPS_Functions/object_modeling_by_default_db_xml_schema/build_object_modeling_by_default_db_xml_schema.xml
  4. 214 25
      SE/schema/WPS_Functions/object_modeling_new/build_object_modeling_new.xml
  5. 1 3
      SE/schema/WPS_Functions/stock_optimize_calculations_raszczyk/build_stock_optimize_calculations_raszczyk.xml
  6. 121 77
      SE/schema/WPS_Functions/stock_optimize_calculations_raszczyk/stock_optimize_calculations_raszczyk.xsl
  7. 1 1
      SE/schema/ant-object/default_db.BI_audit_ENERGA_RUM_KONTRAHENCI/BI_audit_ENERGA_RUM_KONTRAHENCI/BI_audit_ENERGA_RUM_KONTRAHENCI.xsd
  8. 51 5
      SE/schema/default_db_xml_cache.public/appinfo.xsd
  9. 523 116
      SE/schema/default_db_xml_cache.public/build_object_install_se_ant_object.xsl
  10. 479 23
      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
  11. 149 4
      SE/schema/default_db_xml_cache.public/default_db/Benford.xsl
  12. 131 23
      SE/schema/default_db_xml_cache.public/default_db/tree_to_dita.xsl
  13. 137 4
      SE/schema/default_db_xml_cache.public/get_all_xsd.xsl
  14. 5 5
      SE/schema/default_db_xml_cache.public/get_wfs_recurse_xsl.xsl
  15. 9 2
      SE/schema/default_db_xml_cache.public/system_cache__appinfo/external_schema_targetNamespace.xsl

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

@@ -55,7 +55,7 @@
         <property name="build_object_install_se_ant_object.xsl" location="${default_db_xml_cache.public}/build_object_install_se_ant_object.xsl"/>
     </target>
     
-    <target name="system_cache__appinfo:object_install_se_ant_object.create_tempdir">
+    <target name="system_cache__appinfo:object_install_se_ant_object.create_tempdir">       
         <mkdir dir="${build_object_modeling_new_basedir_temp}"/>
     </target>
     <target name="clean" description="Clean all output and temp files">
@@ -78,6 +78,9 @@
             <param name="default_db.instance.xml" expression="${default_db.instance.xml}"/>
             <param name="default_db.instance.xml.symlink" expression="${default_db.instance.xml.symlink}"/>
             <param name="external_schema_table.path" expression="${external_schema_table.path}"/>
+            <param name="default_db.dir" expression="${default_db.dir}"/>
+            <param name="debug_level_param" expression="0"/>
+            <!--<param name="debug_level" expression="6"/>-->
             <!--<param name="targetNamespace_DEFAULTS" expression="${targetNamespace_DEFAULTS}"/>-->
             <classpath location="/opt/local/share/java/saxon9he.jar"/>
         </xslt>
@@ -97,7 +100,15 @@
             <!--<param name="procesy5_system_schema_file" expression="${procesy5_system_schema.xml}"/>-->
             <param name="NamespaceBinding.xml" expression="${NamespaceBinding.xml}"/>
             <param name="vrtfNamespaces.xml" expression="${vrtfNamespaces.xml}"/>
+            <param name="vrtfNamespaces_file" expression="${vrtfNamespaces.xml}"/>
+            <param name="external_schema_table.path" expression="${external_schema_table.path}"/>
+            <param name="procesy5_system_schema_file" expression="${procesy5_system_schema.xml}"/>
+            <param name="default_db.instance.xml" expression="${default_db.instance.xml}"/>
+            <param name="default_db.instance.xml.symlink" expression="${default_db.instance.xml.symlink}"/>
             <param name="external_schema_table.path" expression="${external_schema_table.path}"/>
+            <param name="default_db.dir" expression="${default_db.dir}"/>
+            <param name="debug_level_param" expression="0"/>
+            
             <classpath location="/opt/local/share/java/saxon9he.jar"/>
         </xslt>
         <!-- TODO nadac @id obiektom external tak samo i przegrac je spowrotem -->
@@ -108,9 +119,9 @@
     <target name="system_cache__appinfo:object_install_se_ant_object.import_external_schemas" description="To import to import aviable schemas to local/table undestable elements TODO"/>
     
     <target name="system_cache__appinfo:object_install_se_ant_object.list_schema_elements" description="To list current elements aviable in schema"/>
-    <target name="system_cache__appinfo:object_install_se_ant_object.list_installed_elements" description="To list current installed elements aviable in schema">
+    <target name="system_cache__appinfo:object_install_se_ant_object.list_installed_elements" description="To list current installed elements aviable in schema"/>
         
-    </target>
+    
     <target name="system_cache__appinfo:object_install_se_ant_object.install_new_elements" description="To install uninstalled elements aviable in schema"/>
     <target name="system_cache__appinfo:object_install_se_ant_object.install_update_elements" description="To update newer/different elements aviable in schema"/>
     

Разлика између датотеке није приказан због своје велике величине
+ 633 - 58
SE/schema/WPS_Functions/object_install_se_ant_object/build_object_install_se_ant_object.xsl


+ 38 - 1
SE/schema/WPS_Functions/object_modeling_by_default_db_xml_schema/build_object_modeling_by_default_db_xml_schema.xml

@@ -32,14 +32,33 @@
         <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}"/>
+                <available file="${default_db.xml}"/>
         </condition>
     </target>
     
     <target name="system_cache__appinfo:default_db_get_xml_schema_if_not_exists" depends="system_cache__appinfo:default_db_get_xml_schema_if_not_exists_check" unless="${default_db_get_xml_schema_if_not_exists_check}">
         <antcall target="system_cache__appinfo:default_db_get_xml_schema"/>
+        <antcall target="system_cache__appinfo:default_db_get_xml_schema_if_not_exists_check.Unauthorized.fail"/>
+    </target>
+    
+    
+    <target name="system_cache__appinfo:default_db_get_xml_schema_if_not_exists_check.Unauthorized">
+        <loadfile property="default_db.xml.loadfile.Unauthorized" srcfile="${default_db.xml}"/>
+        <condition property="default_db_get_xml_schema_if_not_exists_check.Unauthorized" taskname="system_cache__appinfo:default_db_get_xml_schema_if_not_exists_check.Unauthorized.fail">
+            <contains  string="${default_db.xml.loadfile.Unauthorized}" substring="Unauthorized" />
+        </condition>
+    </target>
+    
+    <target name="system_cache__appinfo:default_db_get_xml_schema_if_not_exists_check.Unauthorized.fail" depends="system_cache__appinfo:default_db_get_xml_schema_if_not_exists_check.Unauthorized" if="${default_db_get_xml_schema_if_not_exists_check.Unauthorized}">
+        <fail>#62 Cannot retrieve ${default_db.xml} from ${default_db.xml.get_url} 
+            Propably unset -DpasswordBase64Basic parameter
+        </fail>
     </target>
     
     
@@ -54,6 +73,24 @@
     
     
     
+    <!--<target name="system_cache__appinfo:default_db_get_xml_schema.bravecom" depends="read_build_properties" description="To import custom schema from API to parse and prepare models">
+        <property name="default_db.xml.get_url" value="https://bravecom.procesy5.pl/SE/index.php?_route=Storage_TestXsd&idStorage=2"/>
+        <property name="default_db.xml" location="${basedir}/default_db/"/>
+        
+        <antcall target="read_build_properties"/>
+        
+        <echo>We try to refresh ${default_db.xml} </echo>
+        <delete file="${default_db.xml}"/>
+        
+        <exec executable="curl" output="${default_db.xml}" errorproperty="wfs_error" resultproperty="wfs_result"> <!-\-  errorproperty="wfs_error" resultproperty="wfs_result" -\->
+            <arg line=" -H 'Authorization: Basic ${passwordBase64Basic}' &#34;${default_db.xml.get_url}&#34;"/> <!-\- ${TargetNamespaceBindings}/SE/version-git/api.php/xml/xsd/default_db  -\->
+        </exec>
+        
+        <antcall target="system_cache__appinfo:default_db_get_xml_schema_if_not_exists_check.Unauthorized.fail"/>
+        
+    </target>-->
+    
+    
     
     
     

+ 214 - 25
SE/schema/WPS_Functions/object_modeling_new/build_object_modeling_new.xml

@@ -17,22 +17,6 @@
     <property name="object_modeling_new_basedir_repository" location="${basedir}/WPS_Functions/${ant.project.name}/object_modeling_new_repository"  />
     <property name="object_modeling_new_basedir_temp" location="${object_modeling_new_basedir}/temp"  />
     
-    
-    
-    <!--<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" />-->
-    
-    <!--<property  name="object_modeling_new.xsl" location="${basedir}/default_db_xml_cache.public/object_modeling_new.xsl"/>-->
-    <!--<property name="build_properties" location="${basedir}/build_properties" />-->
-    
-    
-   <!-- <property name="table.local" location="${public_html}/table"/>
-    
-    <property name="transformed.local" location="${default_db.instance.xml}/transformed"/>
-    <property name="procesy5_system_schema.xml" value="${transformed.local}/procesy5_system_schema.xml"/>
-    -->
-    
     <property name="build_object_modeling_new.childproperties" location="${WPS_Functions.childproperties}/build_object_modeling_new.properties"/>
     
     <!--<property name="public_html" location="${basedir}" />-->
@@ -51,7 +35,9 @@
     
     <target name="write_child_props_to_config_dir" depends="read_build_properties">
         <echoproperties destfile="${build_object_modeling_new.childproperties}"/>
-    </target><target name="system_cache__appinfo:object_modeling_new_create_dirs">
+    </target>
+    
+    <target name="system_cache__appinfo:object_modeling_new_create_dirs">
         <mkdir dir="${object_modeling_new_basedir_temp}"/>
     </target>
     
@@ -65,14 +51,12 @@
         <property name="template_object.xml_location.xml" value="${template_object.xml_location}.xml"/>
     </target>
     
-    
-    
-    
     <target name="clean" description="Clean all output and temp files">
         <delete dir="${object_modeling_new_basedir_temp}" failonerror="false"/>
         <delete dir="${object_modeling_new_basedir_repository}" failonerror="false"/>
     </target>
     
+    
     <target  name="system_cache__appinfo:object_modeling_new_check_condition">
         <!--<input addproperty="prototype_object_namespace" defaultvalue="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd" />--> <!-- https://biuro.biall-net.pl/wfs/default_db/Types/Infrastructure.xsd -->
         <input addproperty="TargetNamespaceBindingsApi" defaultvalue="https://biuro.biall-net.pl/wfs"/> <!-- root namespace API -->
@@ -99,7 +83,7 @@
         <input addproperty="NamespaceObjectInstanceTable" /> <!-- example CRM_PROCES -->
         <ant antfile="${build_root.xml}" target="procesy5_system_schema.xml_if_not_exists" />
         
-        <echo> object_modeling_new_repository= ${object_modeling_new_repository}
+        <echo> object_modeling_new_basedir_repository= ${object_modeling_new_basedir_repository}
             procesy5_system_schema.xml= ${procesy5_system_schema.xml} 
             TargetNamespaceBindingsApi ${TargetNamespaceBindingsApi}
             NamespaceDatabaseStorageDefinitionPrefix ${NamespaceDatabaseStorageDefinitionPrefix}
@@ -123,6 +107,7 @@
             <param name="template_object.xml_location" expression="${template_object.xml_location.xml}"/>
             <param name="object_modeling_new_basedir_repository" expression="${object_modeling_new_basedir_repository}"/>
             <param name="procesy5_system_schema_collection_dir" expression="${basedir}"/>
+            <param name="external_schema_table.path" expression="${external_schema_table.path}"/>
             <classpath location="/opt/local/share/java/saxon9he.jar"/>
         </xslt>
         <loadfile property="object_modeling_new_in_schema_check.xml.loadfile" srcfile="${object_modeling_new_in_schema_check.xml}"/>
@@ -131,6 +116,7 @@
         </condition>
         <antcall target="system_cache__appinfo:object_modeling_new_in_schema_check_fail"/>
     </target>
+    
     <target name="system_cache__appinfo:object_modeling_new_in_schema_check" depends="system_cache__appinfo:object_modeling_new_in_schema_check_condition"/>
     <target name="system_cache__appinfo:object_modeling_new_in_schema_check_fail" if="${system_cache__appinfo:object_modeling_new_in_schema_check}">
         <fail message="ERROR ${object_modeling_new_in_schema_check.xml.loadfile}"/>
@@ -151,7 +137,7 @@
         <input addproperty="prototype_object_namespace" defaultvalue="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd" />
         <ant antfile="${build_root.xml}" target="procesy5_system_schema.xml_if_not_exists" />
         <ant antfile="${build_object_modeling_by_default_db_xml_schema.xml}" target="system_cache__appinfo:default_db_get_xml_schema_if_not_exists"/>
-        <echo> object_modeling_new_repository= ${object_modeling_new_repository}
+        <echo> object_modeling_new_basedir_repository= ${object_modeling_new_basedir_repository}
             procesy5_system_schema.xml= ${procesy5_system_schema.xml} 
             generating from ${prototype_object_namespace}
             generating to ${new_object_namespace}
@@ -224,18 +210,219 @@
             <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
             <param name="NamespaceObjectInstanceType" value="table"/>
         </antcall>-->
+        <!--<antcall target="system_cache__appinfo:object_modeling_new">
+            <param name="NamespaceObjectInstanceTable" value="DEALS_TABLE"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>-->
+        <!--<antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_KW_requested"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>-->
+        <!--<antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BADANIA_W_TERENIE"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>-->
+        <!--<antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_CEIDG"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>
         <antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_CEIDG_pelnomocnicy"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>
+        <antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_CEIDG_powiazania"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>
+        <antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_ENERGA_PRACOWNICY"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>
+        <antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_ENERGA_PRACOWNICY_adresy"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>
+        <antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_ENERGA_PRACOWNICY_adresy_copy"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>
+        <antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_ENERGA_RUM_KONTRAHENCI"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>
+        
+        <antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_ENERGA_RUM_UMOWY"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>
+        <antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_KRS"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>
+        -->
+        <!--<antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
             <param name="NamespaceObjectInstanceTable" value="BI_audit_KRS_person"/>
             <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
             <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
             <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
             <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>-->
+        
+        <!--<antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_KRS_MSIG"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>
+        
+        <antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_KRS_MSIG_poz"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>-->
+        
+        <!--<antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_ENERGA_PRACOWNICY_group"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>-->
+        
+        <!--<antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_adres"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>-->
+        
+        <!--<antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_KRS_PKD"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>-->
+        <!--<antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_MSIG"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>-->
+      <!--  <antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_MSIG_address"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
         </antcall>
+        <antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_MSIG_person"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>
+        <antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_MSIG_company"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>
+        -->
+        <!--<antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_MSIG_name"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>-->
+        <!--<antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_MSIG_PKD"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>-->
+        
+        <!--<antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_KRS_MSIG_poz"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>-->
+        
+        <!--<antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_ENERGA_FAKTURY"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>-->
+        <!--<antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_taxpayer"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>-->
+        <antcall target="system_cache__appinfo:object_modeling_new_by_xml_schema">
+            <param name="NamespaceObjectInstanceTable" value="BI_audit_operational_raport_note"/>
+            <param name="prototype_object_namespace" value="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd"/>
+            <param name="TargetNamespaceBindingsApi" value="https://biuro.biall-net.pl/wfs"/>
+            <param name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
+            <param name="NamespaceObjectInstanceType" value="table"/>
+        </antcall>
+        
+        
     </target>
     
     
     
-    
+    <!--TODO TO TEST FIX ETC-->
     <target  name="system_cache__appinfo:object_modeling_new_add_new_table"  depends="read_build_properties,system_cache__appinfo:object_modeling_new_in_schema_check,system_cache__appinfo:object_modeling_new_in_xsd_check" description="TODO Create new schema (empty table - not working currently)">
         <input addproperty="TargetNamespaceBindingsApi" defaultvalue="https://biuro.biall-net.pl/wfs"/> <!-- root namespace API -->
         <input addproperty="NamespaceDatabaseStorageDefinitionPrefix" defaultvalue="default_db"/>
@@ -268,11 +455,12 @@
         </xslt>
     </target>
     
-    
+    <!-- depends="system_cache__appinfo:object_modeling_new" test off -->
     <target  name="system_cache__appinfo:object_modeling_new_by_xml_schema" depends="read_build_properties,system_cache__appinfo:object_modeling_new_in_schema_check,system_cache__appinfo:object_modeling_new_in_xsd_check"   description="TESTING Create new schema based on default_db.xml(xsd) + prototype">
         <input addproperty="prototype_object_namespace" defaultvalue="https://biuro.biall-net.pl/wfs/default_db/Types/Default.xsd" />
         <ant antfile="${build_root.xml}" target="procesy5_system_schema.xml_if_not_exists" />
-        <ant antfile="${build_object_modeling_by_default_db_xml_schema.xml}" target="system_cache__appinfo:default_db_get_xml_schema_if_not_exists"/><echo> object_modeling_new_repository= ${object_modeling_new_repository}
+        <ant antfile="${build_object_modeling_by_default_db_xml_schema.xml}" target="system_cache__appinfo:default_db_get_xml_schema"/> <!-- or system_cache__appinfo:default_db_get_xml_schema_if_not_exists -->
+        <echo> object_modeling_new_basedir_repository= ${object_modeling_new_basedir_repository}
             procesy5_system_schema.xml= ${procesy5_system_schema.xml} 
             generating from ${prototype_object_namespace}
             generating to ${new_object_namespace}
@@ -291,6 +479,7 @@
             <param name="object_modeling_new_basedir_repository" expression="${object_modeling_new_basedir_repository}"/>
             <param name="procesy5_system_schema_collection_dir" expression="${basedir}"/>
             <param name="default_db.xml" expression="${default_db.xml}"/>
+            <param name="external_schema_table.path" expression="${external_schema_table.path}"/>
             <classpath location="/opt/local/share/java/saxon9he.jar"/>
         </xslt>
         <loadfile property="new_object_by_prototype_result.xml_loadfile" srcfile="${new_object_by_prototype_result.xml}"/>

+ 1 - 3
SE/schema/WPS_Functions/stock_optimize_calculations_raszczyk/build_stock_optimize_calculations_raszczyk.xml

@@ -82,7 +82,6 @@
             <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"/>
@@ -93,13 +92,12 @@
             <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">
+    <target name="stock_optimize_calculations_raszczyk"  depends="read_build_properties,from_xsl_2_xml,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" >

+ 121 - 77
SE/schema/WPS_Functions/stock_optimize_calculations_raszczyk/stock_optimize_calculations_raszczyk.xsl

@@ -27,7 +27,10 @@
             <sheet_source sheet_name="Żeromskiego">leclerc GD</sheet_source>
             <sheet_source sheet_name="polanki">leclerc GD</sheet_source>
         </cennik_2_sheet_name>
-    </xsl:variable><xsl:template match="Types__x3A__xlsx:main">
+    </xsl:variable>
+    
+    
+    <xsl:template match="Types__x3A__xlsx:main">
         
         <RelatedFeatureRoot>
             <map title="raport przetwarzania Procesy5 A.Binder"
@@ -35,6 +38,7 @@
                 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">
@@ -43,23 +47,61 @@
                      </raszczyk_row_prod>
                  </xsl:variable>
                 
-                
                 <xsl:result-document href="temp/raszczyk_row_prod">
                     <xsl:copy-of select="$raszczyk_row_prod"/>
-                </xsl:result-document><xsl:variable name="raszczyk_row_prod_local_sum">
+                </xsl:result-document>
+                
+                
+                <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"><xsl:with-param name="raszczyk_row_prod" select="$raszczyk_row_prod"/>
-                    </xsl:apply-templates></raszczyk_row_prod_local_sum>
+                        <xsl:apply-templates select="$raszczyk_row_prod" mode="raszczyk_row_prod_local_sum">
+                            <xsl:with-param name="raszczyk_row_prod" select="$raszczyk_row_prod"/>
+                        </xsl:apply-templates>
+                    </raszczyk_row_prod_local_sum>
                 </xsl:variable>
                 
-                 <!--<xsl:copy-of select="$raszczyk_row_prod"/>-->
-                <!--<xsl:copy-of select="$raszczyk_row_prod_local_sum"/>-->
+                
                  
                 <xsl:result-document href="temp/raszczyk_row_prod_local_sum">
                     <xsl:copy-of select="$raszczyk_row_prod_local_sum"></xsl:copy-of>
                 </xsl:result-document>
-                    <xsl:apply-templates mode="raszczyk_row_prod_local_sum.errors" select="$raszczyk_row_prod_local_sum"/><xsl:apply-templates mode="SKLEPY_EFEKTYWNOSC_TABELE" select="$raszczyk_row_prod_local_sum"/>
-                
+                <!--<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(1b)</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 (1a)</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>
@@ -85,7 +127,6 @@
                             <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>
@@ -141,7 +182,8 @@
             </xsl:choose>
         </xsl:variable>
         
-        <xsl:message>#166 ustalam cene na <xsl:value-of select="$Cena"/> - oryg <xsl:value-of select="Cena"/></xsl:message><row><xsl:copy-of select="@*"/>
+        <xsl:message>#166 ustalam cene na <xsl:value-of select="$Cena"/> - oryg <xsl:value-of select="Cena"/></xsl:message>
+        <row><xsl:copy-of select="@*"/>
         <xsl:apply-templates mode="raszczyk_row_prod_local_sum"/>
         <xsl:element name="wynik">
             <xsl:value-of select="( ( Sprzed - Il_zw ) * ( $Cena - build_stock_optimize_calculations_raszczyk:koszt_wytworzenia_all(Nazwa)  )  ) - ( Il_zw * build_stock_optimize_calculations_raszczyk:koszt_wytworzenia(Nazwa) )  "/>
@@ -149,22 +191,29 @@
         <xsl:element name="koszt_zwrotu">
             <xsl:value-of select="Il_zw * build_stock_optimize_calculations_raszczyk:koszt_wytworzenia(Nazwa)  "/>
         </xsl:element>
+            
+            
             <xsl:element name="Cena_cennik">
                 <xsl:value-of select="$Cena"/>
             </xsl:element>
             <xsl:element name="wynik_bez_zwrotu">
                 <xsl:value-of select="( ( Sprzed - Il_zw ) * ( $Cena - build_stock_optimize_calculations_raszczyk:koszt_wytworzenia_all(Nazwa)  )  )   "/>
-            </xsl:element><xsl:element name="koszt_wytworzenia">
+            </xsl:element>
+            <xsl:element name="koszt_wytworzenia">
                 <xsl:value-of select="build_stock_optimize_calculations_raszczyk:koszt_wytworzenia(Nazwa)  "/>
             </xsl:element>
-        <xsl:element name="koszt_wytworzenia_sur_i_prac">
+            <xsl:element name="koszt_wytworzenia_sur_i_prac">
                 <xsl:value-of select="build_stock_optimize_calculations_raszczyk:koszt_wytworzenia_all(Nazwa)  "/>
-            </xsl:element></row>
+            </xsl:element>
+        </row>
     </xsl:template>
     
     <xsl:template match="raszczyk_row_prod" mode="raszczyk_row_prod_local_sum">
-            <xsl:param name="raszczyk_row_prod" required="yes"/><xsl:apply-templates mode="raszczyk_row_prod_local_sum"><xsl:with-param name="raszczyk_row_prod" select="$raszczyk_row_prod"/>
-    </xsl:apply-templates></xsl:template>
+        <xsl:param name="raszczyk_row_prod" required="yes"/>
+            <xsl:apply-templates mode="raszczyk_row_prod_local_sum">
+                <xsl:with-param name="raszczyk_row_prod" select="$raszczyk_row_prod"/>
+            </xsl:apply-templates>
+    </xsl:template>
     
     <xsl:template match="*" mode="raszczyk_row_prod_local_sum">
             <xsl:copy-of select="."/>
@@ -436,21 +485,15 @@
     
     
     <xsl:template match="raszczyk_row_prod_local_sum" mode="SKLEPY_EFEKTYWNOSC_TABELE">
-       
-            
-            <xsl:variable name="row" select="row"/>
-                    
-                  <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"/>-->
-                    
-                    <topic id="topic_x5aaaj_{generate-id()}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        <xsl:variable name="row" select="row"/>
+        <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>
+            <topic id="topic_x5aaaj_{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  (2) </title>
                 <body>
@@ -461,52 +504,48 @@
                     <xsl:for-each-group select="row" group-by="@miesiac">
                         <xsl:variable name="miesiac" select="@miesiac"/>
                         <xsl:variable name="miesiac_group" select=" current-group()"/>
-                        <p>Miesiąc <xsl:value-of select="@miesiac"/></p><p><simpletable frame="all" id="simplet_sklep_ablMiese_{position()}_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="current-group()" group-by="@sheet_name">
-                             <strow>
+                        <p>Miesiąc <xsl:value-of select="@miesiac"/></p>
+                        <p><simpletable frame="all" id="simplet_sklep_ablMiese_{position()}_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="current-group()" group-by="@sheet_name">
+                                <strow>
                                     <stentry>
                                         <xsl:value-of select="@sheet_name"/>
                                     </stentry>
                                     <xsl:variable name="sheet_name_group" select="current-group()"/>
                                     <xsl:for-each select="$Grupy/Grupy/Grupa">
-                                       <stentry>
-                                           <xsl:value-of select="round(sum($sheet_name_group[Grupa = current()]/wynik[ text()]))"/> <!-- [ ../Grupa = current()] -->
-                                       </stentry>
+                                        <stentry>
+                                            <xsl:value-of select="round(sum($sheet_name_group[Grupa = current()]/wynik[ text()]))"/> <!-- [ ../Grupa = current()] -->
+                                        </stentry>
                                     </xsl:for-each>
-                                       <stentry>
-                                           <xsl:value-of select="round(sum( current-group()/wynik [ text()]))"/>
-                                       </stentry>
-                             </strow>
+                                    <stentry>
+                                        <xsl:value-of select="round(sum( current-group()/wynik [ text()]))"/>
+                                    </stentry>
+                                </strow>
                             </xsl:for-each-group>
-                        <strow>
-                            <stentry></stentry>
-                            <xsl:for-each select="$Grupy/Grupy/Grupa" >
-                                <stentry>
-                                <xsl:value-of select="round(sum( $miesiac_group [ Grupa = current()]/wynik [text()])) "/></stentry>
-                            </xsl:for-each>
-                            <stentry><xsl:value-of select="round(sum( current-group()/wynik[ text()])) "/></stentry>
-                        </strow>
-                        
-                        
-                    </simpletable>
-                    </p>
-                    
-                    
-                    
-                    
-                    
-                </xsl:for-each-group>
+                            <strow>
+                                <stentry></stentry>
+                                <xsl:for-each select="$Grupy/Grupy/Grupa" >
+                                    <stentry>
+                                        <xsl:value-of select="round(sum( $miesiac_group [ Grupa = current()]/wynik [text()])) "/>
+                                    </stentry>
+                                </xsl:for-each>
+                                <stentry><xsl:value-of select="round(sum( current-group()/wynik[ text()])) "/></stentry>
+                            </strow>
+                            
+                            
+                        </simpletable>
+                        </p>
+                    </xsl:for-each-group>
                     
                             <!--<p><simpletable frame="all" id="simplet_sklep_able_56_{ generate-id()}">
                                 <sthead>
@@ -549,7 +588,7 @@
                             </p>-->
                     
                 </body>
-            <topic id="topic_x5jffas_{generate-id()}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                <topic id="topic_x5jffas_{generate-id()}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
                     <title>Tabela sprzedazy dla produktów/sklepów  (2A) </title>  
                     <body>
@@ -622,7 +661,7 @@
             
             <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>
+                <title>Dla sklepu <xsl:value-of select="@sheet_name"/>)604)</title>
                 <body>
                   
                     <p><simpletable frame="all" relcolwidth="1* 1* 1* 1*" id="simpletable_56_{ generate-id()}">
@@ -942,8 +981,11 @@
                         <xsl:when test=" number(@r) &lt; number($row_month)">
                             <xsl:attribute name="miesiac" select="'biezacy'"/>
                         </xsl:when>
-                        <xsl:when test="number(@r) &gt; number($row_month)"><xsl:attribute name="miesiac" select="'poprzedni'"/></xsl:when>
-                    <xsl:otherwise><xsl:message terminate="yes">#979 error with <xsl:copy-of select="@*"></xsl:copy-of> </xsl:message></xsl:otherwise></xsl:choose>
+                        <xsl:when test="number(@r) &gt; number($row_month)">
+                            <xsl:attribute name="miesiac" select="'poprzedni'"/>
+                        </xsl:when>
+                        <xsl:otherwise><xsl:message terminate="yes">#979 error with <xsl:copy-of select="@*"></xsl:copy-of> </xsl:message></xsl:otherwise>
+                    </xsl:choose>
                     <xsl:attribute name="row_month" select="$row_month"/>
                     <xsl:attribute name="r" select="@r"/>
                     <xsl:variable name="c" select="c"/>
@@ -1059,7 +1101,6 @@
             </xsl:choose>
     </xsl:function>
     
-    
     <xsl:function name="build_stock_optimize_calculations_raszczyk:koszt_wytworzenia_all">
         <xsl:param name="Nazwa"/>
         <xsl:message>#991 analyzing <xsl:value-of select="$Nazwa"/></xsl:message>
@@ -1075,7 +1116,9 @@
                 <xsl:message>#993B 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">
+    </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>
@@ -1095,7 +1138,8 @@
                         </xsl:when>
                         <xsl:when test=" position()=5">
                             <KOSZTYLACZNIE><xsl:value-of select="."/></KOSZTYLACZNIE>
-                        </xsl:when><xsl:otherwise><col><xsl:value-of select="."/></col></xsl:otherwise>
+                        </xsl:when>
+                        <xsl:otherwise><col><xsl:value-of select="."/></col></xsl:otherwise>
                     </xsl:choose>
                     
                 </xsl:for-each>

+ 1 - 1
SE/schema/ant-object/default_db.BI_audit_ENERGA_RUM_KONTRAHENCI/BI_audit_ENERGA_RUM_KONTRAHENCI/BI_audit_ENERGA_RUM_KONTRAHENCI.xsd

@@ -33,7 +33,7 @@
    <xs:complexType name="BI_audit_ENERGA_RUM_KONTRAHENCI" id="KONTRAHENCI___d4e4963-1_BI_audit_E">
       <xs:sequence id="KONTRAHENCI___d4e4964-1">
          <xs:element name="ID" type="xs:integer" id="KONTRAHENCI___d4e4989-1_ID"/>
-         <!--<xs:element ref="SystemObjects__x3A__AccessOwner:L_APPOITMENT_USER"
+         <!--<xs:element ref="SystemObjects__x3A__AccessOwner:L_APPOITMENT_USER" 
             id="KONTRAHENCI___d4e4972-1">
             <xs:annotation>
                <xs:appinfo>

+ 51 - 5
SE/schema/default_db_xml_cache.public/appinfo.xsd

@@ -45,7 +45,7 @@ complexType, sequence, element . Ostatni będzie podmieniany, ale to zalezy od i
     </xs:attributeGroup>
     <xs:attribute name="change_optimize_id" id="system_cache__appinfo___d149e44">
         <xs:annotation id="system_cache__appinfo___d149e46">
-            <xs:documentation>Jest to unikalny numer elementu dla rekordu zmiany. 
+            <xs:documentation>Jest to unikalny numer elementu dla rekordu zmiany.
 
 Ostatni wezel bedzie miec powtorzony ten numer w polu @change_optimize_id_root</xs:documentation>
         </xs:annotation>
@@ -144,7 +144,7 @@ Walidacja schematu nie dziala prawidlowo dla tego obiektu - wymagane jest redefi
                                 <xs:attribute default="@name" name="rel_key"
                                     id="system_cache__appinfo___d149e153">
                                     <xs:annotation id="system_cache__appinfo___d149e155">
-                                        <xs:documentation>przyklad: 
+                                        <xs:documentation>przyklad:
 xs:complexType name="ACCESS_REQUESTS" system_cache__appinfo:rel_key="@name" system_cache__appinfo:dig_recurse="1"
 
 Nalezy wprowadzic glowny klucz nazwy do odnalezienia odpowiednika elementu w drzewie edytowanym</xs:documentation>
@@ -208,7 +208,7 @@ Nalezy wprowadzic glowny klucz nazwy do odnalezienia odpowiednika elementu w drz
                                 <xs:attribute default="@name" name="rel_key"
                                     id="system_cache__appinfo___d149e228">
                                     <xs:annotation id="system_cache__appinfo___d149e230">
-                                        <xs:documentation>przyklad: 
+                                        <xs:documentation>przyklad:
 xs:complexType name="ACCESS_REQUESTS" system_cache__appinfo:rel_key="@name" system_cache__appinfo:dig_recurse="1"
 
 Nalezy wprowadzic glowny klucz nazwy do odnalezienia odpowiednika elementu w drzewie edytowanym</xs:documentation>
@@ -219,7 +219,7 @@ Nalezy wprowadzic glowny klucz nazwy do odnalezienia odpowiednika elementu w drz
                     </xs:choice>
                     <xs:attribute name="change_optimize_id" id="system_cache__appinfo___d149e240">
                         <xs:annotation id="system_cache__appinfo___d149e242">
-                            <xs:documentation>Jest to unikalny numer elementu dla rekordu zmiany. 
+                            <xs:documentation>Jest to unikalny numer elementu dla rekordu zmiany.
 
 Ostatni wezel bedzie miec powtorzony ten numer w polu @change_optimize_id_root</xs:documentation>
                         </xs:annotation>
@@ -302,12 +302,13 @@ Ostatni wezel bedzie miec powtorzony ten numer w polu @change_optimize_id_root</
     <xs:attribute name="sort"/>
     <xs:attribute name="root_element_in_schema"/>
     <xs:attribute name="prefix" type="xs:string"/>
+    <xs:attribute name="primaryKey" type="xs:string"/>
     <xs:attribute name="namespace_uri"/>
     <xs:attribute name="id" type="xs:NCName"/>
     <xs:attribute name="name" type="xs:string"/>
     <xs:attribute name="name_no_prefix" type="xs:string"/>
     <xs:attribute name="xpath_full"/>
-    <xs:attribute name="ref"/>
+    <xs:attribute name="ref" type="xs:NCName"/>
     <xs:attribute name="xpath_local"/>
     <xs:attribute name="xpath" type="xs:string"/>
     <xs:attribute name="restriction_path"/>
@@ -597,6 +598,51 @@ Ostatni wezel bedzie miec powtorzony ten numer w polu @change_optimize_id_root</
             </xs:sequence>
         </xs:complexType>
     </xs:element>
+    <xs:attribute name="exherit_ref" type="xs:NCName">
+        <xs:annotation>
+            <xs:documentation>To exherit some options </xs:documentation>
+        </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="heritage_acl" type="xs:boolean">
+        <xs:annotation>
+            <xs:documentation>Attributes for inherit/exherit acl/sort controll. For minimise PROCESS/Resources handling problems</xs:documentation>
+        </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="heritage_sort" type="xs:boolean">
+        <xs:annotation>
+            <xs:documentation>Attributes for inherit/exherit acl/sort controll. For minimise PROCESS/Resources handling problems</xs:documentation>
+        </xs:annotation>
+    </xs:attribute>
+    <xs:element name="heritage">
+        <xs:annotation>
+            <xs:documentation>Attributes for inherit/exherit acl/sort controll. For minimise PROCESS/Resources handling problems - to be set in xs:appinfo</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+            <xs:choice>
+                <xs:element ref="system_cache__appinfo:exherit_all"/>
+                <xs:element maxOccurs="unbounded" ref="system_cache__appinfo:exherit"/>
+            </xs:choice>
+        </xs:complexType>
+    </xs:element>
+    <xs:element name="exherit_all">
+        <xs:annotation>
+            <xs:documentation>To exherit all properties to all child elements/complexTypes</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+            <xs:attribute ref="system_cache__appinfo:heritage_acl"/>
+            <xs:attribute ref="system_cache__appinfo:heritage_sort"/>
+        </xs:complexType>
+    </xs:element>
+    <xs:element name="exherit">
+        <xs:annotation>
+            <xs:documentation>To exherit to selected by attributes elements/complexTypes</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+            <xs:attribute ref="system_cache__appinfo:exherit_ref" use="required"/>
+            <xs:attribute ref="system_cache__appinfo:heritage_sort"/>
+            <xs:attribute ref="system_cache__appinfo:heritage_acl"/>
+        </xs:complexType>
+    </xs:element>
     <xs:element name="RelatedFilter">
         <xs:complexType>
             <xs:attribute name="xpath"/>

Разлика између датотеке није приказан због своје велике величине
+ 523 - 116
SE/schema/default_db_xml_cache.public/build_object_install_se_ant_object.xsl


+ 479 - 23
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,6 +4,8 @@
     xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
     xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
     xmlns:ogr="http://ogr.maptools.org/"
+    xmlns:Benford="https://pl.wikipedia.org/wiki/Rozkład_Benforda"
+    xmlns:default_db="https://biuro.biall-net.pl/wfs/default_db"
     exclude-result-prefixes="xs"
     version="2.0">
     
@@ -63,7 +65,11 @@
         <xsl:value-of select="concat($group_name,'/',$ID,'_',$end_name,'_',$end_ID,'_',$pos)"/>
     </xsl:function>
     
-    
+    <xsl:function name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_operational_raport_note.key">
+        <xsl:param name="ID"/>
+        <xsl:variable name="group_name" select="'note'"/>
+        <xsl:value-of select="concat($group_name,'_',$ID)"/>
+    </xsl:function>
    
     <xsl:function name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_ENERGA_RUM_KONTRAHENCI.key">
         <xsl:param name="ID"/>
@@ -291,8 +297,7 @@
                 </topichead>-->
                 
                 
-                
-<!-- ! Wyłączone tymczasowo 2017-10-19 <topichead navtitle="Powiązania do kontrahentów z którymi zawarto umowy (podział na źródła)(z wariantu porównawczego)">
+                <!-- ! Wyłączone tymczasowo 2017-10-19 <topichead navtitle="Powiązania do kontrahentów z którymi zawarto umowy (podział na źródła)(z wariantu porównawczego)">
                     <xsl:for-each select="$sources/sources/source">
                         <xsl:variable name="source" select="."/>
                         <topichead navtitle="żródło: {.} - Powiązania do kontrahentów z którymi zawarto umowy">
@@ -313,10 +318,11 @@
                             </xsl:for-each-group>
                         </topichead>
                     </xsl:for-each>
-                </topichead>-->                
-                                
+                </topichead>-->
                 
-<!--@107-11-14 to be fixed? <topichead navtitle="Powiązania do kontrahentów z którymi zawarto umowy">
+                
+                
+                <!--@107-11-14 to be fixed? <topichead navtitle="Powiązania do kontrahentów z którymi zawarto umowy">
                     
                     <xsl:for-each-group select="$interested_row/interested_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[object[position() =  last()]/BI_audit_ENERGA_RUM_KONTRAHENCI ]" group-by="object[position() =  last()]/BI_audit_ENERGA_RUM_KONTRAHENCI/concat(ID,Pelna_nazwa_kontrahenta)">
                                 <xsl:variable name="group_name" select="object[position() = last() ]/* [ position() = 1]/system_cache__appinfo:truncate_special_and_do_uppercase(concat(ID,Pelna_nazwa_kontrahenta,position()))"/>
@@ -446,6 +452,7 @@
                                                     <!--<xsl:copy-of select="../../."/>-->
                                                     <xsl:apply-templates mode="BI_audit_ENERGA_RUM_KONTRAHENCI" select="." >
                                                         <xsl:with-param name="group_name" select="$group_name"/>
+                                                        <xsl:with-param name="resulset" select="$resulset"/>
                                                     </xsl:apply-templates>
                                                 </xsl:when>
                                                 <xsl:otherwise>
@@ -458,6 +465,7 @@
                                             <xsl:message>#455 otherwise</xsl:message>
                                             <xsl:apply-templates mode="BI_audit_ENERGA_RUM_KONTRAHENCI" select="." >
                                                 <xsl:with-param name="group_name" select="$group_name"/>
+                                                <xsl:with-param name="resulset" select="$resulset"/>
                                             </xsl:apply-templates>
                                         </xsl:otherwise>
                                     </xsl:choose> 
@@ -470,16 +478,14 @@
                 </topichead>
                 
                 
-                                
-<xsl:choose>
-                                    <xsl:when test="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_old">
+                <xsl:choose>
+                    <xsl:when test="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_old">
                         <topichead navtitle="Powiązania dla wariantu porównawczego raportów (dostępne, nie użyte)"/>
                     </xsl:when>
-                                            <xsl:otherwise><topichead navtitle="Powiązania dla wariantu porównawczego raportów  (niedostępne w danych do raportu)"/></xsl:otherwise>
-                                </xsl:choose>
-                                
-                            
-<!--<topichead navtitle="Powiązania do wybranych podmiotów/kontrahentów (dla wariantu porównawczego)">
+                    <xsl:otherwise><topichead navtitle="Powiązania dla wariantu porównawczego raportów  (niedostępne w danych do raportu)"/></xsl:otherwise>
+                </xsl:choose>
+                
+                <!--<topichead navtitle="Powiązania do wybranych podmiotów/kontrahentów (dla wariantu porównawczego)">
                     <xsl:for-each select="$sources/sources/source">
                         <xsl:variable name="source" select="."/>
                         <topichead navtitle="żródło: {.} -(podział na spółki własne)  Powiązania wybranych podmiotów/kontrahentów">
@@ -540,7 +546,7 @@
 
                         </topichead>
                     </xsl:for-each>
-                </topichead>-->                
+                </topichead>-->
                 
                 <topichead navtitle="Powiązania do kontrahentów z KRS ogólnie (podział na źródła)">
                     
@@ -684,6 +690,88 @@
                 
                 
                 
+                
+                
+                <topichead navtitle="Wykryte powiązania do śledzonych obiektów w ramach Operacyjnej Bazy Danych (podział na źródła)">
+                    
+                    <xsl:variable name="BI_audit_operational_raport_note_fixed">
+                        <BI_audit_operational_raport_note_fixed>
+                            <xsl:for-each select="$sources/sources/source">
+                                <xsl:variable name="source" select="."/>
+                                <xsl:for-each select="$interested_row/interested_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[object[position() = 1]/*/source=current()]/object//BI_audit_operational_raport_note" >
+                                    <element>
+                                        <xsl:attribute name="key" select="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_operational_raport_note.key(ID)"/>
+                                        <xsl:attribute name="source" select="$source"/>
+                                    </element>
+                                </xsl:for-each>
+                            </xsl:for-each>
+                        </BI_audit_operational_raport_note_fixed>
+                    </xsl:variable>
+                    
+                    <xsl:variable name="BI_audit_operational_raport_note_uniq">
+                        <BI_audit_operational_raport_note_uniq>
+                            <xsl:for-each select="$sources/sources/source">
+                                <xsl:variable name="source" select="."/>
+                                <xsl:for-each-group select="$BI_audit_operational_raport_note_fixed//element[@source=$source]" group-by="@key">
+                                    <element>
+                                        <xsl:attribute name="key" select="@key"/>
+                                        <xsl:attribute name="source" select="$source"/>
+                                    </element>
+                                </xsl:for-each-group>
+                            </xsl:for-each>
+                        </BI_audit_operational_raport_note_uniq>
+                    </xsl:variable>
+                    
+                    <xsl:for-each select="$sources/sources/source">
+                        <xsl:variable name="source" select="."/>
+                        <xsl:message>#719 Powiązania do BI_audit_operational_raport_note (podział na źródła) = <xsl:value-of select="."/></xsl:message>
+                        <topichead navtitle="żródło:{.}  Powiązania do śledzonych obiektów">
+                            <xsl:for-each select="$BI_audit_operational_raport_note_uniq//element[@source=$source]">
+                                
+                                <xsl:for-each-group select="$interested_row/interested_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[object[position() = 1]/*/source= $source]/object//BI_audit_operational_raport_note[ system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_operational_raport_note.key(ID) = current()/@key ]"  group-by=" system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_KRS_person.key(nazwisko,imiona,pesel,'')">
+                                    <xsl:variable name="group_name" select="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_operational_raport_note.key(ID)"/>
+                                    <!--<topichead navtitle="{object[position() = last()]/*/concat(Pelna_nazwa_kontrahenta,' ',Miejscowosc,' ',NIP)} powiązań ({ count( current-group())}) ">-->
+                                    
+                                    <!--<xsl:choose>
+                                        <xsl:when test="//BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_old/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/object[ position() = last()]/BI_audit_ENERGA_RUM_KONTRAHENCI/ID=$BI_audit_ENERGA_RUM_KONTRAHENCI.ID">-->
+                                    <xsl:message>#733 counting ile notes dla $group_name=<xsl:value-of select="$group_name"/> <xsl:value-of select="count($BI_audit_operational_raport_note_fixed//element[@key = $group_name])"/></xsl:message>
+                                    <xsl:choose> <!-- testowanie czy jest w roznych zrodlach ten sam pesel -->
+                                        <xsl:when test="count($BI_audit_operational_raport_note_fixed//element[@key = $group_name]) &gt; 1">
+                                            <!-- pierwszy vs obecny _row powiazania z danym PESEL-->
+                                            <xsl:variable name="min" select="$interested_row/interested_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[ object//BI_audit_operational_raport_note[ system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_operational_raport_note.key(ID) = $group_name ]][1]/@pos"/>
+                                            <xsl:variable name="curr" select="../../.././@pos"/>
+                                            <xsl:message>#740 pozycja $min = <xsl:value-of select="$min"/> ; curr = <xsl:value-of select="$curr"/> $group_name = <xsl:value-of select="$group_name"/> ; position()=<xsl:value-of select="position()"/> </xsl:message>
+                                            <xsl:choose>
+                                                <xsl:when test="$curr = $min and position() = 1">
+                                                    <xsl:message>#742 - generating first occurence of <xsl:value-of select="$group_name"/></xsl:message>
+                                                    <xsl:comment>#744 pos <xsl:value-of select="$curr"/></xsl:comment>
+                                                    <!--<xsl:copy-of select="../../."/>-->
+                                                    <xsl:apply-templates mode="BI_audit_operational_raport_note" select="." >
+                                                        <xsl:with-param name="group_name" select="$group_name"/>
+                                                    </xsl:apply-templates>
+                                                </xsl:when>
+                                                <xsl:otherwise>
+                                                    <xsl:variable name="refpos" select="concat($group_name,'_', position())"/>
+                                                    <topicref href="{$group_name}/{$refpos}.dita"/>
+                                                </xsl:otherwise>
+                                            </xsl:choose>
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                            <xsl:message>#522 otherwise</xsl:message>
+                                            <xsl:apply-templates mode="BI_audit_operational_raport_note" select="." >
+                                                <xsl:with-param name="group_name" select="$group_name"/>
+                                            </xsl:apply-templates>
+                                        </xsl:otherwise>
+                                    </xsl:choose> 
+                                </xsl:for-each-group>
+                            </xsl:for-each>
+                        </topichead>
+                    </xsl:for-each>
+                </topichead>
+                
+                
+                
+                
             </map>
         <!--</xsl:result-document>-->
     </xsl:template>
@@ -721,7 +809,7 @@
                     <xsl:copy-of select="$simpletable"/>
                     <xsl:apply-templates mode="system_cache__dita:graph__read" select="$simpletable">
                         <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
-                        <xsl:with-param name="width" select="700"/>
+                        <xsl:with-param name="width" select="500"/>
                     </xsl:apply-templates>
                 </p>
                 
@@ -752,7 +840,7 @@
                     <xsl:copy-of select="$simpletable"/>
                     <xsl:apply-templates mode="system_cache__dita:graph__read" select="$simpletable">
                         <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
-                        <xsl:with-param name="width" select="700"/>
+                        <xsl:with-param name="width" select="500"/>
                     </xsl:apply-templates>
                 </p>
                 
@@ -775,11 +863,13 @@
                                         <!--(xs:double(sum(current-group()/field[@name='Wartosc_zlecenia_zamowienia_netto_w_PLN__aktualna_'][ string(replace(text(),',','.')) != 'NaN']/number(replace(text(),',','.')) ) )-->
                                         <!--(xs:double(sum(current-group()/field[@name='Wartosc_zlecenia_zamowienia_netto_w_PLN__aktualna_'][ string(replace(text(),',','.')) != 'NaN']/number(replace(text(),',','.')) ) )-->
                                         <!-- sum( $current/BI_audit_ENERGA_RUM_KONTRAHENCI[ID=$kontrach]/BI_audit_ENERGA_RUM_UMOWY/Wartosc_przedmiotu_umowy_netto_w_PLN__aktualna_) -->
-                                            <sum kontrach="{$kontrach}"><xsl:value-of select="xs:double(sum( $current/BI_audit_ENERGA_RUM_KONTRAHENCI[ID=$kontrach]/BI_audit_ENERGA_RUM_UMOWY/number(replace(Wartosc_przedmiotu_umowy_netto_w_PLN__aktualna_,',','.'))))"/></sum>
+                                            <sum kontrach="{$kontrach}"><xsl:value-of select="xs:double(sum( $current/BI_audit_ENERGA_RUM_KONTRAHENCI[ID=$kontrach]/BI_audit_ENERGA_RUM_UMOWY/number(replace(Wartosc,',','.'))))"/></sum>
                                     </xsl:for-each>
                                     </transakcje>
                                 </xsl:variable>
-                                <!--<xsl:copy-of select="$transakcje"/>-->
+                                <!--<debug.transakcje>
+                                    <xsl:copy-of select="$transakcje"/>
+                                </debug.transakcje>-->
                                 <stentry><xsl:value-of select=" format-number(xs:double(sum($transakcje/transakcje/sum[ not(text()='NaN')]) div 1000000),'####')"/></stentry>
                             </xsl:for-each-group>
                         </strow>
@@ -789,7 +879,7 @@
                     <xsl:copy-of select="$simpletable"/>
                     <xsl:apply-templates mode="system_cache__dita:graph__read" select="$simpletable">
                         <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
-                        <xsl:with-param name="width" select="700"/>
+                        <xsl:with-param name="width" select="500"/>
                     </xsl:apply-templates>
                 </p>
                 
@@ -801,11 +891,271 @@
     
     <xsl:template match="BI_audit_ENERGA_RUM_KONTRAHENCI" mode="BI_audit_ENERGA_RUM_KONTRAHENCI">
         <xsl:param name="group_name" required="yes"/>
+        <xsl:param name="resulset" required="yes"/>
         <xsl:variable name="refpos" select="concat($group_name,'_', position())"/>
         <xsl:variable name="position" select="position()"/>
         <topicref href="{$group_name}/{$refpos}.dita">
             <xsl:message>#781 debug : result doc: <xsl:value-of select="$group_name"/>/<xsl:value-of select="$refpos"/></xsl:message>
+            
+            <xsl:variable name="BI_audit_ENERGA_RUM_UMOWY_fix" select="$resulset/BI_audit_ENERGA_RUM_KONTRAHENCI[ID/text()= current()/ID ]"/>
+            
+            <!--<xsl:variable name="BI_audit_ENERGA_RUM_UMOWY_fix">
+                        <xsl:for-each select="$resulset/BI_audit_ENERGA_RUM_KONTRAHENCI[ID/text()= current()/ID ]">
+                            <xsl:element name="{name()}">
+                                <Data_zawarcia.rok><xsl:value-of select=""/></Data_zawarcia.rok>
+                                <xsl:copy-of select="."/>
+                            </xsl:element>
+                        </xsl:for-each>
+                    </xsl:variable>-->
+            
+            <xsl:variable name="polarize_spolka_nazwa" select="Pelna_nazwa_kontrahenta"/>
+            <xsl:variable name="polarize_spolka" select="ID"/>
+            
+            <xsl:variable name="Spolka_glowna">
+                <Spolka_glowna>
+                    <xsl:for-each-group select="$BI_audit_ENERGA_RUM_UMOWY_fix/BI_audit_ENERGA_RUM_UMOWY" group-by="Spolka_glowna">
+                        <xsl:sort select="Spolka_glowna"/>
+                        <xsl:copy-of select="Spolka_glowna"/>
+                    </xsl:for-each-group>
+                </Spolka_glowna>
+            </xsl:variable>
+            
+            <xsl:variable name="Osoba_merytoryczna___nazwisko_i_imie">
+                <Osoba_merytoryczna___nazwisko_i_imie>
+                    <xsl:for-each-group select="$BI_audit_ENERGA_RUM_UMOWY_fix/BI_audit_ENERGA_RUM_UMOWY" group-by="Osoba_merytoryczna___nazwisko_i_imie">
+                        <xsl:sort select="Osoba_merytoryczna___nazwisko_i_imie"/>
+                        <xsl:copy-of select="Osoba_merytoryczna___nazwisko_i_imie"/>
+                    </xsl:for-each-group>
+                </Osoba_merytoryczna___nazwisko_i_imie>
+            </xsl:variable>
+            
+            <xsl:variable name="rok">
+                <rok>
+                    <xsl:for-each-group select="$BI_audit_ENERGA_RUM_UMOWY_fix/BI_audit_ENERGA_RUM_UMOWY" group-by="tokenize(Data_zawarcia,'\.')[3]">
+                        <xsl:sort select="tokenize(Data_zawarcia,'\.')[3]"/>
+                        <xsl:element name="Data_zawarcia.rok">
+                            <xsl:attribute name="ID" select="ID"/>
+                            <xsl:value-of select="tokenize(Data_zawarcia,'\.')[3]"/>
+                        </xsl:element>
+                    </xsl:for-each-group>
+                </rok>
+            </xsl:variable>
+            
+            <!--<debugs.993>
+                                <xsl:copy-of select="$Spolka_glowna"/>
+                                <xsl:copy-of select="$Osoba_merytoryczna___nazwisko_i_imie"/>
+                                <xsl:copy-of select="$rok"/>
+                            </debugs.993>-->
+            
+            
+            <!--Analiza podpisywanych umow w RUM kwotowo wszystkie spółki - w mln (7)-->
+            
+            <!-- <xsl:variable name="simpletable">
+                        <simpletable frame="all"  id="simplebtasdd_fwf_{generate-id()}" system_cache__dita:width_cols="10" system_cache__dita:bypass_rows_with_zero="true" system_cache__dita:bypass_rows_empty="true">
+                            
+                            <sthead>
+                                <stentry>Spółka gł.</stentry>
+                                <xsl:for-each select="$rok//Data_zawarcia.rok">
+                                    <stentry><xsl:value-of select="."/></stentry>
+                                </xsl:for-each>
+                                <stentry>suma.</stentry>
+                            </sthead>
+                            
+                            <xsl:for-each select="$Spolka_glowna/Spolka_glowna/Spolka_glowna">
+                                <xsl:variable name="Spolka" select="."/>
+                                <strow>
+                                    <stentry><xsl:value-of select="."/> </stentry>
+                                    <xsl:for-each select="$rok//Data_zawarcia.rok">
+                                        <xsl:variable name="rok_cur" select="."/>
+                                        <xsl:message>#109 spółka <xsl:value-of select="$Spolka"/> / Rok <xsl:value-of select="$rok_cur"/></xsl:message>
+                                        <stentry><xsl:value-of select="ceiling(sum($BI_audit_ENERGA_RUM_UMOWY_fix//default_db:BI_audit_ENERGA_RUM_UMOWY[ Spolka_glowna = $Spolka and tokenize(Data_zawarcia,'\.')[3] = $rok_cur ]/Wartosc)  div 1000000) "/>
+                                            
+                                            <xsl:variable name="Benford:table">
+                                                <Benford:table>
+                                                    <xsl:attribute name="Benford:year" select="$rok_cur"/>
+                                                    <xsl:attribute name="Benford:subject" select="$Spolka"/>
+                                                    <xsl:for-each select="$BI_audit_ENERGA_RUM_UMOWY_fix//BI_audit_ENERGA_RUM_UMOWY[ Spolka_glowna = $Spolka and tokenize(Data_zawarcia,'\.')[3] = $rok_cur ]">
+                                                        <Benford:value><xsl:value-of select="substring( Wartosc,1,1)"/></Benford:value>
+                                                    </xsl:for-each>
+                                                </Benford:table>
+                                            </xsl:variable>
+                                            <xsl:if test="$Benford:table//Benford:value">
+                                                <!-\-<xsl:copy-of select="$Benford:table"/>-\->
+                                                <xsl:variable name="Benford:table_analys">
+                                                    <xsl:apply-templates mode="Benford:table_analys" select="$Benford:table"/>
+                                                </xsl:variable>
+                                                <xsl:copy-of select="$Benford:table_analys"/>
+                                                
+                                                <xsl:apply-templates mode="system_cache__dita:topic" select="$Benford:table_analys">
+                                                    <xsl:with-param name="Benford:subject.xml" select="$BI_audit_ENERGA_RUM_UMOWY_fix//BI_audit_ENERGA_RUM_UMOWY[ Spolka_glowna = $Spolka and tokenize(Data_zawarcia,'\.')[3] = $rok_cur ]"/>
+                                                    <xsl:with-param name="Benford:subject" select="$Spolka"/>
+                                                    <xsl:with-param name="Benford:year" select="tokenize(Data_zawarcia,'\.')[3]"/>
+                                                    <xsl:with-param name="Benford:subject.value" select="'Wartosc'"/>
+                                                    <xsl:with-param name="Benford:subject.description" select="'Numer_rejestrowy Przedmiot_umowy Kontrahenci'"/>
+                                                    <!-\-<xsl:with-param name="id" select="concat('simpleetableaaa_benford',position(),'_',generate-id())"/>-\->
+                                                </xsl:apply-templates>
+                                            </xsl:if>
+                                            
+                                        </stentry> <!-\- '###,###.00' -\->
+                                    </xsl:for-each>
+                                    <stentry><xsl:value-of select="ceiling(sum($BI_audit_ENERGA_RUM_UMOWY_fix//BI_audit_ENERGA_RUM_UMOWY[ Spolka_glowna = $Spolka  ]/Wartosc)  div 1000000) "/>
+                                        
+                                        <xsl:variable name="Benford:table">
+                                            <Benford:table>
+                                                <xsl:attribute name="Benford:year" select="'suma'"/>
+                                                <xsl:attribute name="Benford:subject" select="$Spolka"/>
+                                                <xsl:for-each select="$BI_audit_ENERGA_RUM_UMOWY_fix//BI_audit_ENERGA_RUM_UMOWY[ Spolka_glowna = $Spolka ]">
+                                                    <Benford:value><xsl:value-of select="substring( Wartosc,1,1)"/></Benford:value>
+                                                </xsl:for-each>
+                                            </Benford:table>
+                                        </xsl:variable>
+                                        <xsl:if test="$Benford:table//Benford:value">
+                                            <!-\-<xsl:copy-of select="$Benford:table"/>-\->
+                                            <xsl:variable name="Benford:table_analys">
+                                                <xsl:apply-templates mode="Benford:table_analys" select="$Benford:table"/>
+                                            </xsl:variable>
+                                            <xsl:copy-of select="$Benford:table_analys"/>
+                                            
+                                            <xsl:apply-templates mode="system_cache__dita:topic" select="$Benford:table_analys">
+                                                <xsl:with-param name="Benford:subject.xml" select="$BI_audit_ENERGA_RUM_UMOWY_fix//BI_audit_ENERGA_RUM_UMOWY[ Spolka_glowna = $Spolka  ]"/>
+                                                <xsl:with-param name="Benford:subject" select="$Spolka"/>
+                                                <xsl:with-param name="Benford:year" select="'Data_zawarcia.rok'"/>
+                                                <xsl:with-param name="Benford:subject.value" select="'Wartosc'"/>
+                                                <xsl:with-param name="Benford:subject.description" select="'Numer_rejestrowy Przedmiot_umowy Kontrahenci'"/>
+                                                <!-\-<xsl:with-param name="id" select="concat('simpleetablebbb_benford',position(),'_',generate-id())"/>-\->
+                                            </xsl:apply-templates>
+                                        </xsl:if>
+                                        
+                                    </stentry>
+                                </strow>
+                            </xsl:for-each>
+                        </simpletable>
+                    </xsl:variable>
+                    <xsl:apply-templates mode="Benford:ditamap_root.embedded_map.topic.body" select="$simpletable">
+                        <xsl:with-param name="topic.id" select=""/>
+                    </xsl:apply-templates>-->
+            
+            
+            
+            
+            <!--<debug.1187>
+                            <xsl:copy-of select="$topic"/>
+                        </debug.1187>-->
+            
+            
+            
+            <!--<related-links>
+                        <xsl:apply-templates mode="ditamap_root.embedded_map" select="$topic">
+                            <xsl:with-param name="path_rel" select="'../'"/>
+                            <xsl:with-param name="xref" select="'link'"/>
+                        </xsl:apply-templates>
+                    </related-links>-->
+            <!--<xsl:apply-templates mode="Benford:ditamap_root.embedded_map.body.topic.cleanup" select="$topic"/>-->
+            
+            
+            
+            <xsl:variable name="topic">
+                <topic id="topic_ghxf_rum_aos_{ generate-id()}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                    xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
+                    <xsl:variable name="polarize_osoba_string" select="'Hirsz' "/>
+                    <title>Analiza podpisywanych umow w RUM [] - Osoby merytoryczne (1). </title>
+                    <xsl:message>#1106 Analiza podpisywanych umow w RUM - Osoby merytoryczne. </xsl:message>
+                    <body>
+                        <simpletable frame="all"  id="simpgletablesss_inaaz_fwf_{generate-id()}" system_cache__dita:width_cols="auto"  > <!-- system_cache__dita:width_cols="10" system_cache__dita:bypass_rows_with_zero="true" system_cache__dita:bypass_rows_empty="true" -->
+                            
+                            <sthead>
+                                <stentry>Osoba</stentry>
+                                <xsl:for-each select="$rok//Data_zawarcia.rok">
+                                    <stentry><xsl:value-of select="."/></stentry>
+                                </xsl:for-each>
+                                <stentry>Suma</stentry>
+                            </sthead>
+                            
+                            
+                            <xsl:for-each select="$Osoba_merytoryczna___nazwisko_i_imie/Osoba_merytoryczna___nazwisko_i_imie/Osoba_merytoryczna___nazwisko_i_imie  ">
+                                <xsl:variable name="Osoba" select="."/>
+                                <strow>
+                                    <stentry><xsl:value-of select="."/></stentry>
+                                    <xsl:for-each select="$rok//Data_zawarcia.rok">
+                                        <xsl:variable name="rok_cur" select="."/>
+                                        <xsl:message>#194 Osoba <xsl:value-of select="$Osoba"/> / Rok <xsl:value-of select="$rok_cur"/></xsl:message>
+                                        <stentry>
+                                            <xsl:value-of select="system_cache__dita:big_values_format(sum($BI_audit_ENERGA_RUM_UMOWY_fix//BI_audit_ENERGA_RUM_UMOWY[ lower-case(Osoba_merytoryczna___nazwisko_i_imie) = lower-case($Osoba)  and tokenize(Data_zawarcia,'\.')[3] = $rok_cur ]/number(Wartosc)))   "/>
+                                            <xsl:variable name="Benford:table">
+                                                <Benford:table>
+                                                    <xsl:attribute name="Benford:year" select="."/>
+                                                    <xsl:attribute name="Benford:subject" select="$Osoba"/>
+                                                    <xsl:for-each select="$BI_audit_ENERGA_RUM_UMOWY_fix//BI_audit_ENERGA_RUM_UMOWY[ lower-case(Osoba_merytoryczna___nazwisko_i_imie) = lower-case($Osoba)  and tokenize(Data_zawarcia,'\.')[3] = $rok_cur and not(Wartosc = '0' )]">
+                                                        <Benford:value><xsl:value-of select="substring( Wartosc,1,1)"/></Benford:value>
+                                                    </xsl:for-each>
+                                                </Benford:table>
+                                            </xsl:variable>
+                                            <xsl:if test="$Benford:table//Benford:value">
+                                                <!--<xsl:copy-of select="$Benford:table"/>-->
+                                                <xsl:variable name="Benford:table_analys">
+                                                    <xsl:apply-templates mode="Benford:table_analys" select="$Benford:table"/>
+                                                </xsl:variable>
+                                                
+                                                <xsl:comment>#1138 lower $Benford:table_analys</xsl:comment>
+                                                <xsl:copy-of select="$Benford:table_analys"/>
+                                                <xsl:comment>#1138B upper EOF $Benford:table_analys</xsl:comment>
+                                                <xsl:apply-templates mode="system_cache__dita:topic" select="$Benford:table_analys">
+                                                    <xsl:with-param name="Benford:subject.xml" select="$BI_audit_ENERGA_RUM_UMOWY_fix//BI_audit_ENERGA_RUM_UMOWY[ lower-case(Osoba_merytoryczna___nazwisko_i_imie) = lower-case($Osoba)  and tokenize(Data_zawarcia,'\.')[3] = $rok_cur ]"/>
+                                                    <xsl:with-param name="Benford:subject" select="'Osoba_merytoryczna___nazwisko_i_imie'"/>
+                                                    <xsl:with-param name="Benford:year" select="'Data_zawarcia'"/>
+                                                    <xsl:with-param name="Benford:subject.value" select="'Wartosc'"/>
+                                                    <xsl:with-param name="Benford:subject.description" select="'Data_zawarcia Numer_rejestrowy Przedmiot_umowy Strony_umowy Kontrahenci'"/>
+                                                    <xsl:with-param name="Benford:force_raport" select="true()"/>
+                                                    <!--<xsl:with-param name="id" select="concat('simpleetableadddaa_benford',position(),'_',generate-id())"/>-->
+                                                </xsl:apply-templates>
+                                            </xsl:if>
+                                        </stentry>
+                                        <!-- '###,###.00' -->
+                                    </xsl:for-each>
+                                    <stentry>
+                                        <xsl:value-of select="system_cache__dita:big_values_format(sum($BI_audit_ENERGA_RUM_UMOWY_fix//BI_audit_ENERGA_RUM_UMOWY[ lower-case(Osoba_merytoryczna___nazwisko_i_imie) = lower-case($Osoba)   ]/number(Wartosc)   ))"/>
+                                        <xsl:variable name="Benford:table">
+                                            <Benford:table>
+                                                <xsl:attribute name="Benford:year" select="'SUMA'"/>
+                                                <xsl:attribute name="Benford:subject" select="$Osoba"/>
+                                                <xsl:for-each select="$BI_audit_ENERGA_RUM_UMOWY_fix//BI_audit_ENERGA_RUM_UMOWY[ lower-case(Osoba_merytoryczna___nazwisko_i_imie) = lower-case($Osoba)  and not(Wartosc = '0' )]">
+                                                    <Benford:value><xsl:value-of select="substring( Wartosc,1,1)"/></Benford:value>
+                                                </xsl:for-each>
+                                            </Benford:table>
+                                        </xsl:variable>
+                                        <xsl:if test="$Benford:table//Benford:value">
+                                            <!--<xsl:copy-of select="$Benford:table"/>-->
+                                            <xsl:variable name="Benford:table_analys">
+                                                <xsl:apply-templates mode="Benford:table_analys" select="$Benford:table"/>
+                                            </xsl:variable>
+                                            <xsl:copy-of select="$Benford:table_analys"/>
+                                            <xsl:apply-templates mode="system_cache__dita:topic" select="$Benford:table_analys">
+                                                <xsl:with-param name="Benford:subject.xml" select="$BI_audit_ENERGA_RUM_UMOWY_fix//BI_audit_ENERGA_RUM_UMOWY[ lower-case(Osoba_merytoryczna___nazwisko_i_imie) = lower-case($Osoba)  ]"/>
+                                                <xsl:with-param name="Benford:subject" select="'Osoba_merytoryczna___nazwisko_i_imie'"/>
+                                                <xsl:with-param name="Benford:year" select="'Data_zawarcia'"/>
+                                                <xsl:with-param name="Benford:subject.value" select="'Wartosc'"/>
+                                                <xsl:with-param name="Benford:subject.description" select="'Data_zawarcia Numer_rejestrowy Przedmiot_umowy Strony_umowy Kontrahenci'"/>
+                                                <!--<xsl:with-param name="id" select="concat('simpleetableahhaa_benford',position(),'_',generate-id())"/>-->
+                                            </xsl:apply-templates>
+                                        </xsl:if>
+                                    </stentry>
+                                </strow>
+                                <!--<debug.1182.rum_umowy>
+                                            <xsl:copy-of select="$BI_audit_ENERGA_RUM_UMOWY_fix//BI_audit_ENERGA_RUM_UMOWY[ lower-case(Osoba_merytoryczna___nazwisko_i_imie) = lower-case($Osoba)  ]"/>
+                                        </debug.1182.rum_umowy>-->
+                            </xsl:for-each>
+                        </simpletable>
+                    </body>
+                </topic>
+            </xsl:variable>
+            
             <xsl:result-document href="{$temp}/{$uuid}/{$group_name}/{$refpos}.dita">
+                
+                
+                
+                <!--                    Analiza spójności liczbowej dla ID kontr <xsl:value-of select="current()/ID"/>
+-->                    
+               
                 <topic id="{$uuid}topic_simpletable_person_{$group_name}_{position()}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
                     <xsl:variable name="count">
@@ -854,13 +1204,24 @@
                                     </xsl:apply-templates>
                                 </xsl:for-each-group>
                             </xsl:for-each-group>
-                            
-                            
                             <!--</xsl:for-each>-->
                         </simpletable>
                     </body>
+ 
+                    <xsl:apply-templates mode="ditamap_root.embedded_map" select="$topic">
+                        <xsl:with-param name="path_rel" select="'../'"/>
+                        <xsl:with-param name="xref" select="'topic'"/>
+                    </xsl:apply-templates>
                 </topic>
             </xsl:result-document>
+            
+            <!--<debug.1221>
+                <xsl:copy-of select="$topic"/>
+            </debug.1221>-->
+            
+            <xsl:apply-templates mode="ditamap_root.embedded_map.topic_child_to_ditamap" select="$topic">
+                <xsl:with-param name="path_rel" select="''"/>
+            </xsl:apply-templates>
         </topicref>
         
         
@@ -929,6 +1290,88 @@
     </xsl:template>
     
     
+    <xsl:template match="BI_audit_operational_raport_note" mode="BI_audit_operational_raport_note">
+        <xsl:param name="group_name" required="yes"/>
+        <xsl:variable name="refpos" select="concat($group_name,'_', position())"/>
+        <xsl:variable name="position" select="position()"/>
+        <topicref href="{$group_name}/{$refpos}.dita">
+            <xsl:message>#1021 debug : result doc: <xsl:value-of select="$group_name"/>/<xsl:value-of select="$refpos"/></xsl:message>
+            <xsl:result-document href="{$temp}/{$uuid}/{$group_name}/{$refpos}.dita">
+                <topic id="{$uuid}topic_simpletable_person_{$group_name}_{position()}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                    xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
+                    <xsl:variable name="count">
+                        <count><!--                                                 concat(object/*/ID  -->
+                            <xsl:for-each-group select="current-group()/../../../." group-by="object/*/BI_audit_operational_raport_note/ID">
+                                <row/>
+                            </xsl:for-each-group>
+                        </count>
+                    </xsl:variable>
+                    
+                    <title>Do śledzonego obiektu występuje <!--<xsl:value-of select="position()"/> /--><xsl:value-of select="count( $count//row)"/> powiązań. 
+                        adnotacje : <xsl:value-of select="note"/><xsl:text> </xsl:text>, utworzona przez <xsl:value-of select="A_RECORD_CREATE_AUTHOR"/><xsl:text> </xsl:text>
+                        w dniu <xsl:value-of select="A_RECORD_CREATE_DATE"/><xsl:text> </xsl:text>
+                    </title>
+                    <!--<curr><xsl:copy-of select="current-group()"></xsl:copy-of></curr>-->
+                    <!--<curr_parrent><xsl:copy-of select="current-group()/../../."></xsl:copy-of></curr_parrent>-->
+                    <!--<parent><xsl:copy-of select="../../."/></parent>-->
+                    
+                    
+                    <body>
+                        <draft-comment author="a.binder">#1042 - odziedziczone Tu jest blad dla szukania ogolnego - zaklada ze sa kontrahenci - trzeba zrobic funckje TODO 
+                        
+                        </draft-comment>
+                        <p>
+                            
+                            <xsl:apply-templates mode="enter_to_ph_text" select="long_note/text()">
+                                <xsl:with-param name="element" select="'entry'"/>
+                            </xsl:apply-templates>
+                        </p>
+                        <simpletable frame="all" relcolwidth="1* 3* 3*" id="{$uuid}simpletable_rows__child_person_{$group_name}_{$refpos}">
+                            <strow>
+                                <stentry>Lp</stentry>
+                                <!--<stentry>Uwagi!</stentry>-->
+                                <stentry>Osoba od</stentry>
+                                <stentry>Firma do</stentry>
+                            </strow>
+                            <!-- <xsl:for-each select="current-group()[ position() &lt; 10 ] ">-->
+                            <xsl:variable name="current_group_person" select="current-group()/../../../."/>
+                            <xsl:variable name="position_1" select="position()"/>    
+                            <xsl:variable name="firma_do_id" select="../object[position() =  last()]/*[ position() = 1]/ID"/>
+                            
+                            
+                            
+                            <xsl:for-each-group select="current-group()/../../../.[ position() &lt; 10 ] " group-by="object[position() =  last()]/*[ position() = 1]/concat(name(),ID,imiona,nazwisko,pesel,nip)"><!-- firmy do -->
+                                <xsl:variable name="position_1" select="position()"/>    
+                                <xsl:variable name="firma_do_id" select="object[position() =  last()]/*[ position() = 1]/ID"/>
+                                <xsl:comment>#1064 firma do <xsl:value-of select="object[position() =  last()]/*[ position() = 1]/concat(name(),ID,imiona,nazwisko,pesel,nip)"/></xsl:comment>
+                                
+                                <xsl:for-each-group select="$current_group_person[ object[position() = last()]/*[position()=1]/ID = $firma_do_id  and position() &lt; 10 ] " group-by="object[position() =  1]/*[ position() = 1]/concat(name(),ID,imiona,nazwisko,pesel,nip)"> <!-- pracownicy -->
+                                    <xsl:apply-templates mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.middle_ref" select=".">
+                                        <xsl:with-param name="position_1" select="$position_1"/>
+                                        <xsl:with-param name="position" select="position()"/>
+                                    </xsl:apply-templates>
+                                </xsl:for-each-group>
+                            </xsl:for-each-group>
+                            
+                            
+                            <!--</xsl:for-each>-->
+                        </simpletable>
+                    </body>
+                </topic>
+            </xsl:result-document>
+        </topicref>
+        
+        
+    </xsl:template>
+    
+    <xsl:template match="*|text()|comment()" mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.middle_ref.note"/>
+    <xsl:template match="BI_audit_operational_raport_note" mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.middle_ref.note">
+        <xref href="../{system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_operational_raport_note.key(ID)}/{system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_operational_raport_note.key(ID)}_1.dita">
+            <!--<xsl:value-of select="note"/>-->
+        </xref>
+    </xsl:template>
+    
+    
     <xsl:template match="*" mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.middle_ref">
         <xsl:param name="position_1" required="yes"/>
         <xsl:param name="position" required="yes"/>
@@ -949,6 +1392,10 @@
                 <xref href="../{ system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_ENERGA_PRACOWNICY.key(object[ position() = 1]/BI_audit_ENERGA_PRACOWNICY/ID ,object[ position() = last()]/*[ position() = 1]/name(),object[ position() = last()]/*[ position() = 1]/ID,@pos)}.dita">
                     <xsl:value-of select="object[ position() = 1]/*[ position() = 1 ]/concat(imiona,' ',nazwisko,' (',source,')')"/>
                 </xref>
+                <xsl:apply-templates mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.middle_ref.note" select="object[position() =  1]/*[ position() = 1]/*"/>
+                <!--<test>
+                    <xsl:copy-of select="object[position() =  1]/*[ position() = 1]"></xsl:copy-of>
+                </test>-->
             </stentry>
             <stentry>
                 <xsl:choose>
@@ -1393,6 +1840,9 @@
                             </simpletable>
                             
                         </p>
+                        
+                        
+                        
                         <p>
                             Podpisane umowy:<!--(<xsl:value-of select="../BI_audit_ENERGA_RUM_KONTRAHENCI[ID/text()='2816']/BI_audit_ENERGA_RUM_UMOWY/Tytul_dokumentu"/>)-->
                            <!-- (<xsl:value-of select="current()/object[ position() = last() ]/BI_audit_ENERGA_RUM_KONTRAHENCI/ID "/>)-->
@@ -1477,6 +1927,11 @@
                                     </xsl:choose>
                                 </xsl:for-each>
                             </simpletable>
+                            
+                            
+                           
+                            
+                            
                         </p>
                     </body>
                 </topic>
@@ -1834,6 +2289,7 @@
                                                     <xsl:copy-of select="."/>-->
                                                     
                                                     
+                                                    
                                                     <simpletable frame="all" relcolwidth="1* 2* 2* 4*" id="{$uuid}simpletable_rows__child_cheat_7{$group_name.id}_path__{generate-id()}">
                                                         <strow>
                                                             <stentry>Lp</stentry>
@@ -1881,7 +2337,7 @@
                                                                             </xsl:for-each>
                                                                         </xsl:otherwise>
                                                                     </xsl:choose>
-                                                                    
+                                                                    <xsl:apply-templates mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.middle_ref.note" select="*/*"/>
                                                                 </stentry>
                                                             </strow>
                                                         </xsl:for-each>

+ 149 - 4
SE/schema/default_db_xml_cache.public/default_db/Benford.xsl

@@ -64,6 +64,7 @@
     -->
     
     <xsl:param name="Benford:true.tolerance" select="10"/>
+    <xsl:param name="Benford:true.minimal_records" select="20"/>
     
     <xsl:variable name="Benford:true">
         <Benford:true>
@@ -97,7 +98,7 @@
         </xsl:variable>
         
         <xsl:choose>
-            <xsl:when test="$Benford:table_analys//Benford:table_analys.dig[@Benford:digit.occurs = 0 ]">
+            <xsl:when test="$Benford:table_analys//Benford:table_analys.dig[@Benford:digit.occurs = 0 ] and sum($Benford:table_analys//Benford:table_analys.dig/@Benford:digit.occurs) &lt; $Benford:true.minimal_records ">
                 <xsl:comment>#41 $Benford:table_analys not complete all numnbers used - use bigger period</xsl:comment>
                 <Benford:table>
                     <xsl:copy-of select="$Benford:table/@*"/>
@@ -105,6 +106,28 @@
                     <xsl:copy-of select="*"/>
                 </Benford:table>
             </xsl:when>
+            <xsl:when test="$Benford:table_analys//Benford:table_analys.dig[@Benford:digit.occurs = 0 ] ">
+                <xsl:comment>#110 nie ma wszystkich cyfr, trzeba to zaznaczyc i inaczej analizowac - tylko zwiekszone liczby</xsl:comment>
+                <xsl:variable name="Benford:table_analys.dig.all.sum" select="sum($Benford:table_analys//Benford:table_analys.dig/@Benford:digit.occurs)"/>
+                <xsl:for-each select="$Benford:table_analys//Benford:table_analys.dig">
+                    <xsl:variable name="Benford:true.current.dig" select="$Benford:true//Benford:table_analys.dig[number(@Benford:digit) = current()/number(@Benford:digit)]/@Benford:digit.occurs" />
+                    <xsl:variable name="Benford:current.dig.ratio" select="number(@Benford:digit.occurs) div number($Benford:table_analys.dig.all.sum) * 100" />
+                    <xsl:variable name="Benford:current.dig.test.fault" select="number($Benford:current.dig.ratio) - number($Benford:true.current.dig)" />
+                    <xsl:choose>
+                        <xsl:when test=" number($Benford:current.dig.test.fault) &gt; number($Benford:true.tolerance) ">
+                            <Benford:table_analys_exceed>
+                                <xsl:copy-of select="$Benford:table/@*"/>
+                                <xsl:attribute name="Benford:digit" select="@Benford:digit"/>
+                                <xsl:attribute name="Benford:true.current.dig" select="round($Benford:true.current.dig)"/>
+                                <xsl:attribute name="Benford:current.dig.ratio" select="round($Benford:current.dig.ratio)"/>
+                                <xsl:attribute name="Benford:current.dig.test.fault" select="round($Benford:current.dig.test.fault)"/>
+                                <xsl:attribute name="Benford:table_analys.dig.all.sum" select="$Benford:table_analys.dig.all.sum"/>
+                                <xsl:attribute name="Benford:current.dig.test.fault.rel" select="number($Benford:current.dig.ratio) - number($Benford:true.current.dig)"/>
+                            </Benford:table_analys_exceed>
+                        </xsl:when>
+                    </xsl:choose>
+                </xsl:for-each>
+            </xsl:when>
             <xsl:otherwise>
                 <xsl:variable name="Benford:table_analys.dig.all.sum" select="sum($Benford:table_analys//Benford:table_analys.dig/@Benford:digit.occurs)"/>
                 <xsl:for-each select="$Benford:table_analys//Benford:table_analys.dig">
@@ -227,7 +250,104 @@
         </topic>
     </xsl:template>
     
+    <!-- to generate dita topic based on Benford:table - it will shows analyzed data-->
+    <xsl:template match="Benford:table" mode="system_cache__dita:topic">
+        <!-- input: <Benford:table_analys_exceed Benford:year="2012"
+                                                  Benford:subject="Jan Npwak"
+                                                  Benford:digit="8"
+                                                  Benford:true.current.dig="5"
+                                                  Benford:current.dig.ratio="16"
+                                                  Benford:current.dig.test.fault="11"
+                                                  Benford:table_analys.dig.all.sum="37"
+                                                  Benford:current.dig.test.fault.rel="-10"/>
+        -->
+        <xsl:param name="Benford:subject.xml" /> <!-- example "$BI_audit_ENERGA_RUM_UMOWY_fix//default_db:BI_audit_ENERGA_RUM_UMOWY"  -->
+        <xsl:param name="Benford:subject.value" /> <!-- to search against Benford:subject.xml for get value - example  'Wartosc' -->
+        
+        <xsl:param name="Benford:subject" /> <!-- example to search against Benford:subject.xml 'default_db:Osoba_merytoryczna___nazwisko_i_imie'  -->
+        <xsl:param name="Benford:year" /> <!-- to search against shorter period - example  'Data_zawarcia.rok' -->
+        <xsl:param name="Benford:subject.description" /> <!-- to search against Benford:subject.xml for get description - example  'default_db:Przedmiot_umowy default_db:Kontrahenci' -->
+        
+        <xsl:param name="topic.id"/>
+        <xsl:param name="simpletable.id"/>
+        <xsl:param name="id" select="concat('topic__Benford_table_analys_not_exceed',generate-id())"/>
+        <xsl:param name="Benford:force_raport" select="false()"/> <!-- default is to ignore when there is no anomaly - otherwise when true is to show analyzed data subject -->
+        <xsl:variable name="Benford:table_analys_exceed" select="."/>
+        
+        
+        <topic id="{$id}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
+            <title>Nie wykryto anomalii Benford dla <xsl:value-of select="@Benford:subject"/> w <xsl:value-of select="@Benford:year"/> dla liczby <xsl:value-of select="@Benford:digit"/>   liczone dla <xsl:value-of select="count($Benford:subject.xml/node()[name()=$Benford:subject.value])"/> pozycji.
+                <!--Wartość: <xsl:value-of select="sum($Benford:subject.xml [ node()[name()=$Benford:subject] = $Benford:table_analys_exceed/@Benford:subject and substring(node()[name()=$Benford:subject.value],1,1)=$Benford:table_analys_exceed/@Benford:digit and  node()[name()=$Benford:year]=$Benford:table_analys_exceed/@Benford:year  ]/node()[name()=$Benford:subject.value])"/>-->
+                Wartość: <xsl:value-of select="sum($Benford:subject.xml[substring(node()[name()=$Benford:subject.value],1,1)=$Benford:table_analys_exceed/@Benford:digit ] /node()[name()=$Benford:subject.value]) div 1000000"/> [mln]
+               
+            </title>
+            <body>
+                
+                
+                <p>
+                    <xsl:value-of select="round(sum($Benford:subject.xml/node()[name()=$Benford:subject.value]) div 1000)"/> [tys] - ogólna wartość transakcji 
+                    
+                </p>
+                <p>
+                    <xsl:value-of select="count($Benford:subject.xml/node()[name()=$Benford:subject.value]) "/> -  ogólna ilość transakcji 
+                </p>
+                
+                
+                <simpletable frame="all"  relcolwidth="8* 2* 2*" id="topic__Benford_table_analys_not_exceed_simpletable_{ generate-id()}" > <!-- system_cache__dita:width_cols="auto" -->
+                    <sthead>
+                        <stentry>Dane obiektu </stentry>
+                        <stentry>Data</stentry>
+                        <stentry>Kwota</stentry>
+                    </sthead>
+                    
+                    <!--<debug.285.Benford.subject.xml>
+                        <xsl:copy-of select="$Benford:subject.xml"/>
+                    </debug.285.Benford.subject.xml>-->
+                    <!--<debug.285.Benford.subject.xml.count>
+                        <xsl:copy-of select="count($Benford:subject.xml//*)"/>
+                    </debug.285.Benford.subject.xml.count>
+                    <Benford:subject.value>
+                        <xsl:copy-of select="$Benford:subject.value"/>
+                    </Benford:subject.value>
+                    <Benford:year>
+                        <xsl:copy-of select="$Benford:year"/>
+                    </Benford:year>
+                    <Benford:subject.value>
+                        <xsl:copy-of select="$Benford:subject.value"/>
+                    </Benford:subject.value>
+                    <Benford:subject.description>
+                        <xsl:copy-of select="$Benford:subject.description"/>
+                    </Benford:subject.description>
+                    <Benford:force_raport>
+                        <xsl:copy-of select="$Benford:force_raport"/>
+                    </Benford:force_raport>
+                    -->
+                    <!--<xsl:for-each select="$Benford:subject.xml [ node()[name()=$Benford:subject] = $Benford:table_analys_exceed/@Benford:subject and substring(node()[name()=$Benford:subject.value],1,1)=$Benford:table_analys_exceed/@Benford:digit and  node()[name()=$Benford:year]=$Benford:table_analys_exceed/@Benford:year  ]">-->
+                    <xsl:for-each select="$Benford:subject.xml">   
+                        <strow>
+                            <xsl:variable name="current" select="current()"/>
+                            <stentry>
+                                <!--<xsl:value-of select="current()/node()[name()='default_db:Numer_rejestrowy']"/>-->
+                                <xsl:for-each select=" tokenize($Benford:subject.description,' ')">
+                                    <xsl:variable name="nname" select="."/>
+                                    <!--<xsl:comment>#171 checking for name '<xsl:value-of select="$nname"/>'</xsl:comment>-->
+                                    <p><xsl:value-of select="$nname"/>: <xsl:value-of select="$current//node()[name()=$nname]"/></p>
+                                </xsl:for-each>
+                            </stentry>
+                            <stentry><xsl:value-of select="current()/node()[name()=$Benford:year]"/></stentry>
+                            <stentry><xsl:value-of select="system_cache__dita:big_values_format(current()/node()[name()=$Benford:subject.value])"/></stentry>
+                        </strow>
+                    </xsl:for-each>
+                    
+                </simpletable>
+            </body>
+        </topic>
+        
+    </xsl:template>
     
+
+
     <xsl:template match="topichead" mode="Benford:ditamap_root.embedded_map">
         <xsl:apply-templates mode="Benford:ditamap_root.embedded_map"/>
     </xsl:template>
@@ -246,6 +366,15 @@
         </xsl:apply-templates>
     </xsl:template>
     
+    <!--<xsl:template match="lq" mode="Benford:ditamap_root.embedded_map.topic.body">
+        <xsl:param name="topic.id" required="yes"/>
+        <p>
+            <xsl:apply-templates mode="Benford:ditamap_root.embedded_map.topic.body">
+                <xsl:with-param name="topic.id" select="$topic.id"/>
+            </xsl:apply-templates>
+        </p>
+    </xsl:template>-->
+    
     <xsl:template match="simpletable" mode="Benford:ditamap_root.embedded_map.topic.body">
         <xsl:param name="topic.id" required="yes"/>
         <xsl:apply-templates mode="Benford:ditamap_root.embedded_map.topic.body.simpletable">
@@ -290,9 +419,17 @@
         </xsl:element>
     </xsl:template>
     
+    <xsl:template match="@*" mode="Benford:ditamap_root.embedded_map.body.topic.cleanup">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    <xsl:template match="@system_cache__dita:bypass_rows_empty|@system_cache__dita:bypass_rows_with_zero" mode="Benford:ditamap_root.embedded_map.body.topic.cleanup"/>
+        
+    
+    
     <xsl:template match="simpletable" mode="Benford:ditamap_root.embedded_map.body.topic.cleanup" >
         <xsl:element name="{name()}">
-            <xsl:copy-of select="@*"/>
+            <xsl:apply-templates select="@*" mode="Benford:ditamap_root.embedded_map.body.topic.cleanup"/>
             <xsl:apply-templates mode="Benford:ditamap_root.embedded_map.body.topic.cleanup.simpletable"/>
         </xsl:element>
     </xsl:template>
@@ -305,10 +442,12 @@
     </xsl:template>
 
     <xsl:template match="topic" mode="Benford:ditamap_root.embedded_map.body.topic.cleanup.simpletable" >
-        <xsl:copy-of select="system_cache__dita:xref_2_topc(@id,concat('!(B',@Benford:digit,'/',round(@Benford:current.dig.test.fault.rel),')'))"/>
+        <xsl:copy-of select="system_cache__dita:xref_2_topc(@id,concat(' !(B',@Benford:digit,'/',round(@Benford:current.dig.test.fault.rel),')'))"/>
     </xsl:template>
     
-    
+    <xsl:template match="topic[not(@Benford:digit) or not(@Benford:current.dig.test.fault.rel)]" mode="Benford:ditamap_root.embedded_map.body.topic.cleanup.simpletable" >
+        <xsl:copy-of select="system_cache__dita:xref_2_topc(@id,' (?)')"/>
+    </xsl:template>
     
     <!--<xsl:template match="topic" mode="Benford:ditamap_root.embedded_map.body.topic.cleanup.simpletable"/>-->
         
@@ -321,6 +460,12 @@
         </xsl:for-each>
     </xsl:template>
     
+    <xsl:template match="*" mode="Benford:ditamap_root.embedded_map.body.topicref.topic.noref">
+        <xsl:for-each select=".//topic">
+            <xsl:apply-templates select="." mode="system_cache__dita:xref.topic.result-document.noref"/>
+        </xsl:for-each>
+    </xsl:template>
+    
     <xsl:template mode="ditamap_root.embedded_map.body" match="@Benford:value"/>
     <xsl:template mode="system_cache__dita:xref.topic.result-document" match="@Benford:digit"/>
     <xsl:template mode="system_cache__dita:xref.topic.result-document" match="@Benford:current.dig.test.fault|@Benford:current.dig.test.fault.rel"/>

+ 131 - 23
SE/schema/default_db_xml_cache.public/default_db/tree_to_dita.xsl

@@ -137,15 +137,15 @@
     <xsl:include href="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_tree_to_dita.xsl"/>
     <xsl:include href="EXAMPLE/EXAMPLE_tree_to_dita.xsl"/>
     <xsl:include href="Benford.xsl"/>
-        
+    
+    
     <xsl:output indent="yes"/>
     <xsl:strip-space elements="*"/>
     
     <xsl:param name="temp" required="yes"/>
     <xsl:param name="uuid" required="yes"/>
-    
-    <xsl:param name="system_cache__dita:pdf_a4_string_width" select="80"/> <!-- parameter for automate table width - how many letters fits in pdf output -->
-    <xsl:param name="system_cache__dita:simpletable.col.size" select="4"/> <!-- parameter for automate table width - how much space takes every column -->
+    <xsl:param name="system_cache__dita:pdf_a4_string_width" select="60"/> <!-- parameter for automate table width - how many letters fits in pdf output -->
+    <xsl:param name="system_cache__dita:simpletable.col.size" select="5"/> <!-- parameter for automate table width - how much space takes every column -->
     
     <xsl:variable name="ditadir" select="concat($temp,'/',$uuid)"/>
     
@@ -191,9 +191,9 @@
     <xsl:template match="map" mode="ditamap_root">
         <xsl:element name="{name()}">
             <xsl:copy-of select="@*"/>
-        <xsl:copy-of select="title"/>
+            <xsl:copy-of select="title"/>
             <xsl:apply-templates mode="ditamap_root.embedded_map" />
-        <xsl:message>#196 in mode="ditamap_root" digging! </xsl:message>
+            <xsl:message>#196 in mode="ditamap_root" digging! </xsl:message>
             <!--<debug197><xsl:copy-of select="."/></debug197>-->
             <!--<xsl:variable name="Benford:ditamap_root.embedded_map">
                 <xsl:apply-templates mode="Benford:ditamap_root.embedded_map" />
@@ -221,20 +221,49 @@
     
     
     <xsl:template match="topic" mode="ditamap_root.embedded_map">
-        <topicref href="{@id}.dita">
+        <xsl:param name="path_rel"/> <!-- may be ../ -->
+        <xsl:param name="xref" select="'topicref'"/>
+        <xsl:element name="{$xref}">
+            <xsl:choose>
+                <xsl:when test="$xref = 'link'">
+                    <xsl:attribute name="href" select="concat($path_rel,@id,'.dita#',@id)"/>
+                </xsl:when>
+                <xsl:when test="$xref = 'topic'">
+                    <xsl:attribute name="id" select="concat(@id,'_cr')"/>
+                    <xsl:attribute name="conref" select="concat($path_rel,@id,'.dita#',@id)"/>
+                    <title/>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:attribute name="href" select="concat($path_rel,@id,'.dita')"/>
+                </xsl:otherwise>
+            </xsl:choose>
+            
+            <!--<topicref href="{$path_rel}{@id}.dita">-->
             <xsl:variable name="ditamap_root.embedded_map.body">
                 <xsl:apply-templates mode="ditamap_root.embedded_map.body"/>
             </xsl:variable>
             <xsl:result-document href="{$temp}/{$uuid}/{@id}.dita">
                 <xsl:element name="{name()}">
                     <xsl:apply-templates mode="ditamap_root.embedded_map" select="@*"/>
+                   <!-- <debug.248><xsl:copy-of select="."/></debug.248>
+                    <debug.249><xsl:copy-of select="$ditamap_root.embedded_map.body"/></debug.249>-->
                     <!--<xsl:copy-of select="@*"/>-->
                     <xsl:apply-templates mode="Benford:ditamap_root.embedded_map.body.topic.cleanup" select="$ditamap_root.embedded_map.body"/>
                 </xsl:element>
             </xsl:result-document>
-            <xsl:apply-templates mode="Benford:ditamap_root.embedded_map.body.topicref.topic" select="$ditamap_root.embedded_map.body"/>
+            <xsl:choose>
+                <xsl:when test="$xref = 'topic'">
+                    <xsl:apply-templates mode="Benford:ditamap_root.embedded_map.body.topicref.topic.noref" select="$ditamap_root.embedded_map.body"/>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:apply-templates mode="Benford:ditamap_root.embedded_map.body.topicref.topic" select="$ditamap_root.embedded_map.body"/>
+                </xsl:otherwise>
+            </xsl:choose>
+            
+            
             <xsl:apply-templates mode="ditamap_root.embedded_map" />
-        </topicref>
+            <!--</topicref>-->
+        </xsl:element>
     </xsl:template>
     
     <xsl:template mode="ditamap_root.embedded_map.body" match="@*">
@@ -257,7 +286,7 @@
         <xsl:value-of select="."/>
     </xsl:template>
     
-    <xsl:template match="simpletable[ contains(@id,'GRAPH_')]" mode="ditamap_root.embedded_map.body">        
+    <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"/>
@@ -266,7 +295,8 @@
     </xsl:template>
     
     
-    <xsl:template match="simpletable[ count(sthead/stentry) &gt; 6 ]" mode="ditamap_root.embedded_map.body">
+    <xsl:template match="simpletable[ count(sthead/stentry) &gt; 6 or @system_cache__dita:header_cols.relcolwidth ]" mode="ditamap_root.embedded_map.body">
+        <xsl:message terminate="no">#270 die for simpletable <xsl:value-of select="@id"/></xsl:message>
         <xsl:variable name="system_cache__dita:max_strings">
             <xsl:call-template name="system_cache__dita:max_strings">
                 <xsl:with-param name="simpletable" select="."/>
@@ -344,8 +374,8 @@
                 <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>
@@ -366,9 +396,8 @@
     
     <xsl:template mode="preprocess_root.embedded_map" match=" text()|comment()"/>
         
-    
-    
-<!-- TODO 2017-10-20 to implement -->  
+        
+        <!-- TODO 2017-10-20 to implement -->
     <xsl:template mode="table_cut" match="simpletable">
         <xsl:param name="width_cols"  select="6"/>
         <xsl:param name="header_cols" select="1"/>
@@ -394,7 +423,9 @@
         
         <xsl:for-each select="1 to xs:integer($to) ">
             <xsl:if test="xs:integer($to) &gt; 1">
-                Tabela podzielona - część <xsl:value-of select="position()"/>/<xsl:value-of select="xs:integer($to)"/>.
+                <lq>Tabela podzielona - część <xsl:value-of select="position()"/>/<xsl:value-of select="xs:integer($to)"/>.
+                    <!--$width_cols=<xsl:value-of select="$width_cols"/>; $start_row=<xsl:value-of select="$start_row"/> ; $start_col=<xsl:value-of select="$start_col"/>; $position=<xsl:value-of select=" current()"/>; $start_col.param = <xsl:value-of select="current() * $width_cols - $width_cols + 1"/>-->
+                </lq>
             </xsl:if>
             <xsl:apply-templates mode="table_cut.strow" select="$simpletable">
                 <xsl:with-param name="width_cols"  select="$width_cols"/>
@@ -471,11 +502,11 @@
         <xsl:variable name="simpletable" select="."/>
         <xsl:variable name="simpletable.id" select="concat($uuid,'_',@id,'_',$start_col)"/>
         <xsl:message>#325 starting $start_col=<xsl:value-of select="$start_col"/>;</xsl:message>
-        <xsl:variable name="add_to_once" select="$position">
-            <!--<xsl:choose>
+        <xsl:variable name="add_to_once" > <!-- select="$position" -->
+            <xsl:choose>
                 <xsl:when test="$start_col = 1"><xsl:value-of select="xs:integer(0)"/></xsl:when>
-                <xsl:otherwise><xsl:value-of select="xs:integer(1)"/></xsl:otherwise>
-            </xsl:choose>-->
+                <xsl:otherwise><xsl:value-of select="xs:integer($position - 1)"/></xsl:otherwise>
+            </xsl:choose>
         </xsl:variable>
         
         <xsl:variable name="cols_count" > <!--  select="$header_cols - 1 + $start_col + $header_cols  - $start_col + $header_cols + $width_cols" -->
@@ -566,12 +597,15 @@
                         <!--<xsl:message>#547 $simpletable/@system_cache__dita:bypass_rows_with_zero  - <xsl:value-of select="$simpletable/@system_cache__dita:bypass_rows_with_zero"/> ; <xsl:value-of select="$strow_test/stentry[ position() &gt; $header_cols and not( text()='0')]"/></xsl:message>-->
                         
                         <xsl:choose>
-                            <xsl:when test="$simpletable/@system_cache__dita:bypass_rows_empty and $simpletable/@system_cache__dita:bypass_rows_with_zero and $strow_test//stentry[ position() &gt; $header_cols and ( text() and not( text()='0')  )]">
+                            <!--<xsl:when test="$simpletable/@system_cache__dita:bypass_rows_empty">
+                                <xsl:message terminate="yes">#598 @system_cache__dita:bypass_rows_empty for <xsl:value-of select="@id"/> ;</xsl:message>
+                            </xsl:when>-->
+                            <xsl:when test="$simpletable/@system_cache__dita:bypass_rows_empty and $simpletable/@system_cache__dita:bypass_rows_with_zero and $strow_test//stentry[ position() &gt; $header_cols and ( text() and not( number(text())=0)  )]">
                                 <xsl:comment>#549c not ignored @system_cache__dita:bypass_rows_empty and @system_cache__dita:bypass_rows_with_zero </xsl:comment>
                                 <xsl:message>#549c not ignored @system_cache__dita:bypass_rows_empty and @system_cache__dita:bypass_rows_with_zero </xsl:message>
                                 <xsl:copy-of select="$strow_test"/>
                             </xsl:when>
-                            <xsl:when test="$simpletable/@system_cache__dita:bypass_rows_with_zero and not($simpletable/@system_cache__dita:bypass_rows_empty) and $strow_test//stentry[ position() &gt; $header_cols and  not( text()='0' )  ]">
+                            <xsl:when test="$simpletable/@system_cache__dita:bypass_rows_with_zero and not($simpletable/@system_cache__dita:bypass_rows_empty) and $strow_test//stentry[ position() &gt; $header_cols and  not( number(text())=0 )  ]">
                                 <xsl:comment>#549a not ignored @system_cache__dita:bypass_rows_with_zero  </xsl:comment>
                                 <xsl:message>#549a not ignored @system_cache__dita:bypass_rows_with_zero <xsl:value-of select="$strow_test//stentry[ position() &gt; $header_cols and not( text()='0')]"/> </xsl:message>
                                 <xsl:copy-of select="$strow_test"/>
@@ -685,6 +719,57 @@
         </topicref>
     </xsl:template>
     
+    <xsl:template match="*" mode="system_cache__dita:xref.topic.result-document.noref">
+       <!-- <topicref href="{@id}.dita">-->
+            <xsl:result-document href="{system_cache__dita:xref_result-document(@id)}">
+                <xsl:element name="{name()}">
+                    <xsl:apply-templates select="@*" mode="system_cache__dita:xref.topic.result-document"/>
+                    <!--<xsl:copy-of select="@*"/>-->
+                    <xsl:copy-of select="*"/>
+                </xsl:element>
+            </xsl:result-document>
+        <!--</topicref>-->
+    </xsl:template>
+    
+    
+    <xsl:template match="text()|comment()" mode="ditamap_root.embedded_map.topic_child_to_ditamap"/>
+    <xsl:template match="text()|comment()" mode="ditamap_root.embedded_map.topic_child_to_ditamap.child"/>  
+    
+    
+    <xsl:template match="*" mode="ditamap_root.embedded_map.topic_child_to_ditamap">
+        <xsl:param name="path_rel" required="yes"/>
+        <xsl:apply-templates mode="ditamap_root.embedded_map.topic_child_to_ditamap">
+            <xsl:with-param name="path_rel" select="$path_rel"/>
+        </xsl:apply-templates>
+    </xsl:template>
+    <xsl:template match="topic" mode="ditamap_root.embedded_map.topic_child_to_ditamap">
+        <xsl:param name="path_rel" required="yes"/>
+        <!--<xsl:comment>#745 matched topic; @id=<xsl:value-of select="@id"/>; </xsl:comment>-->
+        <xsl:apply-templates mode="ditamap_root.embedded_map.topic_child_to_ditamap.child">
+            <xsl:with-param name="path_rel" select="$path_rel"/>
+        </xsl:apply-templates>
+    </xsl:template>
+    
+    <xsl:template match="*" mode="ditamap_root.embedded_map.topic_child_to_ditamap.child">
+        <xsl:param name="path_rel" required="yes"/>
+        <!--<xsl:comment>#753 matched <xsl:value-of select="name()"/>; @id=<xsl:value-of select="@id"/>; </xsl:comment>-->
+        <xsl:apply-templates mode="ditamap_root.embedded_map.topic_child_to_ditamap.child">
+            <xsl:with-param name="path_rel" select="$path_rel"/>
+        </xsl:apply-templates>
+    </xsl:template>
+    
+    <xsl:template match="topic" mode="ditamap_root.embedded_map.topic_child_to_ditamap.child">
+        <xsl:param name="path_rel" required="yes"/>
+        <xsl:comment>#761 matched <xsl:value-of select="name()"/> @id=<xsl:value-of select="@id"/>; </xsl:comment>
+        <xsl:element name="topicref">
+            <xsl:attribute name="toc" select="'no'"/>
+            <xsl:attribute name="href" select="concat($path_rel,@id,'.dita')"/>
+        </xsl:element>
+    </xsl:template>
+    
+    
+    
+    
     
     <xsl:template match="simpletable"  mode="table_cut.local_xref">
         <xsl:param name="header_cols" required="yes"/>
@@ -698,6 +783,10 @@
         </xsl:element>
     </xsl:template>
     
+    <xsl:template match="lq"  mode="table_cut.local_xref">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
     <xsl:template match="sthead"  mode="table_cut.local_xref">
         <xsl:copy-of select="."/>
     </xsl:template>
@@ -776,4 +865,23 @@
         <xsl:value-of select="concat($Benford:subject,'_',$Benford:year)"/>
     </xsl:function>
     
+    
+    <xsl:function name="system_cache__dita:big_values_format">
+        <xsl:param name="value"/>
+        <xsl:choose>
+            <xsl:when test="$value &lt; 1000">
+                <xsl:value-of select='format-number($value, "#.0")'/>
+            </xsl:when>
+            <xsl:when test="$value &lt; 1000000">
+                <xsl:value-of select='format-number($value div 1000, "#.0")'/> k
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:value-of select='format-number($value div 100000, "#.0")'/> m
+            </xsl:otherwise>
+        </xsl:choose>
+        
+        
+    </xsl:function>
+    
+    
 </xsl:stylesheet>

+ 137 - 4
SE/schema/default_db_xml_cache.public/get_all_xsd.xsl

@@ -18,6 +18,8 @@
     <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:param name="default_db.dir" select="'/public_html/default_db/'"/>
+    <xsl:param name="default_db_xml_cache.public" select="'/public_html/default_db_xml_cache.public/'"/>
     
     <xsl:include href="../default_db_xml_cache.public/xml-schema-primitives.xsl"/>
     <xsl:include href="system_cache__appinfo/external_schema_targetNamespace.xsl"/>
@@ -150,8 +152,41 @@
                 <xsl:apply-templates mode="system_cache__appinfo:get_all_xsd_external_schema__equals"/>
             </xsl:template>  
             -->
+    <xsl:template match="complexType" mode="system_cache__appinfo:get_all_xsd_default_db__equals" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" >
+        <xsl:param name="system_cache__appinfo:get_all_xsd.row" required="yes"/>
+        <xsl:if test="not($system_cache__appinfo:get_all_xsd.row/*)">
+            <not_equals>
+                <xsl:attribute name="empty" select="@name"/>
+            </not_equals>
+        </xsl:if>
+        <xsl:variable name="system_cache__appinfo:get_all_xsd.row">
+            <var>
+                <xsl:for-each select="$system_cache__appinfo:get_all_xsd.row/*">
+                    <xsl:element name="{name()}">
+                        <xsl:attribute name="pos" select="position()"/>
+                        <xsl:copy-of select="@*"/>
+                        <xsl:copy-of select="*"/>
+                    </xsl:element>
+                </xsl:for-each>
+            </var>
+        </xsl:variable>
+        <system_cache__appinfo:get_all_xsd_default_db__equals>
+            <xsl:copy-of select="@*"/>
+            <xsl:call-template name="system_cache__appinfo:get_all_xsd_default_db__equals">
+                <xsl:with-param name="system_cache__appinfo:get_all_xsd_default_db" select=".[*]"/>
+                <xsl:with-param name="system_cache__appinfo:get_all_xsd.row" select="$system_cache__appinfo:get_all_xsd.row"/>
+            </xsl:call-template>
+            <!--<system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix>
+                        <xsl:copy-of select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix"></xsl:copy-of>
+                    </system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix>-->
+        </system_cache__appinfo:get_all_xsd_default_db__equals>
+    </xsl:template>
+    
+    
             <xsl:template match="system_cache__appinfo:get_all_xsd_external_schema" mode="system_cache__appinfo:get_all_xsd_external_schema__equals" >
                 <xsl:param name="system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix" required="yes"/>
+                
+                
                 <xsl:variable name="system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix">
                     <var>
                         <xsl:for-each select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix/*">
@@ -183,9 +218,85 @@
                 </xsl:apply-templates>
             </xsl:template>-->
     
+    <xsl:template  name="system_cache__appinfo:get_all_xsd_default_db__equals" >
+        <xsl:param name="system_cache__appinfo:get_all_xsd_default_db" required="yes"/>
+        <xsl:param name="system_cache__appinfo:get_all_xsd.row" required="yes"/>
+        
+        <!--<pre_external_schema>
+                    <xsl:for-each select="$system_cache__appinfo:get_all_xsd_external_schema/*">
+                        <xsl:element name="{name()}"><xsl:copy-of select="@*"/></xsl:element>
+                    </xsl:for-each>
+                </pre_external_schema>
+                <pre_schema_id_namespace_prefix>
+                    <xsl:for-each select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix/var/*">
+                        <xsl:element name="{name()}"><xsl:copy-of select="@*"/></xsl:element>
+                    </xsl:for-each>
+                </pre_schema_id_namespace_prefix>-->
+        
+        <xsl:for-each select="$system_cache__appinfo:get_all_xsd_default_db/*">
+            <xsl:variable name="position" select="position()"/>
+            <xsl:comment> Try position <xsl:value-of select="$position"/>;</xsl:comment>
+            
+            <xsl:choose>
+                <!--<xsl:when test="not($position = $pos)">
+                                <not_pos>
+                                    <xsl:attribute name="pos" select="$pos"/>
+                                    <xsl:attribute name="position" select="$position"/>
+                                    <xsl:attribute name="expected" select="local-name()"/>
+                                </not_pos>
+                            </xsl:when>-->
+                <xsl:when test="$system_cache__appinfo:get_all_xsd.row/var/*[ @pos = $position]/local-name() = local-name()">
+                                <equals>
+                                    <xsl:attribute name="position" select="position()"/>
+                                    <xsl:attribute name="expected" select="local-name()"/>
+                                    <xsl:attribute name="found" select="$system_cache__appinfo:get_all_xsd.row/var/*[ @pos = $position]/local-name()"/>
+                                    <xsl:attribute name="found.name" select="$system_cache__appinfo:get_all_xsd.row/var/*[ @pos = $position]/@name"/>
+                                    
+                                    <xsl:attribute name="first_el_par" select="$system_cache__appinfo:get_all_xsd.row/var[1]/name()"/>
+                                </equals>
+                    <!--<xsl:message>#170 comp equal <xsl:value-of select="local-name()"/> === <xsl:value-of select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix[ position() = $position]/local-name()"/></xsl:message>-->
+                </xsl:when>
+                <xsl:otherwise>
+                    <not_equals>
+                        <xsl:attribute name="position" select="position()"/>
+                        <xsl:attribute name="expected" select="local-name()"/>
+                        <xsl:attribute name="expected.name" select="@name"/>
+                        <xsl:attribute name="found" select="$system_cache__appinfo:get_all_xsd.row/var/*[  @pos = $position]/local-name()"/>
+                        <xsl:attribute name="found.name" select="$system_cache__appinfo:get_all_xsd.row/var/*[  @pos = $position]/@name"/>
+                        <xsl:attribute name="found_id" select="$system_cache__appinfo:get_all_xsd.row/var/*[  @pos = $position]/@id"/>
+                        <xsl:attribute name="found_pos" select="$system_cache__appinfo:get_all_xsd.row/var/*[  @pos = $position]/@pos"/>
+                        <xsl:attribute name="first_el_par" select="$system_cache__appinfo:get_all_xsd.row/var/*[1]/name()"/>
+                    </not_equals>
+                </xsl:otherwise>
+            </xsl:choose>
+            
+            <!--<child>-->
+            <xsl:variable name="system_cache__appinfo:get_all_xsd_default_db_new">
+                <var>
+                    <xsl:for-each select="$system_cache__appinfo:get_all_xsd.row/var/*[@pos=$position]/*">
+                        <xsl:element name="{name()}">
+                            <xsl:attribute name="pos" select="position()"/>
+                            <xsl:copy-of select="@*"/>
+                            <xsl:copy-of select="*"/>
+                        </xsl:element>
+                    </xsl:for-each>
+                </var>
+            </xsl:variable>
+            <!--<test_var_new><xsl:copy-of select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix_new"/></test_var_new>-->
+            <xsl:call-template name="system_cache__appinfo:get_all_xsd_default_db__equals">
+                <xsl:with-param name="system_cache__appinfo:get_all_xsd_default_db" select=".[*]"/>
+                <xsl:with-param name="system_cache__appinfo:get_all_xsd.row" select="$system_cache__appinfo:get_all_xsd_default_db_new/.[*]"/>
+            </xsl:call-template>
+            <!--</child>-->
+            
+        </xsl:for-each>
+    </xsl:template>
+    
+    
             <xsl:template  name="system_cache__appinfo:get_all_xsd_external_schema__equals" >
                 <xsl:param name="system_cache__appinfo:get_all_xsd_external_schema" required="yes"/>
                 <xsl:param name="system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix" required="yes"/>
+                
                 <!--<pre_external_schema>
                     <xsl:for-each select="$system_cache__appinfo:get_all_xsd_external_schema/*">
                         <xsl:element name="{name()}"><xsl:copy-of select="@*"/></xsl:element>
@@ -475,7 +586,7 @@
     <!-- EOF external schema templates -->
     
     
-
+    
     <xsl:template name="system_cache__appinfo:get_all_xsd.verify_unique_id">
         <system_cache__appinfo:get_all_xsd.verify_unique_id>
             <xsl:variable name="system_cache__appinfo:get_all_xsd" select="doc($procesy5_system_schema)"/>
@@ -495,7 +606,7 @@
         </system_cache__appinfo:get_all_xsd.verify_unique_id>
     </xsl:template>
     
-
+    
     <xsl:template name="system_cache__appinfo:get_all_xsd">
         <xsl:param name="path2collection" select="$procesy5_system_schema_collection_dir"/> 
         <xsl:param name="get_system_schemas"/>
@@ -559,6 +670,28 @@
                                     </xsl:apply-templates>
                                 </system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix>
                             </xsl:when>
+                            <xsl:when test=" contains(document-uri(/), $default_db_xml_cache.public)">
+                                <system_cache__appinfo:get_all_xsd.default_db_xml_cache.public>
+                                    <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), '/public_html/')"/>
+                                    <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
+                                    <xsl:copy-of select="/"/>
+                                </system_cache__appinfo:get_all_xsd.default_db_xml_cache.public>
+                            </xsl:when>
+                            
+                            <xsl:when test=" contains(document-uri(/), $default_db.dir)">
+                                <system_cache__appinfo:get_all_xsd_default_db>
+                                    <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), '/public_html/')"/>
+                                    <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
+                                    <xsl:copy-of select="/"/>
+                                </system_cache__appinfo:get_all_xsd_default_db>
+                            </xsl:when>
+                            <xsl:when test=" contains(document-uri(/), $external_schema_table.path)">
+                                <system_cache__appinfo:get_all_xsd_external_schema_table>
+                                    <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), '/public_html/')"/>
+                                    <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
+                                    <xsl:copy-of select="/"/>
+                                </system_cache__appinfo:get_all_xsd_external_schema_table>
+                            </xsl:when>
                             <xsl:otherwise>
                                 <system_cache__appinfo:get_all_xsd>
                                     <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), '/public_html/')"/>
@@ -646,9 +779,9 @@
     
     <xsl:template match="system_cache__appinfo:get_all_xsd_list" mode="system_cache__appinfo:vrtfNamespaces">
         <system_cache__appinfo:vrtfNamespaces>
-            <xsl:for-each select="//(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/schema/namespace::node()"
+            <xsl:for-each select="//(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix|system_cache__appinfo:get_all_xsd_default_db)/schema/namespace::node()"
                 xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
-                <ns element="{name(..)}" prefix="{name()}" uri="{.}" system_cache__appinfo:document-uri="{../@system_cache__appinfo:document-uri}"/>
+                <ns element="{name(..)}" prefix="{name()}" uri="{.}" system_cache__appinfo:document-uri="{../../@system_cache__appinfo:document-uri}"/>
             </xsl:for-each>
         </system_cache__appinfo:vrtfNamespaces>
     </xsl:template>

+ 5 - 5
SE/schema/default_db_xml_cache.public/get_wfs_recurse_xsl.xsl

@@ -235,7 +235,7 @@
                        <xsl:copy-of select="$OGC_Filter"/>
                    </Filter>-->
         </xsl:if>
-        <xsl:variable name="request_string" select="concat('?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=',$get_wfs_recurse_xsl:typeNameRealResource,$OGC_Filter,'&amp;SRSNAME=EPSG:3003')"/>
+        <xsl:variable name="request_string" select="concat('?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=',$get_wfs_recurse_xsl:typeNameRealResource,$OGC_Filter,'&amp;SRSNAME=EPSG:3003')"/> <!-- &amp;MAXFEATURES=15 -->
         <xsl:variable name="url_string" select="concat($protocol,$username,':',$username.pass,'@',$api,'/',$targetNamespace_DEFAULTS_prefix,'/',$request_string)"/>
         <xsl:variable name="get_wfs_recurse_xsl:wfs_response" select="doc($url_string)"/>
         <xsl:if test="$debug &gt; 5">
@@ -246,8 +246,8 @@
                 
                 <!--<xsl:copy-of select="$wfs_response"/>-->
                 
-                <!--<xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response"/>-->
-            <xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response"/></wfs_response>
+                <xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response"/>
+            </wfs_response>
         </xsl:if>
         <xsl:apply-templates mode="after_first_ant_assing_vars" select="$get_wfs_recurse_xsl:GetsimpleSchema">
             <xsl:with-param name="get_wfs_recurse_xsl:wfs_response" select="$get_wfs_recurse_xsl:wfs_response"/>
@@ -317,7 +317,7 @@
                           <xsl:copy-of select="$OGC_Filter"/>
                       </Filter>-->
         </xsl:if>
-        <xsl:variable name="request_string" select="concat('?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=',$get_wfs_recurse_xsl:typeNameRealResource,$OGC_Filter,'&amp;SRSNAME=EPSG:3003')"/>
+        <xsl:variable name="request_string" select="concat('?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=',$get_wfs_recurse_xsl:typeNameRealResource,$OGC_Filter,'&amp;SRSNAME=EPSG:3003')"/> <!-- &amp;MAXFEATURES=15 -->
         <xsl:variable name="url_string" select="concat($protocol,$username,':',$username.pass,'@',$api,'/',$targetNamespace_DEFAULTS_prefix,'/',$request_string)"/>
         <xsl:variable name="get_wfs_recurse_xsl:wfs_response" select="doc($url_string)"/>
         <xsl:if test="$debug &gt; 5">
@@ -382,7 +382,7 @@
                       <xsl:copy-of select="$OGC_Filter"/>
                   </Filter>-->
         
-        <xsl:variable name="request_string" select="concat('?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=',$get_wfs_recurse_xsl:typeNameRealResource,$OGC_Filter,'&amp;SRSNAME=EPSG:3003')"/>
+        <xsl:variable name="request_string" select="concat('?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=',$get_wfs_recurse_xsl:typeNameRealResource,$OGC_Filter,'&amp;SRSNAME=EPSG:3003')"/> <!-- &amp;MAXFEATURES=15 -->
         <xsl:variable name="url_string" select="concat($protocol,$username,':',$username.pass,'@',$api,'/',$targetNamespace_DEFAULTS_prefix,'/',$request_string)"/>
         <xsl:variable name="get_wfs_recurse_xsl:wfs_response" select="doc($url_string)"/>
         <xsl:if test="$debug &gt; 4">

+ 9 - 2
SE/schema/default_db_xml_cache.public/system_cache__appinfo/external_schema_targetNamespace.xsl

@@ -9,7 +9,7 @@
     
     <xsl:output indent="yes"/>
     <xsl:strip-space elements="*"/>
-      
+    
     <xsl:param name="default_db_targetNamespace_detect_string" select="'default_db/table/'"/>
     
     <xsl:function name="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace">
@@ -59,7 +59,7 @@
             </xsl:when>
             <xsl:otherwise>
                 <xsl:value-of select="concat($targetNamespace,'.xsd')"/>
-    </xsl:otherwise>
+            </xsl:otherwise>
         </xsl:choose>
     </xsl:function>
     
@@ -85,5 +85,12 @@
         <xsl:value-of select="system_cache__appinfo:escape_object_prefix_to_string(concat($prefix,':',$generate_tables_from_external_root.path.last_token))"/>
     </xsl:function>
     
+    <!-- to extract from system_cache__appinfo:xpath="p5_zasob_17666:sys_users/UserId" sys_users - use in build_object_install_se_ant_object.xsl -->
+    <xsl:function name="system_cache__appinfo:xpath.to.root_table">
+        <xsl:param name="system_cache__appinfo:xpath"/> <!-- like p5_zasob_17666:sys_users/UserId -->
+        <xsl:variable name="result" select=" substring-before($system_cache__appinfo:xpath,'/')"/>
+        <xsl:if test="string-length($result) &lt; 1"><xsl:message terminate="yes">#92 incorrect arg <xsl:value-of select="$system_cache__appinfo:xpath"/> should be like p5_zasob_17666:sys_users/UserId</xsl:message></xsl:if>
+        <xsl:value-of select=" system_cache__appinfo:clean_object_prefix($result)"/>
+    </xsl:function>
     
 </xsl:stylesheet>

Неке датотеке нису приказане због велике количине промена