1<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 2 3<xsl:output indent="yes"/> 4 5 <!-- FileName: attribset42 --> 6 <!-- Document: http://www.w3.org/TR/xslt --> 7 <!-- DocVersion: 19991116 --> 8 <!-- Section: 7.1.4 Named Attribute Sets --> 9 <!-- Creator: Morten Jorgensen --> 10 <!-- Purpose: Test inheritance of attribute sets. A literal result element 11 is referring an attribute set that is defined by two separate 12 <xsl:attribute-set.../> elements with the same name. Both 13 these elements have a use-attribute-sets attribute, which 14 means that we have a single attribute set that inherits from 15 two other attribute sets. Both parents attribute sets have 16 attributes that are overridden by the child.--> 17 18<xsl:template match="/"> 19 <out xsl:use-attribute-sets="child"> 20 <xsl:attribute name="location">Wonderland</xsl:attribute> 21 </out> 22</xsl:template> 23 24<xsl:attribute-set name="child" use-attribute-sets="alice"> 25 <xsl:attribute name="follow">yellowbrickroad</xsl:attribute> 26 <xsl:attribute name="rabbithole">shallow</xsl:attribute> 27</xsl:attribute-set> 28 29<xsl:attribute-set name="child" use-attribute-sets="rabbit"> 30 <xsl:attribute name="follow">theleader</xsl:attribute> 31 <xsl:attribute name="alice">intoxicated</xsl:attribute> 32</xsl:attribute-set> 33 34<xsl:attribute-set name="rabbit"> 35 <xsl:attribute name="rabbithole">deep</xsl:attribute> 36</xsl:attribute-set> 37 38<xsl:attribute-set name="alice"> 39 <xsl:attribute name="alice">ondrugs</xsl:attribute> 40</xsl:attribute-set> 41 42 43 <!-- 44 * Licensed to the Apache Software Foundation (ASF) under one 45 * or more contributor license agreements. See the NOTICE file 46 * distributed with this work for additional information 47 * regarding copyright ownership. The ASF licenses this file 48 * to you under the Apache License, Version 2.0 (the "License"); 49 * you may not use this file except in compliance with the License. 50 * You may obtain a copy of the License at 51 * 52 * http://www.apache.org/licenses/LICENSE-2.0 53 * 54 * Unless required by applicable law or agreed to in writing, software 55 * distributed under the License is distributed on an "AS IS" BASIS, 56 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 57 * See the License for the specific language governing permissions and 58 * limitations under the License. 59 --> 60 61</xsl:stylesheet> 62