Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


XalanDocumentPrefixResolver.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(XALANDOCUMENTPREFIXRESOLVER_HEADER_GUARD_1357924680)
19 #define XALANDOCUMENTPREFIXRESOLVER_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base include file. Must be first.
25 
26 
27 
29 
30 
31 
34 
35 
36 
40 
41 
42 
44 
45 
46 
47 XALAN_CPP_NAMESPACE_BEGIN
48 
49 
50 
51 
52 
53 class XalanAttr;
55 
58 
59 
61 {
62 public:
63 
65  typedef XalanMap<const XalanDOMString*,
66  AttributeVectorType> NamespacesMapType;
67 
68  /**
69  * Constructor.
70  *
71  * @param theDocument The XalanDocument instance to use for namespace bindings.
72  * @param theURI The base URI for the instance. This is rarely needed, but can be provided if the URI for the XalanDocument instance is known.
73  */
75  const XalanDocument* theDocument,
76  const XalanDOMString& theURI = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
77  MemoryManager& theManager XALAN_DEFAULT_MEMMGR);
78 
79  virtual
81 
82 
83  virtual const XalanDOMString*
84  getNamespaceForPrefix(const XalanDOMString& prefix) const;
85 
86  virtual const XalanDOMString&
87  getURI() const;
88 
89  /**
90  * A utility class to walk the XalanDocument instance and look for attribute nodes that declare namespaces.
91  */
93  {
94  public:
95 
96  NamespaceNodesTreeWalker(NamespacesMapType& theMap);
97 
98  virtual
100 
101  protected:
102 
103  virtual bool
104  startNode(const XalanNode* node);
105 
106  virtual bool
107  startNode(XalanNode* node);
108 
109  virtual bool
110  endNode(const XalanNode* node);
111 
112  virtual bool
113  endNode(XalanNode* node);
114 
115  private:
116 
117  NamespacesMapType& m_map;
118  };
119 
120 
121 protected:
122 
123  /**
124  * This function is called when more than one binding exists for a given prefix.
125  * The default behavior uses the first binding, but a deriving class can change
126  * that behavior by overriding.
127  *
128  * @param theVector The vector associated with the namespace prefix.
129  * @return A pointer to a const XalanDOMString containing the desired binding, or NULL.
130  */
131  virtual const XalanDOMString*
132  duplicateBinding(const AttributeVectorType& theVector) const;
133 
134 private:
135 
136  NamespacesMapType m_namespaces;
137 
138  const XalanDOMString m_uri;
139 };
140 
141 
142 
143 XALAN_CPP_NAMESPACE_END
144 
145 
146 
147 #endif // XALANDOCUMENTPREFIXRESOLVER_HEADER_GUARD_1357924680
A utility class to walk the XalanDocument instance and look for attribute nodes that declare namespac...
#define XALAN_DEFAULT_MEMMGR
#define XALAN_DOMSUPPORT_EXPORT
AttributeVectorTypeDecl AttributeVectorType
static MemoryManager & getDummyMemMgr()
This class defines an interface for classes that resolve namespace prefixes to their URIs...
XalanMap< const XalanDOMString *, AttributeVectorType > NamespacesMapType
#define XALAN_USES_MEMORY_MANAGER(Type)
Xalan implementation of a hashtable.
Definition: XalanMap.hpp:186
XalanVector< const XalanNode * > AttributeVectorTypeDecl

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