Hello,
When creating a XML file for usage as database with BaseX, is there some policy about when it's good to use an element and when it's good to use an attribut ?
Cheers,
Florent
Hello Florent,
I don't think are are any general rules per se. Most people tend to prefer one over the other. I personally would use elements as much as possible as they are more flexible. You shouldn't use attributes if there is the slightest chance you might want to break up the value into smaller values. i.e. for age an attribute is ok, for a name I personally would use an element (as you might want to store first name, middle name, ... separately).
From the database perspektive, there is not difference in speed whether you use an attribute or an element. So only the model of your data should be relevant to your schema.
Cheers, Dirk On 12/27/2014 07:23 PM, Florent Gallaire wrote:
Hello,
When creating a XML file for usage as database with BaseX, is there some policy about when it's good to use an element and when it's good to use an attribut ?
Cheers,
Florent
Thanks a lot (again) for your answer.
Cheers
Florent
On Mon, Dec 29, 2014 at 11:33 AM, Dirk Kirsten dk@basex.org wrote:
Hello Florent,
I don't think are are any general rules per se. Most people tend to prefer one over the other. I personally would use elements as much as possible as they are more flexible. You shouldn't use attributes if there is the slightest chance you might want to break up the value into smaller values. i.e. for age an attribute is ok, for a name I personally would use an element (as you might want to store first name, middle name, ... separately).
From the database perspektive, there is not difference in speed whether you use an attribute or an element. So only the model of your data should be relevant to your schema.
Cheers, Dirk On 12/27/2014 07:23 PM, Florent Gallaire wrote:
Hello,
When creating a XML file for usage as database with BaseX, is there some policy about when it's good to use an element and when it's good to use an attribut ?
Cheers,
Florent
-- Dirk Kirsten, BaseX GmbH, http://basex.org |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22
basex-talk@mailman.uni-konstanz.de