1<?xml version="1.0" encoding="iso-8859-1"?> 2<xsl:stylesheet 3 version="1.0" 4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 5 6 <!-- Test FileName: mk032.xsl --> 7 <!-- Source Attribution: 8 This test was written by Michael Kay and is taken from 9 'XSLT Programmer's Reference' published by Wrox Press Limited in 2000; 10 ISBN 1-861003-12-9; copyright Wrox Press Limited 2000; all rights reserved. 11 Now updated in the second edition (ISBN 1861005067), http://www.wrox.com. 12 No part of this book may be reproduced, stored in a retrieval system or 13 transmitted in any form or by any means - electronic, electrostatic, mechanical, 14 photocopying, recording or otherwise - without the prior written permission of 15 the publisher, except in the case of brief quotations embodied in critical articles or reviews. 16 --> 17 <!-- Example: itinerary.xml, itinerary.xsl --> 18 <!-- Chapter/Page: 4-421 --> 19 <!-- Purpose: Using the key() pattern to format a specific node --> 20 21<xsl:template match="/"> 22 <html> 23 <head> 24 <title>Itinerary</title> 25 </head> 26 <body><center> 27 <xsl:apply-templates select="//day"/> 28 </center></body> 29 </html> 30</xsl:template> 31 32<xsl:template match="day"> 33 <h3>Day <xsl:value-of select="@number"/></h3> 34 <p><xsl:apply-templates/></p> 35</xsl:template> 36 37 38 <!-- 39 * Licensed to the Apache Software Foundation (ASF) under one 40 * or more contributor license agreements. See the NOTICE file 41 * distributed with this work for additional information 42 * regarding copyright ownership. The ASF licenses this file 43 * to you under the Apache License, Version 2.0 (the "License"); 44 * you may not use this file except in compliance with the License. 45 * You may obtain a copy of the License at 46 * 47 * http://www.apache.org/licenses/LICENSE-2.0 48 * 49 * Unless required by applicable law or agreed to in writing, software 50 * distributed under the License is distributed on an "AS IS" BASIS, 51 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 52 * See the License for the specific language governing permissions and 53 * limitations under the License. 54 --> 55 56</xsl:stylesheet> 57