lists in attributes

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

    #1

    lists in attributes

    Can lists be used in attributes? For example, suppose I have an
    element like this:

    <x tol="-2.0 2.0">

    where I am specifying a lower and an upper tolerance on x. Or, for
    another example,

    <poly coeff="-3.23 4.11 8.32"

    where I am giving the coefficients of a polynomial. Are these legal?
    Are they a good idea? Thanks.
  • DFN-CIS NetNews Service

    #2
    Re: lists in attributes

    On 12/02/2004, around 09:10, Russ wrote:
    R>Are these legal?
    Yes.

    R> Are they a good idea?
    No.

    R> Thanks.
    You're welcome. 8-)

    Seriously, I would do something like

    <x>
    <lowerTol>-2.0</lowerTol>
    <upperTol>-2.0</upperTol>
    </x>

    and

    <poly>
    <coeff>-3.23</coeff>
    <coeff>4.11</coeff>
    <coeff>8.32</coeff>
    </poly>

    --
    Stuart
    See headers for PGP Key.
    Local Area Network in Australia: the LAN down under.

    Comment

    • Russ

      #3
      Re: lists in attributes

      DFN-CIS NetNews Service <shemming@estat ecomputers.com> wrote in message news:<136866953 5.2004021309130 9@estatecompute rs.com>...[color=blue]
      > On 12/02/2004, around 09:10, Russ wrote:
      > R>Are these legal?
      > Yes.
      >
      > R> Are they a good idea?
      > No.[/color]

      Why not?
      [color=blue]
      > R> Thanks.
      > You're welcome. 8-)
      >
      > Seriously, I would do something like
      >
      > <x>
      > <lowerTol>-2.0</lowerTol>
      > <upperTol>-2.0</upperTol>
      > </x>
      >
      > and
      >
      > <poly>
      > <coeff>-3.23</coeff>
      > <coeff>4.11</coeff>
      > <coeff>8.32</coeff>
      > </poly>[/color]

      To my untrained eye, these appear more cluttered to me, without adding
      any additional information.

      Comment

      • Patrick TJ McPhee

        #4
        Re: lists in attributes

        In article <bebbba07.04021 31034.68cc35ae@ posting.google. com>,
        Russ <18k11tm001@sne akemail.com> wrote:
        % DFN-CIS NetNews Service <shemming@estat ecomputers.com> wrote in message
        % news:<136866953 5.2004021309130 9@estatecompute rs.com>...
        % > On 12/02/2004, around 09:10, Russ wrote:
        % > R>Are these legal?
        % > Yes.
        % >
        % > R> Are they a good idea?
        % > No.
        %
        % Why not?

        The argument usually goes that you should use XML to mark each
        individual component of your data, since then your XML parser can give
        you each individual component, and you then don't have to parse out the
        values you want from your attribute list.

        % To my untrained eye, these appear more cluttered to me, without adding
        % any additional information.

        The argument here goes that it doesn't matter because you would never
        look at the XML without some XML-specific tool. It says so right on the
        first page of the standard, although not in so many words.

        You may balance this against the fact that DTDs and XML Schemas provide
        a type (NMTOKENS) which is essentially intended for a white-space
        delimited list of numbers, and that XML Schemas goes on to provide
        mechanisms for defining your own lists of white-space delimited things,
        all of which suggests that somebody who's thought about it a lot thinks
        that your approach isn't so bad after all. And your approach surely is
        more readable for some purposes.
        --

        Patrick TJ McPhee
        East York Canada
        ptjm@interlog.c om

        Comment

        • arnold m. slotnik

          #5
          Re: lists in attributes

          ptjm@interlog.c om (Patrick TJ McPhee) wrote in
          news:c0jerv$323 $1@news.eusc.in ter.net:
          [color=blue]
          > The argument here goes that it doesn't matter because you would
          > never look at the XML without some XML-specific tool. It says so
          > right on the first page of the standard, although not in so many
          > words.[/color]

          Okay, I'll bite--where are the words that imply that?

          Design goal #6 supports the opposite supposition.

          --
          a. m. slotnik

          Comment

          Working...