xsl-list
[Top] [All Lists]

Re: [xsl] __LINE__ equivalent in XSTL

2011-12-02 08:26:51


On 2011-12-02 14:38, Emma Burrows wrote:
From: Andrew Welch [mailto:andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com]
Sometimes I use the advanced technique of temporarily adding XX, YY,
ZZ to various places....  :)

I'm glad to know I'm not the only one who uses such sophisticated debugging 
methods. :)

We’re using essentially the same technique, but less ad hoc, more institutionalized.

In complex conversion pipelines with lots of template rules and lots of passes in different modes, we sometimes add “template identifier” attributes to some of the generated elements. Then we are able to track which template in which mode was responsible for a certain transformation.

For example, <idml2xml:genSpan idml2xml:reason="autocorrect-08" aid:cstyle="..."> indicates that a generated span has been introduced by template #08 in the pass that takes place in mode="autocorrect". 'autocorrect-08' is the template’s ID that it will add to its offspring, so to say.

Sophistication goes on: In addition, each pass's result will be written into a file, such as debug/pass-50-autocorrect.xml

The debug files will be written by an xsl:result-document with a dedicated format that indents for legibility.

'pass-50' should not indicate that there are 50 or more passes. We’d like to number the passes in ascending order, so that we can see more easily, by inspecting adjacent files in the debug directory, how the data changed from pass to pass. And we’d like to keep unused number ranges between the passes, so that we don’t have to renumber them whenever we need to introduce an intermediate pass.

Gerrit

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