xsl-list
[Top] [All Lists]

Re: [xsl] opinion re flexible style vs speed

2007-01-09 09:45:36

in general I'd go for flexibility rather than speed, but in this case
I'm not sure that 
  <xsl:template mode="metadata" match="Article/Body" />
is really so inflexible and is a resonably natural expression of the
(current) fact that metadata isn't in the body.

Yes it will need changing if the datamodel changes, but so will other
parts of the stylesheet.

  <xsl:template mode="metadata" match="Article/Authors/Author">

might not pull in all authors if a new Book/Authors/Author element is
added.
writing it as
  <xsl:template mode="metadata" match="Author">
would make it catch both cases automatically (and probably make it a
fraction faster as it wouldn't have to check the parent and grandparent
names) but might be the wrong thing all together if there are other
Author elements that would be matched by this that you don't want to
process, or process differently.

Everything depends so much on the details of the format, and how stable
it is.

Have any of you folks made a similar decision one way or the other and
come to regret it? :)

Oh yes, often, but not in any way that leads to any general
conclusions. It's just that whichever way you choose, you always wonder
if it would have been better the other way:-)

David


--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>