473,320 Members | 2,083 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

xsl for an rdf file, src attribute won't create correct link to image file

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/">

<xsl:output 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>
&lt;img src="http://www.dilbert.com/comics/dilbert/archive/images/dilbert2004067240609.gif"
border="0" /&gt;
</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>
&lt;img src="http://www.dilbert.com/comics/dilbert/archive/images/dilbert2061008040608.gif"
border="0" /&gt;
</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>
&lt;img src="http://www.dilbert.com/comics/dilbert/archive/images/dilbert21220170040607.gif"
border="0" /&gt;
</description>
</item>
</rdf:RDF>
Jul 20 '05 #1
1 3251
j erickson wrote:
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? <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>


1. the description element from the namespace prefixed with lc has no
src attribute
2. there is no img element in the description element, just text
(&lt;img ... /&gt; is _not_ <img ... />).
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Karen Grube | last post by:
Hi! Each week, we receive a two-page PDF file from UPS along with a separate flat file (a CSV) The PDF file contains the overview of our weekly invoice and the CSV contains the details of each...
3
by: David Thielen | last post by:
Hi; I created a virtual directory in IIS 6.0 and my asp.net app runs fine. But when it tries to write a file I get: Access to the path is denied. - C:\Inetpub\wwwroot\RunReportASP\images ...
3
by: Mark Olbert | last post by:
I have some img tags on a master page which reference files in a top-level directory. They look like this: <img src="assets/test.gif" id="gnr" /> assets is a subdirectory of the website root. ...
2
by: Phat G5 (G3) | last post by:
I am trying to do something seemingly difficult. I am trying to take the value from a file input and set the source of an image to the value of the file input. It seems to only work on Safari. In...
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
13
by: Bill Nguyen | last post by:
Is it possible to create your won XSD to use with .NET based on an XML content? For example the one below: <?xml version="1.0"?> <pcats:FuelsDoc...
38
by: ted | last post by:
I have an old link that was widely distributed. I would now like to put a link on that old page that will go to a new page without displaying anything.
7
Curtis Rutland
by: Curtis Rutland | last post by:
Building A Silverlight (2.0) Multi-File Uploader All source code is C#. VB.NET source is coming soon. Note: This project requires Visual Studio 2008 SP1 or Visual Web Developer 2008 SP1 and...
4
by: naveenmurthy | last post by:
Hello All, I have created a .mht file in following format. 1. The .mht file contains following htmls. a. MHTLinkingProblem.html b. Left.html c. Right.html d. Start.html
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.