a.binder 6 лет назад
Родитель
Сommit
73c10ff126

+ 1 - 0
SE/schema/ant-tool/SyncResourcesYed/graphml.xsd

@@ -9,6 +9,7 @@
            xmlns:p5opr="http://biuro.biall-net.pl/xmlschema_procesy5/system_cache/object_parent_relations/object_parent_relations.xsd"
            xmlns:p5_simpleSchema_map="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/p5_simpleSchema_map.xsd"
            targetNamespace="http://graphml.graphdrawing.org/xmlns"
+           xmlns:g="http://graphml.graphdrawing.org/xmlns"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified">
    <xs:annotation>

+ 1 - 0
SE/schema/ant-tool/SyncResourcesYed/ygraphml.xsd

@@ -5,6 +5,7 @@
            xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns:y="http://www.yworks.com/xml/graphml"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+           xmlns:g="http://graphml.graphdrawing.org/xmlns"
            xmlns:p5_tr_map="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd"
            xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
            xmlns:system_cache__resources_tree_generate_xsl_required_occurs_raport="http://biuro.biall-net.pl/xmlschema_procesy5/system_cache/resources_tree_generate_xsl_require_occurs_raport"

+ 14 - 2
SE/schema/default_db_xml_cache.public/build_ant_universal_by_xsl_match.xsl

@@ -69,7 +69,8 @@
                 <parallel  failonany="true" threadCount="{$threadCount}"> <!-- threadCount="4"  -->
                     <xsl:variable name="system_cache__appinfo:element_complexType">
                         <xsl:for-each select="*">
-                            <xsl:sort select="number(@id.int.rand)"/>
+                            <xsl:sort select="@count" order="ascending" data-type="number"/>
+                            <!--<xsl:sort select="number(@id.int.rand)"/>-->
                             <xsl:copy-of select="."/>
                         </xsl:for-each>
                     </xsl:variable>
@@ -144,11 +145,22 @@
                                 <factory name="net.sf.saxon.TransformerFactoryImpl">    
                                     <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
                                     <attribute name="http://saxon.sf.net/feature/initialTemplate">
-                                        <xsl:attribute name="value" select="'{http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd}build_complexType'"/>
+                                        <xsl:attribute name="value" select="'{http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd}build_complexType__simpleType'"/>
                                     </attribute>
                                 </factory>
                                 <param name="complexType" expression="{with-param/@select}"/>
                             </xsl:when>
+                            
+                            <xsl:when test="@name='build_complexType__simpleType'">
+                                <factory name="net.sf.saxon.TransformerFactoryImpl">    
+                                    <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
+                                    <attribute name="http://saxon.sf.net/feature/initialTemplate">
+                                        <xsl:attribute name="value" select="'{http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd}build_complexType__simpleType'"/>
+                                    </attribute>
+                                </factory>
+                                <param name="element" expression="{with-param/@select}"/>
+                            </xsl:when>
+                            
                             <xsl:otherwise><xsl:message terminate="yes">#72 unexpected type of element !</xsl:message></xsl:otherwise>
                         </xsl:choose>
                         <param name="default_db.instance.xml" >

+ 44 - 3
SE/schema/default_db_xml_cache.public/get_all_xsd.xsl

@@ -816,13 +816,16 @@
         <xsl:param name="targetNamespace" select="$targetNamespace_DEFAULTS"/>    
             <system_cache__appinfo:element_complexType>
                 <xsl:for-each select="get_all_xsd[ substring-before(@system_cache__appinfo:document-uri,'/')!='default_db_xml_cache'  and  substring-before(@system_cache__appinfo:document-uri,'/')!='default_db_xml_cache.public']" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd">
+                    <xsl:sort select="max( */*/count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ]))" order="ascending" data-type="number"/>
                     <xsl:variable name="get_all_xsd_236" select="."/>
                     <xsl:comment>
