Try something like:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wi="http://schemas.microsoft.com/wix/2006/wi">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<!-- identity transform -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<!-- insert GUID -->
<xsl:template match="wi:Component/@Guid">
<xsl:variable name="path" select="concat(../../@Name, '\', ../@Id)" />
<xsl:attribute name="Guid">
<xsl:value-of select="document('FileList.xml')/FileSystemList/File[contains(@Path, $path)]/@Guid"/>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>
Edit:
To base the match on the contents of Component/File/@Source
, change the definition of the $path
variable to:
<xsl:variable name="path" select="substring-after(../wi:File/@Source, ')')" />
This is assuming that anything in the Source
attribute that comes after the first ")" is part of the path stored in the other file.