~ubuntu-branches/debian/sid/calligraplan/sid

« back to all changes in this revision

Viewing changes to devtools/scripts/removeForeign.xsl

  • Committer: Package Import Robot
  • Author(s): Pino Toscano
  • Date: 2018-02-01 18:20:19 UTC
  • Revision ID: package-import@ubuntu.com-20180201182019-1qo7qaim5wejm5k9
Tags: upstream-3.1.0
Import upstream version 3.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="utf-8"?>
 
2
<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml"
 
3
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0"
 
4
        xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
 
5
        xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
 
6
        xmlns:db="urn:oasis:names:tc:opendocument:xmlns:database:1.0"
 
7
        xmlns:dc="http://purl.org/dc/elements/1.1/"
 
8
        xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
 
9
        xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
 
10
        xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"
 
11
        xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
 
12
        xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
 
13
        xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
 
14
        xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
 
15
        xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
 
16
        xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
 
17
        xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
 
18
        xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
 
19
        xmlns:odf="http://docs.oasis-open.org/ns/office/1.2/meta/odf#"
 
20
        xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
 
21
        xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
 
22
        xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0"
 
23
        xmlns:xlink="http://www.w3.org/1999/xlink">
 
24
        <xsl:output encoding="utf-8" indent="no" method="xml"
 
25
                omit-xml-declaration="no"></xsl:output>
 
26
 
 
27
        <!-- omit any content unless specified explicitly -->
 
28
        <xsl:template match="@*|node()">
 
29
        </xsl:template>
 
30
 
 
31
        <!-- copy text -->
 
32
        <xsl:template match="text()">
 
33
                <xsl:copy />
 
34
        </xsl:template>
 
35
 
 
36
        <!-- copy attributes from allowed namespaces -->
 
37
        <xsl:template
 
38
                match="@anim:*|@chart:*|@config:*|@db:*|@dc:*|@dr3d:*|@draw:*|@form:*|@manifest:*|@meta:*|@number:*|@office:*|@presentation:*|@script:*|@table:*|@text:*|@style:*|@odf:*|@fo:*|@svg:*|@smil:*|@xlink:*|@xml:*">
 
39
                <xsl:copy />
 
40
        </xsl:template>
 
41
 
 
42
        <!-- copy elements from allowed namespaces -->
 
43
        <xsl:template
 
44
                match="anim:*|chart:*|config:*|db:*|dc:*|dr3d:*|draw:*|form:*|manifest:*|meta:*|number:*|office:*|presentation:*|script:*|table:*|text:*|style:*|odf:*|fo:*|svg:*|smil:*|xml:*">
 
45
                <xsl:copy>
 
46
                        <xsl:apply-templates select="@*|node()" />
 
47
                </xsl:copy>
 
48
        </xsl:template>
 
49
 
 
50
        <!-- if @office:process-content='true' or document is not ODF 1.2, the contents
 
51
                of a foreign element should not be processed -->
 
52
        <xsl:template
 
53
                match="*[@office:process-content='true' or ancestor::office:*[@office:version!='1.2']]">
 
54
                <xsl:copy>
 
55
                        <xsl:apply-templates select="@*|node()" />
 
56
                </xsl:copy>
 
57
        </xsl:template>
 
58
 
 
59
        <!-- TODO: implement the rule for foreign element beneath text:h and text:p
 
60
                in ODF 1.2 § 3.17 -->
 
61
</xsl:stylesheet>