【发布时间】:2011-04-11 06:47:45
【问题描述】:
我需要拆分一个字符串 "ab|bc|cd>xy|yz|zx>pq|rs|tu>
如果有人可以帮我...
这里是代码......
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="1.0" indent="yes" />
<xsl:template match="/products/product">
<xsl:variable name="ImageString" select="properties/property[@name='Brand']"></xsl:variable>
<xsl:variable name="ImageFolderName" select="substring-before($ImageString,'#')" ></xsl:variable>
Folder Name:-<xsl:value-of select="$ImageFolderName" ></xsl:value-of>
<br/>
<xsl:variable name="ImageStringName" select="substring-after($ImageString,'#')" ></xsl:variable>
Final String:-<xsl:value-of select="$ImageStringName" ></xsl:value-of>
<xsl:variable name="values">
<xsl:text><xsl:value-of select="$ImageStringName" ></xsl:value-of></xsl:text>
</xsl:variable>
<xsl:call-template name="str:split">
<xsl:with-param name="string" select="$values" />
<xsl:with-param name="pattern" select="'|'" />
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
【问题讨论】:
-
请贴出你目前写的代码。人们通常不喜欢只为您编写代码。事实上,这是一个工作描述,而不是一个问题。
-
我已经更新了帖子并编写了我正在使用的代码...请帮助我...
标签: xslt