Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Linking with xml content

Reply
Thread Tools

Linking with xml content

 
 
Sneamia
Guest
Posts: n/a
 
      06-02-2006
Hi, im a noob at xml and stuff.
I have an xml document, and I styled it with an xsl file.
I want to use content in the xml file to use as a link, like, for
example, in the xml file is this:

<link>http://www.link.com</link>
<description>A link</description>

I want to use something like:

<xsl:for-each select="file/content">
<td><xsl:value-of select="description"/></td>
</xsl:for-each>

Is there any simple way for me to use the data for the link in the xml
file to link the description?
like <a href="<xsl:value-of select="link"/>"><xsl:value-of
select="description"/></a>, but it doesnt work because I cant have a
tag in a tag...is there something I'm missing?

 
Reply With Quote
 
 
 
 
Joe Kesselman
Guest
Posts: n/a
 
      06-02-2006
> like <a href="<xsl:value-of select="link"/>"><xsl:value-of
> select="description"/></a>, but it doesnt work because I cant have a
> tag in a tag...is there something I'm missing?


1) Attribute Value Templates
<a href="{link}"><xsl:value-of select="description"/></a>

2) xsl:attribute
<a>
<xsl:attribute name="href">
<xsl:value-of select="link"/>
</xsl:attribute>
<xsl:value-of select="description"/>
</a>
 
Reply With Quote
 
 
 
 
Sneamia
Guest
Posts: n/a
 
      06-02-2006
Thanks.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error: Only Content controls are allowed directly in a content page that contains Content controls. hazz ASP .Net 6 06-09-2010 01:54 PM
Can I read String (XML content) rather XML file using SAX parser Sanjeev Java 4 05-04-2008 10:59 PM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
[XML Schema] Content type of complex type definition with complex content Stanimir Stamenkov XML 2 10-25-2005 10:16 AM
Content Linking Janaka ASP .Net 2 04-29-2004 02:04 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57