473,796 Members | 2,570 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.
Jul 20 '05 #1
4 1419
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.

Jul 20 '05 #2
DFN-CIS NetNews Service <sh******@estat ecomputers.com> wrote in message news:<13******* *************** *@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?
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>


To my untrained eye, these appear more cluttered to me, without adding
any additional information.
Jul 20 '05 #3
In article <be************ **************@ posting.google. com>,
Russ <18********@sne akemail.com> wrote:
% DFN-CIS NetNews Service <sh******@estat ecomputers.com> wrote in message
% news:<13******* *************** *@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
pt**@interlog.c om
Jul 20 '05 #4
pt**@interlog.c om (Patrick TJ McPhee) wrote in
news:c0******** **@news.eusc.in ter.net:
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
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4505
by: Alan Little | last post by:
I need to merge and de-duplicate some lists, and I have some code which works but doesn't seem particularly elegant. I was wondering if somebody could point me at a cleaner way to do it. Here's my function: +++++++++++++++++++ from sets import Set
2
4638
by: Stewart Midwinter | last post by:
I would like to link the contents of three OptionMenu lists. When I select an item from the first list (call it continents), the contents of the 2nd list (call it countries) would update. And in turn the contents of the 3rd list (call it states would be updated by a change in the 2nd list. If anyone can share a recipe or some ideas, I'd be grateful! Here's some sample code that displays three OptionMenus, but doesn't update the list...
29
3066
by: Joseph Haig | last post by:
I am trying to use descriptive lists, <DL>, as shown in <http://www.maths.man.ac.uk/~jhaig/tmp/test.html> with a style sheet at <http://www.maths.man.ac.uk/~jhaig/tmp/default-2.css>. With Mozilla and Opera they appear correctly, with a border round both the <DT> and <DD> parts but in Internet Explorer the borders are messed up. Can anyone please tell me where the mistake is? As an aside, the <div id="main"> section should have the...
9
3752
by: Dave H | last post by:
Hello, I have a query regarding definition lists. Is it good practice semantically to use the dt and dd elements to mark up questions and answers in a frequently asked questions list, or FAQ? Here is an example of just such a usage: <dl class="faq"> <di>
5
1630
by: Jan Danielsson | last post by:
Hello all, I have written a simple whiteboard application. In my application, I want to be able to set draw attributes. This part works. I have a dictionary object which contains stuff like: self.attr = ... self.attr = ... Now, the problem is that I want to be able to store attributes in a list so they'll be easily accessed using the function keys. I.e. I have
3
2203
by: Andy Dingley | last post by:
We've all seen this structure many times: <ul> <li><a href="..." >Click here</a></li> <li><a href="..." >Click here</a></li> </ul> Now it's obvious good practice to have sensible link texts, and also sensible use of title attributes on either the<a> or <li> elements. What's a good rule of thumb for these attributes ?
12
1372
by: BBands | last post by:
I have a list with some strings in in it, 'one', 'two' 'three' and so on. I would like to add lists to a class with those names. I have no way of knowing what will be in the list or how long the list will be in advance. Something like: class master: def __init__(self, list): self.count = len(list)
5
1495
by: Mizipzor | last post by:
Consider the following snippet of code: ========================== class Stats: def __init__(self, speed, maxHp, armor, strength, attackSpeed, imagePath): self.speed = speed self.maxHp = maxHp self.armor = armor self.strength = strength
9
4963
by: Paulo da Silva | last post by:
Hi! What is the best way to have something like the bisect_left method on a list of lists being the comparision based on an specified arbitrary i_th element of each list element? Is there, for lists, something equivalent to the __cmp__ function for classes? Thanks.
0
9684
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9530
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10236
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10182
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6793
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.