Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Location
    IN, USA
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Using <a href=""> in XSL

    I have a simple XML doc, and am styling it with XSL.
    One problem i havent been able to figure out, is the following:
    XML:
    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <?xml-stylesheet type="text/xsl" href="menu.xsl"?>
    
    <menu>
      <item id="webtech">
        <arrow>true</arrow>
        <action>showSub('webtechSub')</action>
        <content>Web Technologies</content>
      </item>
    
      <item id="resources">
        <arrow>false</arrow>
        <action>showSub('resourcesSub')</action>
        <content>Resources</content></item>
    
      <item id="projects">
        <arrow>true</arrow>
        <action>showSub('projectsSub')</action>
        <content>Projects</content>
      </item>
    
      <item id="tools">
        <arrow>false</arrow>
        <action>showSub('toolsSub')</action>
        <content>Tools</content>
      </item>
    
      <item id="downloads">
        <arrow>true</arrow>
        <action>showSub('downloadsSub')</action>
        <content>Downloads</content>
      </item>
    </menu>
    XSL:
    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    
    <html>
    
    <head>
      <title>Menu</title>
      <link rel="stylesheet" type="text/css" href="../global.css" />
    </head>
    
    <body>
      <table cellpadding="0" cellspacing="0" border="0" width="650px" height="" class="menu" align="center">
        <tr>
          <xsl:for-each select="menu/item">
            <td align="center" width="20%"><a class="menu" hidefocus="hidefocus" href="@content"><xsl:value-of select="content" /><img src="../images/blank.gif" /></a></td>
          </xsl:for-each>
        </tr>
      </table>
    </body>
    
    </html>
    </xsl:template>
    </xsl:stylesheet>
    I want to get the href attribute in the XSL doc to get the data from the <action> node in the XML
    Just call me Crash...
    "Crash- and BURN!"
    -Cereal Killer

  • #2
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    href="{action}"

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    IN, USA
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, thats all
    Just call me Crash...
    "Crash- and BURN!"
    -Cereal Killer


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •