Browse Source

tune token filter dla ograniczania output jak jest balagan w polach tesktowych

a.binder 9 năm trước cách đây
mục cha
commit
fda5eafed8

+ 2 - 2
SE/schema/ant-url_action/default_db.in7_dziennik_koresp/test-druk/IN7_DZIENNIK_KORESP.dita

@@ -74,7 +74,7 @@
         </strow>
         <strow>
           <stentry>Kontakty</stentry>
-          <stentry><ph xpath="EMAIL_LOCAL_ACCOUNT_ADDRESS"/><ph> </ph><ph xpath="ADM_PHONE"/></stentry>
+          <stentry><ph xpath="EMAIL_LOCAL_ACCOUNT_ADDRESS" xpath_token_filter=" " xpath_token="1"/><ph> </ph><ph xpath="ADM_PHONE"/></stentry>
         </strow>
       </simpletable>
       </p>
@@ -88,7 +88,7 @@
           </strow>
           <strow>
             <stentry>Kontakty</stentry>
-            <stentry><ph xpath="EMAIL_LOCAL_ACCOUNT_ADDRESS"/><ph> </ph><ph xpath="ADM_PHONE"/></stentry>
+            <stentry><ph xpath="EMAIL_LOCAL_ACCOUNT_ADDRESS" xpath_token_filter=" " xpath_token="1"/><ph> </ph><ph xpath="ADM_PHONE"/></stentry>
           </strow>
         </simpletable>
         </p>

+ 17 - 0
SE/schema/default_db_xml_cache.public/build_recurse_ant.xsl

@@ -660,8 +660,25 @@
                                     <xsl:apply-templates mode="enter_to_ph" select="$input_obj_with_xpath/node()[local-name()=current()/@xpath]">
                                         <xsl:with-param name="count" select="count($input_obj_with_xpath/node()[local-name()=current()/@xpath])"/>
                                         <xsl:with-param name="element" select="name()"/>
+                                        <!--<xsl:with-param name="xpath_token_filter" select="@xpath_token_filter"/>--><!-- mozliwosc wybrania pierwszego wyrazu np ' ' -->
+                                        <!--<xsl:with-param name="xpath_token" select="@xpath_token"/>--><!-- mozliwosc wybrania pierwszego wyrazu np 1 -->
                                     </xsl:apply-templates>
                                 </xsl:variable>
+                                <xsl:variable name="enter_to_ph">
+                                    <xsl:choose>
+                                        <xsl:when test="@xpath_token_filter and @xpath_token ">
+                                            <!-- implementacja filtra dla czegos oddzielonego parametrem -->
+                                            <xsl:variable name="xpath_token_filter" select="tokenize($enter_to_ph,@xpath_token_filter)"/>
+                                            <xsl:for-each select=" tokenize(@xpath_token,' ')">
+                                                <xsl:variable name="xpath_token" select="number(.)"/>
+                                                <xsl:copy-of select="$xpath_token_filter[$xpath_token]"></xsl:copy-of>
+                                            </xsl:for-each>
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                            <xsl:copy-of select="$enter_to_ph"/>
+                                        </xsl:otherwise>
+                                    </xsl:choose>
+                                </xsl:variable>
                                 <xsl:copy-of select="$enter_to_ph"/>
                             </xsl:when>
                         </xsl:choose>

+ 1 - 1
SE/schema/default_db_xml_cache.public/build_recurse_ant_merge_dita_from_temp.xsl

@@ -166,7 +166,7 @@
     <xsl:template match="@*">
         <xsl:copy-of select="."/>
     </xsl:template>
-    <xsl:template match="@xml_id"/>
+    <xsl:template match="@xml_id|@xpath_token_filter|@xpath_token"/>