Is there an easy way to optimize the following for-each loops? There are 3 for-each loops. Actually it is not very performant ;-) The bottleneck is the second and third foreach
Must be Xsl1.0!
<xsl:for-each select="ViewMasterdataMaint/MaintMessageConsist">
<Message>
<xsl:variable name="Message_Device">
<xsl:value-of select="Message_Device"/>
</xsl:variable>
<DataStructures>
<xsl:for-each select="msxsl:node-set(/ViewMasterdataMaint/DeviceWebPage[Device=$Message_Device])">
<xsl:variable name="WebPageGuid" select="Page" />
<xsl:for-each select="msxsl:node-set(/ViewMasterdataMaint/DataRecordType[Page=$WebPageGuid])[not(Structure = preceding-sibling::DataRecordType/Structure)]">
<xsl:variable name="FacetGuid" select="Structure" />
<xsl:element name="DataStructure">
<xsl:attribute name="name">
<xsl:value-of select="/ViewMasterdataMaint/DataStructure[Guid=$FacetGuid]/Name" />
</xsl:attribute>
</xsl:element>
</xsl:for-each>
</xsl:for-each>
</DataStructures>
</Message>
</xsl:for-each>
My only idea was to switch to apply-templates. But it's a huge xslt and the postet xsl is only a small snippet of it ;-(