Xalan-C++ API Reference  1.12.0
ElemEmpty.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_ELEMEMPTY_HEADER_GUARD)
19 #define XALAN_ELEMEMPTY_HEADER_GUARD
20 
21 /**
22  * Simple empty elem to push on the stack when nothing
23  * else got pushed, so that pop() works correctly.
24  */
25 
26 // Base include file. Must be first.
27 #include "XSLTDefinitions.hpp"
28 
29 
30 
31 // Base class header file.
32 #include "ElemTemplateElement.hpp"
33 
34 
35 
36 namespace XALAN_CPP_NAMESPACE {
37 
38 
39 
41 {
42 public:
43 
44  /**
45  * Construct an object corresponding to an empty element
46  *
47  * @param constructionContext context for construction of object
48  * @param stylesheetTree stylesheet containing element
49  * @param lineNumber line number in document
50  * @param columnNumber column number in document
51  * @param elementName The element name for which this instance is representing
52  */
53  ElemEmpty(
54  StylesheetConstructionContext& constructionContext,
55  Stylesheet& stylesheetTree,
56  XalanFileLoc lineNumber,
57  XalanFileLoc columnNumber,
58  const XalanDOMString* elementName = 0);
59 
60  /**
61  * Construct an object corresponding to an empty element. This
62  * constructor is used for surrogate empty elements that do not
63  * need namespace contexts and Locator information, etc.
64  *
65  * @param constructionContext context for construction of object
66  * @param stylesheetTree stylesheet containing element
67  * @param elementName The element name for which this instance is representing
68  */
69  ElemEmpty(
70  StylesheetConstructionContext& constructionContext,
71  Stylesheet& stylesheetTree,
72  const XalanDOMString* elementName = 0);
73 
74  virtual
75  ~ElemEmpty();
76 
77  // These methods are inherited from ElemTemplateElement ...
78 
79  virtual const XalanDOMString&
80  getElementName() const;
81 
82 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
83  virtual const ElemTemplateElement*
84  startElement(StylesheetExecutionContext& executionContext) const;
85 #else
86  virtual void
87  execute(StylesheetExecutionContext& executionContext) const;
88 #endif
89 
90 protected:
91 
92  virtual bool
93  childTypeAllowed(int xslToken) const;
94 
95 private:
96 
97  const XalanDOMString* const m_elementName;
98 };
99 
100 
101 
102 }
103 
104 
105 
106 #endif // XALAN_ELEMEMPTY_HEADER_GUARD
xalanc::ElemEmpty
Definition: ElemEmpty.hpp:40
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::StylesheetExecutionContext
Definition: StylesheetExecutionContext.hpp:106
xalanc::ElemTemplateElement
Definition: ElemTemplateElement.hpp:79
xalanc::StylesheetConstructionContext
Definition: StylesheetConstructionContext.hpp:83
ElemTemplateElement.hpp
XSLTDefinitions.hpp
xalanc::Stylesheet
This class represents the base stylesheet or an "import" stylesheet.
Definition: Stylesheet.hpp:86
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:45