Is there a way to apply import for a particular imported file and not all the files imported?
Basically only want to do apply import for a certain import based on some value evaluated.
For example in pseudo,
If value = ‘Medical’ then Do Medical Imported File apply imports Else If value = ‘Transport’ Then Do Transport Imported File apply Imports
Cheers
For XSLT 1.0 the answer is negative. However you may use modes to simulate similar behavior.
In XSLT 2.0 there is the
xsl:use-whenattribute that may be present on any XSLT instruction, including<xsl:import>, however the conditions that may be tested in it are severely limited. To quote the Spec:‘There are no syntactic constraints on the XPath expression that can be used as the value of the use-when attribute. However, there are severe constraints on the information provided in its evaluation context. These constraints are designed to ensure that the expression can be evaluated at the earliest possible stage of stylesheet processing, without any dependency on information contained in the stylesheet itself or in any source document’