473,320 Members | 1,828 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.

problem with <span>

I have such a construction:

<span id="xyz">Hello world</span>

<span id="xyz">Hello Nordrhein-Westfalen</span>

Validator critizises (oh!) that there is twice the same span.
the problem is that the html-file is automatically created and I must be
sure tat every element is cleanly framed by <span></span>

How to convince validator that this is necessary?

thanks

Werner
--
--------------------------------------------------
Werner Partner, 45699 Herten
http://www.sonoptikon.de
Jul 24 '05 #1
19 2278
"Werner Partner" wrote in comp.infosystems.www.authoring.html:
I have such a construction:

<span id="xyz">Hello world</span>

<span id="xyz">Hello Nordrhein-Westfalen</span>

Validator critizises (oh!) that there is twice the same span.
No, it complains that there is twice the same id.
the problem is that the html-file is automatically created and I must be
sure tat every element is cleanly framed by <span></span>

How to convince validator that this is necessary?


Instead, why not fix your generator so that it doesn't spew out
duplicate IDs?

--

Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
Jul 24 '05 #2
Stan Brown schrieb:
"Werner Partner" wrote in comp.infosystems.www.authoring.html:
I have such a construction:

<span id="xyz">Hello world</span>

<span id="xyz">Hello Nordrhein-Westfalen</span>

Validator critizises (oh!) that there is twice the same span.

No, it complains that there is twice the same id.

the problem is that the html-file is automatically created and I must be
sure tat every element is cleanly framed by <span></span>

How to convince validator that this is necessary?

Instead, why not fix your generator so that it doesn't spew out
duplicate IDs?

It is more secure, because the elements are larger, and it is easier to
frame any element by <span></span> instead of checking if the id has
changed.

regards

Werner
--
--------------------------------------------------
Werner Partner, 45699 Herten
http://www.sonoptikon.de
Jul 24 '05 #3
On Wed, 27 Apr 2005 23:23:30 +0200, Werner Partner
<ka****@sonoptikon.de> wrote:
I have such a construction:

<span id="xyz">Hello world</span>
<span id="xyz">Hello Nordrhein-Westfalen</span>
Which is directly wrong if those two lines appears in the same instance
of markup.
How to convince validator that this is necessary?


You can't change the rules just because it would fit your needs at some
convenient point in time.

Each and every id value assignment within one specific instance of
markup _must_ be unique.

It's your processing system that is in error, not the validator.

Think about it; an 'id' value is supposed to be possible to use as a
target to link to as in e.g. http://www.somedomain.com/page#xyz

Now if you have several id="xyz" in your instance, what shall your
browser do to find out which one you want it to go to?

--
Rex
Jul 24 '05 #4
Werner Partner wrote:
Stan Brown schrieb:
"Werner Partner" wrote in comp.infosystems.www.authoring.html:
I have such a construction:

<span id="xyz">Hello world</span>

<span id="xyz">Hello Nordrhein-Westfalen</span>

It is more secure, because the elements are larger, and it is easier to
frame any element by <span></span> instead of checking if the id has
changed.


Although I don't quite understand your needs, maybe you can use
<span class="xyz"> instead?
This is valid, you can check for it, and you don't need to do anything
with the class in your stylesheet.
Jul 24 '05 #5
Robert schrieb:
Werner Partner wrote:
Stan Brown schrieb:
"Werner Partner" wrote in comp.infosystems.www.authoring.html:

I have such a construction:

<span id="xyz">Hello world</span>

<span id="xyz">Hello Nordrhein-Westfalen</span>

It is more secure, because the elements are larger, and it is easier
to frame any element by <span></span> instead of checking if the id
has changed.


Although I don't quite understand your needs, maybe you can use
<span class="xyz"> instead?
This is valid, you can check for it, and you don't need to do anything
with the class in your stylesheet.


The document is valid except the repeating same id's
Perhaps I should just bear it ;-)

Werner

--
--------------------------------------------------
Werner Partner, 45699 Herten
http://www.sonoptikon.de
Jul 24 '05 #6
Werner Partner wrote:
The document is valid except the repeating same id's
Perhaps I should just bear it ;-)


Not a great idea. I'm pretty sure I've encountered browsers unable to
compensate well for that particular error.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 24 '05 #7
On Thu, 28 Apr 2005, Werner Partner wrote:
The document is valid except the repeating same id's
i.e it's not valid.
Perhaps I should just bear it ;-)


Perhaps you should give up on the idea of validity. It evidently
doesn't suit you. *plonk*
Jul 24 '05 #8
In article <mt********************************@4ax.com>, jr****@newsguy.com
enlightened us with...

Think about it; an 'id' value is supposed to be possible to use as a
target to link to as in e.g. http://www.somedomain.com/page#xyz


It is?
I thought that was what named anchors were for.
Can you do this with IDs? That'd be cool...

--
--
~kaeli~
He's your God, they're your rules - you burn in Hell.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 24 '05 #9
Werner Partner wrote:
I have such a construction:

<span id="xyz">Hello world</span>

<span id="xyz">Hello Nordrhein-Westfalen</span>

Validator critizises (oh!) that there is twice the same span.
the problem is that the html-file is automatically created and I must be
sure tat every element is cleanly framed by <span></span>

How to convince validator that this is necessary?

thanks

Werner

use classes
Jul 24 '05 #10
kaeli wrote:
In article <mt********************************@4ax.com>, jr****@newsguy.com
enlightened us with...
Think about it; an 'id' value is supposed to be possible to use as a
target to link to as in e.g. http://www.somedomain.com/page#xyz

It is?
I thought that was what named anchors were for.
Can you do this with IDs? That'd be cool...


Yes, you should always use id's for this.
So instead of:
<a name="mytable">
<table>
....

You should use:
<table id="mytable">
....

Much cleaner, right?
Jul 24 '05 #11
Werner Partner wrote:
The document is valid except the repeating same id's
Perhaps I should just bear it ;-)


lol
You could say that about every rule you break that makes it invalid.
Do you understand why multiple id's are not allowed?
Well anyway... I strongly advice you not to use the same id's to prevent
problems like css selectors, javascript dom selectors, and validation.
"class" should work best in your case I think.
But it's your choice :)
Jul 24 '05 #12
Werner Partner wrote:
I have such a construction:

<span id="xyz">Hello world</span>

<span id="xyz">Hello Nordrhein-Westfalen</span>

Validator critizises (oh!) that there is twice the same span.
the problem is that the html-file is automatically created and I must be
sure tat every element is cleanly framed by <span></span>

How to convince validator that this is necessary?


You can't convince a validator that invalid usage is necessary. Either
accept that it's invalid, or fix it.

In this case, you *need* to fix it because the whole point of the ID
attribute is that it is unique on the page.
Jul 24 '05 #13
kaeli wrote:
In article <mt********************************@4ax.com>, jr****@newsguy.com
enlightened us with...
Think about it; an 'id' value is supposed to be possible to use as a
target to link to as in e.g. http://www.somedomain.com/page#xyz
It is?
I thought that was what named anchors were for.


Originally, but using IDs is preferred, and is supported in IE going
back to at least version 5, and Netscape since version 6, not to mention
Mozilla and Firefox and, I'm sure, Opera. If you need to support
Netscape 4.x, though, forget about it.
Can you do this with IDs? That'd be cool...

Jul 24 '05 #14
In article <3d*************@individual.net>, Harlan Messinger writes:
kaeli wrote:
In article <mt********************************@4ax.com>, jr****@newsguy.com enlightened us with...
Think about it; an 'id' value is supposed to be possible to use as a
target to link to as in e.g. http://www.somedomain.com/page#xyz
I thought that was what named anchors were for.
Originally, but using IDs is preferred, and is supported in IE going
back to at least version 5,
Yup, IE supported id's as link targets as of 4.x (which I was using until
just recently).
back to at least version 5, and Netscape since version 6, not to mention
Mozilla and Firefox and, I'm sure, Opera. If you need to support
Netscape 4.x, though, forget about it.


I just verified that they are not supported with NS 4.07.

--
Michael F. Stemper
#include <Standard_Disclaimer>
No animals were harmed in the composition of this message.

Jul 24 '05 #15
In article <3d*************@individual.net>,
hm*******************@comcast.net enlightened us with...
kaeli wrote:
In article <mt********************************@4ax.com>, jr****@newsguy.com
enlightened us with...
Think about it; an 'id' value is supposed to be possible to use as a
target to link to as in e.g. http://www.somedomain.com/page#xyz

It is?
I thought that was what named anchors were for.


