lists in attributes

Discussion in 'XML' started by Russ, Feb 12, 2004.

  1. Russ

    Russ Guest

    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.
    Russ, Feb 12, 2004
    #1
    1. Advertising

  2. 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. :cool:

    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.
    DFN-CIS NetNews Service, Feb 13, 2004
    #2
    1. Advertising

  3. Russ

    Russ Guest

    DFN-CIS NetNews Service <> wrote in message news:<>...
    > On 12/02/2004, around 09:10, Russ wrote:
    > R>Are these legal?
    > Yes.
    >
    > R> Are they a good idea?
    > No.


    Why not?

    > R> Thanks.
    > You're welcome. :cool:
    >
    > 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>


    To my untrained eye, these appear more cluttered to me, without adding
    any additional information.
    Russ, Feb 13, 2004
    #3
  4. In article <>,
    Russ <> wrote:
    % DFN-CIS NetNews Service <> wrote in message
    % news:<>...
    % > 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
    Patrick TJ McPhee, Feb 13, 2004
    #4
  5. (Patrick TJ McPhee) wrote in
    news:c0jerv$323$:

    > 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.


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

    Design goal #6 supports the opposite supposition.

    --
    a. m. slotnik
    arnold m. slotnik, Feb 14, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JustSomeGuy

    Sorting lists of lists...

    JustSomeGuy, Jun 17, 2004, in forum: C++
    Replies:
    0
    Views:
    318
    JustSomeGuy
    Jun 17, 2004
  2. Jon Slaughter

    lists of lists

    Jon Slaughter, Dec 13, 2004, in forum: C++
    Replies:
    4
    Views:
    416
    Buster
    Dec 13, 2004
  3. Charlotte Henkle

    Counter for items in lists in lists?

    Charlotte Henkle, Sep 25, 2004, in forum: Python
    Replies:
    8
    Views:
    397
    Charlotte Henkle
    Sep 26, 2004
  4. robin
    Replies:
    10
    Views:
    541
    Dave Hansen
    Apr 12, 2006
  5. =?UTF-8?B?w4FuZ2VsIEd1dGnDqXJyZXogUm9kcsOtZ3Vleg==

    List of lists of lists of lists...

    =?UTF-8?B?w4FuZ2VsIEd1dGnDqXJyZXogUm9kcsOtZ3Vleg==, May 8, 2006, in forum: Python
    Replies:
    5
    Views:
    398
    =?UTF-8?B?w4FuZ2VsIEd1dGnDqXJyZXogUm9kcsOtZ3Vleg==
    May 15, 2006
Loading...

Share This Page