Warning, /office/calligra/devtools/scripts/removeForeign.xsl is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" encoding="utf-8"?>
0002 <xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml"
0003         xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0"
0004         xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
0005         xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
0006         xmlns:db="urn:oasis:names:tc:opendocument:xmlns:database:1.0"
0007         xmlns:dc="http://purl.org/dc/elements/1.1/"
0008         xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
0009         xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
0010         xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"
0011         xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
0012         xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
0013         xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
0014         xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
0015         xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
0016         xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
0017         xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
0018         xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
0019         xmlns:odf="http://docs.oasis-open.org/ns/office/1.2/meta/odf#"
0020         xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
0021         xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
0022         xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0"
0023         xmlns:xlink="http://www.w3.org/1999/xlink">
0024         <xsl:output encoding="utf-8" indent="no" method="xml"
0025                 omit-xml-declaration="no"></xsl:output>
0026 
0027         <!-- omit any content unless specified explicitly -->
0028         <xsl:template match="@*|node()">
0029         </xsl:template>
0030 
0031         <!-- copy text -->
0032         <xsl:template match="text()">
0033                 <xsl:copy />
0034         </xsl:template>
0035 
0036         <!-- copy attributes from allowed namespaces -->
0037         <xsl:template
0038                 match="@anim:*|@chart:*|@config:*|@db:*|@dc:*|@dr3d:*|@draw:*|@form:*|@manifest:*|@meta:*|@number:*|@office:*|@presentation:*|@script:*|@table:*|@text:*|@style:*|@odf:*|@fo:*|@svg:*|@smil:*|@xlink:*|@xml:*">
0039                 <xsl:copy />
0040         </xsl:template>
0041 
0042         <!-- copy elements from allowed namespaces -->
0043         <xsl:template
0044                 match="anim:*|chart:*|config:*|db:*|dc:*|dr3d:*|draw:*|form:*|manifest:*|meta:*|number:*|office:*|presentation:*|script:*|table:*|text:*|style:*|odf:*|fo:*|svg:*|smil:*|xml:*">
0045                 <xsl:copy>
0046                         <xsl:apply-templates select="@*|node()" />
0047                 </xsl:copy>
0048         </xsl:template>
0049 
0050         <!-- if @office:process-content='true' or document is not ODF 1.2, the contents
0051                 of a foreign element should not be processed -->
0052         <xsl:template
0053                 match="*[@office:process-content='true' or ancestor::office:*[@office:version!='1.2']]">
0054                 <xsl:copy>
0055                         <xsl:apply-templates select="@*|node()" />
0056                 </xsl:copy>
0057         </xsl:template>
0058 
0059         <!-- TODO: implement the rule for foreign element beneath text:h and text:p
0060                 in ODF 1.2 ยง 3.17 -->
0061 </xsl:stylesheet>