0

Is it possible to log/capture which XSL templates are used and/or not used during an XML transform using lxml? I'm looking to report on and prune unused templates to reduce "technical debt".

mzjn
  • 48,958
  • 13
  • 128
  • 248
Phillip B Oldham
  • 18,807
  • 20
  • 94
  • 134

1 Answers1

0

lxml's transform methods allow you to profile a transformation, and obtain the results as an XML document which shows how many times a pattern/mode/named-template was used. It should be possible to then perform an XPath across the XSL files to obtain all the comparative patterns/modes/named-templates and compare the two lists to see which templates are most/least used.

Phillip B Oldham
  • 18,807
  • 20
  • 94
  • 134