I have a particular problem I’m not sure how to approach. Here at the office there is this large unwieldy XSLT we have for adapting one type of XML to another. The problem is that it’s not very consistently written and very difficult to follow. In the ancient creation of this stylesheet, it seems it was forgotten exactly what it does.
Is there a way to easily map out in a human-readable format exactly what the giant XSLT does? i.e. Every possible input -> Every possible output. We can’t create an all-encompassing input document, since the adapter has different behavior for different input (We estimate it would take 100+ input documents to cover every possible output)
Any suggestion would be greatly welcome.
Break it up — move the xsl execution statements to xsl templates inside the document. By doing this, you’ll work down to a more reasonable understanding of the document from the top down.
And if it’s so incredibly gigantic as to prevent you from understanding it, this sounds like you have a re-factoring decision ahead of you: is this document so important that we need to know what it does (and understand how it works — thus requiring some re-work), or can we live with it as-is?