1<!--*********************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 ***********************************************************--> 21 22 23<xsl:stylesheet 24 version="1.0" 25 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 26 xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 27 xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 28 xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 29 xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 30 xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 31 xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 32 xmlns:xlink="http://www.w3.org/1999/xlink" 33 xmlns:dc="http://purl.org/dc/elements/1.1/" 34 xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 35 xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 36 xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 37 xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 38 xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 39 xmlns:math="http://www.w3.org/1998/Math/MathML" 40 xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 41 xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 42 xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 43 xmlns:ooo="http://openoffice.org/2004/office" 44 xmlns:ooow="http://openoffice.org/2004/writer" 45 xmlns:oooc="http://openoffice.org/2004/calc" 46 xmlns:dom="http://www.w3.org/2001/xml-events" 47 xmlns:xforms="http://www.w3.org/2002/xforms" 48 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 49 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 50 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 51 xmlns:rng="http://relaxng.org/ns/structure/1.0" 52 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" 53 xmlns:xalan="http://xml.apache.org/xalan" 54 xmlns:UML = 'org.omg.xmi.namespace.UML' 55 exclude-result-prefixes = "xalan" 56 xml:space="default"> 57 <xsl:output method="text" /> 58 59 <xsl:include href="factorytools.xsl"/> 60 61 <!-- 62 Generates input for gperf to genreate hash map for OOXMLFastTokenHandler 63 --> 64 <xsl:template name="gperfinputfasttokenhandler"> 65 <xsl:text> 66%{ 67#include "OOXMLFastTokens.hxx" 68 69namespace writerfilter { namespace ooxml { namespace tokenmap { 70%} 71struct token { const char * name; Token_t nToken; }; 72%%</xsl:text> 73 <xsl:for-each select=".//rng:element|.//rng:attribute"> 74 <xsl:if test="generate-id(.) = generate-id(key('same-token-name', @localname)[1])"> 75 <xsl:text>
</xsl:text> 76 <xsl:value-of select="@localname"/> 77 <xsl:text>, </xsl:text> 78 <xsl:call-template name="fastlocalname"/> 79 </xsl:if> 80 </xsl:for-each> 81 <xsl:text> 82%%
</xsl:text> 83}}}
</xsl:template> 84 85 <xsl:template match="/"> 86 <xsl:call-template name="gperfinputfasttokenhandler"/> 87 </xsl:template> 88 89</xsl:stylesheet>