472,363 Members | 1,981 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,363 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 3177
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
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
0
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...

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.