瀏覽代碼

upd empty fix

a.binder 6 年之前
父節點
當前提交
e075c3620b

+ 0 - 1
SE/schema/WPS_Functions/ant/build.p5ant.PRODUCT.xml

@@ -37,7 +37,6 @@
     
     <property name="p5ant.commons-net-3.6.jar"     location="/opt/local/share/java/apache-ant/lib/commons-net-3.6.jar"/>
     
-    
     <property name="p5ant.documentation.files.antstructure.dtd" location="${p5ant.repository}/p5dg.documentation.files.antstructure.dtd"/>
     
     <target name="p5xsls.xml" depends="basedir">

+ 14 - 11
SE/schema/WPS_Functions/ant/p5ant.include.xsl

@@ -1,13 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet ns0:exclude-result-prefixes="xs" ns0:version="2.0" xmlns="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="">
-  <xsl:output ns0:indent="yes" />
-  <xsl:strip-space ns0:elements="*" />
-  <xsl:param ns0:name="p5build_SE.build" ns0:required="yes" />
-  <xsl:param ns0:name="p5dg.repository.dita" ns0:required="yes" />
-  <xsl:param ns0:name="p5dg.temp" ns0:required="yes" />
-  <xsl:param ns0:name="p5dg.repository" ns0:required="yes" />
-  <xsl:param ns0:name="p5dg.documentation.files.index.root_dir" ns0:required="yes" />
-  <xsl:param ns0:name="p5dg.documentation.files.index.excludes.regex" ns0:required="yes" />
-  <xsl:param ns0:name="p5ant.xsl" ns0:required="yes" />
-  <xsl:include ns0:href="p5dg" />
+<xsl:stylesheet 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  exclude-result-prefixes="xs" version="2.0"  >
+  <xsl:output indent="yes" />
+  <xsl:strip-space elements="*" />
+  <xsl:param name="p5build_SE.build" required="yes" />
+  <xsl:param name="p5dg.repository.dita" required="yes" />
+  <xsl:param name="p5dg.temp" required="yes" />
+  <xsl:param name="p5dg.repository" required="yes" />
+  <xsl:param name="p5dg.documentation.files.index.root_dir" required="yes" />
+  <xsl:param name="p5dg.documentation.files.index.excludes.regex" required="yes" />
+  <xsl:param name="p5ant.xsl" required="yes" />
+  <!--<xsl:include href="p5dg" />-->
 </xsl:stylesheet>

+ 13 - 1
SE/schema/WPS_Functions/default_db/recurse_ant/build_recurse_ant.xml

@@ -1113,10 +1113,22 @@
         </echo>
     </target>
     
-    <target name="build_recursed_xsl" depends="input,install_folders,uuid_check,typeName_check,xpath_check,xpath_value_check,set_dita"  description="retrieve data styled Related and build object from api using just XSL calls - needed username and password">
+    
+    <target name="empty.xml.if_exists">
+        <condition property="empty.xml__exists__flag">
+            <available file="${empty.xml}"/>
+        </condition>
+    </target>
+    
+    
+    <target name="empty.xml" depends="empty.xml.if_exists" unless="empty.xml__exists__flag">
         <echoxml file="${empty.xml}">
             <empty>empty</empty>
         </echoxml>
+    </target>
+    
+    <target name="build_recursed_xsl" depends="input,install_folders,uuid_check,typeName_check,xpath_check,xpath_value_check,set_dita,empty.xml"  description="retrieve data styled Related and build object from api using just XSL calls - needed username and password">
+        
         <property name="debug.dita-ot.dtd.catalog" refid="dita-ot.dtd.catalog"/>
         <echo>#1075 $out_task.dita.final = ${out_task.dita.final}
                     $out_task.dita.final.out ${out_task.dita.final.out}

+ 4 - 2
SE/schema/WPS_Functions/documentation_generator/build.p5dg.PRODUCT.xml

@@ -58,7 +58,7 @@
     <property name="p5dg.schema.generate.xml" location="${p5dg.schema.dir}/p5dg.schema.dir.xml"/>
     <property name="p5dg.schema.generated.tstamp" location="${p5dg.schema.dir}/p5dg.schema.generated.tstamp"/>
     
-    
+    <property name="p5dg.repository.schema.dir" location="${p5dg.basedir}/repository"/>
     
     
     
@@ -82,7 +82,9 @@
     <property name="p5dg.documentation.files.index_analyzed_structurized.xml" location="${p5dg.repository}/p5dg.documentation.files.index_analyzed_structurized.xml"/>
     
     
