Re: [xsl] Measuring the complexity of XSLT stylesheets
by other posts by this author
Apr 18 2005 9:00AM messages near this date
Re: [xsl] Measuring the complexity of XSLT stylesheets
|
Re: [xsl] Measuring the complexity of XSLT stylesheets
& XSLT Jirka makes the following excellent point:
-----------------------------------------------------
I think that many people think about XML as about hierarchical way of
describing/storing data. XSLT by default traverses XML data from the
root to the leaves using templates. If you need to access other axes
than child and descendant in your stylesheet, then there is usualy some
complexity behind your data from human perspecitive of view. So counting
number of XPath expressions that use different axes than child and
descendant might give you some metric not completely unrelated to
complexity of input data and their processing. Or you can assign
different weight to differents axes to make it more "scientific".
-----------------------------------------------------
It seems to me that, when you have to pull data from different parts of
the hierarchy or output something that isn't based on the source
structure, you've got a big jump in complexity. These kinds of problems
are usually addressed by Meunchian grouping. Thus, if the stylesheet
contains a key, I would add a multiplier to its complexity. You might add
another multiplier for variables that contain result tree fragments,
though a lot of people do that unintentionally.
I strongly suspect that assigning a weight to the length of match
expressions and then multiplying by some value for the presence of one or
more keys would give you a good measure of a stylesheet's complexity, at
least from the point of view of writing and maintaining the stylesheet.
Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)
--~------------------------------------------------------------------
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@[...].com>
--~--
Thread:
Lars Marius Garshol
Anthony B. Coates
James Fuller
Dimitre Novatchev
Lars Marius Garshol
Dimitre Novatchev
Adam Turoff
M. David Peterson
Sebastien Arbogast
Lars Marius Garshol
Jirka Kosek
Lars Marius Garshol
James Fuller
Lars Marius Garshol
Colin Paul Adams
M. David Peterson
M. David Peterson
Jun Zhang
M. David Peterson
Francesco Barresi
Ben Pickering
Lars Marius Garshol
M. David Peterson
Colin Paul Adams
|