【发布时间】:2018-01-19 12:36:33
【问题描述】:
xml
<product>
<name>Smartphone Samsung S6</name>
</product>
<product>
<name>Smartphone Samsung S8</name>
</product>
html
<h1>Smartphone<small>Samsung S6</small></h1>
<h1>Smartphone<small>Samsung S8</small></h1>
如何在 xslt 中做到这一点?输出:html
<xsl:for-each select="product">
<h1><xsl:value-of select="name"/></h1>
</xsl:for-each>
【问题讨论】:
-
好吧,在
small元素中标记该文本的标准是什么,是单词Samsung后跟另一个单词还是Smartphone的任何内容?您使用哪个版本的 XSLT? -
三星后面是 S6 或 S8。在智能手机之前什么都没有。 xsl 2.0
-
您的产品名称是否总是采用相同的“类别制造型号”格式?