2 # This file is part of the LibreOffice project.
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # This file incorporates work covered by the following license notice:
10 # Licensed to the Apache Software Foundation (ASF) under one or more
11 # contributor license agreements. See the NOTICE file distributed
12 # with this work for additional information regarding copyright
13 # ownership. The ASF licenses this file to you under the Apache
14 # License, Version 2.0 (the "License"); you may not use this file
15 # except in compliance with the License. You may obtain a copy of
16 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 <xsl:stylesheet version="1.0"
24 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
25 <xsl:output method="xml"/>
27 <xsl:include href="./modelpreprocess.xsl"/>
29 <xsl:template match="namespace-alias[\@id]">
30 <xsl:variable name="value">
31 <xsl:call-template name="getnamespaceid">
32 <xsl:with-param name="id" select="\@id" />
36 <xsl:apply-templates select="@*"/>
37 <xsl:attribute name="id">
38 <xsl:value-of select="\$value"/>
43 <xsl:template name="getnamespaceid">
44 <xsl:param name='id'/>
50 open ( NAMESPACES
, $ARGV0 ) || die "can't open namespace file: $!";
51 while ( <NAMESPACES
> )
54 # line format is: numeric-id short-name namespace-URL
55 $_ =~ /^([0-9]+)\s+([a-zA-Z]+)\s+([a-zA-Z0-9-.:\/]+)\s
*$/ or die "Error: invalid character in input data";
57 <xsl:when test="\$id = '$2'">
58 <xsl:text>$1</xsl:text>