00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one 00003 * or more contributor license agreements. See the NOTICE file 00004 * distributed with this work for additional information 00005 * regarding copyright ownership. The ASF licenses this file 00006 * to you under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 #if !defined(XERCESTOXALANNODEMAP_HEADER_GUARD_1357924680) 00019 #define XERCESTOXALANNODEMAP_HEADER_GUARD_1357924680 00020 00021 00022 00023 #include <xalanc/XercesParserLiaison/XercesParserLiaisonDefinitions.hpp> 00024 00025 00026 00027 #include <map> 00028 00029 00030 00031 #if XERCES_VERSION_MAJOR >= 2 00032 #include <xercesc/dom/deprecated/DOM_Node.hpp> 00033 #else 00034 #include <xercesc/dom/DOM_Node.hpp> 00035 #endif 00036 00037 00038 00039 #include <xalanc/XercesParserLiaison/Deprecated/XercesDOM_NodeHack.hpp> 00040 00041 00042 00043 XALAN_DECLARE_XERCES_CLASS(NodeImpl) 00044 00045 00046 00047 XALAN_CPP_NAMESPACE_BEGIN 00048 00049 00050 00051 class XalanNode; 00052 00053 00054 /** 00055 * This class is deprecated. 00056 * 00057 * @deprecated This class works with the deprecated Xerces DOM bridge. 00058 */ 00059 class XALAN_XERCESPARSERLIAISON_EXPORT XercesToXalanNodeMap 00060 { 00061 public: 00062 00063 typedef XERCES_CPP_NAMESPACE_QUALIFIER DOM_Node DOM_NodeType; 00064 typedef XERCES_CPP_NAMESPACE_QUALIFIER NodeImpl NodeImplType; 00065 00066 #if defined(XALAN_NO_STD_NAMESPACE) 00067 typedef map<XalanNode*, NodeImplType*, less<XalanNode*> > XalanNodeMapType; 00068 00069 typedef map<NodeImplType*, XalanNode*, less<NodeImplType*> > XercesNodeMapType; 00070 #else 00071 typedef std::map<XalanNode*, NodeImplType*> XalanNodeMapType; 00072 00073 typedef std::map<NodeImplType*, XalanNode*> XercesNodeMapType; 00074 #endif 00075 00076 XercesToXalanNodeMap(); 00077 00078 ~XercesToXalanNodeMap(); 00079 00080 void 00081 addAssociation( 00082 const DOM_NodeType& theXercesNode, 00083 XalanNode* theXalanNode); 00084 00085 void 00086 clear(); 00087 00088 XalanNode* 00089 getNode(const DOM_NodeType& theXercesNode) const 00090 { 00091 return getNode(XercesDOM_NodeHack::getImpl(theXercesNode)); 00092 } 00093 00094 XalanNode* 00095 getNode(NodeImplType* theXercesNodeImpl) const 00096 { 00097 const XercesNodeMapType::const_iterator i = 00098 m_xercesMap.find(theXercesNodeImpl); 00099 00100 if (i == m_xercesMap.end()) 00101 { 00102 return 0; 00103 } 00104 else 00105 { 00106 return (*i).second; 00107 } 00108 } 00109 00110 DOM_NodeType 00111 getNode(const XalanNode* theXalanNode) const 00112 { 00113 return XercesDOM_NodeHack(getNodeImpl(theXalanNode)); 00114 } 00115 00116 NodeImplType* 00117 getNodeImpl(const XalanNode* theXalanNode) const; 00118 00119 class NameMapEqualsFunctor 00120 { 00121 public: 00122 00123 NameMapEqualsFunctor(const XalanNode* theXalanNode) : 00124 m_value(theXalanNode) 00125 { 00126 } 00127 00128 bool 00129 operator()(const XercesNodeMapType::value_type& thePair) const 00130 { 00131 return m_value == thePair.second; 00132 } 00133 00134 private: 00135 00136 const XalanNode* m_value; 00137 }; 00138 00139 NodeImplType* 00140 getNodeImpl(const DOM_NodeType& theXercesNode) const 00141 { 00142 return XercesDOM_NodeHack::getImpl(theXercesNode); 00143 } 00144 00145 private: 00146 00147 XalanNodeMapType m_xalanMap; 00148 00149 XercesNodeMapType m_xercesMap; 00150 }; 00151 00152 00153 00154 XALAN_CPP_NAMESPACE_END 00155 00156 00157 00158 #endif // !defined(XERCESTOXALANNODEMAP_HEADER_GUARD_1357924680)
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11 |
|