Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > lists in attributes

Reply
Thread Tools

lists in attributes

 
 
Russ
Guest
Posts: n/a
 
      02-12-2004
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.
 
Reply With Quote
 
 
 
 
DFN-CIS NetNews Service
Guest
Posts: n/a
 
      02-13-2004
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.

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.

 
Reply With Quote
 
 
 
 
Russ
Guest
Posts: n/a
 
      02-13-2004
DFN-CIS NetNews Service <(E-Mail Removed)> wrote in message news:<(E-Mail Removed) m>...
> 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.
>
> 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.
 
Reply With Quote
 
Patrick TJ McPhee
Guest
Posts: n/a
 
      02-13-2004
In article <(E-Mail Removed) >,
Russ <(E-Mail Removed)> wrote:
% DFN-CIS NetNews Service <(E-Mail Removed)> wrote in message
% news:<(E-Mail Removed) m>...
% > 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
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
arnold m. slotnik
Guest
Posts: n/a
 
      02-14-2004
(E-Mail Removed) (Patrick TJ McPhee) wrote in
news:c0jerv$323$(E-Mail Removed):

> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
attributes ala java annotations or .Net attributes? Kyle Schmitt Ruby 3 07-24-2007 07:48 PM
class attributes & data attributes james_027 Python 2 06-20-2007 03:12 PM
WebControl.Attributes.Add and custom attributes P4trykx ASP .Net 2 01-31-2007 04:33 PM
Parse reserved attributes as normal attributes Max XML 1 09-22-2006 12:04 PM
List of lists of lists of lists... =?UTF-8?B?w4FuZ2VsIEd1dGnDqXJyZXogUm9kcsOtZ3Vleg==?= Python 5 05-15-2006 11:47 AM



Advertisments