...

View Full Version : xhtml 1.1 - id problem



MAXX
01-04-2004, 02:26 PM
Heya all

I want to validate some code, and validator tell me:

----------------------------------------------------
character "#" is not allowed in the value of attribute "usemap"
...ike/sort.gif" alt="Sortiraj" usemap="#m1" width="11" /></td>
----------------------------------------------------

If I don't have # than this code is not working! Is there something to replace #?

and this is my all code:
----------------------------------------------------
<map id="m1">
<area href="javascript:SORT('1','D')" shape="rect" coords="0, 10, 11, 17" alt="" />
<area href="javascript:SORT('1','A')" shape="rect" coords="0, 0, 11, 9" alt="" />
</map>
<img src="../sort.gif" alt="Sortiraj" usemap="#m1" width="11" />
----------------------------------------------------

if anybody have idea how to manage this problem, please help

maxx

me'
01-04-2004, 04:14 PM
From the DTD:
[code]<!ENTITY % URI "CDATA"
-- a Uniform Resource Identifier,
see [URI]
-->

...

<!ATTLIST IMG
%attrs; -- %coreattrs, %i18n, %events --
src %URI; #REQUIRED -- URI of image to embed --
alt %Text; #REQUIRED -- short description --
longdesc %URI; #IMPLIED -- link to long description
(complements alt) --
name CDATA #IMPLIED -- name of image for scripting --
height %Length; #IMPLIED -- override height --
width %Length; #IMPLIED -- override width --
usemap %URI; #IMPLIED -- use client-side image map --
ismap (ismap) #IMPLIED -- use server-side image map --
>[code]Just going by that, I don't see any reason why # isn't allowed in usemap.

Which DTD are you using? (as in, strict, transitional or frameset)

MAXX
01-04-2004, 04:35 PM
Originally posted by me'
From the DTD:Just going by that, I don't see any reason why # isn't allowed in usemap.

Which DTD are you using? (as in, strict, transitional or frameset)

I use:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

the problem is that validator refuse to accept #

any ideas?

thanx for help
maxx

ReadMe.txt
01-04-2004, 04:51 PM
wel XHTML1.1 decided to depreciate name on the map element, and browsers dont seem to have caught up.

I've a quick took at the client side image map module and it says to give your map an ID and to specify an IDREF as the usemap attribute, unfortunately, this doesn't work.

I hadn;t noticed this unitl you meantioned it, and i've just swapped my sort buttons into two separate images side by side and it works fine.

me'
01-04-2004, 04:56 PM
It's not depreciated &mdash; it's still in the language, but now id is #REQUIRED and name is #IMPLIED:
<!ELEMENT map ((%block; | form | %misc;)+ | area+)>
<!ATTLIST map
%i18n;
%events;
id ID #REQUIRED
class CDATA #IMPLIED
style %StyleSheet; #IMPLIED
title %Text; #IMPLIED
name NMTOKEN #IMPLIED
>meaning you should be using id instead of name (also with <a name>). Browser support isn't good.

MAXX
01-04-2004, 05:14 PM
Originally posted by ReadMe.txt
wel XHTML1.1 decided to depreciate name on the map element, and browsers dont seem to have caught up.

I've a quick took at the client side image map module and it says to give your map an ID and to specify an IDREF as the usemap attribute, unfortunately, this doesn't work.

I hadn;t noticed this unitl you meantioned it, and i've just swapped my sort buttons into two separate images side by side and it works fine.

heya

Well this is strange situation.
Name is no longer xhtml atribute, so they (w3c) replace it with id.
But are they forgot for usemap?? Or validator is bad?!

I can use:
---------------------------------------------------------------------
<img src="../sort.gif" alt="Sortiraj" usemap="#m1" width="11" />
---------------------------------------------------------------------
it works fine with xhtml 1.1 specification, but if I want to validate my page, then validator say:
---------------------------------------------------------------------
character "#" is not allowed in the value of attribute "usemap"
---------------------------------------------------------------------

... and if I remove #, validator say it's Ok, but code doesn't work any more.

p.s. at last, there is a way to split my picture into 2 parts, and give each one an url.
I think that there must be a way to use usemap with valid xhtml specifications ..... :rolleyes:

maxx



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum