Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

FormatterToHTML.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #if !defined(FORMATTERTOHTML_HEADER_GUARD_1357924680)
17 #define FORMATTERTOHTML_HEADER_GUARD_1357924680
18 
19 
20 
21 // Base include file. Must be first.
23 
24 
25 
27 
28 
29 
30 // Base class header file.
32 
33 
34 
36 
37 
38 
40 
41 
42 
43 XALAN_CPP_NAMESPACE_BEGIN
44 
45 
46 
51 {
52 
53 public:
54 
55 
57 
58 
59  enum
60  {
61  eDefaultIndentAmount = 0
62  };
63 
76  Writer& writer,
81  bool doIndent = true,
82  int indent = eDefaultIndentAmount,
83  bool escapeURLs = true,
84  bool omitMetaTag = false,
86 
87  static FormatterToHTML*
88  create(
89  MemoryManagerType& theManager,
90  Writer& writer,
91  const XalanDOMString& encoding,
92  const XalanDOMString& mediaType,
93  const XalanDOMString& doctypeSystem,
94  const XalanDOMString& doctypePublic,
95  bool doIndent,
96  int indent,
97  bool escapeURLs,
98  bool omitMetaTag);
99  virtual
100  ~FormatterToHTML();
101 
102  // These methods are inherited from DocumentHandler ...
103 
104  virtual void
105  startDocument();
106 
107  virtual void
108  endDocument();
109 
110  virtual void
111  startElement(
112  const XMLCh* const name,
113  AttributeListType& attrs);
114 
115  virtual void
116  endElement(const XMLCh* const name);
117 
118  virtual void
119  characters(
120  const XMLCh* const chars,
121  const unsigned int length);
122 
123  // These methods are inherited from FormatterToXML...
124 
125  virtual bool
127  XalanDOMChar ch,
128  bool escLF);
129 
130  // These methods are inherited from FormatterListener ...
131 
132  virtual void
133  entityReference(const XMLCh* const name);
134 
135  virtual void
136  cdata(
137  const XMLCh* const ch,
138  const unsigned int length);
139 
140  virtual void
142  const XMLCh* const target,
143  const XMLCh* const data);
144 
145 
146  bool
148  {
149  return m_escapeURLs;
150  }
151 
152  void
153  setEscapeURLs(bool flag)
154  {
155  m_escapeURLs = flag;
156  }
157 
158  struct Entity
159  {
160  enum { eMaxLength = 8 };
161 
162  XalanDOMChar m_char;
163 
165 
166  XalanDOMChar m_string[eMaxLength + 1];
167  };
168 
169 protected:
170 
171  virtual void
173  const XalanDOMChar* theString,
174  XalanDOMString::size_type theStringLength);
175 
176  virtual void
177  accumCommentData(const XalanDOMChar* data);
178 
179  void
180  writeCharacters(const XalanDOMString& theString);
181 
182  void
183  writeCharacters(
184  const XalanDOMChar* theString,
185  XalanDOMString::size_type theLength);
186 
187 private:
188 
190 
194  static const XalanDOMChar s_doctypeHeaderStartString[];
195 
196  static const size_type s_doctypeHeaderStartStringLength;
197 
201  static const XalanDOMChar s_doctypeHeaderPublicString[];
202 
203  static const size_type s_doctypeHeaderPublicStringLength;
204 
208  static const XalanDOMChar s_doctypeHeaderSystemString[];
209 
210  static const size_type s_doctypeHeaderSystemStringLength;
211 
215  static const XalanDOMChar s_metaString[];
216 
217  static const size_type s_metaStringLength;
218 
222  void
224 
228  void
229  initCharsMap();
230 
231  void
232  copyEntityIntoBuffer(
233  const XalanDOMChar* s,
234  XalanDOMString::size_type theLength);
235 
236  void
237  copyEntityIntoBuffer(const XalanDOMString& s);
238 
244  virtual void
245  processAttribute(
246  const XalanDOMChar* name,
247  const XalanDOMChar* value,
248  const XalanHTMLElementsProperties::ElementProperties& elemProperties);
249 
257  void
258  writeAttrURI(
259  const XalanDOMChar* theString,
260  XalanDOMString::size_type theStringLength);
261 
269  void
270  accumHexNumber(XalanDOMChar theChar);
271 
272  bool
273  popHasNamespace();
274 
275  bool
276  pushHasNamespace(const XalanDOMChar* theElementName);
277 
278  // Data members...
279  XalanDOMString m_currentElementName;
280 
281  bool m_inBlockElem;
282 
283  BoolStackType m_isRawStack;
284 
285  bool m_isScriptOrStyleElem;
286 
287  BoolStackType m_inScriptElemStack;
288 
289  bool m_escapeURLs;
290 
295  bool m_isFirstElement;
296 
300  bool m_isUTF8;
301 
305  int m_elementLevel;
306 
311  BoolStackType m_hasNamespaceStack;
312 
316  bool m_omitMetaTag;
317 
318  ElementPropertiesStackType m_elementPropertiesStack;
319 
320  static const XalanDOMString s_emptyString;
321 
322  static const Entity s_entities[];
323 
324  static const Entity* const s_lastEntity;
325 };
326 
327 
328 
329 XALAN_CPP_NAMESPACE_END
330 
331 
332 
333 #endif // FORMATTERTOHTML_HEADER_GUARD_1357924680
XalanVector< XalanHTMLElementsProperties::ElementProperties > ElementPropertiesStackType
Definition: FormatterToHTML.hpp:56
Definition: FormatterToHTML.hpp:158
static const XalanDOMString s_emptyString
Definition: FormatterListener.hpp:283
XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType
Definition: AttributeListImpl.hpp:39
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType
Definition: XalanMemoryManagement.hpp:39
virtual void endDocument()
Definition: Writer.hpp:42
virtual bool accumDefaultEntity(XalanDOMChar ch, bool escLF)
Handle one of the default entities, return false if it is not a default entity.
void setEscapeURLs(bool flag)
Definition: FormatterToHTML.hpp:153
void initAttrCharsMap()
Set the attribute characters what will require special mapping.
XalanDOMString::size_type m_length
Definition: FormatterToHTML.hpp:164
virtual void writeAttrString(const XalanDOMChar *theString, XalanDOMString::size_type theStringLength)
Write an attribute string.
virtual void startDocument()
#define XALAN_DEFAULT_MEMMGR
Definition: XalanMemoryManagement.hpp:402
virtual void cdata(const XMLCh *const ch, const unsigned int length)
Receive notification of cdata.
static MemoryManager & getDummyMemMgr()
#define XALAN_XMLSUPPORT_EXPORT
Definition: XMLSupportDefinitions.hpp:33
static FormatterToXML * create(MemoryManagerType &theManager, Writer &writer, const XalanDOMString &version=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), bool doIndent=false, int indent=eDefaultIndentAmount, const XalanDOMString &encoding=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), const XalanDOMString &mediaType=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), const XalanDOMString &doctypeSystem=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), const XalanDOMString &doctypePublic=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), bool xmlDecl=true, const XalanDOMString &standalone=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), eFormat format=OUTPUT_METHOD_XML, bool fBufferData=true)
virtual void characters(const XMLCh *const chars, const unsigned int length)
XALAN_CPP_NAMESPACE_BEGIN typedef size_t size_type
Definition: XalanMap.hpp:44
This class acts as a proxy for and InternalElementProperties instance.
Definition: XalanHTMLElementsProperties.hpp:150
virtual void accumCommentData(const XalanDOMChar *data)
Write the data for a comment.
FormatterToXML formats SAX-style events into XML.
Definition: FormatterToXML.hpp:57
virtual void startElement(const XMLCh *const name, AttributeListType &attrs)
XalanDOMChar m_char
Definition: FormatterToHTML.hpp:162
Definition: XalanDOMString.hpp:42
virtual void entityReference(const XMLCh *const name)
Receive notification of a entityReference.
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
Definition: DOMStringHelper.hpp:277
virtual void endElement(const XMLCh *const name)
unsigned int size_type
Definition: XalanDOMString.hpp:53
void initCharsMap()
Set the output characters what will require special mapping.
bool getEscapeURLs() const
Definition: FormatterToHTML.hpp:147
FormatterToHTML formats SAX-style events into HTML.
Definition: FormatterToHTML.hpp:50
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)

Interpreting class diagrams

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

dot

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

Apache Logo