Xalan-C++ API Reference  1.12.0
ElemTemplate.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_ELEMTEMPLATE_HEADER_GUARD)
19 #define XALAN_ELEMTEMPLATE_HEADER_GUARD
20 
21 
22 
23 // Base include file. Must be first.
24 #include "XSLTDefinitions.hpp"
25 
26 // Base class header file.
27 #include "ElemTemplateElement.hpp"
28 
29 
30 
32 
33 
34 
35 namespace XALAN_CPP_NAMESPACE {
36 
37 
38 
39 class XPath;
40 
41 
42 
44 {
45 public:
46 
48 
49  /**
50  * Construct an object corresponding to an "xsl:template" element
51  *
52  * @param constructionContext context for construction of object
53  * @param stylesheetTree stylesheet containing element
54  * @param atts list of attributes for element
55  * @param lineNumber line number in document
56  * @param columnNumber column number in document
57  */
59  StylesheetConstructionContext& constructionContext,
60  Stylesheet& stylesheetTree,
61  const AttributeListType& atts,
62  XalanFileLoc lineNumber,
63  XalanFileLoc columnNumber);
64 
65  virtual
66  ~ElemTemplate();
67 
68  /**
69  * Retrieve the mode of element
70  *
71  * @return QName for mode
72  */
73  const XalanQName&
74  getMode() const
75  {
76  assert(m_mode != 0);
77 
78  return *m_mode;
79  }
80 
81  /**
82  * Retrieve the match pattern
83  *
84  * @return XPath corresponding to the match pattern
85  */
86  const XPath*
88  {
89  return m_matchPattern;
90  }
91 
92  /**
93  * Retrieve the priority of element
94  *
95  * @return priority value
96  */
97  double
98  getPriority() const
99  {
100  return m_priority;
101  }
102 
103  virtual const XalanQName&
104  getNameAttribute() const;
105 
106  virtual void
107  addToStylesheet(
108  StylesheetConstructionContext& constructionContext,
109  Stylesheet& theStylesheet);
110 
111  virtual const XalanDOMString&
112  getElementName() const;
113 
114  // These methods are inherited from ElemTemplateElement ...
115 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
116  virtual const ElemTemplateElement*
117  startElement(StylesheetExecutionContext& executionContext) const;
118 
119  virtual void
120  endElement(StylesheetExecutionContext& executionContext) const;
121 
122  virtual const ElemTemplateElement*
123  getInvoker(StylesheetExecutionContext& executionContext) const;
124 #else
125  virtual void
126  execute(StylesheetExecutionContext& executionContext) const;
127 
128  virtual void
129  executeChildren(StylesheetExecutionContext& executionContext) const;
130 
131  virtual void
132  executeChildren(
133  StylesheetExecutionContext& executionContext,
134  XalanNode* sourceNode) const;
135  void
136  executeAsNamed(StylesheetExecutionContext& executionContext) const
137  {
138  ParentType::executeChildren(executionContext);
139  }
140 #endif
141 
142  virtual const XPath*
143  getXPath(XalanSize_t index) const;
144 
145 protected:
146 
147  virtual bool
148  childTypeAllowed(int xslToken) const;
149 
150 private:
151 
152  // not implemented
153  ElemTemplate(const ElemTemplate&);
154 
155  ElemTemplate&
156  operator=(const ElemTemplate&);
157 
158  // Data members...
159  const XPath* m_matchPattern;
160 
161  const XalanQName* m_name;
162  const XalanQName* m_mode;
163 
164  double m_priority;
165 };
166 
167 
168 
169 }
170 
171 
172 
173 #endif // XALAN_ELEMTEMPLATE_HEADER_GUARD
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::AttributeListType
xercesc::AttributeList AttributeListType
Definition: AttributeListImpl.hpp:41
xalanc::StylesheetExecutionContext
Definition: StylesheetExecutionContext.hpp:106
xalanc::XalanNode
Definition: XalanNode.hpp:38
XalanDOMString.hpp
xalanc::XPath
Definition: XPath.hpp:67
xalanc::ElemTemplateElement
Definition: ElemTemplateElement.hpp:79
xalanc::ElemTemplate::getMatchPattern
const XPath * getMatchPattern() const
Retrieve the match pattern.
Definition: ElemTemplate.hpp:87
xalanc::ElemTemplate::getPriority
double getPriority() const
Retrieve the priority of element.
Definition: ElemTemplate.hpp:98
xalanc::StylesheetConstructionContext
Definition: StylesheetConstructionContext.hpp:83
xalanc::ElemTemplate::getMode
const XalanQName & getMode() const
Retrieve the mode of element.
Definition: ElemTemplate.hpp:74
ElemTemplateElement.hpp
xalanc::ElemTemplate
Definition: ElemTemplate.hpp:43
XSLTDefinitions.hpp
xalanc::Stylesheet
This class represents the base stylesheet or an "import" stylesheet.
Definition: Stylesheet.hpp:86
xalanc::ElemTemplate::ParentType
ElemTemplateElement ParentType
Definition: ElemTemplate.hpp:47
xalanc::XalanQName
Class to represent a qualified name.
Definition: XalanQName.hpp:70
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:45