Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


XercesToXalanNodeMap.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #if !defined(XERCESTOXALANNODEMAP_HEADER_GUARD_1357924680)
19 #define XERCESTOXALANNODEMAP_HEADER_GUARD_1357924680
20 
21 
22 
24 
25 
26 
27 #include <map>
28 
29 
30 
31 #if XERCES_VERSION_MAJOR >= 2
32 #include <xercesc/dom/deprecated/DOM_Node.hpp>
33 #else
34 #include <xercesc/dom/DOM_Node.hpp>
35 #endif
36 
37 
38 
40 
41 
42 
43 XALAN_DECLARE_XERCES_CLASS(NodeImpl)
44 
45 
46 
47 XALAN_CPP_NAMESPACE_BEGIN
48 
49 
50 
51 class XalanNode;
52 
53 
54 /**
55  * This class is deprecated.
56  *
57  * @deprecated This class works with the deprecated Xerces DOM bridge.
58  */
60 {
61 public:
62 
63  typedef XERCES_CPP_NAMESPACE_QUALIFIER DOM_Node DOM_NodeType;
64  typedef XERCES_CPP_NAMESPACE_QUALIFIER NodeImpl NodeImplType;
65 
66 #if defined(XALAN_NO_STD_NAMESPACE)
67  typedef map<XalanNode*, NodeImplType*, less<XalanNode*> > XalanNodeMapType;
68 
69  typedef map<NodeImplType*, XalanNode*, less<NodeImplType*> > XercesNodeMapType;
70 #else
71  typedef std::map<XalanNode*, NodeImplType*> XalanNodeMapType;
72 
73  typedef std::map<NodeImplType*, XalanNode*> XercesNodeMapType;
74 #endif
75 
77 
79 
80  void
81  addAssociation(
82  const DOM_NodeType& theXercesNode,
83  XalanNode* theXalanNode);
84 
85  void
86  clear();
87 
88  XalanNode*
89  getNode(const DOM_NodeType& theXercesNode) const
90  {
91  return getNode(XercesDOM_NodeHack::getImpl(theXercesNode));
92  }
93 
94  XalanNode*
95  getNode(NodeImplType* theXercesNodeImpl) const
96  {
97  const XercesNodeMapType::const_iterator i =
98  m_xercesMap.find(theXercesNodeImpl);
99 
100  if (i == m_xercesMap.end())
101  {
102  return 0;
103  }
104  else
105  {
106  return (*i).second;
107  }
108  }
109 
110  DOM_NodeType
111  getNode(const XalanNode* theXalanNode) const
112  {
113  return XercesDOM_NodeHack(getNodeImpl(theXalanNode));
114  }
115 
116  NodeImplType*
117  getNodeImpl(const XalanNode* theXalanNode) const;
118 
120  {
121  public:
122 
123  NameMapEqualsFunctor(const XalanNode* theXalanNode) :
124  m_value(theXalanNode)
125  {
126  }
127 
128  bool
129  operator()(const XercesNodeMapType::value_type& thePair) const
130  {
131  return m_value == thePair.second;
132  }
133 
134  private:
135 
136  const XalanNode* m_value;
137  };
138 
139  NodeImplType*
140  getNodeImpl(const DOM_NodeType& theXercesNode) const
141  {
142  return XercesDOM_NodeHack::getImpl(theXercesNode);
143  }
144 
145 private:
146 
147  XalanNodeMapType m_xalanMap;
148 
149  XercesNodeMapType m_xercesMap;
150 };
151 
152 
153 
154 XALAN_CPP_NAMESPACE_END
155 
156 
157 
158 #endif // !defined(XERCESTOXALANNODEMAP_HEADER_GUARD_1357924680)
XalanNode * getNode(NodeImplType *theXercesNodeImpl) const
DOM_NodeType getNode(const XalanNode *theXalanNode) const
NodeImplType * getImpl() const
#define XALAN_XERCESPARSERLIAISON_EXPORT
void clear(XalanDOMString &theString)
Remove all elements from target string.
std::map< NodeImplType *, XalanNode * > XercesNodeMapType
This class is deprecated.
NameMapEqualsFunctor(const XalanNode *theXalanNode)
std::map< XalanNode *, NodeImplType * > XalanNodeMapType
NodeImplType * getNodeImpl(const DOM_NodeType &theXercesNode) const
XERCES_CPP_NAMESPACE_QUALIFIER NodeImpl NodeImplType
XERCES_CPP_NAMESPACE_QUALIFIER DOM_Node DOM_NodeType
XalanNode * getNode(const DOM_NodeType &theXercesNode) const
bool operator()(const XercesNodeMapType::value_type &thePair) const
This class is deprecated.

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.11
Copyright © 1999-2012 The Apache Software Foundation.
All Rights Reserved.

Apache Logo