1<?xml version="1.0" encoding="UTF-8"?> 2<!DOCTYPE stylesheet []> 3 4<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> 5 6 <xsl:param name="config"/> 7 <xsl:param name="mapsFile"/> 8 9 <xsl:output method="text"/> 10 11 <xsl:key name="key1" match="map1" use="@type"/> 12 <xsl:key name="key2" match="map2" use="@type"/> 13 14 <xsl:variable name="maps" select="document($mapsFile)"/> 15 <xsl:variable name="type" select="document($config)/config/@type"/> 16 17 <xsl:template match="map1"> 18 <xsl:for-each select="$maps"> 19 <xsl:value-of select="key('key1', $type)"/> 20 </xsl:for-each> 21 </xsl:template> 22 23 <xsl:template match="map2"> 24 <xsl:for-each select="$maps"> 25 <xsl:value-of select="key('key2',$type)"/> 26 </xsl:for-each> 27 </xsl:template> 28</xsl:stylesheet> 29