[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|