Advanced Search

Results 1 to 3 of 3

Thread: Flex Level Drop Down Menu fails to pass XHTML validation

  1. #1
    Join Date
    May 2007
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Flex Level Drop Down Menu fails to pass XHTML validation

    1) Script Title: Flex Level Drop Down Menu (v1.1)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...exdropdown.htm

    3) Describe problem: does not pass XHTML validation

    I love this navigation. Works great, looks great.. and it’s simple. I have one problem.. and I’m hoping that you can help.. it doesn’t pass XHTML validation. It’s complaining about the attribute ‘data-flexmenu’. I tried to add that to the DTD, but that introduced additional problems, any plans to remove the attribute and just use ‘data-flexmenu’ as a class value instead?

    When I try to validate this page, I see the following error returned:

    Code:
    Line 41, Column 63: Attribute "data-flexmenu" is not a valid attribute
    
    …tion/page.main.htm" data-flexmenu="page">Page</a>&nbsp;&nbsp;|&nbsp;&nb
    I tried defining the data-flexmenu in the dtd
    Code:
    <!DOCTYPE html PUBLIC
    "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
    [
      <!ATTLIST a data-flexmenu CDATA #IMPLIED>
    ]>
    This passes validation, but I was receiving the dreaded ]> in my output, as well as additional problems with my stylesheet.

    Any help is greatly appreciated.
    hanji

  2. #2
    Join Date
    May 2007
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    For now, my solution was to create my own DTD and include this attribute in the a element.
    Code:
    <!--================== The Anchor Element ================================-->
    
    <!-- content is %Inline; except that anchors shouldn't be nested -->
    
    <!ELEMENT a %a.content;>
    <!ATTLIST a
      %attrs;
      %focus;
      charset     %Charset;      #IMPLIED
      type        %ContentType;  #IMPLIED
      name        NMTOKEN        #IMPLIED
      data-flexmenu CDATA        #IMPLIED
      href        %URI;          #IMPLIED
      hreflang    %LanguageCode; #IMPLIED
      rel         %LinkTypes;    #IMPLIED
      rev         %LinkTypes;    #IMPLIED
      shape       %Shape;        "rect"
      coords      %Coords;       #IMPLIED
      target      %FrameTarget;  #IMPLIED
      >
    Not ideal, but gets past validation and doesn't affect my page/css, etc.

    hanji

  3. #3
    Join Date
    Aug 2004
    Posts
    9,864
    Thanks
    3
    Thanked 960 Times in 949 Posts
    Blog Entries
    15

    Default

    The "data" attribute is a new attribute supported/ standardized in HTML5. If you specify a HTML5 doctype at the top of your page, it should then pass:

    Code:
    <!DOCTYPE HTML>
    DD Admin

Bookmarks

Posting Permissions

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