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 from __future__
import print_function
15 class ContentHandler(xml
.sax
.handler
.ContentHandler
):
20 def startDocument(self
):
24 THIS FILE IS GENERATED AUTOMATICALLY! DO NOT EDIT!
29 #ifndef INCLUDED_OOXML_RESOURCEIDS_HXX
30 #define INCLUDED_OOXML_RESOURCEIDS_HXX
32 #include <dmapper/resourcemodel.hxx>
34 namespace writerfilter {
39 def endDocument(self
):
44 #endif // INCLUDED_OOXML_RESOURCEIDS_HXX""")
46 def startElement(self
, name
, attrs
):
47 for k
, v
in attrs
.items():
48 if k
in ("tokenid", "sendtokenid"):
49 if v
.startswith("ooxml:"):
50 token
= v
.replace('ooxml:', '')
51 if token
not in self
.tokens
:
52 print(" const Id LN_%s = %s;" % (token
, self
.counter
))
53 self
.tokens
.append(token
)
57 parser
= xml
.sax
.make_parser()
58 parser
.setContentHandler(ContentHandler())
59 parser
.parse(sys
.argv
[1])
61 # vim:set shiftwidth=4 softtabstop=4 expandtab: