xref: /aoo42x/main/officecfg/util/schema_trim.xsl (revision 1e519d8d)
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<!--***********************************************************
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements.  See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership.  The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License.  You may obtain a copy of the License at
11 *
12 *   http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied.  See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 *
21 ***********************************************************-->
22
23
24
25<xsl:transform  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
26		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
27		xmlns:xs="http://www.w3.org/2001/XMLSchema"
28		xmlns:oor="http://openoffice.org/2001/registry"
29		version="1.0">
30
31<!-- Get the correct format -->
32	<xsl:output method="xml" indent="yes"/>
33	<xsl:namespace-alias stylesheet-prefix="xs" result-prefix="xs"></xsl:namespace-alias>
34
35
36<!-- Remove all comments from the schema files -->
37	<xsl:template match="*|@*">
38	  <xsl:copy>
39		<xsl:apply-templates select="*|@*"/>
40	  </xsl:copy>
41	</xsl:template>
42
43<!-- suppress the location of the schema -->
44	<xsl:template match = "@xsi:schemaLocation"/>
45
46<!-- suppress the constraints of the schema
47	<xsl:template match = "constraints"/>  -->
48
49<!-- suppress all documentation items
50	<xsl:template match = "info"/> -->
51
52<!-- suppress constraints for deprecated items -->
53	<xsl:template match = "constraints[../info/deprecated]"/>
54
55<!-- suppress all documentation for deprecated items -->
56	<xsl:template match = "desc[../deprecated]"/>
57	<xsl:template match = "label[../deprecated]"/>
58
59<!-- copy all other documentation with content -->
60	<xsl:template match="desc|label">
61		<xsl:copy>
62			<xsl:apply-templates select="@*"/>
63			<xsl:value-of select="."/>
64		</xsl:copy>
65	</xsl:template>
66
67<!-- suppress all author items -->
68	<xsl:template match = "author"/>
69
70<!-- suppress values, which are marked as nil -->
71	<xsl:template match="value[@xsi:nil='true']" />
72
73<!-- copy all other values with content -->
74	<xsl:template match="value">
75		<xsl:copy>
76			<xsl:apply-templates select="*|@*"/>
77			<xsl:value-of select="."/>
78		</xsl:copy>
79	</xsl:template>
80
81</xsl:transform>
82