xsl-list
[Top] [All Lists]

Re: [xsl] Standards checkers for XSLT

2006-11-27 14:42:11
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.

Doug

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?

Cheers.

Kamal Bhatt wrote:
Joe Fawcett wrote:
From: Kamal Bhatt <kbhatt(_at_)tt(_dot_)com(_dot_)au>
Reply-To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Standards checkers for XSLT
Date: Mon, 27 Nov 2006 08:44:24 +1100


Also, here is another question. Does anyone have any standards for designing XML for XSLT? This is going to be an issue in my company some time in the future as we XMLise our documentation. I know that it is good practice to group values eg:

<Ford>...</Ford>
<Holden>...</Holden>
<Toyota>...</Toyota>

is less preferred to

<Manufacturers>
 <Ford>...</Ford>
 <Holden>...</Holden>
 <Toyota>...</Toyota>
</Manufacturers>

Any other tips?

Cheers.

--
Kamal Bhatt

Personally I don't like the second style much either, what happens when you get a manufacturer that has an awkward name, Rolls Royce, for instance. Better to have <manufacturer name="Rolls Royce"/>.
Much easier to select appropriately as well.


Point taken. My point was more about the grouping of elements rather than naming, but you are right.



--
Kamal Bhatt


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--