Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


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 XALAN_CPP_NAMESPACE_BEGIN
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
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
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 XALAN_CPP_NAMESPACE_END
170 
171 
172 
173 #endif // XALAN_ELEMTEMPLATE_HEADER_GUARD
virtual void addToStylesheet(StylesheetConstructionContext &constructionContext, Stylesheet &theStylesheet)
Called during compilation when an instance is not parented by another element, and thus...
ElemTemplate(StylesheetConstructionContext &constructionContext, Stylesheet &stylesheetTree, const AttributeListType &atts, XalanFileLoc lineNumber, XalanFileLoc columnNumber)
Construct an object corresponding to an "xsl:template" element.
virtual bool childTypeAllowed(int xslToken) const
Given an xsl token type, determine whether or not a child of that type is allowed.
virtual ~ElemTemplate()
ElemTemplateElement ParentType
Definition: XPath.hpp:64
double getPriority() const
Retrieve the priority of element.
virtual void executeChildren(StylesheetExecutionContext &executionContext) const
Execute the children of this element.
virtual const XalanQName & getNameAttribute() const
Get the QName associated with any name attribute of this element.
const XPath * getMatchPattern() const
Retrieve the match pattern.
virtual void execute(StylesheetExecutionContext &executionContext) const
Execute the element.
virtual void endElement(StylesheetExecutionContext &executionContext) const
Completes "post-processing" afer any sub-elements are invoked (i.e.
XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType
virtual const XalanDOMString & getElementName() const
Get a string for the name of the element.
virtual const ElemTemplateElement * startElement(StylesheetExecutionContext &executionContext) const
Completes "pre-processing" before any sub-elements are invoked (i.e.
This class represents the base stylesheet or an "import" stylesheet.
Definition: Stylesheet.hpp:86
const XalanQName & getMode() const
Retrieve the mode of element.
virtual const XPath * getXPath(XalanSize_t index) const
Get XPath pattern/expression of one of the element atribute.
Class to represent a qualified name.
Definition: XalanQName.hpp:70
virtual const ElemTemplateElement * getInvoker(StylesheetExecutionContext &executionContext) const
Returns the element that invoked this element.

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