I've created two separate maps, each with the source from a CDM schema. I now have to create a third map, which should select the correct map to use, based on a subtype (field element in the header).
For now I have created a Joint.xslt file, which would contain the logic needed to select and use the correct map.
In my scenario: If the subtype is an 'Invoice', one specific map should be used. If the subtype is a 'ConsolidatedInvoice', another map should be used.
I thought about using an xsl:if element to make a test on the subtype:
<xsl:variable name="var:InvoiceSubType" select="string(Header/InvoiceType/text())" />
<xsl:if test="$var:InvoiceSubType = 'Invoice'">
...use invoice map
</xsl:if>
But I'm unsure about the correct way to go about this. When combining the XSLT from both maps, many variable names are duplicated for instance and cause errors in the joint XSLT.
To use the joint map I've selected it as a custom XSLT path in the map properties, while the source schema is the CDM.
Let me know if you need more information.