Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

StylesheetRoot.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(XALAN_STYLESHEETROOT_HEADER_GUARD)
17 #define XALAN_STYLESHEETROOT_HEADER_GUARD
18 
19 
20 
21 // Base include file. Must be first.
22 #include "XSLTDefinitions.hpp"
23 
24 
25 
26 #include "Stylesheet.hpp"
27 
28 
29 
32 
33 
34 
36 
37 
38 
40 
41 
42 
43 XALAN_CPP_NAMESPACE_BEGIN
44 
45 
46 
47 class ElemAttributeSet;
49 class XalanText;
51 
52 
55 
56 
62 {
63 public:
64 
66 
68 
69  typedef XalanMap<const XalanQName*,
70  AttributeSetVectorType> AttributeSetMapType;
71 
79  const XalanDOMString& baseIdentifier,
80  StylesheetConstructionContext& constructionContext);
81 
82  virtual
83  ~StylesheetRoot();
84 
85  static StylesheetRoot*
86  create(
87  MemoryManagerType& theManager,
88  const XalanDOMString& baseIdentifier,
89  StylesheetConstructionContext& constructionContext);
90 
93  {
94  return m_version.getMemoryManager();
95  }
99  virtual void
100  postConstruction(StylesheetConstructionContext& constructionContext);
101 
109  void
110  process(
111  XalanNode* sourceTree,
112  XSLTResultTarget& outputTarget,
113  StylesheetExecutionContext& executionContext) const;
114 
128  setupFormatterListener(
129  XSLTResultTarget& outputTarget,
130  StylesheetExecutionContext& executionContext) const;
131 
140  {
141  return m_outputMethod;
142  }
143 
144  bool
146  {
147  return getOutputMethod() == FormatterListener::OUTPUT_METHOD_NONE ? false : true;
148  }
149 
158  {
159  theResult.assign(m_version);
160 
161  return theResult;
162  }
163 
170  bool
172  {
173  return m_indentResult == eIndentNoImplicit ||
174  m_indentResult == eIndentNoExplicit ? false : true;
175  }
176 
185  bool
187  {
188  return m_indentResult == eIndentNoExplicit ? false : true;
189  }
190 
199  {
200  theResult.assign(m_encoding);
201 
202  return theResult;
203  }
204 
213  {
214  theResult.assign(m_mediatype);
215 
216  return theResult;
217  }
218 
227  {
228  theResult.assign(m_doctypeSystem);
229 
230  return theResult;
231  }
232 
241  {
242  theResult.assign(m_doctypePublic);
243 
244  return theResult;
245  }
246 
252  bool
254  {
255  return m_omitxmlDecl;
256  }
257 
266  {
267  theResult.assign(m_standalone);
268 
269  return theResult;
270  }
271 
279  {
280  return m_defaultTextRule;
281  }
282 
290  {
291  return m_defaultRule;
292  }
293 
301  {
302  return m_defaultRootRule;
303  }
304 
312  void
313  processOutputSpec(
314  const XalanDOMChar* name,
315  const AttributeListType& atts,
316  StylesheetConstructionContext& constructionContext);
317 
323  URLStackType&
325  {
326  return m_importStack;
327  }
328 
334  const URLStackType&
336  {
337  return m_importStack;
338  }
339 
345  void
346  setIndentResult(bool bIndent)
347  {
348  m_indentResult = bIndent == true ? eIndentYesExplicit : eIndentNoExplicit;
349  }
350 
357  void
359  {
360  m_outputMethod = meth;
361  }
362 
363  bool
365  {
366  assert(m_hasCDATASectionElems == false && m_cdataSectionElems.empty() == true ||
367  m_hasCDATASectionElems == true && m_cdataSectionElems.empty() == false);
368 
369  return m_hasCDATASectionElems;
370  }
371 
379  bool
380  isCDATASectionElementName(const XalanQName& theQName) const;
381 
394  void
395  getNodeSetByKey(
396  XalanDocument* doc,
397  const XalanQName& qname,
398  const XalanDOMString& ref,
399  const PrefixResolver& resolver,
400  MutableNodeRefList& nodelist,
401  StylesheetExecutionContext& executionContext,
402  KeyTablesTableType& theKeysTable) const;
403 
404  unsigned long
406  {
407  return m_elemNumberNextID++;
408  }
409 
410  unsigned long
412  {
413  return m_elemNumberNextID;
414  }
415 
416  bool
418  {
419  return m_whitespaceElements.empty() == false;
420  }
421 
422  bool
423  shouldStripSourceNode(const XalanText& textNode) const;
424 
425  void
426  addAttributeSet(ElemAttributeSet& theAttributeSet);
427 
428 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
429 
438  const ElemAttributeSet*
439  getAttributeSet(
440  StylesheetExecutionContext& theExecutionContext,
441  const XalanQName& theQName,
442  size_type matchingIndex,
443  const LocatorType* theLocator) const;
444 #else
445  void
446  executeAttributeSet(
447  StylesheetExecutionContext& theExecutionContext,
448  const XalanQName& theQName,
449  const LocatorType* theLocator) const;
450 #endif
451 
452 
453 private:
454 
462  const XalanDOMString&
463  getEncoding(const XSLTResultTarget& outputTarget) const;
464 
470  void
471  initDefaultRule(StylesheetConstructionContext& constructionContext);
472 
477  XalanDOMString m_version;
478 
479  enum eIndentType { eIndentNoImplicit, eIndentNoExplicit, eIndentYesImplicit, eIndentYesExplicit };
480 
485  eIndentType m_indentResult;
486 
491  XalanDOMString m_encoding;
492 
497  XalanDOMString m_mediatype;
498 
504  XalanDOMString m_doctypeSystem;
505 
514  XalanDOMString m_doctypePublic;
515 
519  bool m_omitxmlDecl;
520 
524  XalanDOMString m_standalone;
525 
530  XalanDOMString m_resultNameSpaceURL;
531 
535  FormatterListener::eFormat m_outputMethod;
536 
541  XalanQNameVectorType m_cdataSectionElems;
542 
543  bool m_hasCDATASectionElems;
544 
549  URLStackType m_importStack;
550 
551 
556  ElemTemplateElement* m_defaultTextRule;
557 
562  ElemTemplateElement* m_defaultRule;
563 
568  ElemTemplateElement* m_defaultRootRule;
569 
573  bool m_needToBuildKeysTable;
574 
578  bool m_outputEscapeURLs;
579 
583  int m_indentAmount;
584 
588  bool m_omitMETATag;
589 
593  unsigned long m_elemNumberNextID;
594 
598  AttributeSetMapType m_attributeSetsMap;
599 
600 
601  // Not implemented...
603 
605  operator=(const StylesheetRoot&);
606 
607  bool
608  operator==(const StylesheetRoot&) const;
609 };
610 
611 
612 
613 XALAN_CPP_NAMESPACE_END
614 
615 
616 
617 #endif // XALAN_STYLESHEETROOT_HEADER_GUARD

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