edwinuestc的个人博客分享 http://blog.sciencenet.cn/u/edwinuestc

博文

modified string-replace-all

已有 2168 次阅读 2012-4-28 16:50 |个人分类:程序调试|系统分类:科研笔记| style, border, initial

 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:svrl="my:my">
   
<xsl:template match="svrl:successful-report">
     
<xsl:call-template name="string-replace-all">
         
<xsl:with-param name="text">
           
<xsl:call-template name="string-replace-all">
               
<xsl:with-param name="text" select="@location"/>
               
<xsl:with-param name="replace" select="&quot;*[local-name()='&quot;"/>
               
<xsl:with-param name="by" select="''"/>
           

         

         
<xsl:with-param name="replace" select="&quot;']&quot;"/>
         
<xsl:with-param name="by" select="''"/>
     

   


   
<xsl:template name="string-replace-all">
     
<xsl:param name="text"/>
     
<xsl:param name="replace"/>
     
<xsl:param name="by"/>
     

         
<xsl:when test="contains($text, $replace)">
           
<xsl:value-of select="substring-before($text,$replace)"/>
           
<xsl:value-of select="$by"/>
           
<xsl:call-template name="string-replace-all">
               
<xsl:with-param name="text" select="substring-after($text,$replace)"/>
               
<xsl:with-param name="replace" select="$replace"/>
               
<xsl:with-param name="by" select="$by"/>
           

         

         

           
<xsl:value-of select="$text"/>
         

     

   



https://wap.sciencenet.cn/blog-615874-564654.html

上一篇:将SVRL结果转换成html的xsl文件
下一篇:显示特定的标签值
收藏 IP: 121.49.127.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-14 04:34

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部