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