a.binder il y a 8 ans
Parent
commit
c079c71c4a

+ 4 - 5
SE/schema/default_db_xml_cache.public/build_ant_universal_by_xsl_match.xsl

@@ -30,10 +30,9 @@
     <xsl:param name="threadCount" select="10"/>
     <xsl:param name="ant-launcher.jar" required="yes"/>
     <xsl:param name="debug_level_param"/>
-
-<!--<xsl:param name="external_schema_table.path" required="yes"/>-->        
+    <!--<xsl:param name="external_schema_table.path" required="yes"/>-->
+    
     
-
     <xsl:template mode="build_element_complexType.xml build_tr_map.xml" match="system_cache__appinfo:element_complexType"> <!-- for type generate in main build.xml mode -->
                 <project basedir="{$basedir}" name="{$antfile_prefix}" default="{$antfile_prefix}"
                     xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd">
@@ -81,7 +80,7 @@
             <param name="default_db.instance.xml.symlink">
                 <xsl:attribute name="expression" select="'${default_db.instance.xml.symlink}'"/>
             </param>
-            <param name="vrtfNamespaces_file" >
+            <param name="vrtfNamespaces.xml" >
                 <xsl:attribute name="expression" select="'${vrtfNamespaces.xml}'"/>
             </param>
             <param name="procesy5_system_schema_file" >
@@ -134,7 +133,7 @@
                 <param name="default_db.instance.xml.symlink">
                     <xsl:attribute name="expression" select="'${default_db.instance.xml.symlink}'"/>
                 </param>
-                <param name="vrtfNamespaces_file" >
+                <param name="vrtfNamespaces.xml" >
                     <xsl:attribute name="expression" select="'${vrtfNamespaces.xml}'"/>
                 </param>
                 <param name="procesy5_system_schema_file" >

+ 68 - 6
SE/schema/default_db_xml_cache.public/build_object_install_se_ant_object.xsl

@@ -15,13 +15,13 @@
     
     
     <xsl:param name="NamespaceBinding.xml" required="yes"/> <!-- to set propery install prefix -->
-    <xsl:param name="vrtfNamespaces.xml" required="yes"/>
+    <!--<xsl:param name="vrtfNamespaces.xml" required="yes"/>-->
     <!--<xsl:param name="external_schema_table.path" required="yes"/>-->
     
     
     <xsl:variable name="NamespaceBinding" select="doc($NamespaceBinding.xml)"/>
     
-    <xsl:variable name="system_cache__appinfo:vrtfNamespaces" select="doc($vrtfNamespaces.xml)"/>
+    <!--<xsl:variable name="system_cache__appinfo:vrtfNamespaces" select="doc($vrtfNamespaces.xml)"/>-->
     
     
    
@@ -55,7 +55,7 @@
         </xsl:apply-templates>
     </xsl:template>
     
-    <xsl:template match="system_cache__appinfo:get_all_xsd[xs:schema/@targetNamespace='https://biuro.biall-net.pl/wfs/default_db/table/ADMIN_USERS.xsd']" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external"> <!-- FILTERING [xs:schema/@targetNamespace='https://biuro.biall-net.pl/wfs/default_db/table/ADMIN_USERS.xsd'] -->
+    <xsl:template match="system_cache__appinfo:get_all_xsd" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external"> <!-- FILTERING [xs:schema/@targetNamespace='https://biuro.biall-net.pl/wfs/default_db/table/ADMIN_USERS.xsd'] -->
         <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external">
             <xsl:with-param name="system_cache__appinfo:document-uri-orig" select="@system_cache__appinfo:document-uri"/>
         </xsl:apply-templates>
@@ -435,6 +435,7 @@
             <xsl:element name="{name()}">
                 <xsl:copy-of select="@*"/>
                      <xsl:variable name="build_element_cache">
+                         <xsl:message>#458 calling system_cache__appinfo:build_element_cache for $targetNamespace=<xsl:value-of select="$targetNamespace"/>; </xsl:message>
                          <xsl:call-template name="system_cache__appinfo:build_element_cache">
                              <xsl:with-param name="element" select="@name"/>
                              <xsl:with-param name="prefix" select="$prefix"/>