-    <property name="p5dg.documentation.files.antstructure.dtd" location="${p5ant.documentation.files.antstructure.dtd}"/>
+    <property name="p5dg.documentation.files.antstructure.dtd" location="${p5dg.repository}/p5dg.documentation.files.antstructure.dtd"/><!-- problem ${p5ant.documentation.files.antstructure.dtd} -->
+    <property name="p5dg.documentation.files.antstructure-to-fix.xsd__x3A__size__x3A__too_small__x3A__value__x3A__kbytes" value="100"/>
+    
     
     <property name="p5dg.documentation.files.antstructure-to-fix.xsd" location="${p5dg.repository}/p5dg.documentation.files.antstructure-to-fix.x_s_d"/>
     <property name="p5dg.documentation.files.antstructure.xsd" location="${p5dg.repository}/p5dg.documentation.files.antstructure.xsd"/>

+ 15 - 1
SE/schema/WPS_Functions/documentation_generator/build.p5dg.schema.xml

@@ -45,9 +45,17 @@
     </target>
     <!--  -->
     
+    <extension-point name="p5dg.schema.generate" unless="p5dg.schema.generate.if.old" description="To generate xsd schema for functions and properties" depends="p5dg.schema.generate.if.old,p5dg.graph.graph.graph-to-analyze-evaluated.xml , p5dg.schema.generate__x3A__transform"/>
     
-    <target name="p5dg.schema.generate" unless="p5dg.schema.generate.if.old" description="To generate xsd schema for functions and properties" depends="p5dg.schema.generate.if.old,p5dg.graph.graph.graph-to-analyze-evaluated.xml">
+    <target name="p5dg.schema.generate__x3A__transform" unless="p5dg.schema.generate.if.old"  >
         <!--<input addproperty="p5dg.schema.PRODUCT" message="todo optional limit to only one some schema"/>-->
+        <echo>#52 [ S C H E M A ] __x3A__transform
+input ${graph.graph-to-analyze-evaluated.xml}
+            
+output ${p5dg.schema.generate.xml}
+        
+        </echo>
+        
         <xslt basedir="${p5dg.schema.dir}" style="${p5dg.schema.xsl}" in="${graph.graph-to-analyze-evaluated.xml}"   out="${p5dg.schema.generate.xml}">
             <factory name="net.sf.saxon.TransformerFactoryImpl">    
                 <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
@@ -57,6 +65,12 @@
             <param name="p5dg.schema.dir.log" expression="${p5dg.schema.dir.log}"/>
             <classpath location="/opt/local/share/java/saxon9he.jar"/>
         </xslt>
+        
+        <antcall target="p5ant.safety.say_and_open_file.drop_overflow">
+            <param name="local.p5ant.safety.limit.file.size__x3A__open_file" value="20"/>   
+            <param name="local.p5ant.safety.limit.file.size__x3A__open_file.units" value="M"/>
+            <param name="local.p5ant.safety.filename" value="${p5dg.schema.generate.xml}"/>
+        </antcall>
     </target>
     
     

+ 65 - 18
SE/schema/WPS_Functions/documentation_generator/build_documentation_generator.xml

@@ -93,15 +93,16 @@
     </target>
     
     <extension-point name="p5dg.basedir" depends="p5dg.temp"/>
-    <!--<target name="p5dg.documentation.ant" depends="p5dg.properties">
-        <!-\-<taskdef   file="/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/documentation_generator/commons-net-3.6/commons-net-3.6.jar"/>-\->
-        <!-\-<typedef name="ant" classname="org.apache.tools.ant.launch.Launcher" />-\->
+    
+    <target name="p5dg.documentation.ant" depends="p5dg.properties">
+        <!--<taskdef   file="/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/documentation_generator/commons-net-3.6/commons-net-3.6.jar"/>-->
+        <!--<typedef name="ant" classname="org.apache.tools.ant.launch.Launcher" />-->
         
             <antstructure output="${p5dg.documentation.files.antstructure.dtd}" />
         <echo> to  ${p5dg.documentation.files.antstructure.dtd}</echo>
-        <!-\-<echoproperties destfile="${p5dg.documentation.files.antstructure.dtd}"/>-\->
-        <!-\- name="antstructure" -\->
-        <!-\- 
+        <!--<echoproperties destfile="${p5dg.documentation.files.antstructure.dtd}"/>-->
+        <!-- name="antstructure" -->
+        <!-- 
         perl  /Users/a.binder/Documents/se/SE/stuff/ant/dtd2xsd.pl  -alias -prefix p5ant p5dg.documentation.files.antstructure.dtd  -ns http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/ant/ant.xsd \
         -simpletype 'ContentType' string \
         -attrgroup  '.*Events' \
@@ -114,9 +115,9 @@
         > p5dg.documentation.files.antstructure.xsd
         
   perl  /Users/a.binder/Documents/se/SE/stuff/ant/dtd2xsd.pl  -alias -prefix p5ant p5dg.documentation.files.antstructure.dtd  -ns http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/ant/ant.xsd > p5dg.documentation.files.antstructure.xsd
