Narays
Narays

Reputation: 15

how to retrieve attributes of XML using XSLT

say i have a LinkName , i will be able to retrieve the value of LinkName using XSLT, but how will retrive the value of href? i.e i need to retrieve the value of xyz as my output. Find the exact XML below from which i need to extract the value of href

<table border="1" align="center" >
  <tr>
        <td bgcolor="#99BBEE" >
              <A HREF="start.swe?C=Gt&amp;S=SSCS&amp;SWENeedContext=false&amp;_sn=0t9LLy7Y6Ciiwff5rq9XulU.O-prUFxaMoJv6vfreLDEwBbxbqJePuZ.S880KNPu&amp;SWEBID=-1&amp;SWEC=2">
                    <font face="Arial" size="2">Calendar</font>
              </A>
        </td>
        <td bgcolor="#99BBEE" width="50%" align="center" valine="middle">
              <A HREF="start.swe?C=Gt&amp;S=SSCS0&amp;SWENeedContext=false&amp;_sn=0t9LLy7Y6Ciiwff5rq9XulU.O-prUFxaMoJv6vfreLDEwBbxbqJePuZ.S880KNPu&amp;SWEBID=-1&amp;SWEC=2">
                    <font face="Arial" size="2">Contacts</font>
              </A>
        </td>
  </tr></table>

my output should be the values of href..! please help

Upvotes: 0

Views: 159

Answers (1)

Jon Egerton
Jon Egerton

Reputation: 41539

Your template for the node would be (as an example):

<xsl:template match="A">
    <xsl:value-of select="@HREF"/>
</xsl:template>

Upvotes: 5

Related Questions