LibreOffice Module xmloff (master)  1
DomBuilderContext.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_XMLOFF_INC_DOMBUILDERCONTEXT_HXX
21 #define INCLUDED_XMLOFF_INC_DOMBUILDERCONTEXT_HXX
22 
23 #include <xmloff/xmlictxt.hxx>
24 
25 
26 // forward declarations
27 
28 
29 namespace com::sun::star {
30  namespace xml::dom {
31  class XNode;
32  class XDocument;
33  }
34  namespace xml::sax {
35  class XAttributeList;
36  }
37 }
38 class SvXMLImport;
39 class SvXMLImportContext;
40 
45 {
46  css::uno::Reference<css::xml::dom::XNode> mxNode;
47 
48  void HandleAttributes(const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs);
49 
50 public:
51 
54  sal_Int32 nElement );
56  const OUString & Namespace, const OUString & Name );
57 
60  sal_Int32 nElement,
61  css::uno::Reference<css::xml::dom::XNode> const & );
64  const OUString & Namespace, const OUString & Name,
65  css::uno::Reference<css::xml::dom::XNode> const & );
66 
67  virtual ~DomBuilderContext() override;
68 
69 
70  // access to the DOM tree
71 
72 
74  css::uno::Reference<css::xml::dom::XDocument> getTree();
75 
76 
77  // implement SvXMLImportContext methods:
78 
79  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
80  sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
81  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createUnknownChildContext(
82  const OUString& Namespace, const OUString& Name,
83  const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs ) override;
84 
85  virtual void SAL_CALL startFastElement(
86  sal_Int32 nElement,
87  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
88  virtual void SAL_CALL startUnknownElement(const OUString & Namespace, const OUString & Name,
89  const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs) override;
90 
91  virtual void SAL_CALL characters( const OUString& rChars ) override;
92 };
93 
94 #endif
95 
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void HandleAttributes(const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs)
DomBuilderContext creates a DOM tree suitable for in-memory processing of XML data from a sequence of...
DomBuilderContext(SvXMLImport &rImport, sal_Int32 nElement)
default constructor: create new DOM tree
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createUnknownChildContext(const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:45
virtual ~DomBuilderContext() override
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
virtual void SAL_CALL startUnknownElement(const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
css::uno::Reference< css::xml::dom::XDocument > getTree()
access the DOM tree
css::uno::Reference< css::xml::dom::XNode > mxNode
virtual void SAL_CALL characters(const OUString &rChars) override
This method is called for all characters that are contained in the current element.