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