-        -\->
-        <!-\- classname="org.apache.tools.ant.taskdefs.optional.net.FTP" -\->
-    </target>-->
+        -->
+        <!-- classname="org.apache.tools.ant.taskdefs.optional.net.FTP" -->
+    </target>
     
     <!-- p5dg.documentation.ant -->
     
@@ -124,13 +125,46 @@
         <condition property="p5dg.documentation.files.antstructure-to-fix.xsd.ifexsist">
             <available file="${p5dg.documentation.files.antstructure-to-fix.xsd}"/>
         </condition>
+        <echo>#127 $[p5dg.documentation.files.antstructure-to-fix.xsd.ifexsist] = ${p5dg.documentation.files.antstructure-to-fix.xsd.ifexsist}
+            ( $p5dg.documentation.files.antstructure-to-fix.xsd = ${p5dg.documentation.files.antstructure-to-fix.xsd} )
+        </echo>
     </target>
     
     
+    <target name="p5dg.documentation.files.antstructure-to-fix.xsd__x3A__validate__x3A__size__x3A__too_small__x3A__flag">
+        
+        <fileset id="p5dg.documentation.files.antstructure-to-fix.xsd__x3A__validate__x3A__size.fileset" file="${p5dg.documentation.files.antstructure-to-fix.xsd}">
+            <size value="${p5dg.documentation.files.antstructure-to-fix.xsd__x3A__size__x3A__too_small__x3A__value__x3A__kbytes}" units="k" when="less"/>
+        </fileset>
+        
+        <property name="p5dg.documentation.files.antstructure-to-fix.xsd__x3A__validate__x3A__size__x3A__too_small__x3A__flag.fileset" refid="p5dg.documentation.files.antstructure-to-fix.xsd__x3A__validate__x3A__size.fileset" />
+        
+            <condition property="p5dg.documentation.files.antstructure-to-fix.xsd__x3A__validate__x3A__size__x3A__too_small__x3A__flag" value="size is too small  : ${p5dg.documentation.files.antstructure-to-fix.xsd__x3A__validate__x3A__size__x3A__too_small__x3A__flag.fileset} ">
+            <!--<istrue value="${local.p5ant.safety.filename.length}"/>-->
+            <and>
+                <contains string="${p5dg.documentation.files.antstructure-to-fix.xsd}" substring="${p5dg.documentation.files.antstructure-to-fix.xsd__x3A__validate__x3A__size__x3A__too_small__x3A__flag.fileset}"/>
+                <not>
+                    <equals arg1="${p5dg.documentation.files.antstructure-to-fix.xsd__x3A__validate__x3A__size__x3A__too_small__x3A__flag.fileset}" arg2="" />
+                </not>
+                <not>
+                    <equals arg1="${p5dg.documentation.files.antstructure-to-fix.xsd__x3A__validate__x3A__size__x3A__too_small__x3A__flag.fileset}" arg2="$p5dg.documentation.files.antstructure-to-fix.xsd__x3A__validate__x3A__size__x3A__too_small__x3A__flag" />
+                </not>
+            </and>
+        </condition>   
+        <fail if="p5dg.documentation.files.antstructure-to-fix.xsd__x3A__validate__x3A__size__x3A__too_small__x3A__flag">
+            #138 [ S I Z E  T O O   S M A L L ]   $p5dg.documentation.files.antstructure-to-fix.xsd__x3A__validate__x3A__size__x3A__too_small__x3A__flag
+            "${p5dg.documentation.files.antstructure-to-fix.xsd__x3A__validate__x3A__size__x3A__too_small__x3A__flag}"
+            
+            $p5dg.documentation.files.antstructure-to-fix.xsd__x3A__validate__x3A__size__x3A__too_small__x3A__flag.fileset
+            "${p5dg.documentation.files.antstructure-to-fix.xsd__x3A__validate__x3A__size__x3A__too_small__x3A__flag.fileset}"
+        </fail>
+    </target>
     
     
-    <target name="p5dg.documentation.ant.dtd2xsd.pl" unless="p5dg.documentation.files.antstructure-to-fix.xsd.ifexsist" depends="p5dg.properties,p5dg.documentation.files.antstructure-to-fix.xsd.ifexsist">
+    
+    <target name="p5dg.documentation.ant.dtd2xsd.pl" unless="p5dg.documentation.files.antstructure-to-fix.xsd.ifexsist" depends="p5dg.properties,p5dg.documentation.ant,p5dg.documentation.files.antstructure-to-fix.xsd.ifexsist ">
         <property environment="env"/>
