Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jan 2003
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    xhtml 1.1 - id problem

    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

  • #2
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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)
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

  • #3
    New Coder
    Join Date
    Jan 2003
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Sheffield, UK
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    "To be successful in IT you don't need to know everything - just where to find it in under 30 seconds"

    (Me Me Me Me Me Me Me Me Me)

  • #5
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's not depreciated &mdash; it's still in the language, but now id is #REQUIRED and name is #IMPLIED:
    Code:
    <!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.
    Last edited by me'; 01-04-2004 at 05:03 PM.
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

  • #6
    New Coder
    Join Date
    Jan 2003
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 .....

    maxx


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •