Main Page
Namespaces
Classes
Files
Examples
File List
File Members
include
xqilla
events
NSFixupFilter.hpp
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2001, 2008,
3
* DecisionSoft Limited. All rights reserved.
4
* Copyright (c) 2004, 2011,
5
* Oracle and/or its affiliates. All rights reserved.
6
*
7
* Licensed under the Apache License, Version 2.0 (the "License");
8
* you may not use this file except in compliance with the License.
9
* 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, software
14
* distributed under the License is distributed on an "AS IS" BASIS,
15
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
* See the License for the specific language governing permissions and
17
* limitations under the License.
18
*/
19
20
#ifndef _NSFIXUPFILTER_HPP
21
#define _NSFIXUPFILTER_HPP
22
23
#include <
xqilla/events/EventHandler.hpp
>
24
25
class
XPath2MemoryManager
;
26
27
class
XQILLA_API
NSFixupFilter
:
public
EventFilter
28
{
29
public
:
30
NSFixupFilter
(
EventHandler
*next,
XPath2MemoryManager
*mm);
31
~
NSFixupFilter
();
32
33
virtual
void
startDocumentEvent
(
const
XMLCh *documentURI,
const
XMLCh *encoding);
34
virtual
void
endDocumentEvent
();
35
virtual
void
startElementEvent
(
const
XMLCh *prefix,
const
XMLCh *uri,
const
XMLCh *localname);
36
virtual
void
endElementEvent
(
const
XMLCh *prefix,
const
XMLCh *uri,
const
XMLCh *localname,
37
const
XMLCh *typeURI,
const
XMLCh *typeName);
38
virtual
void
attributeEvent
(
const
XMLCh *prefix,
const
XMLCh *uri,
const
XMLCh *localname,
const
XMLCh *value,
39
const
XMLCh *typeURI,
const
XMLCh *typeName);
40
virtual
void
namespaceEvent
(
const
XMLCh *prefix,
const
XMLCh *uri);
41
42
private
:
43
struct
ElemEntry {
44
void
set
(
const
XMLCh *p, ElemEntry *pr)
45
{ prefix = p; prev = pr; }
46
47
const
XMLCh *prefix;
48
ElemEntry *prev;
49
};
50
51
struct
NSEntry {
52
void
set
(
const
XMLCh *p,
const
XMLCh *u,
unsigned
int
l, NSEntry *pr)
53
{ prefix = p; uri = u; level = l; prev = pr; }
54
55
const
XMLCh *prefix;
56
const
XMLCh *uri;
57
unsigned
int
level;
58
59
NSEntry *prev;
60
};
61
62
NSEntry *findPrefix(
const
XMLCh *prefix);
64
bool
definePrefix(
const
XMLCh *&prefix,
const
XMLCh *uri,
bool
attr =
false
,
bool
redefine =
true
);
65
66
XPath2MemoryManager
*mm_;
67
unsigned
int
level_;
68
ElemEntry *elements_;
69
NSEntry *namespaces_;
70
};
71
72
#endif
Generated on Thu Jun 12 2014 19:56:33 for XQilla Simple API by
1.8.3.1