+        <echo>#160 [ D T D  2  X S L ]</echo>
         <exec executable="${bin.perl}" searchpath="true"  output="${p5dg.documentation.files.antstructure-to-fix.xsd}" errorproperty="p5dg.documentation.ant.dtd2xsd.pl.error" failifexecutionfails="true">
             <!--<arg value="${dtd2xsd.pl}"/>-->
             <!--<arg value="-major"/>-->
@@ -503,13 +537,16 @@
         
     </target>-->
     
-    
+    <extension-point name="p5dg.generate_documentation" depends="p5dg.generate_documentation.clean,p5dg.generate_documentation.action,p5dg.generate_documentation__x3A__controller"/>
+  
   
-    <target name="p5dg.generate_documentation" depends="p5dg.repository,p5dg.properties,p5dg.documentation.files.index"  description="to generate documentation of ant builds and properties and others">
+    <extension-point name="p5dg.generate_documentation__x3A__controller" depends="p5dg.documentation.files.antstructure-to-fix.xsd__x3A__validate__x3A__size__x3A__too_small__x3A__flag"/><!-- To extend during fuckups -->
+  
+    <target name="p5dg.generate_documentation.action" depends="p5dg.repository,p5dg.properties,p5dg.documentation.files.index"  description="to generate documentation of ant builds and properties and others">
         <echo>#12 test public_html = ${public_html}
             p5dg.basedir ${p5dg.basedir}
         </echo>
-        <antcall target="p5dg.generate_documentation.clean"/> <!-- optionally remove -->
+        <!--<antcall target="p5dg.generate_documentation.clean"/>--> <!-- optionally remove -->
         <echo> build_WPS_Functions.childproperties.builds.xml ${build_WPS_Functions.childproperties.builds.xml}</echo>
         <parallel threadcount="2" >
             <sequential>
@@ -579,11 +616,13 @@
         </antcall>
     </target>-->
     
-    <!--<target name="p5dg.clean" depends="p5dg.properties" description="To delete all temp and repository">
-        <antcall target="p5bws.p5bws:dirs.clean" inheritall="false">
+    <target name="p5dg.clean" depends="p5dg.properties" description="To delete all temp and repository">
+        <!--<antcall target="p5bws.p5bws:dirs.clean" inheritall="false">
             <propertyset refid="p5dg.local.properties"/>
-        </antcall>
-    </target>-->
+        </antcall>-->
+        <delete dir="${p5dg.repository}" verbose="true"/>
+        <mkdir dir="${p5dg.repository}"/>
+    </target>
     
     <!--<target name="p5dg.clean.temp" depends="p5dg.properties" description="To delete all temp and repository">
         <antcall target="p5bws.p5bws:dirs.temp.clean" inheritall="false">
@@ -591,6 +630,14 @@
         </antcall>
     </target>-->
     
-    
+    <target name="p5dg.copy_repository_to_basedir">
+        <description>it looks that some xsd are used by models - it is task to carefully refresh them</description>
+        <echo>#593 copy from ${p5dg.repository}
+            to: ${p5dg.repository.schema.dir}</echo>
+        <copy todir="${p5dg.repository.schema.dir}" verbose="true" >
+            <!--<filelist dir="${p5dg.repository}" />-->
+            <fileset dir="${p5dg.repository}" includes="*"/>
+        </copy>
+    </target>
   
 </project>

+ 0 - 2
SE/schema/WPS_Functions/documentation_generator/documentation_generator.xsd

@@ -15,12 +15,10 @@
    <xs:import
         namespace="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/ant_interface/ant_interface-resp.xsd"
         schemaLocation="../ant_interface/ant_interface-resp.xsd"/>
-   
    <xs:element name="p5dg.documentation.files.index_analyzed.xml"
                id="___d15e109894-1_p5dg.docum">
       <xs:complexType id="___d15e109895-1">
          <xs:sequence id="___d15e109896-1">
-            <!--@201907 problem with resolving todo -->
             <xs:element ref="p5ant-interface-resp:filelist" id="___d15e109897-1"/>
          </xs:sequence>
       </xs:complexType>

+ 328 - 0
SE/schema/WPS_Functions/documentation_generator/p5dg.filepath.xsl

@@ -7,6 +7,7 @@
     xmlns:p5ant-interface-resp="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/ant_interface/ant_interface-resp.xsd"
     xmlns:p5ant="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/ant/ant.xsd"
     xmlns:object_merge_ant_object="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/object_merge_ant_object.xsd"
+    xmlns:p5dkp="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.xsd"
     exclude-result-prefixes="xs"
     version="2.0">
     
@@ -107,5 +108,332 @@
     </xsl:function>
     
     
