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><br />
			</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!

Recommended Answers

All 2 Replies

...
<a href="http://{target}"><xsl:value-of select="name" /></a><br />
...

thank you hielo.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.