473,395 Members | 1,915 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,395 software developers and data experts.

adding alt tags

N9
Hi,

<xsl:template match="Field[@Name='Image']">

<xsl:copy-of select="img"/>
<xsl:copy-of select="a"/>

</xsl:template>

Tht ouput is:

<img src="/files/teaser billeder/basillikum.jpg" style="" />

But can i adding a attribute, so the result is?

<img src="/files/teaser billeder/basillikum.jpg" style="" alt=""/>

Best regards

N9
Jun 27 '08 #1
1 1364
N9 wrote:
<xsl:template match="Field[@Name='Image']">

<xsl:copy-of select="img"/>
<xsl:copy-of select="a"/>

</xsl:template>

Tht ouput is:

<img src="/files/teaser billeder/basillikum.jpg" style="" />

But can i adding a attribute, so the result is?

<img src="/files/teaser billeder/basillikum.jpg" style="" alt=""/>
You can add an attribute to the img element but not if you use
xsl:copy-of. Use
<xsl:template match="Field[@Name='Image']">
<xsl:apply-templates select="img"/>
<xsl:copy-of select="a"/>
</xsl:template>

<xsl:template match-"Field/img">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:attribute name="alt"></xsl:attribute>
</xsl:copy>
</xsl:template>


--

Martin Honnen
http://JavaScript.FAQTs.com/
Jun 27 '08 #2

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

Similar topics

1
by: Jay Sartoris | last post by:
Hi, I'm adding a node to my XML document using DOM. When I serialize it, I lose my comments that are above my root node. I've created an OutputFormat obect and set the setOmitComments(false)...
58
by: Jon Glazer | last post by:
I have an anchor using a class that defines a hover subclass. The issue is that the anchor itself doesn't have any border and when hovered it adds a border, the problem is that when it adds the...
10
by: David | last post by:
Can anyone give me a quick code snippet (that is standards-based) for adding OPTION tags to a SELECT dynamically. I have no problem doing it in IE but I am kind of new to the whole standards world...
9
by: Michelle | last post by:
I have a div that is initially empty. Clicking on a button will add some text boxes and other controls so the user can add additional records. In IE all works fine but in Netscape 7.0 when I add...
7
by: | last post by:
What is the beat way to dynamically write/add to the HEAD tag of an ASPX page (the <head runat=server ... is too error prone and not very repeatable)? Thanks.
5
by: yawnmoth | last post by:
I'm having some difficulty with adding elements to a webpage via the DOM. The following works: main.htm: <script> js = document.createElement('script'); js.src='test.js';...
1
by: Tor Inge Rislaa | last post by:
Adding HTML tags to data from SQL server When dragging a table on to a web form in an ASP.NET 2.0 application, the connection is established and the data is displayed in a DataGrid. Is it...
4
by: shehabic | last post by:
Hello I'm Using The Following Code To Do 2 things 1-Convert Tags To Lower Case 2-Add Quotes To Attributes That Doesn't Have Quote but i'm having problems with some attributes. The Functions...
1
by: CapRand | last post by:
Hi, I am creating an ASP.NET site and have created a form which I have been able to dynamically with listboxes, labels etc from a database - using mainly form1.Controls.Add ..... Does anyone...
8
by: nse111 | last post by:
I want to add tags for a paricular image in my db table. I want these tags to be stored in one table field. lets say I entered the following tags for an image: house mountainside lake...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.