+    <xsl:function name="p5dkp:ditafiles.file_from_fullpath.rel">
+        <xsl:param name="fullpath"/>
+        <xsl:variable name="out">
+            <xsl:for-each select="tokenize($fullpath,'/')">
+                <xsl:choose>
+                    <xsl:when test="position() = 1">
+                        <xsl:value-of select="concat(.,'/')"/>
+                    </xsl:when>
+                    <xsl:when test="position() = last()">
+                        <xsl:value-of select="concat(.,'/')"/>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <xsl:value-of select="concat(.,'/')"/>
+                    </xsl:otherwise>
+                </xsl:choose>
+            </xsl:for-each>
+        </xsl:variable>
+        <xsl:value-of select="p5dg:filepath.clean($out)"/>
+    </xsl:function>
+    
+    <xsl:function name="p5dkp:ditafiles.file_from_fullpath">
+        <xsl:param name="fullpath"/>
+        <xsl:variable name="path_len" select="count(tokenize($fullpath,'/'))"/>
+        <xsl:variable name="out">
+            <xsl:choose>
+                <xsl:when test="$path_len &gt; 0">
+                    <xsl:for-each select="tokenize($fullpath,'/')">
+                        <xsl:choose>
+                            <xsl:when test="position() = last()">
+                                <xsl:value-of select="."/>
+                            </xsl:when>
+                        </xsl:choose>
+                    </xsl:for-each>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:value-of select="$fullpath"/>
+                </xsl:otherwise>
+            </xsl:choose>
+        </xsl:variable>
+        <xsl:value-of select="$out"/>
+    </xsl:function>
+    
+    
+    <xsl:function name="p5dkp:ditafiles.dir_from_fullpath">
+        <xsl:param name="fullpath"/>
+        <!--<xsl:message>#98 <xsl:value-of select="$fullpath"/></xsl:message>-->
+        <xsl:variable name="path_len" select="count(tokenize($fullpath,'/'))"/>
+        <xsl:variable name="out">
+            <xsl:choose>
+                <xsl:when test="$path_len &gt; 0">
+                    <xsl:for-each select="tokenize($fullpath,'/')">
+                        <xsl:choose>
+                            <xsl:when test="position() = 1">
+                                <xsl:value-of select="concat(.,'/')"/>
+                            </xsl:when>
+                            <xsl:when test="position() &lt; $path_len and not(position() = last())">
+                                <xsl:value-of select="concat(.,'/')"/>
+                            </xsl:when>
+                        </xsl:choose>
+                    </xsl:for-each>
+                </xsl:when>
+            </xsl:choose>
+        </xsl:variable>
+        <xsl:value-of select="$out"/>
+    </xsl:function>
+    
+    <xsl:function name="p5dkp:ditafiles.func.merge_path.string.file">
+        <xsl:param name="map.path1"/>
+        <xsl:param name="href1"/>
+        <xsl:param name="map.path2"/>
+        <xsl:param name="href2"/>
+        <xsl:value-of select="concat(p5dkp:ditafiles.func.merge_path.string($map.path1,$href1,$map.path2,$href2),'/',$href1)"/>
+    </xsl:function>
+    
+    <xsl:function name="p5dkp:ditafiles.func.merge_path.string">
+        <xsl:param name="map.path1"/>
+        <xsl:param name="href1"/>
+        <xsl:param name="map.path2"/>
+        <xsl:param name="href2"/>
+        <xsl:variable name="p5dkp:ditafiles.func.merge_path">
+            <p5dkp:ditafiles.func.merge_path>
+                <xsl:copy-of select="p5dkp:ditafiles.func.merge_path($map.path1,$href1,$map.path2,$href2)" copy-namespaces="no"/>
+            </p5dkp:ditafiles.func.merge_path>
+        </xsl:variable>
+        <xsl:variable name="merge_path">
+            <xsl:for-each select="$p5dkp:ditafiles.func.merge_path//result/path">
+                <xsl:choose>
+                    <xsl:when test="position() = last() and string-length(@path) &gt; 0">
+                        <xsl:value-of select="@path"/>
+                    </xsl:when>
+                    <xsl:otherwise><xsl:value-of select="concat(@path,'/')"/></xsl:otherwise>
+                </xsl:choose>
+            </xsl:for-each>
+        </xsl:variable>
+        <xsl:value-of select="$merge_path"/>
+    </xsl:function>
+    
+    <xsl:function name="p5dkp:ditafiles.func.merge_path.string">
+        <xsl:param name="map.path1"/>
+        <xsl:param name="map.path2"/>
+        <xsl:variable name="p5dkp:ditafiles.func.merge_path">
+            <p5dkp:ditafiles.func.merge_path>
+                <xsl:copy-of select="p5dkp:ditafiles.func.merge_path($map.path1,'/FAKEFILE1.FAKE',$map.path2,'/FAKEFILE2.FAKE')" copy-namespaces="no"/>
+            </p5dkp:ditafiles.func.merge_path>
+        </xsl:variable>
+        <xsl:variable name="merge_path">
+            <xsl:for-each select="$p5dkp:ditafiles.func.merge_path//result/path">
+                <xsl:choose>
+                    <xsl:when test="position() = last()">
+                        <xsl:value-of select="@path"/>
+                    </xsl:when>
+                    <xsl:otherwise><xsl:value-of select="concat(@path,'/')"/></xsl:otherwise>
+                </xsl:choose>
+            </xsl:for-each>
+        </xsl:variable>
+        <xsl:value-of select="$merge_path"/>
+    </xsl:function>
+    
+    <xsl:function name="p5dkp:ditafiles.func.merge_path">
+        <xsl:param name="map.path2"/>
+        <xsl:param name="href2"/>
+        <xsl:param name="map.path1"/>
+        <xsl:param name="href1"/>
+        <xsl:variable name="map1" select="p5dg:filepath.clean(concat($map.path1,'/',$href1))"/>
+        <xsl:variable name="map2" select="p5dg:filepath.clean(concat($map.path2,'/',$href2))"/>
+        <xsl:message>[EEE]#148DDDD $map.path1 = "<xsl:value-of select="$map.path1"/>" ; "<xsl:value-of select="$href1"/>"  $map.path2 = "<xsl:value-of select="$map.path2"/>" ; "<xsl:value-of select="$href2"/>"  , count(<xsl:value-of select="count($map.path2)"/>); (<xsl:value-of select="count($href2)"/>)</xsl:message>
+        <xsl:message>[EEE]#148DDDD-B $map1=<xsl:value-of select="$map1"/>; $map2=<xsl:value-of select="$map2"/>;</xsl:message>
+        <xsl:variable name="p5dkp:ditafiles.func.merge_path">
+            <p5dkp:ditafiles.func.merge_path>
+                <xsl:variable name="map2.len" select="count(tokenize($map2,'/'))"/>
+                <xsl:attribute name="p5dg:filepath.clean.1" select="$map1"/>
+                <xsl:attribute name="p5dg:filepath.clean.2" select="$map2"/>
+                <xsl:attribute name="map.path1" select="$map.path1"/>
+                <xsl:attribute name="href1" select="$href1"/>
+                <xsl:attribute name="map.path2" select="$map.path2"/>
+                <xsl:attribute name="href2" select="$href2"/>
+                <xsl:for-each select="tokenize($map1,'/')">
+                    <xsl:variable name="pos1" select="position()"/>
+                    <xsl:variable name="text1" select="."/>
+                    <xsl:choose>
+                        <xsl:when test="position() &gt; $map2.len">
+                            <path1 pos="{xs:integer($pos1)}">
+                                <xsl:attribute name="mismatch" select="."/>
+                            </path1>
+                        </xsl:when>
+                        <xsl:otherwise>
+                            <path1 pos="{xs:integer($pos1)}">
+                                <!--<xsl:message>#148 $map.path1 = "<xsl:value-of select="$map.path1"/>" ; "<xsl:value-of select="$href1"/>"  $map.path2 = "<xsl:value-of select="$map.path2"/>" ; "<xsl:value-of select="$href2"/>"  , count(<xsl:value-of select="count($map.path2)"/>); (<xsl:value-of select="count($href2)"/>)</xsl:message>-->
+                                <xsl:for-each select="tokenize($map2,'/')">
+                                    <xsl:choose>
+                                        <xsl:when test="position() = $pos1">
+                                            <xsl:choose>
+                                                <xsl:when test=". = $text1">
+                                                    <xsl:attribute name="same" select="$text1"/>
+                                                </xsl:when>
+                                                <xsl:otherwise>
+                                                    <xsl:attribute name="mismatch" select="$text1"/>
+                                                </xsl:otherwise>
+                                            </xsl:choose>
+                                        </xsl:when>
+                                    </xsl:choose>
+                                </xsl:for-each>
+                            </path1>
+                        </xsl:otherwise>
+                    </xsl:choose>
+                </xsl:for-each>
+            </p5dkp:ditafiles.func.merge_path>
+        </xsl:variable>
+        <xsl:variable name="p5dkp:ditafiles.func.merge_path2">
+            <p5dkp:ditafiles.func.merge_path2>
+                <xsl:variable name="map1.len" select="count(tokenize($map1,'/'))"/>
+                <xsl:for-each select="tokenize($map2,'/')">
+                    <xsl:variable name="pos2" select="position()"/>
+                    <xsl:variable name="text2" select="."/>
+                    <xsl:choose>
+                        <xsl:when test="position() &gt; $map1.len">
+                            <path2 pos="{xs:integer($pos2)}">
+                                <xsl:attribute name="mismatch" select="."/>
+                            </path2>
+                        </xsl:when>
+                        <xsl:otherwise>
+                            <path2 pos="{xs:integer($pos2)}">
+                                <xsl:for-each select="tokenize($map1,'/')">
+                                    <xsl:choose>
+                                        <xsl:when test="position() = $pos2">
+                                            <xsl:choose>
+                                                <xsl:when test=". = $text2">
+                                                    <xsl:attribute name="same" select="$text2"/>
+                                                </xsl:when>
+                                                <xsl:otherwise>
+                                                    <xsl:attribute name="mismatch" select="$text2"/>
+                                                </xsl:otherwise>
+                                            </xsl:choose>
+                                        </xsl:when>
+                                    </xsl:choose>
+                                    
+                                </xsl:for-each>
+                            </path2>
+                        </xsl:otherwise>
+                    </xsl:choose>
+                </xsl:for-each>
+                
+            </p5dkp:ditafiles.func.merge_path2>
+        </xsl:variable>
+        <xsl:copy-of select="$p5dkp:ditafiles.func.merge_path" copy-namespaces="no"/>
+        <xsl:copy-of select="$p5dkp:ditafiles.func.merge_path2" copy-namespaces="no"/>
+        <xsl:variable name="min.mismatch"  > <!-- select="min($p5dkp:ditafiles.func.merge_path//path1[@mismatch]/number(@pos)) cast as xs:integer " -->
+            <xsl:choose>
+                <xsl:when test="$p5dkp:ditafiles.func.merge_path//path1[@mismatch]/@pos">
+                    <xsl:value-of select="min($p5dkp:ditafiles.func.merge_path//path1[@mismatch]/number(@pos)) cast as xs:integer "/>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:value-of select="0"/>
+                    <xsl:message terminate="no">###273 same path?! situation path1= <xsl:copy-of select="$p5dkp:ditafiles.func.merge_path//path1"></xsl:copy-of></xsl:message>
+                </xsl:otherwise>
+            </xsl:choose>
+        </xsl:variable>
+        <xsl:variable name="max.mismatch" >
+            <xsl:choose>
+                <xsl:when test="not($p5dkp:ditafiles.func.merge_path//path1[@mismatch]/@pos)">
+                    <xsl:value-of select="0"/>
+                    <xsl:message>#282 same path?! WARNING </xsl:message>
+                </xsl:when>
+                <!--<xsl:when test="max(($p5dkp:ditafiles.func.merge_path//path1[@mismatch]/number(@pos)) )  cast as xs:integer  &gt; max($p5dkp:ditafiles.func.merge_path2//path2[@mismatch]/number(@pos)) cast as xs:integer ">
+               <xsl:value-of select="max(($p5dkp:ditafiles.func.merge_path//path1[@mismatch]/number(@pos)) )  cast as xs:integer "/>
+            </xsl:when>-->
+                <xsl:otherwise >
+                    <xsl:value-of select="max(($p5dkp:ditafiles.func.merge_path//path1[@mismatch]/number(@pos)) )  cast as xs:integer "/>
+                </xsl:otherwise>
+                <!--<xsl:otherwise>
+               <xsl:value-of select="max($p5dkp:ditafiles.func.merge_path2//path2[@mismatch]/number(@pos)) cast as xs:integer "/>
+            </xsl:otherwise>-->
+            </xsl:choose>
+        </xsl:variable>
+        
+        <xsl:variable name="max.mismatch.2" >
+            <xsl:choose>
+                <xsl:when test="not($p5dkp:ditafiles.func.merge_path2//path2[@mismatch]/@pos)">
+                    <xsl:value-of select="0"/>
+                    <xsl:message>#282 same path?! WARNING </xsl:message>
+                </xsl:when>
+                <!--<xsl:when test="max(($p5dkp:ditafiles.func.merge_path//path1[@mismatch]/number(@pos)) )  cast as xs:integer  &gt; max($p5dkp:ditafiles.func.merge_path2//path2[@mismatch]/number(@pos)) cast as xs:integer ">
+               <xsl:value-of select="max(($p5dkp:ditafiles.func.merge_path//path1[@mismatch]/number(@pos)) )  cast as xs:integer "/>
+            </xsl:when>-->
+                <xsl:otherwise >
+                    <xsl:value-of select="max(($p5dkp:ditafiles.func.merge_path2//path2[@mismatch]/number(@pos)) )  cast as xs:integer "/>
+                </xsl:otherwise>
+                <!--<xsl:otherwise>
+               <xsl:value-of select="max($p5dkp:ditafiles.func.merge_path2//path2[@mismatch]/number(@pos)) cast as xs:integer "/>
+            </xsl:otherwise>-->
+            </xsl:choose>
+        </xsl:variable>
+        
+        <xsl:variable name="map.path1.len">
+            <xsl:choose>
+                <xsl:when test="count(tokenize($map1,'/')) &gt; 0 " >
+                    <xsl:value-of select="count(tokenize($map1,'/')) cast as xs:string"/>
+                </xsl:when>
+                <xsl:otherwise><xsl:value-of select="0"/></xsl:otherwise>
+            </xsl:choose>
+        </xsl:variable>
+        <xsl:variable name="map.path2.len">
+            <xsl:choose>
+                <xsl:when test="count(tokenize($map2,'/')) &gt; 0 " >
+                    <xsl:value-of select="count(tokenize($map2,'/')) cast as xs:string"/>
+                </xsl:when>
+                <xsl:otherwise><xsl:value-of select="0"/></xsl:otherwise>
+            </xsl:choose>
+        </xsl:variable>
+        <xsl:variable name="max.path.len" >
+            <xsl:for-each select="($map.path1.len,$map.path2.len)">
+                <xsl:sort select="." order="descending" data-type="number"/>
+                <xsl:if test="position() = 1"><xsl:value-of select=". cast as xs:integer"/></xsl:if>
+            </xsl:for-each>
+        </xsl:variable>
+        <result>
+            <xsl:attribute name="min.mismatch" select="$min.mismatch" />
+            <xsl:attribute name="max.mismatch" select="$max.mismatch" />
+            <xsl:attribute name="max.mismatch.2" select="$max.mismatch.2" />
+            <xsl:attribute name="map.path1.len" select="$map.path1.len"/>
+            <xsl:attribute name="map.path2.len" select="$map.path2.len"/>
+            <xsl:attribute name="max.path.len" select="$max.path.len"/>
+            <!--<xsl:message>#max.path.len = <xsl:value-of select="$max.path.len"/> ; $map.path1.len = <xsl:value-of select="$map.path1.len"/>; $map.path2.len = <xsl:value-of select="$map.path2.len"/>; </xsl:message>-->
+            <xsl:variable name="source.file.tune">
+                <xsl:choose>
+                    <xsl:when test="string-length($href1) &gt; 0">
+                        <xsl:value-of select="1"/>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <xsl:value-of select="1"/>
+                    </xsl:otherwise>
+                </xsl:choose>
+            </xsl:variable>
+            <xsl:for-each select="$min.mismatch to ( xs:integer($max.mismatch ) - xs:integer($source.file.tune))"> <!-- - 1  -->
+                <path>
+                    <xsl:attribute name="pos" select="position()"/>
+                    <xsl:attribute name="path"  select="'..'"/>
+                    <xsl:attribute name="ind"  select="."/>
+                </path>
+            </xsl:for-each>
+            
+            <xsl:for-each select="$min.mismatch to ( xs:integer($max.mismatch.2 ))">
+                <xsl:choose>
+                    <xsl:when test="$p5dkp:ditafiles.func.merge_path2//path2[  matches(concat('III',@pos,'III'),xs:string(concat('III',current(),'III'))) ]/@mismatch">
+                        <path>
+                            <xsl:attribute name="pos" select="position()"/>
+                            <xsl:attribute name="path"  select="$p5dkp:ditafiles.func.merge_path2//path2[  matches(concat('III',@pos,'III'),xs:string(concat('III',current(),'III'))) ]/@mismatch"  />
+                            <xsl:attribute name="ind" select="."/>
+                            <!--<xsl:attribute name="path22"  select="$p5dkp:ditafiles.func.merge_path2//path2[@pos=$min.mismatch.pos]/@mismatch"/>
+               <xsl:attribute name="path22"  select="$p5dkp:ditafiles.func.merge_path2//path2[@pos=$min.mismatch.pos]/@mismatch"/>-->
+                        </path>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <else>
+                            <xsl:attribute name="pos" select="position()"/>
+                            <xsl:attribute name="path"  select="$p5dkp:ditafiles.func.merge_path2//path2[ @pos = current() ]/@mismatch"  />
+                            <xsl:attribute name="ind" select="."/>
+                        </else>
+                    </xsl:otherwise>
+                </xsl:choose>
+                
+            </xsl:for-each>
+            <!--<xsl:for-each select="$p5dkp:ditafiles.func.merge_path//path[number(@pos) &lt; $min.mismatch]">
+            
+         </xsl:for-each>-->
+        </result>
+    </xsl:function>
     
 </xsl:stylesheet>

+ 1 - 1
SE/schema/WPS_Functions/documentation_generator/p5dg.schema.xsl

@@ -43,7 +43,7 @@
     
     <xsl:template mode="p5dg:schema.generate" match="graph:graph-to-analyze-evaluated.xml">
         <p5dg:schema.generate>
-            asd
+            <xsl:apply-templates mode="p5dg:schema.generate__x40__template" select="."/>
         </p5dg:schema.generate>
     </xsl:template>