Again I advise against using XPath this way, as changing to a structure that actually represents the data’s parent child relationships works much better than using the linear table based relationship. It would make the code FAR MORE managable in the long term.
You already do use temporary xml variables, as evidenced by use of msxsl:node-set($BranchMFeeTransList) in your BranchTable.xsl file.
Anyways, the ugly xpath:
<xsl:parameter name=“pei”>39</xsl:variable>
<xsl:for-each select=“/document/Invoice/Partner/Hierarchy/Relationships/Element[parent_element_id =$pei]”>
<xsl:for-each select=“/document/Invoice/Partner/Hierarchy/Relationships/Element[parent_element_id = /document/Invoice/Partner/Hierarchy/Relationships/Element[parent_element_id =$pei]/element_id]”>
<xsl:for-each select=“/document/Invoice/Customer[customer_id = (/document/Invoice/Partner/Hierarchy/Relationships/Element[parent_element_id = /document/Invoice/Partner/Hierarchy/Relationships/Element[parent_element_id =$pei]/element_id]/customer_id) ]”>
… now if you created a temporary structure the xpath would be much simpler.
something like:
<xsl:for-each select=“msxsl:node-set(someVariable)/Corporate/District[element_id=”$pei]">
<xsl:for-each select=“Region/Customer”>
#Tamino#API-Management#webMethods