Return-Path: Mailing-List: contact general-help@xml.apache.org; run by ezmlm Delivered-To: mailing list general@xml.apache.org Received: (qmail 41391 invoked from network); 18 May 2000 22:53:45 -0000 Received: from swbcs005.sbc.com (209.184.192.25) by locus.apache.org with SMTP; 18 May 2000 22:53:45 -0000 Received: from swgate1.sbc.com (swgate1.sbc.com [132.201.82.89]) by swbcs005.sbc.com (8.9.3/8.8.8) with SMTP id RAA00701 for ; Thu, 18 May 2000 17:53:19 -0500 (CDT) Received: by swgate1.sbc.com (Smail-3.2 1996-Jul-4 #6 built 1997-Dec-24) id ; Thu, 18 May 2000 17:53:18 -0500 (CDT) Received: from msgstlhub02.sbc.com(really [132.201.87.59]) by swgate1.sbc.com via sendmail with esmtp id for ; Thu, 18 May 2000 17:53:10 -0500 (CDT) Received: by msgstlhub02.sbc.com with Internet Mail Service (5.5.2650.21) id ; Thu, 18 May 2000 17:53:09 -0500 Message-ID: <351FB1C90471D311BCC800508B07636901352677@d072043.sbc.com> From: "HERRICK, CHUCK (SBCSI)" To: "'general@xml.apache.org'" Subject: RE: Attribute and Element Date: Thu, 18 May 2000 17:53:09 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="ISO-8859-1" X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N The fact that an attribute can not have a child element should right off the top tell you that if you're modeling either IS A or HAS A data relationships with attributes, you've made a terrible blunder. Attributes are a way to pass information to the handling program downstream, not a way to model your data relationships. Look at Schemas and pray we all get to them before we have to live too much longer with DTDs. Schemas make all this confusion go away (well, almost :-) -----Original Message----- From: mdelagra@us.britannica.com [mailto:mdelagra@us.britannica.com] Sent: Thursday, May 18, 2000 5:38 PM To: general@xml.apache.org Subject: RE: Attribute and Element Also, if you're XML document needs to be high performance, attributes are much more efficient. The main drawback of an attribute is that it is a simple string; it should never be long, and it can never contain elements. If you think you may reuse the concept of "Price" in other contexts or want to assign child elements, it makes more sense to define it as an element. > -----Original Message----- > From: Rob Wygand [mailto:rob@wygand.com] > Sent: Thursday, May 18, 2000 5:07 PM > To: general@xml.apache.org > Subject: Re: Attribute and Element > > > This is a cause of much debate and consternation for me. What I've > generally decided is that the relationship come down to IS A > and HAS A. > If the thing in question is an integral part of the object represented > by the parent, then make it an attribute. However, if it's another > seperate 'object' and the parent known owns it, then I make it a child > node. > > This is all still highly subjective, but I always try to think how I'd > model this in an RDBMS and then use a similar scheme. > > An example is... > > > To="foo@bar.com" > Date="10-10-10T10:10:10Z" > Subjec"Hello, there foo"/> > > Test message! > > content_encoding="base64"> > > AAlLJSLKFJLKFJSLJFLKSJFLSKJFLSKJFLKFJSLDJFLSJDFLKSJFLSJFLKSDJF > SLKFJLFJSDLKJLSJFLS > > LJSLKFJLKFJSLJFLKSJFLSKJFLSKJFLKFJSLDJFLSJDFLKSJFLSJFLKSDJFSLK > FJLFJSDLKJLSJFLSAA0 > > [... etc ...] > > > > > Cheun N Chong wrote: > > 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? > > > > --------------------------------------------------------------------- > In case of troubles, e-mail: webmaster@xml.apache.org > To unsubscribe, e-mail: general-unsubscribe@xml.apache.org > For additional commands, e-mail: general-help@xml.apache.org > --------------------------------------------------------------------- In case of troubles, e-mail: webmaster@xml.apache.org To unsubscribe, e-mail: general-unsubscribe@xml.apache.org For additional commands, e-mail: general-help@xml.apache.org