1 <?xml version=
"1.0" encoding=
"utf-8"?>
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
23 xmlns:
rng=
"http://relaxng.org/ns/structure/1.0"
24 xmlns:
xalan=
"http://xml.apache.org/xalan"
25 exclude-result-prefixes =
"xalan"
27 <xsl:output method=
"xml" version=
"1.0" encoding=
"UTF-8" indent=
"yes" omit-xml-declaration=
"no"/>
29 <xsl:include href=
"factorytools.xsl"/>
31 <xsl:template match=
"/">
33 <xsl:for-each select=
"//rng:define[@name='CT_FFData']">
34 <xsl:call-template name=
"sprm"/>
35 <xsl:call-template name=
"attribute"/>
40 <xsl:template name=
"sprminner">
41 <xsl:variable name=
"defname" select=
"@name"/>
42 <xsl:for-each select=
".//rng:ref[not(ancestor::rng:element or ancestor::rng:attribute)]">
43 <xsl:call-template name=
"sprminner"/>
45 <xsl:for-each select=
".//rng:element">
46 <xsl:for-each select=
"rng:ref">
47 <xsl:variable name=
"refname" select=
"@name"/>
48 <xsl:for-each select=
"ancestor::namespace/rng:grammar/rng:define[@name=$refname]">
49 <xsl:call-template name=
"sprminner"/>
53 <xsl:variable name=
"elementname" select=
"@name"/>
54 <xsl:attribute name=
"name">
55 <xsl:value-of select=
"@name"/>
57 <xsl:for-each select=
"rng:ref">
58 <xsl:variable name=
"refname" select=
"@name"/>
59 <xsl:for-each select=
"ancestor::namespace/resource[@name=$refname]">
60 <xsl:attribute name=
"action">
62 <xsl:when test=
"@resource='Properties'">
63 <xsl:text>resolve
</xsl:text>
66 <xsl:text>set
</xsl:text>
71 <xsl:for-each select=
"ancestor::namespace/resource[@name=$defname]">
72 <xsl:for-each select=
"element[@name=$elementname]">
73 <xsl:attribute name=
"id">
74 <xsl:call-template name=
"idtoqname">
75 <xsl:with-param name=
"id">
76 <xsl:value-of select=
"@tokenid"/>
87 <xsl:template name=
"sprm">
89 <xsl:call-template name=
"sprminner"/>
93 <xsl:template name=
"attributeinner">
94 <xsl:param name=
"parent"/>
95 <xsl:for-each select=
".//rng:ref[not(ancestor::rng:element or ancestor::rng:attribute)]">
96 <xsl:variable name=
"refname" select=
"@name"/>
97 <xsl:comment><xsl:value-of select=
"$newparent"/></xsl:comment>
98 <xsl:for-each select=
"ancestor::namespace/rng:grammar/rng:define[@name=$refname]">
99 <xsl:call-template name=
"attributeinner">
100 <xsl:with-param name=
"parent" select=
"$parent"/>
104 <xsl:for-each select=
".//rng:element">
105 <xsl:variable name=
"newparent">
106 <xsl:if test=
"string-length($parent)">
107 <xsl:value-of select=
"$parent"/>
108 <xsl:text>:
</xsl:text>
110 <xsl:value-of select=
"@name"/>
112 <xsl:for-each select=
"rng:ref">
113 <xsl:variable name=
"refname" select=
"@name"/>
114 <xsl:for-each select=
"ancestor::namespace/rng:grammar/rng:define[@name=$refname]">
115 <xsl:call-template name=
"attributeinner">
116 <xsl:with-param name=
"parent" select=
"$newparent"/>
121 <xsl:variable name=
"defname" select=
"@name"/>
122 <xsl:variable name=
"resource">
123 <xsl:for-each select=
"ancestor::namespace/resource[@name=$defname]">
124 <xsl:value-of select=
"@resource"/>
127 <xsl:if test=
"$resource='Properties'">
128 <xsl:for-each select=
".//rng:attribute">
129 <xsl:variable name=
"attrname" select=
"@name"/>
131 <xsl:attribute name=
"name">
132 <xsl:if test=
"string-length($parent) > 0">
133 <xsl:value-of select=
"$parent"/>
134 <xsl:text>:
</xsl:text>
136 <xsl:value-of select=
"$attrname"/>
138 <xsl:for-each select=
"ancestor::namespace/resource[@name=$defname]">
139 <xsl:for-each select=
"attribute[@name=$attrname]">
140 <xsl:attribute name=
"id">
141 <xsl:call-template name=
"idtoqname">
142 <xsl:with-param name=
"id">
143 <xsl:value-of select=
"@tokenid"/>
154 <xsl:template name=
"attribute">
156 <xsl:call-template name=
"attributeinner"/>