@@ -469,12 +470,16 @@
     
     <!--<xsl:template match="complexType[ not(@name='sys_users') and not(@name='crm_families') and not(@name='crm_coordinators') and not(@name='crm_addressesfamilieslinks') and  ../.././name()='system_cache__appinfo:get_all_xsd_default_db']" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external"/>--> <!-- not(@name='sys_users') and not(@name='crm_families') and not(@name='crm_coordinators') and not(@name='crm_addressesfamilieslinks') and -->
     
+    <xsl:template match="element[  ../.././name()='system_cache__appinfo:get_all_xsd_default_db']" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external"> <!-- (@name='crm_families' or @name='crm_addressesfamilieslinks' or @name='crm_coordinators' or @name='sys_users') and -->
+        <xsl:message>#474 bypassed ROOT element/@name=<xsl:value-of select="@name"/></xsl:message>
+    </xsl:template>
+    
     <xsl:template match="complexType[  ../.././name()='system_cache__appinfo:get_all_xsd_default_db']" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external"> <!-- (@name='crm_families' or @name='crm_addressesfamilieslinks' or @name='crm_coordinators' or @name='sys_users') and -->
         <xsl:param name="prefix" required="yes"/>
         <xsl:param name="targetNamespace" required="yes"/>
         <xsl:param name="prefix_root"  required="yes"/>
         <xsl:param name="targetNamespace_root" required="yes"/>
-        
+        <!-- TODO testing @2017-12-13 if has run element -->
         <xsl:variable name="element" select="@name"/>
         <xsl:variable name="element-filename" >
             <xsl:choose>
@@ -512,6 +517,7 @@
                     <xsl:copy-of select="$prefixed_object_info"/>
                 </prefixed_object_info>
             </xsl:if>
+            <xsl:message>#516 NOT calling system_cache__appinfo:build_element_cache</xsl:message>
             <xsl:variable name="build_element_cache">
                 <xsl:copy-of select="."/>
             </xsl:variable>
@@ -577,7 +583,9 @@
                         </generate_tables_from_external_root.required_by.path_init>
                     </xsl:element>
                 </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+                <xsl:message>#586 will element=<xsl:value-of select="$element"/>; (foreach) call system_cache__appinfo:xpath.to.root_table(@system_cache__appinfo:xpath) = <xsl:value-of select="@system_cache__appinfo:xpath"/> in $targetNamespace=<xsl:value-of select="$targetNamespace"/>;</xsl:message>
                 <xsl:for-each-group select="../xs:complexType//system_cache__appinfo:flat_relation_cache[ system_cache__appinfo:xpath.to.root_table(@system_cache__appinfo:xpath) = current()/@name ]" group-by="@system_cache__appinfo:name" >
+                    <xsl:message>#583 will ( IN foreach) call system_cache__appinfo:xpath.to.root_table(@system_cache__appinfo:xpath) = <xsl:value-of select="@system_cache__appinfo:xpath"/></xsl:message>
                     <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
                         <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
                         <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
@@ -591,6 +599,7 @@
                             <xsl:attribute name="id" select="concat($id,'ct',@system_cache__appinfo:name)"/>
                             <xs:complexContent>
                                 <xs:extension>
+                                    <xsl:message>#600 calling concat($prefix,':',system_cache__appinfo:xpath.to.root_table(@system_cache__appinfo:xpath)) with @system_cache__appinfo:xpath=(<xsl:value-of select="@system_cache__appinfo:xpath"/>)</xsl:message>
                                     <xsl:attribute name="base" select="concat($prefix,':',system_cache__appinfo:xpath.to.root_table(@system_cache__appinfo:xpath))"/>
                                     <generate_tables_from_external_root.required_by.path_init>
                                         <xsl:attribute name="prefix" select="$prefix"/>
@@ -610,6 +619,7 @@
                         <xsl:element name="xs:element">
                             <xsl:attribute name="name" select="@system_cache__appinfo:name"/>
                             <xsl:attribute name="id" select="concat($id,'el',@system_cache__appinfo:name)"/>