+                        max1="<xsl:value-of select="max( count(*/*/descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ]))"/>"
+                        max1=2<xsl:value-of select="max( */*/count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ]))"/>"
                         246:detect_resource_type, przetwarzam schemat:<xsl:value-of select="@system_cache__appinfo:document-uri"/>; $targetNamespace:<xsl:value-of select="$targetNamespace"/>;
                         @targetNamespace:<xsl:value-of select="schema/@targetNamespace" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>;</xsl:comment>
                     <xsl:variable name="schema_node_144" select="."/>
                     <xsl:for-each select="schema" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"><!--[ @targetNamespace != $targetNamespace ] namespace::node() = $targetNamespace   and @targetNamespace='moj_ogrodek' -->
-                        <xsl:sort select="max( count(*/descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ]))" order="ascending" data-type="number"/>
+                        <xsl:sort select="max( */count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ]))" order="ascending" data-type="number"/>
                         <xsl:message>#239::detect_resource_type przetwarzam schemat:@targetNamespace:<xsl:value-of select="@targetNamespace"/>;</xsl:message>
                         <xsl:variable name="prefix_83" select="namespace::node()[. = $targetNamespace]/name()"/>
                         <xsl:variable name="targetNamespace_134" select="@targetNamespace"/>
@@ -858,13 +861,14 @@
                                 </xsl:element>
                             </xsl:otherwise>
                         </xsl:choose>
-                        <xsl:if test="count(.//node()[(local-name()='element' or local-name()='complexType' or local-name()='sequence' or local-name()='choice' or local-name()='complexContent' or local-name()='extension' ) and not(@id)])=0">
-                                <xsl:for-each select="(element|complexType)"  xpath-default-namespace="http://www.w3.org/2001/XMLSchema"><!-- dla ograniczenia mozna [$prefix_134='test_objects']-->
+                        <xsl:if test="count(.//node()[(local-name()='element' or local-name()='simpleType' or local-name()='complexType' or local-name()='sequence' or local-name()='choice' or local-name()='complexContent' or local-name()='extension' ) and not(@id)])=0">
+                            <xsl:for-each select="(element|complexType|simpleType)"  xpath-default-namespace="http://www.w3.org/2001/XMLSchema"><!-- dla ograniczenia mozna [$prefix_134='test_objects']-->
                                     <xsl:sort select="max( count(descendant-or-self::*[@ref or not(contains(@type,'xs:')) ]))" order="ascending" data-type="number"/>
                                     <xsl:variable name="complexType_or_element_name186">
                                         <xsl:choose>
                                             <xsl:when test="local-name()='element'"><xsl:value-of select="@name"/></xsl:when>
                                             <xsl:when test="local-name()='complexType'"><xsl:value-of select="@name"/></xsl:when>
+                                            <xsl:when test="local-name()='simpleType'"><xsl:value-of select="@name"/></xsl:when>
                                             <xsl:otherwise><xsl:message terminate="yes">#391 it should work only for element or complexType</xsl:message></xsl:otherwise>
                                         </xsl:choose>
                                     </xsl:variable>
@@ -876,6 +880,7 @@
                                     <xsl:choose>
                                         <xsl:when test="local-name()='element'">
                                             <build_cache name="build_element">
+                                                <xsl:attribute name="count" select="count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ])"/>
                                                 <xsl:attribute name="id.int.rand" select="system_cache__appinfo:id.int.rand(@id)"/>
                                                 <xsl:attribute name="system_cache__appinfo:document-uri" select="../.././@system_cache__appinfo:document-uri"/>
                                                 <xsl:attribute name="system_cache__appinfo:document-uri-full" select="../.././@system_cache__appinfo:document-uri-full"/>
@@ -898,6 +903,7 @@
                                         </xsl:when>
                                         <xsl:when test="local-name()='complexType'">
                                             <build_cache name="build_complexType">
