没有合适的资源?快使用搜索试试~ 我知道了~
xml+xsl中分割字符
需积分: 14 2 下载量 170 浏览量
2012-01-13
15:01:40
上传
评论
收藏 2KB TXT 举报
温馨提示
试读
3页
xml+xsl中分割字符
资源推荐
资源详情
资源评论
博客园 首页 发新随笔
发新文章 联系 订阅管理
xml+xsl中分割字符
http://ssm1226.mblogger.cn/posts/14279.aspx
前几天,论坛上有一问题(详见:http://community.csdn.net/Expert/topic/3237/3237160.xml?temp=.6712152)
解决这个问题,其实主要应用xpath中的两个function:substring-before;substring-after
具体例子如下:
test.xml:
<?xml version="1.0" encoding="UTF-8"?>
<data_info CC_ID='195,196,197,198'/>
-----------------------------------------------------------------------
test.xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" method="xml" encoding="utf-8"/>
<xsl:template match="/data_info">
<xsl:element name="{name()}">
<xsl:call-template name="splitStr">
<xsl:with-param name="str" select="@CC_ID"/>
<xsl:with-param name="ctrlname" select="'CC_ID'"/>
</xsl:call-template>
发新文章 联系 订阅管理
xml+xsl中分割字符
http://ssm1226.mblogger.cn/posts/14279.aspx
前几天,论坛上有一问题(详见:http://community.csdn.net/Expert/topic/3237/3237160.xml?temp=.6712152)
解决这个问题,其实主要应用xpath中的两个function:substring-before;substring-after
具体例子如下:
test.xml:
<?xml version="1.0" encoding="UTF-8"?>
<data_info CC_ID='195,196,197,198'/>
-----------------------------------------------------------------------
test.xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" method="xml" encoding="utf-8"/>
<xsl:template match="/data_info">
<xsl:element name="{name()}">
<xsl:call-template name="splitStr">
<xsl:with-param name="str" select="@CC_ID"/>
<xsl:with-param name="ctrlname" select="'CC_ID'"/>
</xsl:call-template>
资源评论
apple125414
- 粉丝: 17
- 资源: 56
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功