Thank you for your reply.
I understand what you mean, and I did encounter that very problem at the very beginning. I suppose if I explain the issue, it might shed light on what I am really trying to do.
XSL I am trying to do is serving to be templating engine for a framework, I am currently working on.
So far this is how it works:
(S) contains 2 templates "frontend" and "admin" templates which are defined by name without a matching pattern. S also includes a "run.xsl" (R), which has a template with a matching pattern to everything.
(R) also includes 2 skins. a Frontend skin and a Backend skin.
Based on the XML structure (R) can determine which skin to call.
In the skin which is a template and renders out, there is a call-template tag that will call either Frontend or Admin (depending on which skin, backend will call admin).
Now all of this works nicely, until I realised that I had to add an additional template in (S) a "superadmin" template. Some of the modules in the framework may or may not have a superadmin function, which enables them to see more information than a normal admin would, and therefore the visual layout would be different.
However, a superadmin may also run a module as an admin, because that particular module may not have a superadmin function and will represent the information equally for admins and superadmins.
In the XML root tag you have an attribute called "user" and a value saying if its admin or superadmin. Based on that I imagined that I could do something like this
Try to call template with match pattern [@user='superadmin']
if it doesnt exist call template with match pattern [@user='admin' or @user='superadmin']
I hope this sheds more light on what I am trying to do, and I might have approached this from a bad angle. I am open to any suggestions.