Home >Backend Development >XML/RSS Tutorial >XML-code sharing for adding links in xslt

XML-code sharing for adding links in xslt

黄舟
黄舟Original
2017-03-25 16:34:512685browse

Don’t underestimate this problem. We generally understand it this way: If you want to add a link, use the tag, for example

<a href=”<xsl: value-of select=。。。”>

However, the syntax is It doesn't work because there are multiple double quotes interfering with each other.

So how to solve this problem? The following syntax should be used

<h4>第七部分:依赖</h4>
<table>
  <tr class="RowHeader">
    <td>类别</td>
    <td>架构</td>
    <td>名称</td>

  </tr>

  <xsl:for-each select="ParentDependencies/ParentDependency">
    <tr>
      <td>
        <xsl:value-of select="Type"/>
      </td>
      <td>
        <xsl:value-of select="Schema"/>
      </td>
      <td>
        <a>
          <xsl:attribute name="href">
            <xsl:value-of select="Schema"/>.<xsl:value-of select="Name"/>.htm
          </xsl:attribute>
          <xsl:value-of select="Name"/>
        </a>
      </td>

    </tr>

  </xsl:for-each>

</table>

That is to say, use an attribute method to reference the href attribute and assign a value to it

Then, the effect we see on the page is similar to the following

XML-code sharing for adding links in xslt

The above is the detailed content of XML-code sharing for adding links in xslt. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn