Using XSL to generate country / tax.xml

It looks like there is a lot of boilerplate code in tax.xml. For example, for the Swiss tax codes 400 and 405, discussed in this other thread, the code is almost identical for each tax code.

For all countries in the EU customs union, there are almost identical patterns for intra-community VAT and similar concepts.

Has anybody looked at strategies for generating the tax.xml records like this using XSL transforms? This would make the files easier to create, easier to read and easier to troubleshoot.

XSL transforms could also help to swap strings in different languages.

XSL transforms are already used to provide the charts of accounts in multiple languages for countries where several languages are commonly used, for example: modules/account_be: d429b0c6650f localize.xsl

I’m not sure whether anyone has investigated using them to generate other files though.

There is also this topic you may be interested in: Templating the XML files

This feedback was really helpful. I created a separate topic for the language issues.

In fact, there would be more than one XSL transform involved:

  • first XSL transform: create all the boilerplate VAT rules, e.g. all the rules for an EU country with intracommunity VAT

  • second XSL transform: as discussed in the other topic, inserting the language strings and creating permutations for each language