|
|
@@ -7,10 +7,14 @@
|
|
|
xmlns:p5_default_db="https://biuro.biall-net.pl/wfs/default_db"
|
|
|
xmlns:wfs="http://www.opengis.net/wfs"
|
|
|
xmlns:ogc="http://www.opengis.net/ogc"
|
|
|
+ xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
|
|
|
exclude-result-prefixes="xs"
|
|
|
version="2.0">
|
|
|
<xsl:output indent="yes" />
|
|
|
<xsl:strip-space elements="*"/>
|
|
|
+
|
|
|
+
|
|
|
+ <xsl:include href="../../../default_db_xml_cache.public/escaped_html_to_xml.xsl"/>
|
|
|
<!--
|
|
|
<property name="url" value="${url}"/> - to point what is record/table to download
|
|
|
<property name="uuid" value="${uuid}"/> it is automatically also set to enable uinque transaction and to allow to save data with user
|
|
|
@@ -34,11 +38,11 @@
|
|
|
<xsl:param name="xpath" required="yes" /> <!-- to be set initially ex: ID -->
|
|
|
<xsl:param name="xpath_value" required="yes" /> <!-- to be set ex: 1000 -->
|
|
|
<xsl:param name="loop_xpath" required="yes"/> <!-- sciezka do zapisywania xmli w przetwarzaniu plikow default root -->
|
|
|
-
|
|
|
+ <xsl:param name="loop_xpath_save" required="yes"/> <!-- przekazany z template match="RelatedFeature" mode="after_first_ant_assing_vars_childs" -->
|
|
|
<!-- static project variables as default styles.dita/xsl and names-->
|
|
|
<xsl:param name="main_build_recurse_ant.dita" select="'main_build_recurse_ant.dita'"/>
|
|
|
<xsl:param name="build_recurse_ant.xsl" select="'build_recurse_ant.xsl'"/>
|
|
|
-
|
|
|
+ <xsl:param name="xml_id_parent" select="@xml_id"/>
|
|
|
<!-- second step fist loop - with data -->
|
|
|
<!--<xsl:param name="wfs_output.xml"/>--> <!-- to be set in second step by ant build generated by this style to fill by its data childs -->
|
|
|
|
|
|
@@ -47,17 +51,33 @@
|
|
|
<xsl:param name="xpath" select="$xpath" />
|
|
|
<xsl:param name="xpath_value" select="$xpath_value" />
|
|
|
<xsl:param name="loop_xpath" select="$loop_xpath"/>
|
|
|
+ <xsl:param name="loop_xpath_save" select="$loop_xpath_save"/><!-- tutaj zapisal sie build z wezla z parent -->
|
|
|
<xsl:param name="input_obj_with_xpath" /> <!-- przekazany z template match="RelatedFeature" mode="after_first_ant_assing_vars_childs" -->
|
|
|
+
|
|
|
<xsl:choose>
|
|
|
<xsl:when test="name()='RelatedFeature'">
|
|
|
<xsl:variable name="RelatedFeatureCount" select="last()"/>
|
|
|
<xsl:variable name="RelatedFeaturePos" select="position()"/>
|
|
|
<xsl:variable name="featureID_name" select="substring-after($typeName,':')"/>
|
|
|
+ <xsl:message>#58 bylo $loop_xpath=<xsl:value-of select="$loop_xpath"/>;</xsl:message>
|
|
|
+ <xsl:variable name="loop_xpath">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$loop_xpath='root'">
|
|
|
+ <xsl:value-of select="concat($loop_xpath,'_x2f_.',@xml_id,'.',$featureID_name)"/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise><xsl:value-of select="$loop_xpath"/></xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:variable>
|
|
|
<xsl:variable name="typeName_dita" select="@typeName"/>
|
|
|
<xsl:variable name="featureID_name_dita" select="substring-after($typeName_dita,':')"/>
|
|
|
- <xsl:variable name="wfs_output" select="concat($uuid,'.',$loop_xpath,'_x2f_',$featureID_name)"/>
|
|
|
+ <xsl:variable name="xml_id" select="@xml_id"/>
|
|
|
+ <!--<xsl:variable name="wfs_output" select="concat($uuid,'.',$loop_xpath,'_x2f_',$featureID_name)"/>-->
|
|
|
+ <xsl:variable name="wfs_output" select="concat($uuid,'.',$loop_xpath)"/>
|
|
|
+ <!--<xsl:variable name="wfs_output.xml" select="concat($wfs_output,'.',position(),'.xml')"/>-->
|
|
|
<xsl:variable name="wfs_output.xml" select="concat($wfs_output,'.',position(),'.xml')"/>
|
|
|
+
|
|
|
<xsl:variable name="wfs_output.dita" select="concat($wfs_output,'.',position(),'.dita.xml')"/>
|
|
|
+ <!--<xsl:variable name="wfs_output.dita" select="concat($wfs_output,'.',position(),'.','.dita.xml')"/>-->
|
|
|
<!-- dane z oczekiwanego template .dita -->
|
|
|
<xsl:variable name="xpath_dita" select="@xpath"/>
|
|
|
<xsl:variable name="xpath_value_dita">
|
|
|
@@ -70,11 +90,14 @@
|
|
|
<xsl:variable name="xpath_value_token">
|
|
|
<xsl:for-each select=" tokenize(@xpath_value,'/')">
|
|
|
<xsl:message>#70 znalazlem dla=<xsl:value-of select="."/>; <xsl:value-of select="$input_obj_with_xpath/node()[@xpath=current()]"/></xsl:message>
|
|
|
- <xsl:copy-of select="$input_obj_with_xpath/node()[@xpath='ID_BILLING_OWNER']"></xsl:copy-of><!-- todo to jest bledne ale dziala tymczasowo-->
|
|
|
+ <xsl:if test="$input_obj_with_xpath/node()[@xpath=current()]">
|
|
|
+ <xsl:copy-of select="$input_obj_with_xpath/node()[@xpath=current()]"/>
|
|
|
+ </xsl:if><!-- todo to jest bledne ale dziala tymczasowo-->
|
|
|
</xsl:for-each>
|
|
|
</xsl:variable>
|
|
|
<xsl:message>#73 ustalam na <xsl:value-of select="$xpath_value_token/node()[1]/text()"/>;</xsl:message>
|
|
|
- <xsl:value-of select="$xpath_value_token/node()[1]/text()"/>
|
|
|
+ <!--<xsl:value-of select="$xpath_value_token/node()[1]/text()"/>-->
|
|
|
+ <xsl:value-of select="$xpath_value_token"/>
|
|
|
</xsl:when>
|
|
|
<xsl:otherwise>
|
|
|
<xsl:value-of select="$xpath_value"/><!-- parametr z template narzuca wartosc -->
|
|
|
@@ -125,6 +148,9 @@
|
|
|
<xsl:with-param name="typeName" select="$typeName"/>
|
|
|
<xsl:with-param name="xpath_value" select="$xpath_value"/>
|
|
|
<xsl:with-param name="loop_xpath" select="$loop_xpath"/>
|
|
|
+ <!--<xsl:with-param name="loop_xpath_save" select="$loop_xpath_save"/>-->
|
|
|
+ <xsl:with-param name="xml_id" select="$xml_id"/>
|
|
|
+ <!--<xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>-->
|
|
|
</xsl:apply-templates>
|
|
|
<!-- na koniec przetwarzania kazdego z wezlow, podmieniamy xsl biezacy wezel -->
|
|
|
|
|
|
@@ -132,25 +158,38 @@
|
|
|
robi result-document href="build_{$loop_xpath}.{$uuid}.xml
|
|
|
wiec powinnismy uruchomic ant ten plik w ciemno znajac jego nizsze wezly</xsl:comment>
|
|
|
<xsl:variable name="featureID_name_child" select="substring-after($typeName,':')"/>
|
|
|
- <xsl:variable name="loop_xpath_child" select="concat($loop_xpath,'_x2f_',$featureID_name)"/>
|
|
|
|
|
|
+ <xsl:variable name="loop_xpath_child" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>
|
|
|
+ <xsl:message>#142 ustalamy $loop_xpath_child=<xsl:value-of select="$loop_xpath_child"/></xsl:message>
|
|
|
+ <xsl:element name="target">
|
|
|
+ <xsl:attribute name="name" select="'get_related_feature_run_child_ant'"/>
|
|
|
+ <xsl:attribute name="depends" select="concat('get_related_feature.',$RelatedFeaturePos)"/>
|
|
|
<xsl:choose>
|
|
|
<xsl:when test=".//(RelatedFeature|RelatedFeatureRoot)">
|
|
|
- <xsl:element name="target">
|
|
|
- <xsl:attribute name="name" select="'get_related_feature_run_child_ant'"/>
|
|
|
- <xsl:attribute name="depends" select="concat('get_related_feature.',$RelatedFeaturePos)"/>
|
|
|
- <ant antfile="temp/{$uuid}.build_{$loop_xpath_child}.xml" dir="."/>
|
|
|
- </xsl:element>
|
|
|
+ <xsl:for-each select=".//RelatedFeature">
|
|
|
+ <xsl:variable name="loop_xpath_child_ant" select="concat($loop_xpath_save,'_x2f_.',@xml_id,'.',$featureID_name)"/>
|
|
|
+ <xsl:message>#148 ustalamy $loop_xpath_child_ant=<xsl:value-of select="$loop_xpath_child_ant"/></xsl:message>
|
|
|
+ <!-- <xsl:element name="target">
|
|
|
+ <xsl:attribute name="name" select="$loop_xpath_child_ant"/><!-\-'get_related_feature_run_child_ant'-\->
|
|
|
+ <xsl:attribute name="depends" select="concat('get_related_feature.',$RelatedFeaturePos)"/>-->
|
|
|
+ <!--<ant antfile="temp/{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.xml" dir="."/>-->
|
|
|
+ <ant antfile="temp/{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.xml" dir="."/>
|
|
|
+
|
|
|
+ <!--</xsl:element>-->
|
|
|
+ <xsl:if test=" position()=last()">
|
|
|
+ <xsl:comment>Tu task z related</xsl:comment>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:for-each>
|
|
|
</xsl:when>
|
|
|
<xsl:otherwise>
|
|
|
<xsl:comment>#135 nie ma wiecej //RelatedFeature</xsl:comment>
|
|
|
- <xsl:element name="target">
|
|
|
+ <!--<xsl:element name="target">
|
|
|
<xsl:attribute name="name" select="'get_related_feature_run_child_ant'"/>
|
|
|
<xsl:attribute name="depends" select="concat('get_related_feature.',$RelatedFeaturePos)"/>
|
|
|
- </xsl:element>
|
|
|
+ </xsl:element>-->
|
|
|
</xsl:otherwise>
|
|
|
</xsl:choose>
|
|
|
-
|
|
|
+ </xsl:element>
|
|
|
<!-- na koniec przetwarzania danego zaglebienia uruchamiamy calosc ponownie do kolejnego zaglebienia -->
|
|
|
|
|
|
<!-- task do polaczenia zaglebien -->
|
|
|
@@ -186,6 +225,8 @@
|
|
|
<xsl:param name="typeName" required="yes"/>
|
|
|
<xsl:param name="xpath_value" required="yes"/>
|
|
|
<xsl:param name="loop_xpath" required="yes"/>
|
|
|
+ <!--<xsl:param name="loop_xpath_save" required="yes"/>-->
|
|
|
+ <xsl:param name="xml_id" required="yes"/>
|
|
|
<xsl:choose>
|
|
|
<xsl:when test="$wfs_output"/>
|
|
|
<xsl:otherwise><xsl:message terminate="yes">Not required param wfs_output - nazwa temp sciagniecia z api xml forsowana przez pierwsze sciagniecie - to set by next parraler step in ant build </xsl:message></xsl:otherwise>
|
|
|
@@ -266,15 +307,18 @@
|
|
|
<param name="xpath" expression="{$xpath}" /> <!-- kontrolnie - nie potrzebne -->
|
|
|
<param name="xpath_value" expression="{$xpath_value}" /> <!-- kontrolnie - nie potrzebne -->
|
|
|
<param name="loop_xpath" expression="{$loop_xpath}"/>
|
|
|
+ <param name="loop_xpath_save" expression="{$loop_xpath_save}"/>
|
|
|
<param name="typeName" expression="{$typeName}"/><!-- kontrolnie - nie potrzebne -->
|
|
|
<param name="uuid" expression="{$uuid}"/>
|
|
|
<param name="passwordBase64Basic" expression="{$passwordBase64Basic}"/>
|
|
|
</xslt>
|
|
|
-
|
|
|
</xsl:element>
|
|
|
<!-- zapisujemy wynik naszego biezacego przetwarzania dita element nizej do kolejnego przejechania z ant wyniku dla podstawienia danych -->
|
|
|
<!-- blad - result jest po tym template -->
|
|
|
- <xsl:result-document href="{$wfs_output.dita}"><xsl:copy-of select="."/></xsl:result-document>
|
|
|
+ <xsl:message>#276 $xml_id=<xsl:value-of select="$xml_id"/>; writing $wfs_output.dita to <xsl:value-of select="$wfs_output.dita"/>;</xsl:message>
|
|
|
+ <xsl:result-document href="{$wfs_output.dita}">
|
|
|
+ <xsl:comment>current $loop_xpath=<xsl:value-of select="$loop_xpath"/>;</xsl:comment>
|
|
|
+ <xsl:copy-of select="."/></xsl:result-document>
|
|
|
</xsl:when>
|
|
|
<xsl:otherwise>
|
|
|
<error>
|
|
|
@@ -298,8 +342,9 @@
|
|
|
|
|
|
|
|
|
<xsl:template match="RelatedFeature" mode="after_first_ant_assing_vars">
|
|
|
+ <xsl:param name="loop_xpath" select="$loop_xpath"/>
|
|
|
<RelatedFeatureRoot>
|
|
|
- <xsl:message>#228 templ match RelatedFeature mode after_first_ant_assing_vars dla @typeName=<xsl:value-of select="@typeName"/>;</xsl:message>
|
|
|
+ <xsl:message>#228 @xml_id=<xsl:value-of select="@xml_id"/>; templ match RelatedFeature mode after_first_ant_assing_vars dla @typeName=<xsl:value-of select="@typeName"/>;</xsl:message>
|
|
|
<!-- first assign xpath to features from -->
|
|
|
<xsl:variable name="wfs_output_nodes" select="doc($wfs_output)"/>
|
|
|
<!--<input_obj_with_xpath_debug>
|
|
|
@@ -324,6 +369,8 @@
|
|
|
</input_node_debug>-->
|
|
|
<xsl:apply-templates mode="after_first_ant_assing_vars_childs">
|
|
|
<xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
|
|
|
+ <xsl:with-param name="xml_id_parent" select="@xml_id"/>
|
|
|
+ <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
|
|
|
</xsl:apply-templates>
|
|
|
</RelatedFeatureRoot>
|
|
|
</xsl:template>
|
|
|
@@ -335,10 +382,12 @@
|
|
|
|
|
|
<xsl:template mode="after_first_ant_assing_xpath" match="*">
|
|
|
<xsl:param name="curr_xpath"/>
|
|
|
+ <xsl:param name="loop_xpath" select="$loop_xpath"/>
|
|
|
<xsl:choose>
|
|
|
<xsl:when test="name()=$typeName">
|
|
|
<xsl:apply-templates mode="after_first_ant_assing_xpath">
|
|
|
<xsl:with-param name="curr_xpath" select="$curr_xpath"/>
|
|
|
+ <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
|
|
|
</xsl:apply-templates>
|
|
|
</xsl:when>
|
|
|
<xsl:otherwise>
|
|
|
@@ -371,19 +420,29 @@
|
|
|
|
|
|
<xsl:template match="RelatedFeature" mode="after_first_ant_assing_vars_childs">
|
|
|
<xsl:param name="input_obj_with_xpath" required="yes"/>
|
|
|
+ <xsl:param name="xml_id_parent" required="yes"/>
|
|
|
+ <xsl:param name="loop_xpath" select="$loop_xpath"/>
|
|
|
+ <xsl:message>#411 mode after_first_ant_assing_vars_childs bylo $loop_xpath=<xsl:value-of select="$loop_xpath"/>;</xsl:message>
|
|
|
<!-- jest okazja do zrobienia bilda aby sciagnal rzeczy nizej -->
|
|
|
- <xsl:variable name="featureID_name" select="substring-after($typeName,':')"/>
|
|
|
- <xsl:variable name="loop_xpath" select="concat($loop_xpath,'_x2f_',$featureID_name)"/>
|
|
|
+ <xsl:variable name="featureID_name" select="substring-after(@typeName,':')"/>
|
|
|
+ <xsl:variable name="xml_id" select="@xml_id"/>
|
|
|
+ <xsl:variable name="loop_xpath" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>
|
|
|
+ <!--<xsl:variable name="loop_xpath_save" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>--> <!-- tutaj zapisal sie build z wezla z parent -->
|
|
|
<!--<debug_358_RelatedFeature>
|
|
|
<xsl:copy-of select="$input_obj_with_xpath"/>
|
|
|
</debug_358_RelatedFeature>-->
|
|
|
+ <xsl:message>#389 jest okazja do zrobienia bilda $xml_id_parent=<xsl:value-of select="$xml_id_parent"/>; $xml_id=<xsl:value-of select="$xml_id"/>; result-document=<xsl:value-of select="concat($uuid,'.build_',$loop_xpath,'.xml')"/> match=RelatedFeature mode=after_first_ant_assing_vars_childs </xsl:message>
|
|
|
<xsl:result-document href="{$uuid}.build_{$loop_xpath}.xml">
|
|
|
<xsl:apply-templates select=".">
|
|
|
<xsl:with-param name="typeName" select="@typeName"/>
|
|
|
<xsl:with-param name="xpath" select="@xpath"/>
|
|
|
<xsl:with-param name="xpath_value" select="@xpath_value"/>
|
|
|
- <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
|
|
|
+ <!--<xsl:with-param name="loop_xpath_save" select="$loop_xpath"/>-->
|
|
|
<xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
|
|
|
+ <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
|
|
|
+ <xsl:with-param name="wfs_output" select="concat($uuid,'.',$loop_xpath)" />
|
|
|
+ <xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>
|
|
|
+ <!--<xsl:with-param name="wfs_output.xml" />-->
|
|
|
</xsl:apply-templates>
|
|
|
</xsl:result-document>
|
|
|
<xsl:element name="RelatedFeature">
|
|
|
@@ -395,6 +454,8 @@
|
|
|
</xsl:template>
|
|
|
|
|
|
<xsl:template match="*" mode="after_first_ant_assing_vars_childs">
|
|
|
+ <xsl:param name="xml_id_parent" required="yes"/>
|
|
|
+ <xsl:param name="loop_xpath" required="yes"/>
|
|
|
<xsl:param name="input_obj_with_xpath" required="yes"/>
|
|
|
<xsl:for-each select=".">
|
|
|
<xsl:choose>
|
|
|
@@ -430,12 +491,24 @@
|
|
|
</xsl:for-each>
|
|
|
<xsl:choose>
|
|
|
<xsl:when test="@xpath">
|
|
|
- <xsl:copy-of select="$input_obj_with_xpath/node()[local-name()=current()/@xpath]/text()"/>
|
|
|
+ <!--<xsl:variable name="escaped_html_to_xml">
|
|
|
+ <xsl:call-template name="system_cache__appinfo:escaped_html_to_xml">
|
|
|
+ <xsl:with-param name="html" select="$input_obj_with_xpath/node()[local-name()=current()/@xpath]/text()"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ </xsl:variable>-->
|
|
|
+ <xsl:variable name="enter_to_ph">
|
|
|
+ <xsl:call-template name="enter_to_ph">
|
|
|
+ <xsl:with-param name="text" select="$input_obj_with_xpath/node()[local-name()=current()/@xpath]/text()"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:copy-of select="$enter_to_ph"/>
|
|
|
</xsl:when>
|
|
|
</xsl:choose>
|
|
|
<xsl:value-of select="text()"/>
|
|
|
<xsl:apply-templates mode="after_first_ant_assing_vars_childs">
|
|
|
<xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
|
|
|
+ <xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>
|
|
|
+ <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
|
|
|
</xsl:apply-templates>
|
|
|
</xsl:element>
|
|
|
</xsl:otherwise>
|
|
|
@@ -443,8 +516,22 @@
|
|
|
</xsl:for-each>
|
|
|
</xsl:template>
|
|
|
<xsl:template match="text()" mode="after_first_ant_assing_vars_childs"/>
|
|
|
-
|
|
|
+ <xsl:template match="comment()" mode="after_first_ant_assing_vars_childs"/>
|
|
|
<!-- pozbieranie do kupy wszystkich xmli i zlozenie dity -->
|
|
|
|
|
|
+ <xsl:template name="enter_to_ph">
|
|
|
+ <xsl:param name="text" required="yes"/>
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test=" contains($text,' ')">
|
|
|
+ <xsl:for-each select="tokenize($text,' ')">
|
|
|
+ <codeblock><xsl:value-of select="."/></codeblock>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:copy-of select="$text"/>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
|
|
|
</xsl:stylesheet>
|