Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Spritey

macrumors regular
Original poster
Sep 22, 2006
174
0
Canada/Norway/USA
I'm really stuck on this one part of my XSLT assignment:

I have an xml document that I need to reproduce as a web page with a left-side navigation bar.

<left_nav>
<linktarget link_url="introduction.htm"><![CDATA[Introduction]]></linktarget>
+ several links

This needs to be somehow converted into a table with one column containing one link per row. I'm trying to do something like this, but I don't know what to do about the " ":

<table>
<xsl:for-each select="article/doc/head/left_nav/linktarget">
<tr>
<a href="<xsl:value-of select="@link_url"/>"><xsl:value-of select="linktarget"/></a>
</tr> </xsl:for-each>
</table>

I also have the same problem when I try taking the content of an element and put it as meta-description: content ="<value of select="description"/>"

Never done XSLT or Xpath before so I'm rather confused...
 
Not sure which part isn't working for you. I work with XSLT a bit. For the link part use:
Code:
<a href="{@link_url}">

As for the meta tag portion:
Code:
<meta name="description">
<xsl:attribute name="name">
  <xsl:value-of select="description" />
</xsl:attribute>
</meta>

See if that works for you.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.