Re: [xsl] __LINE__ equivalent in XSTL

Subject: Re: [xsl] __LINE__ equivalent in XSTL
From: "Imsieke, Gerrit, le-tex" <gerrit.imsieke@xxxxxxxxx>
Date: Fri, 02 Dec 2011 15:26:22 +0100
On 2011-12-02 14:38, Emma Burrows wrote:
From: Andrew Welch [mailto:andrew.j.welch@xxxxxxxxx]
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. :)

Were 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 templates 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. Wed 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 wed like to keep unused number ranges between the passes, so that we dont have to renumber them whenever we need to introduce an intermediate pass.

Gerrit

Current Thread