+                            <xsl:message>#5621 will call system_cache__appinfo:xpath.to.root_table(@system_cache__appinfo:xpath) = <xsl:value-of select="@system_cache__appinfo:xpath"/></xsl:message>
                             <xsl:attribute name="type" select="concat($prefix,':',system_cache__appinfo:xpath.to.root_table(@system_cache__appinfo:xpath))"/>
                                     <generate_tables_from_external_root.required_by.path_init>
                                         <xsl:attribute name="prefix" select="$prefix"/>
@@ -650,7 +660,7 @@
         </xsl:variable>
         <xsl:variable name="prefix_token" select="tokenize(system_cache__appinfo:translate_object_escaped_prefix_from_string($element-filename),':')"/>
         <xsl:variable name="translate_object_escaped_prefix_from_string" select="system_cache__appinfo:translate_object_escaped_prefix_from_string($element-filename)"/>
-        <xsl:message>#186 parsing CT: <xsl:value-of select="@name"/>  ; </xsl:message>
+        <!--<xsl:message>#186 parsing CT: <xsl:value-of select="@name"/>  ; </xsl:message>-->
         
         <system_cache__appinfo:build_complexType>
             <xsl:copy-of select="@*"/>
@@ -667,6 +677,7 @@
             </prefixed_object_info>
             </xsl:if>
             <xsl:variable name="build_element_cache">
+                <xsl:message>#671 calling system_cache__appinfo:build_complexType_cache</xsl:message>
                 <xsl:call-template name="system_cache__appinfo:build_complexType_cache">
                     <xsl:with-param name="complexType" select="@name"/>
                     <xsl:with-param name="prefix" select="$prefix"/>
@@ -1594,6 +1605,40 @@
             </xsl:element>
     </xsl:template>
     
+    <xsl:template match="simpleType" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.get_all_xsd_default_db" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:param name="generate_tables_from_external_root.name" select="@name"/>
+        <xsl:param name="generate_tables_from_external_root.path" select="@name"/>
+        <xsl:param name="targetNamespace" required="yes"/>
+        <xsl:param name="prefix" required="yes"/>
+        <xsl:param name="prefix_root"  required="yes"/>
+        <xsl:param name="targetNamespace_root" required="yes"/>
+        
+        <system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+            <xsl:attribute name="generate_tables_from_external_root.name" select="$generate_tables_from_external_root.name"/>
+            <xsl:attribute name="generate_tables_from_external_root.path" select="$generate_tables_from_external_root.path"/>
+            <xsl:attribute name="prefix" select="$prefix"/>
+            <xsl:attribute name="targetNamespace" select="$targetNamespace"/>
+            <xsl:attribute name="prefix_root" select="$prefix_root"/>
+            <xsl:if test="number($debug_level) &gt; 3"><xsl:attribute name="debug" select="'#1644'"/></xsl:if>
+            <xsl:element name="{name()}">
+                <xsl:copy-of select="@*"/>
+                <xsl:copy-of select="*"/>
+                <xsl:choose>
+                    <xsl:when test="@base">
+                        <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.get_all_xsd_default_db" select=" root()//system_cache__appinfo:get_all_xsd_default_db/schema[@targetNamespace=$targetNamespace_root]/simpleType[@name= system_cache__appinfo:clean_object_prefix(current()/@base)]">
+                            <xsl:with-param name="prefix" select="$prefix"/>
+                            <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                            <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                            <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                        </xsl:apply-templates>
+                    </xsl:when>
+                </xsl:choose>
+            </xsl:element>
+        </system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_root>
+        
+    </xsl:template>
+    
+    
     <xsl:template match="element[@type ]" mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.get_all_xsd_default_db" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
         <xsl:param name="generate_tables_from_external_root.name" select="@type"/>
         <xsl:param name="generate_tables_from_external_root.path" select="@type"/>
