1<html xsl:version="1.0" 2 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 3 xmlns="http://www.w3.org/TR/xhtml1/strict"> 4 5 <!-- FileName: EMBEDerr01 --> 6 <!-- Document: http://www.w3.org/TR/xslt --> 7 <!-- DocVersion: 19991116 --> 8 <!-- Section: 2.3 LRE as Stylesheet --> 9 <!-- Purpose: Literal Result Element used as stylesheet 10 cannot contain top-level elements. Should fail at line 11 containing xsl:key statement --> 12 <!-- ExpectedException: (StylesheetHandler) xsl:key is not allowed inside a template! --> 13 <!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: (StylesheetHandler) xsl:key is not allowed inside a template! --> 14 <!-- ExpectedException: xsl:key is not allowed in this position in the stylesheet! --> 15 16 <xsl:key name="test" match="para" use="@id"/> 17 18 <head> 19 <title>Expense Report Summary</title> 20 </head> 21 <body> 22 <p>Total Amount: <xsl:value-of select="expense-report/total"/></p> 23 </body> 24 25 <!-- 26 * Licensed to the Apache Software Foundation (ASF) under one 27 * or more contributor license agreements. See the NOTICE file 28 * distributed with this work for additional information 29 * regarding copyright ownership. The ASF licenses this file 30 * to you under the Apache License, Version 2.0 (the "License"); 31 * you may not use this file except in compliance with the License. 32 * You may obtain a copy of the License at 33 * 34 * http://www.apache.org/licenses/LICENSE-2.0 35 * 36 * Unless required by applicable law or agreed to in writing, software 37 * distributed under the License is distributed on an "AS IS" BASIS, 38 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 39 * See the License for the specific language governing permissions and 40 * limitations under the License. 41 --> 42 43</html> 44