Subject: [xsl] XML design for XSLT (was Re: [xsl] Standards checkers for XSLT)|
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 28 Nov 2006 14:56:42 -0500
Ford BMW Toyota
Maker[.="Ford"] Maker[.="BMW"] Maker[.="Toyota"]
Brand[@type="manufacturer"][sector="automotive"][.="Ford"] Brand[@type="manufacturer"][sector="automotive"][.="BMW"] Brand[@type="manufacturer"][sector="automotive"][.="Toyota"]
From Doug Rudder Jr.:
My apologies for replying off-list; apparently I need to update my subscription since our email has been "upgraded" (and names changed), since my post to the list was kicked back. But here's my two cents worth on the naming concept:
It depends on the situation. If order and structure are important, using attributes over elements (yet another permathread) is less than optimal. I'm dealing with a situation right now where organization is "implied" by attribute values, and they rely on editorial policy and eyeball QC to make it work. It's not working. The error rate (organization/nesting) is very high. I'm catching the errors by converting all the attribute values to elements and validating against a more structured schema. In other words, they cannot adequately parse/QC their own content using attributes, so I'm helping them clean up their data by providing feedback from my conversion process. (note: The conversion is for a specific project, not just for fixing their data problems; that's a side effect).
Frankly, in most (*but not all*) situations I've run across, using attributes to define content this way scares me. You can't define "grouping" this way, except in the most general sense, because attributes cannot enforce element order.
My reply: I assume that QC means "quality control".
So what you are saying is that this is better: <Manufacturers> <Manufacturer>Toyota</Manufacturer> <Manufacterer>Ford</Manufacturer> </Manufacturers>
This also brings up the question when one uses attributes. Is it OK to use attributes for key values?
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================