xslt: value of text associated with element

后端 未结 2 1620
面向向阳花
面向向阳花 2021-02-19 01:49

If I have an XML file that includes

foo is a way of making pasta sauce


        
相关标签:
2条回答
  • 2021-02-19 01:59

    Try this

    <xsl:for-each select="param">
       <tr>
          <td><xsl:value-of select="@name"/></td>
          <td><xsl:value-of select="@value"/></td>
          <td><xsl:value-of select="text()"/></td>
       </tr>
    </xsl:for-each>
    
    0 讨论(0)
  • 2021-02-19 02:01

    aha, this also seems to work:

    <xsl:for-each select="param">
       <tr>
          <td><xsl:value-of select="@name"/></td>
          <td><xsl:value-of select="@value"/></td>
          <td><xsl:value-of select="."/></td>
       </tr>
    </xsl:for-each>
    
    0 讨论(0)
提交回复
热议问题