+                                                <xsl:attribute name="count" select="count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ])"/>
                                                 <xsl:attribute name="id.int.rand" select="system_cache__appinfo:id.int.rand(@id)"/>
                                                 <!--<xsl:message>#808.1.DEBUG ok</xsl:message>-->
                                                 <xsl:attribute name="system_cache__appinfo:document-uri" select="../.././@system_cache__appinfo:document-uri"/>
@@ -925,6 +931,41 @@
                                                 <!--<system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename><xsl:value-of select="system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename('system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type.single_complexType',concat($prefix_134,':',$complexType_or_element_name186))"/></system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename>-->
                                             </build_cache>
                                         </xsl:when>
+                                        
+                                        <xsl:when test="local-name()='simpleType'">
+                                            <build_cache name="build_complexType__simpleType">
+                                                <xsl:attribute name="count" select="count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ])"/>
+                                                <xsl:attribute name="id.int.rand" select="system_cache__appinfo:id.int.rand(@id)"/>
+                                                <xsl:attribute name="system_cache__appinfo:document-uri" select="../.././@system_cache__appinfo:document-uri"/>
+                                                <xsl:attribute name="system_cache__appinfo:document-uri-full" select="../.././@system_cache__appinfo:document-uri-full"/>
+                                                <xsl:attribute name="system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename" select="system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename(../.././@system_cache__appinfo:document-uri, .././@targetNamespace,local-name(),@name)"/>
+                                                <xsl:attribute name="complexType_or_element_name" select="$complexType_or_element_name186"/>
+                                                <xsl:attribute name="p5opr:element-filename" select="p5opr:element-filename(../.././@system_cache__appinfo:document-uri, .././@targetNamespace,local-name(),@name)"/>
+                                                <xsl:attribute name="system_cache__appinfo:path" select="concat(../@targetNamespace,'/',$complexType_or_element_name186)"/>
+                                                <xsl:attribute name="debug.targetNamespace" select="parent::*/@targetNamespace "/>
+                                                <!--<xsl:attribute name="debug.prefix" select="parent::*/namespace::*[ . = @targetNamespace ]/name()"/>-->
+                                                <xsl:attribute name="debug.prefix" select="parent::*/namespace::*[ . = ../@targetNamespace ]/name()"/>
+                                                <xsl:attribute name="debug.prefix2" select="parent::*/namespace::*[ . = ../@targetNamespace and not(name()='') ]/name()"/>
+                                                <!--<xsl:attribute name="system_cache__appinfo:element-filename" select="system_cache__appinfo:element-filename()"/>-->
+                                                <!--<with-param name="element" select="{$prefix_134}:{$complexType_or_element_name186}"/>-->
+                                                <xsl:choose>
+                                                    <xsl:when test="not(parent::*/namespace::*[ . = ../@targetNamespace and not(name()='') ])">
+                                                        <xsl:message terminate="yes">#952 ERROR WITH @targetNamespace="<xsl:value-of select="parent::*/@targetNamespace "/>"; @system_cache__appinfo:document-uri-full="<xsl:value-of select="../.././@system_cache__appinfo:document-uri-full"/>" </xsl:message>
+                                                    </xsl:when>
+                                                </xsl:choose>
+                                                <with-param name="element" select="{parent::*/namespace::*[ . = ../@targetNamespace and not(name()='')]/name()}:{$complexType_or_element_name186}"/>
+                                                <system_cache__appinfo:element-filename><xsl:value-of select="system_cache__appinfo:element-filename('build_complexType__simpleType',@name,$prefix_134,$targetNamespace_134)"/></system_cache__appinfo:element-filename>
+                                                <system_cache__appinfo:element-filename-prefixed><xsl:value-of select="system_cache__appinfo:element-filename-prefixed('build_complexType__simpleType',@name,$prefix_134,$targetNamespace_134)"/></system_cache__appinfo:element-filename-prefixed>
+                                                <p5_tr_map:element-filename><xsl:value-of select="p5_tr_map:element-filename('go_recurse_from_root_by_build_element_cache',concat($prefix_134,':',$complexType_or_element_name186))"/></p5_tr_map:element-filename>
+                                                <p5_tr_map:element-filename-prefixed><xsl:value-of select="p5_tr_map:element-filename-prefixed(concat($prefix_134,':',$complexType_or_element_name186))"/></p5_tr_map:element-filename-prefixed>
+                                                <system_cache__appinfo:targetNamespace><xsl:value-of select="../@targetNamespace"/></system_cache__appinfo:targetNamespace>
+                                                <system_cache__appinfo:name><xsl:value-of select="@name"/></system_cache__appinfo:name>
+                                                <system_cache__appinfo:prefix><xsl:value-of select="$prefix_134"/></system_cache__appinfo:prefix>
+                                                <p5_simpleSchema_map:element-filename><xsl:value-of select="p5_simpleSchema_map:element-filename(concat($prefix_134,':',$complexType_or_element_name186),.././@targetNamespace)"/></p5_simpleSchema_map:element-filename>
+                                                <!--<system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename><xsl:value-of select="system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename('system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type.single_element',concat($prefix_134,':',$complexType_or_element_name186))"/></system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename>-->
+                                            </build_cache>
+                                        </xsl:when>
+                                        
                                     </xsl:choose>
                               </xsl:for-each>
                         </xsl:if>

