length of html attribute

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Oliver Block

    length of html attribute

    Hi,

    I did not find any length limit for attributes. Is there any? Maybe
    "inherited" by SGML?

    Best Regards,

    Oliver

  • Benjamin Niemann

    #2
    Re: length of html attribute

    Oliver Block wrote:[color=blue]
    > I did not find any length limit for attributes. Is there any? Maybe
    > "inherited" by SGML?[/color]

    The SGML declaration (http://www.w3.org/TR/html40/sgml/sgmldecl.html)
    declares a maximum length of 65536 characters, which is the largest value
    that SGML allows and which comes closest to the 'intended limit' of 'no
    limit'.
    If you write a HTML parser, do not implement size limitations. If you are
    authoring HTML code, you'll win a prize, if you manage to exceed the 64k
    limit with meaningful data...

    --
    Benjamin Niemann
    Email: pink at odahoda dot de
    WWW: http://pink.odahoda.de/

    Comment

    • Andy Dingley

      #3
      Re: length of html attribute


      Benjamin Niemann wrote:
      [color=blue]
      > If you write a HTML parser, do not implement size limitations. If you are
      > authoring HTML code, you'll win a prize, if you manage to exceed the 64k
      > limit with meaningful data...[/color]

      Been there, done that.

      For metadata embedding, it's (reasonably) common practice to embed
      annotations and descriptions as attributes that are lifted from a
      Dublin Core (or similar) "pseudo-namespace". These aren't part of valid
      HTML, but XML namespacing isn't really available to the web yet and
      it's long-established web practice that extra attributes are silently
      and safely ignored by user-agents that don't understand them.

      Once you're adding annotation or metadata, it's not hard to start
      breaking 64k length limits, if you're unaware of the issue.

      Comment

      • Toby Inkster

        #4
        Re: length of html attribute

        Benjamin Niemann wrote:
        [color=blue]
        > If you write a HTML parser, do not implement size limitations. If you are
        > authoring HTML code, you'll win a prize, if you manage to exceed the 64k
        > limit with meaningful data...[/color]

        Writing a CMS, it's often the case that you'll have fairly big chunks of
        data in the value attributes for hidden INPUT elements.

        --
        Toby A Inkster BSc (Hons) ARCS
        Contact Me ~ http://tobyinkster.co.uk/contact

        Comment

        Working...