AW: [xsl] a href incorporation

Subject: AW: [xsl] a href incorporation
From: "Marcus Klinge" <klinge@xxxxxxxxxxxxxxx>
Date: Thu, 19 Apr 2001 11:26:51 +0200
Hi Mohammad.
Ok, try this:

My xsl:
<xsl:template match="Grasslands/LinksForGenus" priority= "1">
<h3>
<a name="Label0045"></a>
<font color="#00007F"><i>Links for the genus:</i></font>
</h3>
<ul>
<xsl:for-each select="Link">
<li><font color="#008000">

<!-- here comnes the new code -->
<a>
	<xsl:attribute name="href">
		<xsl:value-of select="Address/@href"/>
	</xsl:attribute>
	<xsl:value-of select="Name"/>

</a>
<!-- end of example -->
</font></li>
</xsl:for-each>
</ul>
</xsl:template>


For  a more elegant version, try this:

<!-- here comnes the new code -->
<a href="{Adress/@href}">
<xsl:value-of select="Name"/>
</a>
<!-- end of example -->

Also, try only using capitals for all XML-tags... so your source would look
like this:
<GRASSLANDS>
<LINKSFORGENUS>
<LINK>
<ADDRESS href="http://www.bbc.co.uk";>BBC</ADDRESS>
<NAME>This is the home page for the BBC </NAME>
</LINK>
</LINKSFORGENUS>
</GRASSLANDS>

hope this helps...

Marcus Klinge
Web Producing
----------------------
Karzauninkat Webdesign
Barner Strasse 14
22765 Hamburg
Tel: 040 39834 771
Fax: 040 39834 779


-----Ursprüngliche Nachricht-----
Von: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]Im Auftrag von Tanzila
Mohammad
Gesendet: Donnerstag, 19. April 2001 10:57
An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Betreff: Fw: [xsl] a href incorporation


I have the following xml:
<Grasslands>
<LinksForGenus>
<Link>
<Address href="http://www.bbc.co.uk";>BBC</Address>
<Name>This is the home page for the BBC </Name>
</Link>
</LinksForGenus>
</Grasslands>

I want the following output: (bullet-pointed)

* BBC (as a hyperlink); This is the home page for the BBC

My xsl:
<xsl:template match="Grasslands/LinksForGenus" priority= "1">
<h3>
<a name="Label0045"></a>
<font color="#00007F"><i>Links for the genus:</i></font>
</h3>
<ul>
<xsl:for-each select="Link">
<li><font color="#008000">
<xsl:value-of select="Address" />;&#xA;<xsl:text />
<xsl:value-of select="Name" />
</font></li>
</xsl:for-each>
</ul>
</xsl:template>


<xsl:template match="Grasslands/LinksForGenus">
</xsl:template>

The problem is incorporating the "a href".

Thanks.

Tanz



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread