1<?xml version="1.0" encoding="ISO-8859-1"?> 2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 3 4 <!-- FileName: bugzilla6284 --> 5 <!-- Creator: David Marston, from Daniel Gilder's bug report --> 6 7<xsl:output method="xml" indent="no" encoding="UTF-8"/> 8 9<xsl:variable name="lastMove"> 10 <xsl:for-each select="/Nodes/Black"> 11 <xsl:message>Position: <xsl:value-of select="position()"/></xsl:message> 12 <xsl:if test="position()=1"> 13 <xsl:value-of select="@number"/> 14 </xsl:if> 15 </xsl:for-each> 16</xsl:variable> 17 18<xsl:template match="/"> 19 <out> 20 <title> 21 <xsl:text>Reproducing Bugzilla#6284: predicate/global variable/position()</xsl:text> 22 </title> 23 <xsl:text> 24</xsl:text> 25 <xsl:for-each select="/Nodes/Black[@number <= $lastMove]"> 26 <duplicate><!-- Should get one of these --> 27 <xsl:text>found a duplicate at </xsl:text> 28 <xsl:value-of select="position()"/> 29 </duplicate> 30 </xsl:for-each> 31 <xsl:text> 32</xsl:text> 33 <last><!-- Should be 1 --> 34 <xsl:value-of select="$lastMove"/> 35 </last> 36 </out> 37</xsl:template> 38 39 40 <!-- 41 * Licensed to the Apache Software Foundation (ASF) under one 42 * or more contributor license agreements. See the NOTICE file 43 * distributed with this work for additional information 44 * regarding copyright ownership. The ASF licenses this file 45 * to you under the Apache License, Version 2.0 (the "License"); 46 * you may not use this file except in compliance with the License. 47 * You may obtain a copy of the License at 48 * 49 * http://www.apache.org/licenses/LICENSE-2.0 50 * 51 * Unless required by applicable law or agreed to in writing, software 52 * distributed under the License is distributed on an "AS IS" BASIS, 53 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 54 * See the License for the specific language governing permissions and 55 * limitations under the License. 56 --> 57 58</xsl:stylesheet> 59