Trying to get into xml. Lets say I have an XML document with an attached XSLT style sheet similar to this:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="search_results.xsl"?>
<results>
<profile id="01">
<name>
<first>Fred</first>
<last>Noone</last>
</name>
<img src="fred.jpg" />
</profile>
<profile id="02">
<name>
<first>Cindy</first>
<last>Someone</last>
</name>
<img src="cindy.jpg" />
</profile>
</results>
with XSLT looking like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="html"/>
<xsl:template match="/">
<style>
div.profile{
border:1px solid red;
width:350px;
height:200px;
}
div.name{
border:1px dashed blue;
width:100%;
}
span.name{
font.weight:bold; font.style:arial;
}
</style>
<html>
<head>
<title>Search Results</title>
</head>
<body>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="profile">
<div class="profile">
<xsl:apply-templates />
</div>
</xsl:template>
<xsl:template match="name">
<div class="name">
<span class="name">
<xsl:value-of select="last" />,
<xsl:value-of select="first" />
</span>
</div>
</xsl:template>
I would like the image to get added here as simple html img
</xsl:stylesheet>
--my question is how to add the image into the style sheet to display...I have posted where I would like it to go inside the style sheet.
Thanks in advance



utput method="html"/>
Reply With Quote
Bookmarks