I faced this problem more than once so far and now I'd like to find a perfect solution:
when you have a very complex diazo theme, sooner or later you will end up splitting the rules into subsets and move them in separate files.
My habit is to keep them separated based on the template to which they have to be applied. Now, what's the better solution for selecting which of them should be applied?
By now I've found these 2 solutions:
- you can have a list of "rules" with conditions that identify the
template and then import the correct external xml. There are 2 cons
here, you have to hope that all the conditions are mutually
exclusive, and the "otherwise" option, which is basically another
"rules" with all the previous conditions inside a
not()
, grows insanely huge - you can use a
xsl:choose
, but it seems that this option doesn't work perfectly as thexsl:otherwise
option is not always applied and I'm not sure that the construct ends on the first verifiedxsl:when
Am I missing something? do you have other options or you can select which of these two is the best?