J
j erickson
with the following xsl and xml file, the display of the gif file with
the <image/url> tag works. However, the gif file in the <description>
tag using the name attribute "src" won't make the correct link to the
gif file. why?
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:lc="http://my.netscape.com/rdf/simple/0.9/">
<xslutput method="html" />
<xsl:template match="lc:RDF">
<HTML>
<HEAD>
<TITLE>Resource Display Page</TITLE>
</HEAD>
<BODY>
<xsl:apply-templates select="lc:item"/>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="lc:item">
<P> </P>
<a><xsl:attribute name="href"><xsl:value-of select="lc:link"
/></xsl:attribute>link
</a>
<P>image</P>
<TR>
<TD>
<xsl:element name="img">
<xsl:attribute name="src"><xsl:value-of
select="lc:description/@src" /></xsl:attribute>
<xsl:attribute name="border"><xsl:value-of
select="lc:description/@Border" /></xsl:attribute>
</xsl:element>
</TD>
</TR>
</xsl:template>
<xsl:template match="lc:image">
<img><xsl:attribute name="src"><xsl:value-of select="lc:url"
/></xsl:attribute>
<xsl:attribute name="width"><xsl:value-of select="lc:width"
/></xsl:attribute>
<xsl:attribute name="height"><xsl:value-of select="lc:height"
/></xsl:attribute>
</img>
<P>image</P>
<TR>
<TD>
<xsl:element name="img">
<xsl:attribute name="src"><xsl:value-of
select="lc:description/@src" /></xsl:attribute>
<xsl:attribute name="border"><xsl:value-of
select="lc:description/@Border" /></xsl:attribute>
</xsl:element>
</TD>
</TR>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://my.netscape.com/rdf/simple/0.9/">
<channel>
<title>Dilbert</title>
<link>http://dwlt.net/tapestry/</link>
<description>Tapestry :: RSS Delivery of Web Comics</description>
</channel>
<image>
<title>Dilbert</title>
<url>http://dwlt.net/tapestry/img/tapestry.gif</url>
<link>http://dwlt.net/tapestry/</link>
<width>88</width>
<height>31</height>
</image>
<item>
<title>Dilbert for 09 Jun 2004</title>
<link>http://www.dilbert.com/comics/dilbert/archive/dilbert-20040609.html</link>
<guid isPermaLink="false">http://www.dilbert.com/comics/dilbert/archive/dilbert-20040609.html</guid>
<description>
<img src="http://www.dilbert.com/comics/dilbert/archive/images/dilbert2004067240609.gif"
border="0" />
</description>
</item>
<item>
<title>Dilbert for 08 Jun 2004</title>
<link>http://www.dilbert.com/comics/dilbert/archive/dilbert-20040608.html</link>
<guid isPermaLink="false">http://www.dilbert.com/comics/dilbert/archive/dilbert-20040608.html</guid>
<description>
<img src="http://www.dilbert.com/comics/dilbert/archive/images/dilbert2061008040608.gif"
border="0" />
</description>
</item>
<item>
<title>Dilbert for 07 Jun 2004</title>
<link>http://www.dilbert.com/comics/dilbert/archive/dilbert-20040607.html</link>
<guid isPermaLink="false">http://www.dilbert.com/comics/dilbert/archive/dilbert-20040607.html</guid>
<description>
<img src="http://www.dilbert.com/comics/dilbert/archive/images/dilbert21220170040607.gif"
border="0" />
</description>
</item>
</rdf:RDF>
the <image/url> tag works. However, the gif file in the <description>
tag using the name attribute "src" won't make the correct link to the
gif file. why?
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:lc="http://my.netscape.com/rdf/simple/0.9/">
<xslutput method="html" />
<xsl:template match="lc:RDF">
<HTML>
<HEAD>
<TITLE>Resource Display Page</TITLE>
</HEAD>
<BODY>
<xsl:apply-templates select="lc:item"/>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="lc:item">
<P> </P>
<a><xsl:attribute name="href"><xsl:value-of select="lc:link"
/></xsl:attribute>link
</a>
<P>image</P>
<TR>
<TD>
<xsl:element name="img">
<xsl:attribute name="src"><xsl:value-of
select="lc:description/@src" /></xsl:attribute>
<xsl:attribute name="border"><xsl:value-of
select="lc:description/@Border" /></xsl:attribute>
</xsl:element>
</TD>
</TR>
</xsl:template>
<xsl:template match="lc:image">
<img><xsl:attribute name="src"><xsl:value-of select="lc:url"
/></xsl:attribute>
<xsl:attribute name="width"><xsl:value-of select="lc:width"
/></xsl:attribute>
<xsl:attribute name="height"><xsl:value-of select="lc:height"
/></xsl:attribute>
</img>
<P>image</P>
<TR>
<TD>
<xsl:element name="img">
<xsl:attribute name="src"><xsl:value-of
select="lc:description/@src" /></xsl:attribute>
<xsl:attribute name="border"><xsl:value-of
select="lc:description/@Border" /></xsl:attribute>
</xsl:element>
</TD>
</TR>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://my.netscape.com/rdf/simple/0.9/">
<channel>
<title>Dilbert</title>
<link>http://dwlt.net/tapestry/</link>
<description>Tapestry :: RSS Delivery of Web Comics</description>
</channel>
<image>
<title>Dilbert</title>
<url>http://dwlt.net/tapestry/img/tapestry.gif</url>
<link>http://dwlt.net/tapestry/</link>
<width>88</width>
<height>31</height>
</image>
<item>
<title>Dilbert for 09 Jun 2004</title>
<link>http://www.dilbert.com/comics/dilbert/archive/dilbert-20040609.html</link>
<guid isPermaLink="false">http://www.dilbert.com/comics/dilbert/archive/dilbert-20040609.html</guid>
<description>
<img src="http://www.dilbert.com/comics/dilbert/archive/images/dilbert2004067240609.gif"
border="0" />
</description>
</item>
<item>
<title>Dilbert for 08 Jun 2004</title>
<link>http://www.dilbert.com/comics/dilbert/archive/dilbert-20040608.html</link>
<guid isPermaLink="false">http://www.dilbert.com/comics/dilbert/archive/dilbert-20040608.html</guid>
<description>
<img src="http://www.dilbert.com/comics/dilbert/archive/images/dilbert2061008040608.gif"
border="0" />
</description>
</item>
<item>
<title>Dilbert for 07 Jun 2004</title>
<link>http://www.dilbert.com/comics/dilbert/archive/dilbert-20040607.html</link>
<guid isPermaLink="false">http://www.dilbert.com/comics/dilbert/archive/dilbert-20040607.html</guid>
<description>
<img src="http://www.dilbert.com/comics/dilbert/archive/images/dilbert21220170040607.gif"
border="0" />
</description>
</item>
</rdf:RDF>