473,395 Members | 1,554 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.

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 11469
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.