@@ -1610,15 +1655,32 @@
                     <xsl:comment>#203aB - type typu xs:</xsl:comment>
                     <!--<xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_force_refered_element" select="."/>-->
                 </xsl:when>
+                <xsl:when test=" root()//system_cache__appinfo:get_all_xsd_default_db/schema[@targetNamespace=$targetNamespace_root]/simpleType[@name= system_cache__appinfo:clean_object_prefix(current()/@type)]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+                    <xsl:copy-of select="@*"/>
+                    <xsl:if test="number($debug_level) &gt; 3"><xsl:attribute name="debug.203aB">#203aB - type typu xs: v</xsl:attribute></xsl:if>
+                    
+                    <xsl:variable name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace, @name )"/>
+                    <xsl:variable name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix,@name)"/>
+                    <xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child.get_all_xsd_default_db" select=" root()//system_cache__appinfo:get_all_xsd_default_db/schema[@targetNamespace=$targetNamespace_root]/simpleType[@name= system_cache__appinfo:clean_object_prefix(current()/@type)]">
+                            <xsl:with-param name="prefix" select="$prefix"/>
+                            <xsl:with-param name="targetNamespace" select="$targetNamespace"/>
+                            <xsl:with-param name="prefix_root" select="$prefix_root"/>
+                            <xsl:with-param name="targetNamespace_root" select="$targetNamespace_root"/>
+                    </xsl:apply-templates>
+                    <!--<xsl:apply-templates mode="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external_child_force_refered_element" select="."/>-->
+                </xsl:when>
                 <xsl:otherwise>
+                    <xsl:message>#test 1641 child <xsl:value-of select=" root()//system_cache__appinfo:get_all_xsd_default_db/schema[@targetNamespace=$targetNamespace_root]/name()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></xsl:message>
                     <xsl:if test="not(xs:annotation/xs:appinfo/system_cache__appinfo:flat_relation_cache/@system_cache__appinfo:xpath)">
-                        <xsl:message terminate="yes">#1475 Unset xs:annotation/xs:appinfo/system_cache__appinfo:flat_relation_cache/@system_cache__appinfo:xpath in @id:<xsl:value-of select="@id"/> element.</xsl:message>
+                        <xsl:message terminate="yes">FATAL ERROR ? #1475 not set xs:annotation/xs:appinfo/system_cache__appinfo:flat_relation_cache/@system_cache__appinfo:xpath in @id:<xsl:value-of select="@id"/> element name=(<xsl:value-of select="@name"/>) @type=(<xsl:value-of select="@type"/>) generate_tables_from_external_root.path=(<xsl:value-of select="$generate_tables_from_external_root.path"/>) $targetNamespace=(<xsl:value-of select="$targetNamespace"/>)</xsl:message>
                     </xsl:if>
+                    <xsl:message>#1652 will call system_cache__appinfo:xpath.to.root_table(@system_cache__appinfo:xpath) = <xsl:value-of select="xs:annotation/xs:appinfo/system_cache__appinfo:flat_relation_cache/@system_cache__appinfo:xpath"/></xsl:message>
                     <xsl:variable name="prefix" select="system_cache__appinfo:object_install_se_ant_object.create_prefix($prefix_root,system_cache__appinfo:xpath.to.root_table(xs:annotation/xs:appinfo/system_cache__appinfo:flat_relation_cache/@system_cache__appinfo:xpath))"/>
                     <xsl:attribute name="ref" select="concat($prefix,':',@name)"/>
                     <xsl:comment>#203bB - ref wymagac bedzie odtworzenia root/elenent dotyczacy tego refa. na bazie wszystkich uzytych system_cache__appinfo:flat_relation_cache[system_cache__appinfo:xpath.to.root_table(@system_cache__appinfo:xpath) = current()/@name ]</xsl:comment>
                     <generate_tables_from_external_root.required_by.path_init>
                         <xsl:attribute name="prefix" select="$prefix"/>
