XSLT:如何在新计算中获取已填充的标记值

时间:2017-10-17 11:49:03

标签: xslt xpath

我的xslt有以下表格,摘录如下:

 <xsl:variable name="nameValue">
  <name>
    <xsl:call-template name="process-Value">
      <xsl:with-param name="value" select="./address/name"/>
    </xsl:call-template>
  <name>
 </xsl:variable>
  <xsl:if test="message and ( $nameValue = 'John' || $nameValue = 'Cena')" 
  

这里我试图获取先前计算的 name 的值,以及   基于值名称标签,即名称标签内的内容,我填充了    消息 标记   上面的条件在我的Eclipse中显示错误。

   <message>
      <xsl:value-of select="message"
   </message>
  </xsl:if>

结果

<category> 
  <name>Bablo</name>
 </category>
 <category>
  <name>John</name>
  <message>St. John</message>
</category>
<category>
  <name>Cena</name>
  <message>Fighter</message>
</category>
<category>
   <name>Jill</name>
</category>
  

所以,如果这个名字是“John&#39;或者&#39; Cena&#39;然后只有&#34;类别&#34;标签   持有&#34;消息&#34;标签但是在&#34; name&#34;的值的情况下标签   内容是&#39; Bablo&#39;,&#34;消息&#34;节点根本没有附加到   &#34;类别&#34;标签

我的问题是我可以这样做吗?如果不是这样,那么正确的方法是什么?

0 个答案:

没有答案