Max and min values in DTD

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

    Max and min values in DTD

    HI all,

    Could anyone plz tell me whether max and min values can be specified
    in DTD for an attirbute ? if not is there any way around it ? any help
    and suggestion is greatly appreciated.

    Regards,
    Mithil

  • Richard Tobin

    #2
    Re: Max and min values in DTD

    In article <1188232671.084 044.134990@l22g 2000prc.googleg roups.com>,
    Mithil <mithil.mohan@g mail.comwrote:
    >Could anyone plz tell me whether max and min values can be specified
    >in DTD for an attirbute ? if not is there any way around it ?
    No, it can't be done. DTDs don't provide any way to specify numeric
    ranges. (Unless your range is something small like 1-5, in which case
    you could possibly list all the legal values.)

    The workaround is to use a different schema language, or check the
    value in your application.

    -- Richard
    --
    "Considerat ion shall be given to the need for as many as 32 characters
    in some alphabets" - X3.4, 1963.

    Comment

    • Martin Honnen

      #3
      Re: Max and min values in DTD

      Mithil wrote:
      Could anyone plz tell me whether max and min values can be specified
      in DTD for an attirbute ? if not is there any way around it ? any help
      and suggestion is greatly appreciated.
      A DTD does not allow that. The W3C XML schema language however allows it
      using the min/maxInclusive or min/maxExclusive facets:



      --

      Martin Honnen

      Comment

      • Mithil

        #4
        Re: Max and min values in DTD

        Thanks Martin and Richard

        Comment

        • The Magpie

          #5
          Re: Max and min values in DTD

          Mithil wrote:
          HI all,
          >
          Could anyone plz tell me whether max and min values can be specified
          in DTD for an attirbute ? if not is there any way around it ? any help
          and suggestion is greatly appreciated.
          >
          Don't think you can do that in a DTD, though you can in a Schema.

          Comment

          Working...