+                        <xsl:message>#1658 will call system_cache__appinfo:xpath.to.root_table(@system_cache__appinfo:xpath) = <xsl:value-of select="xs:annotation/xs:appinfo/system_cache__appinfo:flat_relation_cache/@system_cache__appinfo:xpath"/></xsl:message>
                         <xsl:attribute name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.create_targetNamespace($targetNamespace_root,system_cache__appinfo:xpath.to.root_table(xs:annotation/xs:appinfo/system_cache__appinfo:flat_relation_cache/@system_cache__appinfo:xpath))"/>
                     </generate_tables_from_external_root.required_by.path_init>
                 </xsl:otherwise>

+ 64 - 13
SE/schema/default_db_xml_cache.public/get_wfs_recurse_xsl.xsl

@@ -27,7 +27,7 @@
     
     <xsl:param name="username" select="'a.binder'"/>
     <xsl:param name="username.pass"  required="yes"/>
-    
+    <xsl:param name="php_session_id_ok.string"/>
     <xsl:param name="simpleSchema_dir" required="yes"/>
     
     <xsl:param name="targetNamespace_DEFAULTS_prefix" select="'default_db'"/> <!-- TODO should be detected -->
@@ -61,6 +61,33 @@
         <xsl:value-of select="$get_wfs_recurse_xsl:GetsimpleSchema/(RelatedFeatureRoot|RelatedFeature)/RelatedFilter"/>
     </xsl:function>
     
+    <xsl:template name="get_wfs_recurse_xsl:request_string">
+        <xsl:param name="protocol" select="$protocol"/>
+        <xsl:param name="api" select="$api"/>
+        <xsl:param name="targetNamespace_DEFAULTS_prefix" select="$targetNamespace_DEFAULTS_prefix"/>
+        <xsl:param name="username" select="$username"/>
+        <xsl:param name="username.pass" select="$username.pass"/>
+        <xsl:param name="REQUEST.SERVICE" select="'WFS'"/>
+        <xsl:param name="REQUEST.VERSION" select="'1.0.0'"/>
+        <xsl:param name="REQUEST.TYPE" select="'GetFeature'"/>
+        <xsl:param name="REQUEST.TYPENAME"  required="yes"/>
+        <xsl:param name="OGC_Filter"/>
+        <xsl:param name="REQUEST.SRSNAME" select="'EPSG:3003'"/>
+        <xsl:variable name="php_session_id_ok.string">
+            <xsl:if test=" string-length($php_session_id_ok.string) &gt; 0">
+                <xsl:value-of select="concat('&amp;sid=',normalize-space($php_session_id_ok.string))"/>
+            </xsl:if>
+        </xsl:variable>
+        <xsl:variable name="username_and_pass">
+            <xsl:choose>
+                <xsl:when test="string-length($php_session_id_ok.string) &gt; 0"/>
+                <xsl:otherwise><xsl:value-of select="concat($username,':',$username.pass,'@')"/></xsl:otherwise>
+            </xsl:choose>
+        </xsl:variable>
+        <xsl:value-of select="concat($protocol,$username_and_pass,$api,'/',$targetNamespace_DEFAULTS_prefix,'/?SERVICE=',$REQUEST.SERVICE,'&amp;VERSION=',$REQUEST.VERSION,'&amp;REQUEST=',$REQUEST.TYPE,'&amp;TYPENAME=',$REQUEST.TYPENAME,$php_session_id_ok.string,$OGC_Filter,'&amp;SRSNAME=',$REQUEST.SRSNAME)"/>
+    </xsl:template>
+    
+    
         
     <xsl:function name="get_wfs_recurse_xsl:simpleTypeMakeOgcFilter">
         <xsl:param name="get_wfs_recurse_xsl:GetsimpleSchema"/>
@@ -236,12 +263,22 @@
                        <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')"/> <!-- &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: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="request_string">
+            <xsl:call-template name="get_wfs_recurse_xsl:request_string">
+                <xsl:with-param name="OGC_Filter" select="$OGC_Filter"/>
+                <xsl:with-param name="REQUEST.TYPE" select="'GetFeature'"/>
+                <xsl:with-param name="REQUEST.TYPENAME" select="$get_wfs_recurse_xsl:typeNameRealResource"/>
+            </xsl:call-template>
+        </xsl:variable>
+        
+        <!--<xsl:variable name="url_string" select="concat($protocol,$username,':',$username.pass,'@',$api,'/',$targetNamespace_DEFAULTS_prefix,'/',$request_string)"/>-->
+        <xsl:message>#265 test $php_session_id_ok.string=<xsl:value-of select="$php_session_id_ok.string"/>; $url_string=<xsl:value-of select="$request_string"/> </xsl:message>
+        <xsl:variable name="get_wfs_recurse_xsl:wfs_response" select="doc($request_string)"/>
         <xsl:if test="$debug &gt; 5">
             <wfs_response>
-            <request>Retrieving <xsl:value-of select="$url_string"/></request>
+                <request>Retrieving <xsl:value-of select="$request_string"/></request>
                 <oryg>https://                     biuro.biall-net.pl/SE/version-git/wfs-data.php/default_db/?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=p5_default_db:CRM_PROCES&amp;SRSNAME=EPSG:3003&amp;MAXFEATURES=15</oryg>
                 <test>https://a.binder:@biuro.biall-net.pl/SE/version-git/wfs-data.php/default_db/?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=p5_default_db:PROCES_INIT&amp;SRSNAME=EPSG:3003&amp;MAXFEATURES=15</test>
                 
@@ -318,12 +355,19 @@
                           <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')"/> <!-- &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: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="request_string">
+            <xsl:call-template name="get_wfs_recurse_xsl:request_string">
+                <xsl:with-param name="OGC_Filter" select="$OGC_Filter"/>
+                <xsl:with-param name="REQUEST.TYPE" select="'GetFeature'"/>
+                <xsl:with-param name="REQUEST.TYPENAME" select="$get_wfs_recurse_xsl:typeNameRealResource"/>
+            </xsl:call-template>
+        </xsl:variable>
+        <!--<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($request_string)"/>
         <xsl:if test="$debug &gt; 5">
             <wfs_response>
-                <request>Retrieving <xsl:value-of select="$url_string"/></request>
+                <request>Retrieving <xsl:value-of select="$request_string"/></request>
                 <oryg>https://                     biuro.biall-net.pl/SE/version-git/wfs-data.php/default_db/?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=p5_default_db:CRM_PROCES&amp;SRSNAME=EPSG:3003&amp;MAXFEATURES=15</oryg>
                 <test>https://a.binder:@biuro.biall-net.pl/SE/version-git/wfs-data.php/default_db/?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=p5_default_db:PROCES_INIT&amp;SRSNAME=EPSG:3003&amp;MAXFEATURES=15</test>
                 <xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response//gml:featureMember[1]"/>
@@ -383,12 +427,19 @@
                       <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')"/> <!-- &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: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="request_string">
+            <xsl:call-template name="get_wfs_recurse_xsl:request_string">
+                <xsl:with-param name="OGC_Filter" select="$OGC_Filter"/>
+                <xsl:with-param name="REQUEST.TYPE" select="'GetFeature'"/>
+                <xsl:with-param name="REQUEST.TYPENAME" select="$get_wfs_recurse_xsl:typeNameRealResource"/>
+            </xsl:call-template>
+        </xsl:variable>
+        <!--<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($request_string)"/>
         <xsl:if test="$debug &gt; 4">
             <wfs_response>
-                <request>Retrieving <xsl:value-of select="$url_string"/></request>
+                <request>Retrieving <xsl:value-of select="$request_string"/></request>
                 <oryg>https://                     biuro.biall-net.pl/SE/version-git/wfs-data.php/default_db/?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=p5_default_db:CRM_PROCES&amp;SRSNAME=EPSG:3003&amp;MAXFEATURES=15</oryg>
                 <test>https://a.binder:@biuro.biall-net.pl/SE/version-git/wfs-data.php/default_db/?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=p5_default_db:PROCES_INIT&amp;SRSNAME=EPSG:3003&amp;MAXFEATURES=15</test>
                <!-- <debug_child_loop>-->

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