Originally, but using IDs is preferred, and is supported in IE going
back to at least version 5, and Netscape since version 6, not to mention
Mozilla and Firefox and, I'm sure, Opera. If you need to support
Netscape 4.x, though, forget about it.


I don't.
Kickin'. I learned *something* useful today!

Thanks.

--
--
~kaeli~
Do cemetery workers prefer the graveyard shift?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 24 '05 #16
Alan J. Flavell schrieb:
On Thu, 28 Apr 2005, Werner Partner wrote:

The document is valid except the repeating same id's

i.e it's not valid.

Perhaps I should just bear it ;-)

Perhaps you should give up on the idea of validity. It evidently
doesn't suit you. *plonk*

---------------------^^^^^^^^ ????

WP

--
--------------------------------------------------
Werner Partner, 45699 Herten
http://www.sonoptikon.de
Jul 24 '05 #17
Werner Partner schrieb:
I have such a construction:

<span id="xyz">Hello world</span>

<span id="xyz">Hello Nordrhein-Westfalen</span>

Validator critizises (oh!) that there is twice the same span.
the problem is that the html-file is automatically created and I must be
sure tat every element is cleanly framed by <span></span>

How to convince validator that this is necessary?


Thanks for the long discussion (and the *plonk*, of course).
I had some language problems and asked in another - german speaking -
NG, there my question was a bit OT, but I got some background
information so that I could understand better what you wrote.

I tried first with classes, but it did not work, so I tried id.
No I corrected the error in my class definitions, and the document is
valid, and I am happy.

Thanks

Werner

--
--------------------------------------------------
Werner Partner, 45699 Herten
http://www.sonoptikon.de
Jul 24 '05 #18
"kaeli" wrote in comp.infosystems.www.authoring.html:
In article <mt********************************@4ax.com>, jr****@newsguy.com
enlightened us with...

Think about it; an 'id' value is supposed to be possible to use as a
target to link to as in e.g. http://www.somedomain.com/page#xyz


It is?
I thought that was what named anchors were for.
Can you do this with IDs? That'd be cool...


Yes, for many years. Netscape 4 was the last browser that didn't
honor IDs as link targets, I velieve.
--

Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
Jul 24 '05 #19
Werner Partner wrote:
Alan J. Flavell schrieb:

On Thu, 28 Apr 2005, Werner Partner wrote:
The document is valid except the repeating same id's
i.e it's not valid. Perhaps I should just bear it ;-)

Perhaps you should give up on the idea of validity. It evidently
doesn't suit you. *plonk*

---------------------^^^^^^^^ ????


http://catb.org/%7Eesr/jargon/html/P/plonk.html

--
Blinky Linux Registered User 297263
Killing all Usenet posts from Google Groups
Info: http://blinkynet.net/comp/uip5.html
Jul 24 '05 #20

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

Similar topics

3
by: Alexander Ross | last post by:
I have an html snippet, and I want to remove any <span> tags that have a specific attribute (class=none) ex. The quick brown <span class="animal">fox</span> jumped <span...
23
by: Mikko Ohtamaa | last post by:
From XML specification: The representation of an empty element is either a start-tag immediately followed by an end-tag, or an empty-element tag. (This means that <foo></foo> is equal to...
4
by: DMJ | last post by:
What is the difference between these two tags?
5
by: Kathryn | last post by:
Good morning! I am having a problem with a span. I have items, of which I only want to show the first X characters on the screen. If the user prints the page, I want the entire item to print....
3
by: Andrew Tang | last post by:
Hi. I'm having problems with the following code. The last line seems to be in the wrong place, its been moved down slightly by about 3 pixels in IE6. <html> <head> <title>Lorem Ipsum</title>...
18
by: Timothy Casey | last post by:
Thanks in advance... =~= Timothy Casey South Australia worloq@iprimus.com.au Formerly: casey@smart.net.au
9
by: Wang, Jay | last post by:
Hello, all, I would like to enable some text between <SPAN url="http://www.testserver.com/">WORD TO BE DRAGGED </SPAN>. I put some javascript and it will extract http://www.testserver.com/ from...
2
by: xhe | last post by:
I met a very headache problem in javascript, I think this might be difference between IE and NS / Safari. I have a text area <form> <textarea name='tex1' onkeyup='displayit();'></textarea>...
1
by: shivani anand | last post by:
Hi.. I have a doubt. I have some code.. <span class="test1"> my screeen </span> I simply changed it to. <h2 class = "test1"> my screen </h2>
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.