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

New requirement for img tags? ( like <img src=... /> )

I have switched to a new HTML editor that comes with the Eclipse IDE
(plugin MyEclipse).

This editor flags image tags such as

<img src="http://xyz.com/images/logo.gif" alt="test" >

saying that the "element type "img" must be terminated by a matching
end-tag.
If I change the above img tag to

<img src="http://xyz.com/images/logo.gif" alt="test" />

i.e., I close the tag with a forward slash and angle right bracket,
than there are no more complaints.

Is this a new rule in HTML, that tags need to be treated more like
common XML and closed "properly" with "/>".

Thanks for your help and advice,

Wolfgang,
Santa Barbara, CA

Jun 11 '06 #1
6 11468
mo******@alexandria.ucsb.edu wrote:
I have switched to a new HTML editor that comes with the Eclipse IDE
(plugin MyEclipse).

This editor flags image tags such as

<img src="http://xyz.com/images/logo.gif" alt="test" >

saying that the "element type "img" must be terminated by a matching
end-tag.
If I change the above img tag to

<img src="http://xyz.com/images/logo.gif" alt="test" />

i.e., I close the tag with a forward slash and angle right bracket,
than there are no more complaints.

Is this a new rule in HTML, that tags need to be treated more like
common XML and closed "properly" with "/>".


Not in HTML. Your editor seems to be expecting XHTML, in which all
elements do have to be closed. Check whether it can be configured for
plain HTML.
Jun 12 '06 #2
Dan

Harlan Messinger wrote:
Not in HTML. Your editor seems to be expecting XHTML, in which all
elements do have to be closed. Check whether it can be configured for
plain HTML.


Which syntax to use would depend on which doctype is used in the page,
which we can't tell because no URL was given.

--
Dan

Jun 12 '06 #3
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

Harlan Messinger wrote:
mo******@alexandria.ucsb.edu wrote:
I have switched to a new HTML editor that comes with the Eclipse IDE
(plugin MyEclipse).

This editor flags image tags such as

<img src="http://xyz.com/images/logo.gif" alt="test" >

saying that the "element type "img" must be terminated by a matching
end-tag.
If I change the above img tag to

<img src="http://xyz.com/images/logo.gif" alt="test" />

i.e., I close the tag with a forward slash and angle right bracket,
than there are no more complaints.

Is this a new rule in HTML, that tags need to be treated more like
common XML and closed "properly" with "/>".


Not in HTML. Your editor seems to be expecting XHTML, in which all
elements do have to be closed. Check whether it can be configured for
plain HTML.


Jun 13 '06 #4

mo******@alexandria.ucsb.edu wrote:
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">


That's not a doctype (search this ng - we beat this issue to death
regularly) but it does strongly suggest you're trying to write XHTML,
rather than HTML.

If you're writing XHTML, then yes, <img /> now needs to be closed
because you're working with XML, not SGML or HTML.. You should know
this. If you don't know this, and you don't desperately _need_ this,
then don't write XHTML, stick with HTML (which is no more XML now than
it has ever been).

XHTML may have its uses (opinions vary), but it certainly shouldn't be
used blindly. There are lots of problems with its correct, practical
use.

Jun 13 '06 #5
mo******@alexandria.ucsb.edu wrote:
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">


HTML (other than XHTML) has no such thing as an xmlns attribute or an
xml:lang attribute.
Jun 13 '06 #6
To see all the gory detail, you can have a look at another example
that causes the same effect of "missing img tag",
http://online.wellsfargo.com/

This redirects to another page whose page source causes the complaint.

Dan wrote:
Harlan Messinger wrote:
Not in HTML. Your editor seems to be expecting XHTML, in which all
elements do have to be closed. Check whether it can be configured for
plain HTML.


Which syntax to use would depend on which doctype is used in the page,
which we can't tell because no URL was given.

--
Dan


Jun 13 '06 #7

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

Similar topics

14
by: Gregory | last post by:
Hello, I'm trying to do the above in order to process an image and return the result to an html image control. It fails and my key suspects are either the variable that I'm passing in -...
0
by: Zbigniew Lisiecki | last post by:
Hi, to show a big picture on a web page i divided it into pieces and put them together in a table:   <table>     <tr>       <td>         <a href="part1.jpg">...
8
by: Eric Bragas | last post by:
What is this? <img src="{$ ImagesDir}/photo.gif"> I KNOW what an HTML image tag looks like. But what do you call that in the file source? Is it like a virtual directory in IIS? It's some type...
1
by: Michael Stock | last post by:
Hi all, hopefully someone can tell me how to do this for a web server in C#: We have images in a folder you can't access over the net. So everytime we need to display an image from this folder,...
10
by: FX | last post by:
I wanna publish a script on my site which allows me to hide image source. i have rough idea abt it. i`ll point src to some php page like: <img src="image.php"> & in tht php wat exactly shud be...
2
by: McKirahan | last post by:
If I have a Web page invoked via http://myDomain.com/What.htm that references an ASP page via the <img> tag's "src=" like this: <html> <head> <title>Page.htm</title> </head> <body> <img...
3
by: Steve Richter | last post by:
Is there a way to pull text from a url into a web page? Similar to how the <img> element uses a URL to access the image to display. <txt src="http:\\www....." > thanks, -Steve
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.