Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


AVT.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(XALAN_AVT_HEADER_GUARD)
19 #define XALAN_AVT_HEADER_GUARD
20 
21 // Base include file. Must be first.
23 
24 
25 
27 
28 
29 
30 XALAN_DECLARE_XERCES_CLASS(Locator)
31 
32 
33 
34 XALAN_CPP_NAMESPACE_BEGIN
35 
36 
37 
38 typedef XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType;
39 XALAN_USING_XERCES(Locator)
40 
41 
42 
43 class AVTPart;
44 class PrefixResolver;
46 class XalanNode;
47 class StringTokenizer;
49 
50 
51 
52 /**
53  * Class to hold an Attribute Value Template.
54  */
55 class AVT
56 {
57 public:
58 
59 #if defined(XALAN_STRICT_ANSI_HEADERS)
60  typedef std::size_t size_type;
61 #else
62  typedef size_t size_type;
63 #endif
64 
65  /**
66  * Construct an Attribute Value Template(AVT) by parsing the string, and
67  * either constructing a vector of AVTParts, or simply hold on to the
68  * string if the AVT is simple.
69  *
70  * @param constructionContext context for construction of AVT
71  * @param locator the Locator for the AVT. May be null.
72  * @param name name of AVT
73  * @param stringedValue string value to parse
74  * @param resolver resolver for namespace resolution
75  */
76  AVT(
77  StylesheetConstructionContext& constructionContext,
78  const Locator* locator,
79  const XalanDOMChar* name,
80  const XalanDOMChar* stringedValue,
81  const PrefixResolver& resolver);
82 
83  virtual
84  ~AVT();
85 
86  /**
87  * Retrieve the name of the Attribute Value Template
88  *
89  * @return name of AVT
90  */
91  const XalanDOMString&
92  getName() const
93  {
94  return m_name;
95  }
96 
97  /**
98  * Append the value to the buffer.
99  *
100  * @param buf buffer to write into
101  * @param contextNode current context node
102  * @param prefixResolver prefix resolver to use
103  * @param executionContext execution context
104  */
105  void
107  XalanDOMString& buf,
108  XalanNode* contextNode,
109  const PrefixResolver& prefixResolver,
110  XPathExecutionContext& executionContext) const
111  {
112  if(m_simpleString != 0)
113  {
114  buf.assign(m_simpleString, m_simpleStringLength);
115  }
116  else
117  {
118  doEvaluate(buf, contextNode, prefixResolver, executionContext);
119  }
120  }
121 
122  /**
123  * Append the value to the buffer.
124  *
125  * @param buf buffer to write into
126  * @param prefixResolver prefix resolver to use
127  * @param executionContext execution context
128  */
129  void
131  XalanDOMString& buf,
132  const PrefixResolver& prefixResolver,
133  XPathExecutionContext& executionContext) const
134  {
135  if(m_simpleString != 0)
136  {
137  buf.assign(m_simpleString, m_simpleStringLength);
138  }
139  else
140  {
141  doEvaluate(buf, prefixResolver, executionContext);
142  }
143  }
144 
145 private:
146 
147  void
148  doEvaluate(
149  XalanDOMString& buf,
150  const PrefixResolver& prefixResolver,
151  XPathExecutionContext& executionContext) const;
152 
153  void
154  doEvaluate(
155  XalanDOMString& buf,
156  XalanNode* contextNode,
157  const PrefixResolver& prefixResolver,
158  XPathExecutionContext& executionContext) const;
159 
160  void
161  nextToken(
162  StylesheetConstructionContext& constructionContext,
163  const Locator* locator,
164  StringTokenizer& tokenizer,
165  XalanDOMString& token);
166 
167  // not implemented
168  AVT(const AVT&);
169 
170  AVT&
171  operator=(const AVT&);
172 
173  bool
174  operator==(const AVT&) const;
175 
176 
177  // Data members...
178  const AVTPart** m_parts;
179 
180  size_type m_partsSize;
181 
182  const XalanDOMChar* m_simpleString;
183 
184  XalanDOMString::size_type m_simpleStringLength;
185 
186  const XalanDOMString& m_name;
187 
188  static const XalanDOMString s_emptyString;
189 };
190 
191 
192 
193 XALAN_CPP_NAMESPACE_END
194 
195 
196 
197 #endif // XALAN_AVT_HEADER_GUARD
virtual ~AVT()
void evaluate(XalanDOMString &buf, XalanNode *contextNode, const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext) const
Append the value to the buffer.
Definition: AVT.hpp:106
void evaluate(XalanDOMString &buf, const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext) const
Append the value to the buffer.
Definition: AVT.hpp:130
XalanSize_t size_type
XalanDOMString & assign(const XalanDOMChar *theSource)
Class to hold a part, either a string or XPath, of an Attribute Value Template.
Definition: AVTPart.hpp:43
size_t size_type
Definition: AVT.hpp:62
Class to hold an Attribute Value Template.
Definition: AVT.hpp:55
const XalanDOMString & getName() const
Retrieve the name of the Attribute Value Template.
Definition: AVT.hpp:92
AVT(StylesheetConstructionContext &constructionContext, const Locator *locator, const XalanDOMChar *name, const XalanDOMChar *stringedValue, const PrefixResolver &resolver)
Construct an Attribute Value Template(AVT) by parsing the string, and either constructing a vector of...
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType
Definition: AVT.hpp:38
This class defines an interface for classes that resolve namespace prefixes to their URIs...
XALAN_CPP_NAMESPACE_BEGIN XALAN_USING_XERCES(Locator)

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