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/.
10 # take a .zip containing a flat hierarchy of odf files and strip out the
11 # language and country tags in each of them and repack it all up
12 # should convert templates so that documents based on them use
13 # the default-document-language rather than the hardcoded lang-tag
15 # All a bit hacky, but it should work
17 if [ -z "$CALLXSLTPROC" ]; then
18 echo "$0: \$CALLXSLTPROC not defined!"
19 echo "$0: Apparently we are not called from the build process, bailing out."
25 XSL
=`mktemp /tmp/${tempfoo}.XXXXXX`
27 echo "$0: Can't create temp file, exiting..."
31 # On Windows, xsltproc is a non-Cygwin program, so we can't pass
32 # a Cygwin /tmp path to it
33 [ "$COM" == MSC
] && XSL
=`cygpath -m -s $XSL`
35 WRKDIR
=`mktemp -d /tmp/${tempfoo}.XXXXXX`
37 echo "$0: Can't create temp dir, exiting..."
42 <?xml version="1.0" encoding="UTF-8"?>
43 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
45 <xsl:template match="node()|@*">
47 <xsl:apply-templates select="@*|node()"/>
51 <xsl:template match="@fo:language"/>
52 <xsl:template match="@fo:country"/>
53 <xsl:template match="@fo:script"/>
54 <xsl:template match="@number:rfc-language-tag"/>
55 <xsl:template match="@style:rfc-language-tag"/>
56 <xsl:template match="@table:rfc-language-tag"/>
57 <xsl:template match="@style:rfc-language-tag-asian"/>
58 <xsl:template match="@style:rfc-language-tag-complex"/>
63 unzip -q $1 -d $WRKDIR
66 unzip -qc $a styles.xml
> styles.tmp
67 eval "$CALLXSLTPROC -o styles.xml $XSL styles.tmp"
69 rm styles.xml styles.tmp