1<?xml version="1.0"?> 2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 3 4 <!-- FileName: idkey59 --> 5 <!-- Document: http://www.w3.org/TR/xslt --> 6 <!-- DocVersion: 19991116 --> 7 <!-- Section: 12.2 --> 8 <!-- Creator: Frank Weiss --> 9 <!-- Purpose: Test xsl:key with union in "use" attribute. --> 10 11<xsl:output method="xml" encoding="UTF-8" indent="yes"/> 12 13<xsl:key name="key1" match="div" use="x | y | z"/> 14 15<xsl:template match="/"> 16 <out> 17 <h1>Coordinate 25 (4 hits, 3 sections):</h1> 18 <xsl:for-each select="key('key1', 25)"> 19 <title> 20 <xsl:value-of select="title"/> 21 </title> 22 </xsl:for-each> 23 <h1>Coordinate 39 (1 hit):</h1> 24 <xsl:for-each select="key('key1', 39)"> 25 <title> 26 <xsl:value-of select="title"/> 27 </title> 28 </xsl:for-each> 29 <h1>Coordinate 44 (2 hits, 2 sections):</h1> 30 <xsl:for-each select="key('key1', 44)"> 31 <title> 32 <xsl:value-of select="title"/> 33 </title> 34 </xsl:for-each> 35 <h1>Coordinate 75 (2 hits, 2 sections):</h1> 36 <xsl:for-each select="key('key1', 75)"> 37 <title> 38 <xsl:value-of select="title"/> 39 </title> 40 </xsl:for-each> 41 </out> 42</xsl:template> 43 44 45 <!-- 46 * Licensed to the Apache Software Foundation (ASF) under one 47 * or more contributor license agreements. See the NOTICE file 48 * distributed with this work for additional information 49 * regarding copyright ownership. The ASF licenses this file 50 * to you under the Apache License, Version 2.0 (the "License"); 51 * you may not use this file except in compliance with the License. 52 * You may obtain a copy of the License at 53 * 54 * http://www.apache.org/licenses/LICENSE-2.0 55 * 56 * Unless required by applicable law or agreed to in writing, software 57 * distributed under the License is distributed on an "AS IS" BASIS, 58 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 59 * See the License for the specific language governing permissions and 60 * limitations under the License. 61 --> 62 63</xsl:stylesheet> 64