xref: /aoo41x/main/officecfg/util/schema_trim.xsl (revision cdf0e10c)
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<!--***********************************************************************
3 *
4  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
6  Copyright 2000, 2010 Oracle and/or its affiliates.
7
8  OpenOffice.org - a multi-platform office productivity suite
9
10  This file is part of OpenOffice.org.
11
12  OpenOffice.org is free software: you can redistribute it and/or modify
13  it under the terms of the GNU Lesser General Public License version 3
14  only, as published by the Free Software Foundation.
15
16  OpenOffice.org is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  GNU Lesser General Public License version 3 for more details
20  (a copy is included in the LICENSE file that accompanied this code).
21
22  You should have received a copy of the GNU Lesser General Public License
23  version 3 along with OpenOffice.org.  If not, see
24  <http://www.openoffice.org/license.html>
25  for a copy of the LGPLv3 License.
26
27 ************************************************************************ -->
28
29<xsl:transform  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
30		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
31		xmlns:xs="http://www.w3.org/2001/XMLSchema"
32		xmlns:oor="http://openoffice.org/2001/registry"
33		version="1.0">
34
35<!-- Get the correct format -->
36	<xsl:output method="xml" indent="yes"/>
37	<xsl:namespace-alias stylesheet-prefix="xs" result-prefix="xs"></xsl:namespace-alias>
38
39
40<!-- Remove all comments from the schema files -->
41	<xsl:template match="*|@*">
42	  <xsl:copy>
43		<xsl:apply-templates select="*|@*"/>
44	  </xsl:copy>
45	</xsl:template>
46
47<!-- suppress the location of the schema -->
48	<xsl:template match = "@xsi:schemaLocation"/>
49
50<!-- suppress the constraints of the schema
51	<xsl:template match = "constraints"/>  -->
52
53<!-- suppress all documentation items
54	<xsl:template match = "info"/> -->
55
56<!-- suppress constraints for deprecated items -->
57	<xsl:template match = "constraints[../info/deprecated]"/>
58
59<!-- suppress all documentation for deprecated items -->
60	<xsl:template match = "desc[../deprecated]"/>
61	<xsl:template match = "label[../deprecated]"/>
62
63<!-- copy all other documentation with content -->
64	<xsl:template match="desc|label">
65		<xsl:copy>
66			<xsl:apply-templates select="@*"/>
67			<xsl:value-of select="."/>
68		</xsl:copy>
69	</xsl:template>
70
71<!-- suppress all author items -->
72	<xsl:template match = "author"/>
73
74<!-- suppress values, which are marked as nil -->
75	<xsl:template match="value[@xsi:nil='true']" />
76
77<!-- copy all other values with content -->
78	<xsl:template match="value">
79		<xsl:copy>
80			<xsl:apply-templates select="*|@*"/>
81			<xsl:value-of select="."/>
82		</xsl:copy>
83	</xsl:template>
84
85</xsl:transform>
86