954,517 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

xml generation of links

Hey there,
seems like this part of DaniWeb is not as active as other parts, but in hope I get an answer, I'm asking.

I have this xml file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="site.xsl"?>
<navigation>
	<link>
		<name>About</name>
		<content></content>
		<target>www.google.com</target>
	</link>
	<link>
		<name>Friends</name>
		<content></content>
		<target>www.google.com</target>
	</link>
	<link>
		<name>Archive</name>
		<content></content>
		<target>www.google.com</target>
	</link>
	<link>
		<name>Blog</name>
		<content></content>
		<target>www.google.com</target>
	</link>
	<link>
		<name>Contact</name>
		<content></content>
		<target>www.google.com</target>
	</link>
</navigation>


and this XSL file:

<?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>
	<body>
		<div id="navigation" style="background-color:black; width:100px">
			<xsl:for-each select="navigation/link">
				<a href="how to extract link from xml"><xsl:value-of select="name"/></a>
			</xsl:for-each>
		</div>
	</body>
</html>

</xsl:template>

</xsl:stylesheet>


so, inside my xsl file, I want to be able to extract the vale of link element from my xml file. can anyone please direct me on how to do this? thank you!

bibiki
Posting Whiz
327 posts since Nov 2009
Reputation Points: 28
Solved Threads: 27
 
...
<a href="http://{target}"><xsl:value-of select="name" /></a>
...
hielo
Veteran Poster
1,124 posts since Dec 2007
Reputation Points: 116
Solved Threads: 244
 

thank you hielo.

bibiki
Posting Whiz
327 posts since Nov 2009
Reputation Points: 28
Solved Threads: 27
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You