+ 137 - 2
SE/schema/default_db_xml_cache/build_complexType.xsl

@@ -599,6 +599,141 @@
         </xsl:choose>
     </xsl:template>
     
+    
+    <!--  -->
+    
+    
+    <xsl:template name="system_cache__appinfo:build_complexType__simpleType">
+        <xsl:param name="element" select="$element"/> <!--  mozna podawac prefix w samym elemencie -->
+        <xsl:param name="path"/>
+        <xsl:param name="prefix" select="substring-before($element,':')"/>
+        <xsl:param name="namespace_uri_param"/>
+        <xsl:param name="cache" select="$cache"/> <!-- or refresh -->
+        <xsl:param name="name" select="substring-after($element,':')"/>
+        <xsl:variable name="path">
+            <xsl:value-of select="concat($prefix,'/',$element)"/>
+        </xsl:variable>
+        <!--<xsl:variable name="element-filename" select="system_cache__appinfo:escape_object_prefix_to_string($element)"/>-->
+        <!--<xsl:variable name="element-filename" select="system_cache__appinfo:element-filename('build_element',$element,$prefix,$namespace_uri_param)" >
+            <xsl:choose>
+                <xsl:when test="$prefix">
+                    <xsl:value-of select="system_cache__appinfo:escape_object_prefix_to_string(concat($prefix,':',$element))"/>
+                </xsl:when>
+                <xsl:when test="$namespace_uri_param">
+                    <xsl:value-of select="system_cache__appinfo:escape_object_prefix_to_string(concat($namespace_uri_param,':',$element))"/>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:value-of select="system_cache__appinfo:escape_object_prefix_to_string($element)"/>
+                </xsl:otherwise>
+            </xsl:choose>
+        </xsl:variable>-->
+        <xsl:variable name="if-prepare" select="unparsed-text-available(system_cache__appinfo:element-filename.prepare('build_complexType__simpleType',$element,$prefix,$namespace_uri_param))"/>
+        <xsl:choose>
+            <xsl:when test="unparsed-text-available(system_cache__appinfo:element-filename.complete('build_complexType__simpleType',$name,$prefix,$namespace_uri_param)) and $cache='read' and not($if-prepare) "> <!-- concat($default_db.instance.xml,'/build_complexType/element-',$element-filename,'.xml' -->
+                <xsl:message>#629a. hit from cache for <xsl:value-of select="system_cache__appinfo:element-filename.complete('build_complexType__simpleType',$name,$prefix,$namespace_uri_param)"/> </xsl:message>
+                <xsl:copy-of select="doc(system_cache__appinfo:element-filename('build_complexType__simpleType',$name,$prefix,$namespace_uri_param))"/> <!-- concat($default_db.instance.xml,'/build_complexType/element-',$element-filename,'.xml') -->
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:message>#629b NO cache for <xsl:value-of select="system_cache__appinfo:element-filename('build_complexType__simpleType',$name,$prefix,$namespace_uri_param)"/> ; ($element="<xsl:value-of select="$element"/>"); ($prefix="<xsl:value-of select="$prefix"/>"); ($name="<xsl:value-of select="$name"/>");</xsl:message>
+                
+                <xsl:choose>
+                    <xsl:when test="$if-prepare">
+                        <xsl:message>#629c !!!! $if-prepare = <xsl:value-of select="$if-prepare"/> . Skipping output to file</xsl:message>
+                        <xsl:choose>
+                            <xsl:when test="$namespace_uri_param">
+                                <xsl:message>#629-642  apply with prefix="<xsl:value-of select="$prefix"/>";</xsl:message>
+                                <xsl:apply-templates mode="system_cache__appinfo:build_flat_schema" select="$procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/schema[@targetNamespace = $namespace_uri_param]/simpleType[@name = $name]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+                                    <xsl:with-param name="element" select="$element"/>
+                                    <xsl:with-param name="namespace_uri_param" select="$namespace_uri_param"/>
+                                    <xsl:with-param name="prefix" select="$prefix"/>
+                                    <xsl:with-param name="path" select="$path"/>
+                                    <xsl:with-param name="targetNamespace" select="$procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/schema[@targetNamespace = namespace::*[ name() = $prefix ]]/@targetNamespace" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
+                                </xsl:apply-templates>
+                            </xsl:when>
+                            <xsl:when test="not($procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/schema[@targetNamespace = namespace::*[ name() = $prefix ]]/simpleType[@name = $name])" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+                                <xsl:message terminate="yes">#629 t not found $prefix="<xsl:value-of select="$prefix"/>"; $name="<xsl:value-of select="$name"/>";
+                                    count="<xsl:value-of select="count($procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/schema[@targetNamespace = namespace::*[ name() = $prefix ]])"/>";
+                                    test Query Local = "<xsl:value-of select="count($procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/schema[@targetNamespace = namespace::*[ name() = 'get_wfs_recurse_xsl' ]]/simpleType[@name='Query.xml.local'])"/>";
+                                    test Query Local 3 = "<xsl:value-of select="count($procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/schema[@targetNamespace = 'https://biuro.biall-net.pl/wfs/patterns/patterns/A_STATUS.xsd']/simpleType[@name='Query.xml.local'])"/>";
+                                    test Query Local 4 = "<xsl:value-of select="count($procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/schema[@targetNamespace = 'https://biuro.biall-net.pl/wfs/patterns/patterns/A_STATUS.xsd'])"/>";
+                                    test Query Local 5 = "<xsl:value-of select="count($procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/*[@targetNamespace = 'https://biuro.biall-net.pl/wfs/patterns/patterns/A_STATUS.xsd'])"/>";
+                                    test Query Local 5/schema = "<xsl:value-of select="count($procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/schema[@targetNamespace = 'https://biuro.biall-net.pl/wfs/patterns/patterns/A_STATUS.xsd'])"/>";
+                                    test Query Local 5/schema+target = "<xsl:value-of select="count($procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/schema[@targetNamespace = 'https://biuro.biall-net.pl/wfs/patterns/patterns/A_STATUS.xsd'])" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>";
+                                    test Query Local 5/* = "<xsl:value-of select="count($procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/*[ @targetNamespace = namespace::*[ name() = $prefix ]] )"/>";
+                                    test Query Local 6 = "<xsl:value-of select="count($procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/*)"/>";
+                                </xsl:message>
+                            </xsl:when>
+                            <xsl:otherwise>
+                                <xsl:message>#629-663  apply with prefix="<xsl:value-of select="$prefix"/>"; $path="<xsl:value-of select="$path"/>"</xsl:message>
+                                <xsl:apply-templates mode="system_cache__appinfo:build_flat_schema" select="$procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/schema[@targetNamespace = namespace::*[ name() = $prefix ]]/simpleType[@name = $name]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+                                    <xsl:with-param name="element" select="$element"/>
+                                    <xsl:with-param name="prefix" select="$prefix"/>
+                                    <xsl:with-param name="path" select="$path"/>
+                                    <xsl:with-param name="targetNamespace" select="$procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/schema[@targetNamespace = namespace::*[ name() = $prefix ]]/@targetNamespace" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
+                                </xsl:apply-templates>
+                            </xsl:otherwise>
+                        </xsl:choose>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <!-- todo moze nizej? -->
+                        <xsl:result-document href="{system_cache__appinfo:element-filename.symlink.prepare('build_complexType__simpleType',$name,$prefix,$namespace_uri_param)}">
+                            <prepare/>
+                        </xsl:result-document>
+                        <xsl:variable name="build_element_cache">
+                            <xsl:choose>
+                                <xsl:when test="$namespace_uri_param">
+                                    <xsl:message>#629-679  apply with prefix="<xsl:value-of select="$prefix"/>"; $path="<xsl:value-of select="$path"/>";</xsl:message>
+                                    <xsl:apply-templates mode="system_cache__appinfo:build_flat_schema" select="$procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/schema[@targetNamespace = $namespace_uri_param]/simpleType[@name = $name]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+                                        <xsl:with-param name="element" select="$element"/>
+                                        <xsl:with-param name="namespace_uri_param" select="$namespace_uri_param"/>
+                                        <xsl:with-param name="prefix" select="$prefix"/>
+                                        <xsl:with-param name="path" select="$path" />
+                                        <xsl:with-param name="targetNamespace" select="$procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/schema[@targetNamespace = namespace::*[ name() = $prefix ]]/@targetNamespace" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
+                                    </xsl:apply-templates>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                    <xsl:message>#629-687  apply with prefix="<xsl:value-of select="$prefix"/>"; $path="<xsl:value-of select="$path"/>"</xsl:message>
+                                    <xsl:apply-templates mode="system_cache__appinfo:build_flat_schema" select="$procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/schema[@targetNamespace = namespace::*[ name() = $prefix ]]/simpleType[@name = $name]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+                                        <xsl:with-param name="element" select="$element"/>
+                                        <xsl:with-param name="prefix" select="$prefix"/>
+                                        <xsl:with-param name="path" select="$path"/>
+                                        <xsl:with-param name="targetNamespace" select="$procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix)/schema[@targetNamespace = namespace::*[ name() = $prefix ]]/@targetNamespace" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
+                                    </xsl:apply-templates>
+                                </xsl:otherwise>
+                            </xsl:choose>
+                        </xsl:variable>
+                        <xsl:if test="$build_element_cache/*">
+                            <xsl:message>629d:build_complexType__simpleType cache try to save: <xsl:value-of select="system_cache__appinfo:element-filename.symlink('build_complexType__simpleType',$name,$prefix,$namespace_uri_param)"/></xsl:message>
+                            
+                            <xsl:result-document href="{system_cache__appinfo:element-filename.symlink('build_complexType__simpleType',$name,$prefix,$namespace_uri_param)}"> <!--  -->
+                                <xsl:copy-of select="$build_element_cache"/>
+                            </xsl:result-document>
+                            <xsl:result-document href="{system_cache__appinfo:element-filename.symlink.complete('build_complexType__simpleType',$name,$prefix,$namespace_uri_param)}">
+                                <complete/>
+                            </xsl:result-document>
+                            
+                            <!--<xsl:variable name="prefixed_object_info">
+                        <xsl:call-template name="system_cache__appinfo:prefixed_object_info">
+                            <xsl:with-param name="prefixed_object" select="$element-filename"/>
+                        </xsl:call-template>
+                    </xsl:variable>-->
+                            <xsl:message>629e:build_complexType__simpleType _cache try to save: <xsl:value-of select="system_cache__appinfo:element-filename-prefixed.symlink('build_complexType__simpleType',$name,$prefix,$namespace_uri_param)"/></xsl:message>
+                            <xsl:result-document href="{system_cache__appinfo:element-filename-prefixed.symlink('build_complexType__simpleType',$name,$prefix,$namespace_uri_param)}">
+                                <xsl:copy-of select="$build_element_cache"/>
+                            </xsl:result-document>
+                            <xsl:result-document href="{system_cache__appinfo:element-filename-prefixed.symlink.complete('build_complexType__simpleType',$name,$prefix,$namespace_uri_param)}">
+                                <complete/>
+                            </xsl:result-document>
+                            <xsl:copy-of select="$build_element_cache"/>
+                        </xsl:if>
+                    </xsl:otherwise>
+                </xsl:choose>
+                
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+    
+    
     <xsl:template match="annotation" mode="system_cache__appinfo:build_complexType_cache.path" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" priority="9">
         <xsl:copy-of select="."/>
     </xsl:template>
@@ -2153,8 +2288,8 @@
         <xsl:variable name="type_uri" select="ancestor-or-self::*[@targetNamespace][1]/@targetNamespace"/>
         <xsl:choose>
             <xsl:when test="not($if-prepare) and unparsed-text-available(system_cache__appinfo:element-filename.complete('build_complexType__simpleType',@name,$prefix,$type_uri)) "><!-- and $cache='read' --> <!-- concat($default_db.instance.xml,'/build_complexType/complexType-',$element-filename,'.xml') -->
-                <xsl:message>#2101 TODO hit from cache for <xsl:value-of select="system_cache__appinfo:element-filename.complete('build_complexType__simpleType',@name,$prefix,$type_uri)"/> </xsl:message>
-                <!--<xsl:copy-of select="doc(system_cache__appinfo:element-filename('build_complexType',$complexType,$prefix,$namespace_uri_param))"/>-->
+                <xsl:message>#2101 TODO-TEST hit from cache for <xsl:value-of select="system_cache__appinfo:element-filename.complete('build_complexType__simpleType',@name,$prefix,$type_uri)"/> </xsl:message>
+                <xsl:copy-of select="doc(system_cache__appinfo:element-filename('build_complexType__simpleType',@name,$prefix,$type_uri))"/>
             </xsl:when>
             <xsl:otherwise>
                 <xsl:variable name="prefix">

+ 3 - 3
SE/schema/p5/types.xsd

@@ -22,13 +22,13 @@
          <xs:maxLength value="1000"/>
       </xs:restriction>
    </xs:simpleType>
-   <xs:simpleType name="p5:enum" id="___d15e589-1_p5__x3A__enum">
+   <xs:simpleType name="enum" id="___d15e589-1_p5__x3A__enum">
       <xs:restriction base="xs:string"/>
    </xs:simpleType>
-   <xs:simpleType name="p5:www_link" id="___d15e591-1_p5__x3A__www_lin">
+   <xs:simpleType name="www_link" id="___d15e591-1_p5__x3A__www_lin">
       <xs:restriction base="xs:string"/>
    </xs:simpleType>
-   <xs:simpleType name="p5:alias" id="___d15e593-1_p5__x3A__alias">
+   <xs:simpleType name="alias" id="___d15e593-1_p5__x3A__alias">
       <xs:restriction base="xs:string"/>
    </xs:simpleType>
    <xs:simpleType name="price" id="___d15e595-1_price">