[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Using attributes and elements and text
I found this comment (from Michael Sperberg-McQueen's 1992 entry) to be the most cogent: "it wasn't such a fateful decision after all, but one you could back out of later if you really needed to." Given that we can write stylesheets to turn <book title="something">...</book> into <book><title>something</title>...</book> and back again, it's not that big a deal to me. That said, I have my rules of thumb, as I'm sure we all do. Mine go like this: * If it can't be repeated, is just text, and is fairly short, make it an attribute. Thus, I tend to make title into an attribute. * If it can be repeated, has its own structure (such as a title that has a subtitle), or is more than a few words, make it an element. FWIW Jay Bryant Bryant Communication Services (presently consulting at Synergistic Solution Technologies) "Michael Kay" <mike@xxxxxxxxxxxx> 02/24/2005 11:45 AM Please respond to xsl-list@xxxxxxxxxxxxxxxxxxxxxx To <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> cc Subject RE: Using attributes and elements and text > > I have never see a conclusive definition on when using attributes > instead of elements The usual reference is http://xml.coverpages.org/elementsAndAttrs.htm Michael Kay http://www.saxonica.com/
|
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
|