xref: /aosp_15_r20/external/apache-xml/test/tests/contrib/xsltc/schemasoft/attributes2elements.xsl (revision 1212f9a0ffdc28482b8821715d2222bf16dc14e2)
1<?xml version="1.0"?>
2
3<!-- Replace attributes with elements.
4
5     Note that the reverse transform is not possible.
6
7
8
9Copyright J.M. Vanel 2000 - under GNU public licence
10
11xt testHREF.xml attributes2elements.xslt > attributes2elements.xml
12
13
14
15 -->
16
17
18
19<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
20
21                version="1.0" >
22
23
24
25 <xsl:template match ="@*" >
26
27   <xsl:element name='{name()}'>
28
29    <xsl:value-of select='.' />
30
31   </xsl:element>
32
33 </xsl:template>
34
35
36
37 <xsl:template match="*">
38
39  <xsl:copy>
40
41    <xsl:apply-templates select="*|@*" />
42
43  </xsl:copy>
44
45 </xsl:template>
46
47  <!--
48   * Licensed to the Apache Software Foundation (ASF) under one
49   * or more contributor license agreements. See the NOTICE file
50   * distributed with this work for additional information
51   * regarding copyright ownership. The ASF licenses this file
52   * to you under the Apache License, Version 2.0 (the  "License");
53   * you may not use this file except in compliance with the License.
54   * You may obtain a copy of the License at
55   *
56   *     http://www.apache.org/licenses/LICENSE-2.0
57   *
58   * Unless required by applicable law or agreed to in writing, software
59   * distributed under the License is distributed on an "AS IS" BASIS,
60   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
61   * See the License for the specific language governing permissions and
62   * limitations under the License.
63  -->
64
65</xsl:stylesheet>
66