Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


ElemUse.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_ELEMUSE_HEADER_GUARD)
19 #define XALAN_ELEMUSE_HEADER_GUARD
20 
21 
22 
23 // Base include file. Must be first.
24 #include "XSLTDefinitions.hpp"
25 
26 
27 
28 // Base class header file.
29 #include "ElemTemplateElement.hpp"
30 
31 
32 
33 XALAN_CPP_NAMESPACE_BEGIN
34 
35 
36 
38 {
39 public:
40 
41 #if defined(XALAN_STRICT_ANSI_HEADERS)
42  typedef std::size_t size_type;
43 #else
44  typedef size_t size_type;
45 #endif
46 
47  /**
48  * Construct an object corresponding to an "use-attribute-sets" attribute.
49  * This is a base class for "xsl:element," "xsl:copy" and
50  * "xsl:attribute-set" elements, which may specify attribute sets to use.
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  */
58  ElemUse(
59  StylesheetConstructionContext& constructionContext,
60  Stylesheet& stylesheetTree,
61  XalanFileLoc lineNumber,
62  XalanFileLoc columnNumber,
63  int xslToken);
64 
65  virtual
66  ~ElemUse();
67 
68  /**
69  * See if this is a use-attribute-sets attribute, and, if so, process it.
70  *
71  * @param attrName qualified name of attribute
72  * @param atts attribute list where the element comes from (not used at
73  * this time)
74  * @param which index into the attribute list (not used at this time)
75  * @return true if this is a use-attribute-sets attribute
76  */
77  bool
79  StylesheetConstructionContext& constructionContext,
80  const XalanDOMChar* attrName,
81  const AttributeListType& atts,
82  XalanSize_t which);
83 
84  // These methods are inherited from ElemTemplateElement ...
85 
86  virtual const XalanDOMString&
87  getElementName() const;
88 
89  virtual void
91  StylesheetConstructionContext& constructionContext,
92  const NamespacesHandler& theParentHandler);
93 
94 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
95  virtual const ElemTemplateElement*
96  startElement(StylesheetExecutionContext& executionContext) const;
97 
98  virtual void
99  endElement(StylesheetExecutionContext& executionContext) const;
100 
101  virtual const ElemTemplateElement*
103  StylesheetExecutionContext& executionContext,
104  const ElemTemplateElement* currentElem) const;
105 
106  virtual const ElemTemplateElement*
108  StylesheetExecutionContext& executionContext) const;
109 #else
110  virtual void
111  execute(StylesheetExecutionContext& executionContext) const;
112 #endif
113 
114 
115 protected:
116 
117 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
118  /**
119  * Get the next attribute set to execute.
120  *
121  * @param executionContext context to execute this element
122  * @returns a pointer to the attribute set element, 0 if no more attribute sets
123  */
124  const ElemTemplateElement*
126  StylesheetExecutionContext& executionContext) const;
127 
128  /**
129  * Evalute the AVTs for this element
130  *
131  * @param executionContext context to execute this element
132  */
133  virtual void
134  evaluateAVTs(
135  StylesheetExecutionContext& executionContext) const;
136 #else
137  /**
138  * Execute and conditionally apply any attribute sets. To be used
139  * by deriving classes who want ElemUse to do any default execution
140  * but skip applying attribute sets. Typically, this would be done
141  * when attempting to recover from an error.
142  *
143  * @param executionContext The current execution context.
144  * @param applyAttributeSets If true, attribute sets will be applied.
145  */
146  virtual void
147  doExecute(
148  StylesheetExecutionContext& executionContext,
149  bool applyAttributeSets) const;
150 #endif
151 
152 private:
153 
154  const XalanQName** m_attributeSetsNames;
155 
156  size_type m_attributeSetsNamesCount;
157 };
158 
159 
160 
161 XALAN_CPP_NAMESPACE_END
162 
163 
164 
165 #endif // XALAN_ELEMUSE_HEADER_GUARD
virtual void evaluateAVTs(StylesheetExecutionContext &executionContext) const
Evalute the AVTs for this element.
ElemUse(StylesheetConstructionContext &constructionContext, Stylesheet &stylesheetTree, XalanFileLoc lineNumber, XalanFileLoc columnNumber, int xslToken)
Construct an object corresponding to an "use-attribute-sets" attribute.
virtual const ElemTemplateElement * getFirstChildElemToExecute(StylesheetExecutionContext &executionContext) const
Returns the first sub-element (i.e.
virtual const ElemTemplateElement * getNextChildElemToExecute(StylesheetExecutionContext &executionContext, const ElemTemplateElement *currentElem) const
Returns the next sub-element (i.e.
virtual void execute(StylesheetExecutionContext &executionContext) const
Execute the element.
const ElemTemplateElement * getNextAttributeSet(StylesheetExecutionContext &executionContext) const
Get the next attribute set to execute.
virtual const ElemTemplateElement * startElement(StylesheetExecutionContext &executionContext) const
Completes "pre-processing" before any sub-elements are invoked (i.e.
virtual ~ElemUse()
virtual const XalanDOMString & getElementName() const
Get a string for the name of the element.
XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType
This class represents the base stylesheet or an "import" stylesheet.
Definition: Stylesheet.hpp:86
virtual void endElement(StylesheetExecutionContext &executionContext) const
Completes "post-processing" afer any sub-elements are invoked (i.e.
size_t size_type
Definition: ElemUse.hpp:44
Class to represent a qualified name.
Definition: XalanQName.hpp:70
virtual void postConstruction(StylesheetConstructionContext &constructionContext, const NamespacesHandler &theParentHandler)
Called after construction is completed.
bool processUseAttributeSets(StylesheetConstructionContext &constructionContext, const XalanDOMChar *attrName, const AttributeListType &atts, XalanSize_t which)
See if this is a use-attribute-sets attribute, and, if so, process it.

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