[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Attribute and Element

Subject: RE: Attribute and Element
From: "Beckers, Marc" <Marc.Beckers@xxxxxxxxxxxxxx>
Date: Fri, 19 May 2000 10:03:52 +0200
RE: Attribute and Element

> 	The confusion I am having now is, should I put the Price (or
> ValidBefore) as an attribute of the Ticket or put it as an 
> element under
> the Ticket. What is the difference, and what is the benefits?
> 
The decision "element or attribute?" is often a very fine one.
I tend to use an attribute if the value represents a certain "type"
or "flavour" of the element, and I use elements for fragments of
content.

In your example of the ticket element, "price" sounds like
it should be an element, allowing you to specify currency
in an attribute of "price". This being the case, I would make everything
else elements, too, to avoid later confusion "which ones were the
attributes, and which the elements". Also using elements allows you
to control the order in which they should appear (if you are using a DTD).

>From a pure instance generation and (XSL) processing point of view,
it makes no difference, but I am willing to be corrected.

A good source of tips is "Developing SGML DTDs" by Eve Maler and 
Jeanne Al Andaloussi. Though appearing in 1996 makes the book ancient
given the speed of developments, the chapters on docvument type modelling
are still useful in designing XML structures.

Hope this helps,
Dr. Marc Beckers
Documentation Consultant
Software AG
Uhlandstraße 12
D-64297 Darmstadt
Phone +49-6151-92-1322
Fax              -1612
mailto:Marc.Beckers@xxxxxxxxxxxxxx
http://www.softwareag.com


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.