@@ -197,6 +197,7 @@
         <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
         <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
         <xsl:param name="prototype_NamespacePrefix" required="yes"/>
+        <xsl:message>#200 matched <xsl:value-of select="name()"/></xsl:message>
         <xsl:element name="{name()}">
             <!--<xsl:attribute name="id" select="concat(substring($new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,0,15),'_',generate-id())"/>-->
         <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child">
@@ -211,6 +212,7 @@
         <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
         <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
         <xsl:param name="prototype_NamespacePrefix" required="yes"/>
+        <xsl:message>#215 matched <xsl:value-of select="name()"/>/<xsl:value-of select="@name"/></xsl:message>
         <xsl:element name="{name()}">
             <xsl:copy-of select="@minOccurs"/>
             <xsl:copy-of select="@maxOccurs"/>

+ 28 - 5
SE/schema/default_db_xml_cache.public/object_modeling_new_by_xml_schema.xsl

@@ -75,6 +75,7 @@
     
     <xsl:template mode="system_cache__appinfo:object_modeling_new_add_xml_schema" match="schema[@targetNamespace=$prototype_object_namespace]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
         <xsl:result-document href="{$template_object.xml_location}">
+            <xsl:message>#78 saving to <xsl:value-of select="$template_object.xml_location"/></xsl:message>
             <xsl:element name="xs:schema">
                 <xsl:copy-of select="namespace::node()"/>
                 <xsl:namespace name="{$new_TargetNamespaceBindings_from_Namespace//@NamespacePrefix}" select="$TargetNamespace_from_Bindings//@TargetNamespace"/>
@@ -87,21 +88,37 @@
                     </xsl:for-each>
                 </xsl:variable>
                 
-                <!-- read object from default_db.xml -->
                 
-                <xsl:variable name="merge_complexType" select="doc($default_db.xml)//complexType[@name=$NamespaceObjectInstanceTable]/sequence" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
+                
+                <!-- read object from default_db.xml -->
+                <xsl:if test="$targetNamespace.base='${targetNamespace.base}'"><xsl:message terminate="yes">#91 not set <xsl:value-of select="$targetNamespace.base"/></xsl:message></xsl:if>
+                <!--<xsl:variable name="merge_complexType" select="doc($default_db.xml)//complexType[@name=$NamespaceObjectInstanceTable]/sequence" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>--><!-- TODO use system schema instead -->
+                <xsl:variable name="merge_complexType" select="root()//system_cache__appinfo:get_all_xsd_default_db/schema[ substring-after(@targetNamespace,'://')=substring-after($targetNamespace.base,'://')]/complexType[@name=$NamespaceObjectInstanceTable]/sequence" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
                 <xsl:variable name="schema_merged">
-                    <xsl:apply-templates mode="system_cache__appinfo:object_modeling_new_add_xml_schema_root">
+                    <xsl:apply-templates mode="system_cache__appinfo:object_modeling_new_add_xml_schema_root" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
                         <xsl:with-param name="merge_complexType" select="$merge_complexType"/>
                     </xsl:apply-templates>
                 </xsl:variable>
-                <xsl:message>#93 default_db.xml object found <xsl:copy-of select="$default_db.xml"/></xsl:message>
-                
+                <xsl:variable name="system_cache__appinfo:new_object_by_prototype.base" select="root()//system_cache__appinfo:get_all_xsd_default_db/schema[ substring-after(@targetNamespace,'://')=substring-after($targetNamespace.base,'://')]/complexType[@name=$NamespaceObjectInstanceTable]/sequence" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
+                <xsl:message>#93 root()//name() <xsl:value-of select="root()/node()/name()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>; $targetNamespace.base = <xsl:value-of select="$targetNamespace.base"/></xsl:message>
+                <xsl:message>#101 default_db.xml object found <xsl:copy-of select="$default_db.xml"/></xsl:message>
+                <xsl:message>#102 count(merge_complexType/*) <xsl:value-of select="count($merge_complexType/*)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></xsl:message>
+                <xsl:message>#104 count(system_cache__appinfo:new_object_by_prototype.base/*) <xsl:value-of select="count($system_cache__appinfo:new_object_by_prototype.base/*)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></xsl:message>
+                <xsl:message>#105 count(current/*) <xsl:value-of select="count(current()/*)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></xsl:message>
+                <xsl:message>#106 schema_merged <xsl:copy-of select="$schema_merged//*/@name" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></xsl:message>
+                <xsl:if test="count($merge_complexType/*)=0"><xsl:message terminate="yes">#105 not found or error count($merge_complexType/* <xsl:value-of select="count($merge_complexType/*)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></xsl:message></xsl:if>
+                <xsl:if test="count($system_cache__appinfo:new_object_by_prototype.base/*)=0"><xsl:message terminate="yes">#105 not found or error count(system_cache__appinfo:new_object_by_prototype.base/*) <xsl:value-of select="count($system_cache__appinfo:new_object_by_prototype.base/*)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></xsl:message></xsl:if>
                 <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_root" select="$schema_merged" >
                     <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
                     <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
                     <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
