Hi Razvan,
There are a set of rules defined by the XSLT spec for conflict
resolution for selecting which templates to select. Please do read the
spec for detailed description.
In a normal stylesheet you cannot have two template rules having the
same match pattern. This is also valid for root node. If you have 2
root templates, the processor will usually give an error.
But you may invoke the transform with an initial mode. For e.g. Saxon
provides -im option to specify the initial mode.
So you may have 2 templates for root node as below:
<xsl:template match="/">
</xsl:template>
<xsl:template match="/" mode="x" >
</xsl:template>
These templates both match the root node, but are differentiated by
the mode.
If you invoke the transformation with -im x option, the 2nd rule will
be invoked, otherwise 1st rule will be invoked.
Regards,
Mukul