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