+                    <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
                 </xsl:apply-templates>
+                
+                <!--<debug_90>
+                    <xsl:copy-of select="$schema_merged"></xsl:copy-of>
+                </debug_90>-->
+                
             </xsl:element>
         </xsl:result-document>
     </xsl:template>
@@ -109,6 +126,7 @@
     
     <xsl:template mode="system_cache__appinfo:object_modeling_new_add_xml_schema_root" match="complexType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
         <xsl:param name="merge_complexType" required="yes"/>
+        <xsl:message>#120 matched complexType/<xsl:value-of select="@name"/></xsl:message>
         <xsl:element name="{name()}">
             <xsl:copy-of select="@*"/>
             <xsl:apply-templates mode="system_cache__appinfo:object_modeling_new_add_xml_schema_child">
@@ -118,17 +136,20 @@
     </xsl:template>
     
     <xsl:template mode="system_cache__appinfo:object_modeling_new_add_xml_schema_root" match="*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <xsl:message>#130 matched */<xsl:value-of select="name()"/></xsl:message>
         <xsl:copy-of select="."/>
     </xsl:template>
     
     <xsl:template mode="system_cache__appinfo:object_modeling_new_add_xml_schema_child" match="sequence" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
         <xsl:param name="merge_complexType" required="yes"/>
+        <xsl:message>#136 matched sequence/@id <xsl:value-of select="@id"/></xsl:message>
         <xsl:element name="{name()}">
             <xsl:copy-of select="@*"/>
             <!--<xsl:apply-templates mode="system_cache__appinfo:object_modeling_new_add_xml_schema_child">
                 <xsl:with-param name="merge_complexType" select="$merge_complexType/sequence"/>
             </xsl:apply-templates>-->
             <xsl:for-each select="element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+                <xsl:message>#143 testing element/@name<xsl:value-of select="@name"/></xsl:message>
                 <xsl:element name="{name()}">
                     <xsl:copy-of select="@*"/>
                     <xsl:apply-templates mode="system_cache__appinfo:object_modeling_new_add_xml_schema_child_annotation"/>
@@ -136,12 +157,14 @@
             </xsl:for-each>
             <xsl:variable name="current" select="element"/>
             <xsl:for-each select="$merge_complexType/element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+                <xsl:message>#152 from base trying element/<xsl:value-of select="@name"/></xsl:message>
                 <xsl:choose>
                     <xsl:when test="$current[@name = current()/@name]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
                         <xsl:message>#140 element <xsl:value-of select="@name"/> already exists!</xsl:message>
                     </xsl:when>
                     <xsl:otherwise>
                         <xsl:element name="{name()}">
+                            <xsl:message>#159 adding <xsl:value-of select="@name"/></xsl:message>
                             <xsl:attribute name="name" select="@name"/>
                             <xsl:attribute name="type" select="$merge_complexType/ancestor::node()/simpleType[@name= substring-after(current()/@type,':')]/restriction/@base" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
                             <xsl:apply-templates mode="system_cache__appinfo:object_modeling_new_add_xml_schema_child_annotation"/>