Xalan-C++ API Reference 1.12.0
Stylesheet.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
19#if !defined(XALAN_STYLESHEET_HEADER_GUARD)
20#define XALAN_STYLESHEET_HEADER_GUARD
21
22
23
24// Base include file. Must be first.
25#include "XSLTDefinitions.hpp"
26
27
28
31
32
33
36
37
38
40
41
42
46
47
48
54
55
56
57namespace XALAN_CPP_NAMESPACE {
58
59
60
61class ExtensionNSHandler;
62class XalanDecimalFormatSymbols;
63class ElemDecimalFormat;
64class ElemTemplate;
65class ElemTemplateElement;
66class ElemVariable;
67class KeyTable;
68class NodeRefListBase;
69class PrefixResolver;
70class StylesheetConstructionContext;
71class StylesheetRoot;
72class XalanMatchPatternData;
73class XalanQName;
74class XObject;
75class StylesheetExecutionContext;
76
77
80
81
82/**
83 * This class represents the base stylesheet or an "import" stylesheet.
84 * "include" stylesheets are combined with the including stylesheet.
85 */
87{
88
89public:
90
94
102
104
107
109
111
113
114 /**
115 * Constructor for a Stylesheet needs a Document.
116 * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
117 * the error condition is severe enough to halt processing.
118 */
120 StylesheetRoot& root,
121 const XalanDOMString& baseIdentifier,
122 StylesheetConstructionContext& constructionContext);
123
124 virtual
126
127 static Stylesheet*
128 create(MemoryManager& theManager,
129 StylesheetRoot& root,
130 const XalanDOMString& baseIdentifier,
131 StylesheetConstructionContext& constructionContext);
132
133 MemoryManager&
135 {
136 return m_elementPatternTable.getMemoryManager();
137 }
138
139 /**
140 * Retrieve XSLT version number
141 *
142 * @return number representing XSLT version
143 */
144 double
146 {
147 return m_XSLTVerDeclared;
148 }
149
150 /**
151 * Set XSLT version number
152 *
153 * @param ver number representing XSLT version
154 */
155 void
157 {
158 m_XSLTVerDeclared = ver;
159 }
160
161 /**
162 * Retrieve the root stylesheet object
163 *
164 * @return const reference to the stylesheet object
165 */
166 const StylesheetRoot&
168 {
169 return m_stylesheetRoot;
170 }
171
172 /**
173 * Retrieve the root stylesheet object
174 *
175 * @return reference to the stylesheet object
176 */
179 {
180 return m_stylesheetRoot;
181 }
182
183 /**
184 * Retrieve the stack of namespace lists
185 *
186 * @return vector of namespace vectors
187 */
188 const NamespacesStackType&
190 {
191 return m_namespaces;
192 }
193
194 /**
195 * Retrieve the stack of namespace lists
196 *
197 * @return vector of namespace vectors
198 */
199 NamespacesStackType&
201 {
202 return m_namespaces;
203 }
204
205 const NamespacesHandler&
207 {
208 return m_namespacesHandler;
209 }
210
213 {
214 return m_namespacesHandler;
215 }
216
217 /**
218 * Retrieve the list of namespace declarations currently in effect
219 *
220 * @return vector of namespace vectors
221 */
222 const NamespaceVectorType&
224 {
225 return m_namespaceDecls;
226 }
227
228 /**
229 * Retrieve the list of namespace declarations currently in effect
230 *
231 * @return vector of namespace vectors
232 */
233 NamespaceVectorType&
235 {
236 return m_namespaceDecls;
237 }
238
239 /**
240 * Set the list of namespace declarations currently in effect
241 *
242 * @param ns vector of namespace vectors
243 */
244 void
246 {
247 m_namespaceDecls = ns;
248 }
249
250 /**
251 * Push the namespace declarations from the current attribute
252 * list onto the namespace stack.
253 *
254 * @param atts attribute list constaining namespaces
255 */
256 void
258
259 /**
260 * Pop a namespace declaration from the namespace stack.
261 */
262 void
264 {
265 assert(m_namespaces.empty() == false);
266
267 m_namespaces.pop_back();
268 }
269
270 void
272
273 /**
274 * Called after construction is completed.
275 */
276 virtual void
278
279 /**
280 * See if this is a xmlns attribute, and, if so, process it.
281 *
282 * @param attrName qualified name of attribute
283 * @param atts attribute list where the element comes from (not used at
284 * this time)
285 * @param which index into the attribute list (not used at this time)
286 * @return true if this is a namespace name
287 */
288 bool
290 const XalanDOMChar* attrName,
291 const AttributeListType& atts,
292 XalanSize_t which,
293 StylesheetConstructionContext& constructionContext) const;
294
295 /**
296 * Get the namespace from a qualified name.
297 *
298 * @param nodeName name of node
299 * @return namespace string for node, or null if not found.
300 */
301 const XalanDOMString*
303 const XalanDOMString& nodeName,
304 XalanDOMString& theBuffer) const
305 {
306 return getNamespaceFromStack(nodeName.c_str(), theBuffer);
307 }
308
309 /**
310 * Get the namespace from a qualified name.
311 *
312 * @param nodeName name of node
313 * @return namespace string for node, or null if not found.
314 */
315 const XalanDOMString*
317 const XalanDOMChar* nodeName,
318 XalanDOMString& theBuffer) const;
319
320 /**
321 * Get the namespace from a prefix by searching the stack of namespace
322 * lists.
323 *
324 * @param prefix prefix to search
325 * @return namespace corresponding to prefix, or null if not found.
326 */
327 const XalanDOMString*
329 {
330 return XalanQName::getNamespaceForPrefix(m_namespaces, prefix);
331 }
332
333 /**
334 * Get the namespace from a prefix by searching the stack of namespace
335 * lists.
336 *
337 * @param prefix prefix to search
338 * @return namespace corresponding to prefix, or null if not found.
339 */
340 const XalanDOMString*
341 getNamespaceForPrefixFromStack(const XalanDOMChar* prefix) const
342 {
343 assert(prefix != 0);
344
345 return XalanQName::getNamespaceForPrefix(m_namespaces, (const XalanDOMChar*)prefix);
346 }
347
348 /**
349 * Get the namespace for a prefix, and report an error if it wasn't found.
350 *
351 * @param prefix prefix to search
352 * @param constructionContext The current construction context
353 * @return namespace corresponding to prefix, or null if not found.
354 */
355 const XalanDOMString*
357 const XalanDOMString& prefix,
358 StylesheetConstructionContext& constructionContext) const;
359
360 /**
361 * Get the namespace for a prefix, and report an error if it wasn't found.
362 *
363 * @param prefix prefix to search
364 * @param constructionContext The current construction context
365 * @return namespace corresponding to prefix, or null if not found.
366 */
367 const XalanDOMString*
369 const XalanDOMChar* prefix,
370 StylesheetConstructionContext& constructionContext) const;
371
372 /**
373 * See if a namespace should be excluded.
374 *
375 * @param theConstructionContext the current construction context.
376 * @param theValue the prefix of the namespace.
377 * @return
378 */
379 void
381 StylesheetConstructionContext& theConstructionContext,
382 const XalanDOMChar* theValue)
383 {
384 m_namespacesHandler.processExcludeResultPrefixes(
385 theConstructionContext,
386 theValue,
387 m_namespaces);
388 }
389
390 /**
391 * Add a template to the list of names templates
392 *
393 * @param theTemplate template to add
394 * @param constructionContext context for construction
395 */
396 void
398 ElemTemplate* theTemplate,
399 StylesheetConstructionContext& constructionContext);
400
401 /**
402 * Process an attribute that has the value of 'yes' or 'no'.
403 *
404 * @param aname name of attribute
405 * @param val value
406 * @param constructionContext context for construction
407 * @return true if value equals string constant for "yes," false otherwise
408 */
409 bool
411 const XalanDOMChar* aname,
412 const XalanDOMChar* val,
413 StylesheetConstructionContext& constructionContext) const;
414
415 /**
416 * Retrieve the base identifier with which this stylesheet is associated.
417 *
418 * @return string for base identifier
419 */
420 const XalanDOMString&
422 {
423 return m_baseIdent;
424 }
425
426 /**
427 * Retrieve the base identifier for the most recently
428 * included stylesheet. This will return the same value
429 * as getBaseIdentifier(), if no include is being
430 * processed.
431 *
432 * @return string for base identifier
433 */
434 const XalanDOMString&
436 {
437 return m_includeStack.empty() == true ? getBaseIdentifier() : m_includeStack.back();
438 }
439
440 /**
441 * Process an xsl:namespace-alias element.
442 *
443 * @param name the element name.
444 * @param attrs the current attribute list
445 * @param constructionContext the active construction context
446 */
447 void
449 const XalanDOMChar* name,
450 const AttributeListType& atts,
451 StylesheetConstructionContext& constructionContext);
452
453 /**
454 * Process an xsl:decimal-format element.
455 *
456 * @param elemDecimalFormat the element
457 */
458 void
460 StylesheetConstructionContext& constructionContext,
461 const AttributeListType& atts,
462 const Locator* locator = 0);
463
464 /**
465 * Retrieve the XalanDecimalFormatSymbols instance associated with
466 * the QName.
467 *
468 * @param theQName the QName for the lookup
469 * @return a pointer to the matching instance, or 0 if none was found
470 */
472 getDecimalFormatSymbols(const XalanQName& theQName) const;
473
474 /**
475 * Add an imported stylesheet.
476 *
477 * @param theStylesheet The stylesheet to add.
478 */
479 void
480 addImport(Stylesheet* theStylesheet)
481 {
482 m_imports.insert(m_imports.begin(), theStylesheet);
483 }
484
485 /**
486 * whether there is a wrapper template
487 *
488 * @return true is there is a wrapper
489 */
490 bool
492 {
493 return m_isWrapperless;
494 }
495
498 StylesheetConstructionContext& constructionContext,
499 const Locator* locator);
500
501 /**
502 * Retrieve the stack of who's including who
503 *
504 * @return stack of includes
505 */
508 {
509 return m_includeStack;
510 }
511
512 /**
513 * Process the xsl:key element.
514 *
515 * @param nsContext The PrefixResolver instance for namespace prefixes.
516 * @param atts The attribute list for element.
517 * #param locator The Locator instance for error reporting, if any. May be 0.
518 * @param constructionContext The current construction context.
519 */
520 void
522 const PrefixResolver& nsContext,
523 const AttributeListType& atts,
524 const Locator* locator,
525 StylesheetConstructionContext& constructionContext);
526
527 /**
528 * Locate a template via the "name" attribute.
529 *
530 * @param name qualified name of template
531 * @return pointer to template found or 0 if none found
532 */
533 const ElemTemplate*
534 findNamedTemplate(const XalanQName& qname) const;
535
536 /**
537 * Given a target element, find the template that best matches in the given
538 * XSL document, according to the rules specified in the xsl draft.
539 *
540 * @param executionContext current execution context
541 * @param targetNode element that needs a rule
542 * @return pointer to rule that best matches targetNode
543 */
544 const ElemTemplate*
546 StylesheetExecutionContext& executionContext,
547 XalanNode* targetNode) const
548 {
549 assert(targetNode != 0);
550
551 return findTemplate(
552 executionContext,
553 targetNode,
554 targetNode->getNodeType(),
555 s_emptyQName,
556 false);
557 }
558
559 /**
560 * Given a target element, find the template that best matches in the given
561 * XSL document, according to the rules specified in the xsl draft.
562 *
563 * @param executionContext current execution context
564 * @param targetNode node that needs a rule
565 * @param targetNodeType the type of targetNode
566 * @param mode string indicating the mode
567 * @param onlyUseImports only use imports, do not use any templates from the stylesheet itself
568 * @return pointer to rule that best matches targetElem
569 */
570 const ElemTemplate*
572 StylesheetExecutionContext& executionContext,
573 XalanNode* targetNode,
574 XalanNode::NodeType targetNodeType,
575 const XalanQName& mode,
576 bool onlyUseImports) const;
577
578 /**
579 * Add object to vector of match patterns if not already there.
580 *
581 * @param thePattern pattern to add
582 * @param theVector vector of patterns to add to
583 */
584 static void
586 const XalanMatchPatternData* thePattern,
587 PatternTableVectorType& theVector);
588
589 /**
590 * Add object to array of match patterns if not already there.
591 * theArraySize size will be incremented if the pattern was
592 * added.
593 *
594 * @param thePattern pattern to add
595 * @param theArray vector of patterns to add to
596 * @param theArraySize The size of the array
597 */
598 static void
600 const XalanMatchPatternData* thePattern,
601 const XalanMatchPatternData* theArray[],
602 XalanSize_t& theArraySize);
603
604 /**
605 * Given a name, locate the start of a list of
606 * possible templates that match that name. If
607 * none match, then use the default list.
608 *
609 * @param theName The name to match
610 */
613
614 /**
615 * Given a name, locate the start of a list of
616 * possible templates that match that name. If
617 * none match, then use the default list.
618 *
619 * @param theName The name to match
620 */
623
624 /**
625 * Given a XalanNode, locate the start of a list of
626 * possible templates that match it.
627 *
628 * @param XalanNode The node to match
629 */
632 const XalanNode& theNode,
633 XalanNode::NodeType targetNodeType) const;
634
635 /**
636 * Add an extension namespace handler. This provides methods for calling
637 * an element extension as well as for function calls (which is passed
638 * on to XPath).
639 *
640 * @param constructionContext The current construction context.
641 * @param uri The namespace URI of the extension.
642 */
643 void
645 StylesheetConstructionContext& theConstructionContext,
646 const XalanDOMString& uri);
647
648 /**
649 * Return the handler for a given extension namespace.
650 *
651 * @param uri the URI of the extension namespace.
652 * @return pointer to extension handler
653 */
656 {
658 m_extensionNamespaces.find(uri);
659
660 return it == m_extensionNamespaces.end() ? 0 : (*it).second;
661 }
662
663 /**
664 * Set a top level variable.
665 *
666 * @param var top-level variable declared with "xsl:variable" or
667 * xsl:param-variable.
668 */
669 void
671 {
672 m_topLevelVariables.push_back(var);
673 }
674
675 /**
676 * Set a list of top level variables in the specified execution context
677 * stylesheet.
678 *
679 * @param executionContext current execution context
680 * @param topLevelParams list of top level parameters
681 */
682 void
684 StylesheetExecutionContext& executionContext,
685 const ParamVectorType& topLevelParams) const;
686
687
688 // These interfaces are inherited from PrefixResolver...
689
690 virtual const XalanDOMString*
692
693 virtual const XalanDOMString&
694 getURI() const;
695
696 const XalanDOMString&
698 {
699 return m_XSLTNamespaceURI;
700 }
701
702 void
704 {
705 m_XSLTNamespaceURI = theURI;
706 }
707
708 const ElemTemplate*
710 {
711 return m_firstTemplate;
712 }
713
714protected:
715
716 /**
717 * The root of the stylesheet tree.
718 */
720
721 /**
722 * The base URL of the XSL document.
723 */
725
726 /**
727 * Table of KeyDeclaration objects, which are set by the
728 * xsl:key element.
729 */
731
733
735
736private:
737
738 // Not defined...
739 Stylesheet(const Stylesheet&);
740
742 operator=(const Stylesheet&);
743
744 bool
745 operator==(const Stylesheet&) const;
746
747 void
748 error(
750 XalanMessages::Codes theErrorCode,
751 const Locator* theLocator,
752 const XalanDOMChar* theParam1 = 0,
753 const XalanDOMChar* theParam2 = 0,
754 const XalanDOMChar* theParam3 = 0) const;
755
756 /**
757 * Given a target element, find the template that best matches in the given
758 * stylesheet, using only imports
759 *
760 * @param executionContext current execution context
761 * @param targetNode node that needs a rule
762 * @param targetNodeType the type of targetNode
763 * @param mode string indicating the mode
764 * @return pointer to rule that best matches targetElem
765 */
766 const ElemTemplate*
767 findTemplateInImports(
768 StylesheetExecutionContext& executionContext,
769 XalanNode* targetNode,
770 XalanNode::NodeType targetNodeType,
771 const XalanQName& mode) const;
772
773 /**
774 * The full XSLT Namespace URI. To be replaced by the one actually
775 * found.
776 */
777 XalanDOMString m_XSLTNamespaceURI;
778
779 /**
780 * A vector of the -imported- XSL Stylesheets.
781 */
782 StylesheetVectorType m_imports;
783
785
786 /**
787 * A stack to keep track of the result tree namespaces.
788 */
789 NamespacesStackType m_namespaces;
790
791 /**
792 * A list of namespace declarations,
793 * for mapping from prefix to namespace URI.
794 */
795 NamespaceVectorType m_namespaceDecls;
796
797 /**
798 * Tells if the stylesheet is without an xsl:stylesheet and xsl:template
799 * wrapper.
800 */
801 bool m_isWrapperless;
802
803 /**
804 * The table of extension namespaces.
805 */
806 ExtensionNamespacesMapType m_extensionNamespaces;
807
808 /**
809 * The first template of the template children.
810 */
811 ElemTemplate* m_firstTemplate;
812
813 /**
814 * A stack of who's including who is needed in order to support "It is an
815 * error if a stylesheet directly or indirectly includes itself."
816 */
817 URLStackType m_includeStack;
818
819 /**
820 * Keyed on string macro names, and holding values that are macro elements
821 * in the XSL DOM tree. Initialized in initMacroLookupTable, and used in
822 * findNamedTemplate.
823 */
824 ElemTemplateMapType m_namedTemplates;
825
826 /**
827 * Table for defined constants, keyed on the names.
828 */
829 ElemVariableVectorType m_topLevelVariables;
830
831 /**
832 * The version of XSL that was declared.
833 */
834 double m_XSLTVerDeclared;
835
836 /**
837 * This table is keyed on the target elements of patterns, and contains linked
838 * lists of the actual patterns that match the target element to some degree
839 * of specifity.
840 */
841 PatternTableMapType m_elementPatternTable;
842
843 const PatternTableMapType::const_iterator m_elementPatternTableEnd;
844
845 PatternTableVectorType m_elementAnyPatternList;
846
847 /**
848 * This table is keyed on the target attributes of patterns, and contains linked
849 * lists of the actual patterns that match the target attribute to some degree
850 * of specifity.
851 */
852 PatternTableMapType m_attributePatternTable;
853
854 const PatternTableMapType::const_iterator m_attributePatternTableEnd;
855
856 PatternTableVectorType m_attributeAnyPatternList;
857
858 /**
859 * These tables are for text, comment, root, and PI node templates.
860 */
861 PatternTableVectorType m_textPatternList;
862
863 PatternTableVectorType m_commentPatternList;
864
865 PatternTableVectorType m_rootPatternList;
866
867 PatternTableVectorType m_piPatternList;
868
869 /**
870 * This table is for patterns that match "node()".
871 */
872 PatternTableVectorType m_nodePatternList;
873
874 size_type m_patternCount;
875
876 ElemDecimalFormatVectorType m_elemDecimalFormats;
877
878 NamespacesHandler m_namespacesHandler;
879
880 static const XalanDOMString s_emptyString;
881
882 static const PatternTableVectorType s_emptyTemplateList;
883};
884
885
886
887}
888
889
890
891#endif // XALAN_STYLESHEET_HEADER_GUARD
#define XALAN_XSLT_EXPORT
#define XALAN_USES_MEMORY_MANAGER(Type)
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
This class defines an interface for classes that resolve namespace prefixes to their URIs.
This acts as the stylesheet root of the stylesheet tree, and holds values that are shared by all styl...
This class represents the base stylesheet or an "import" stylesheet.
Definition: Stylesheet.hpp:87
const ElemTemplate * findNamedTemplate(const XalanQName &qname) const
Locate a template via the "name" attribute.
const XalanDecimalFormatSymbols * getDecimalFormatSymbols(const XalanQName &theQName) const
Retrieve the XalanDecimalFormatSymbols instance associated with the QName.
StylesheetRoot & getStylesheetRoot()
Retrieve the root stylesheet object.
Definition: Stylesheet.hpp:178
Stylesheet(StylesheetRoot &root, const XalanDOMString &baseIdentifier, StylesheetConstructionContext &constructionContext)
Constructor for a Stylesheet needs a Document.
virtual void postConstruction(StylesheetConstructionContext &constructionContext)
Called after construction is completed.
XalanMap< const XalanNode *, KeyTable * > KeyTablesTableType
Definition: Stylesheet.hpp:108
void processDecimalFormatElement(StylesheetConstructionContext &constructionContext, const AttributeListType &atts, const Locator *locator=0)
Process an xsl:decimal-format element.
const XalanDOMString * getNamespaceForPrefixFromStack(const XalanDOMString &prefix) const
Get the namespace from a prefix by searching the stack of namespace lists.
Definition: Stylesheet.hpp:328
static void addObjectIfNotFound(const XalanMatchPatternData *thePattern, PatternTableVectorType &theVector)
Add object to vector of match patterns if not already there.
const XalanDOMString * getNamespaceFromStack(const XalanDOMString &nodeName, XalanDOMString &theBuffer) const
Get the namespace from a qualified name.
Definition: Stylesheet.hpp:302
const ElemTemplate * findTemplate(StylesheetExecutionContext &executionContext, XalanNode *targetNode) const
Given a target element, find the template that best matches in the given XSL document,...
Definition: Stylesheet.hpp:545
XalanVector< XalanSpaceNodeTester > WhitespaceElementsVectorType
Definition: Stylesheet.hpp:100
XalanVector< ElemDecimalFormat * > ElemDecimalFormatVectorType
Definition: Stylesheet.hpp:99
XalanVector< KeyDeclaration > KeyDeclarationVectorType
Definition: Stylesheet.hpp:96
StylesheetConstructionContext::GetCachedString GetCachedString
Definition: Stylesheet.hpp:112
ExtensionNSHandler * lookupExtensionNSHandler(const XalanDOMString &uri) const
Return the handler for a given extension namespace.
Definition: Stylesheet.hpp:655
XalanMap< XalanDOMString, ExtensionNSHandler * > ExtensionNamespacesMapType
Definition: Stylesheet.hpp:103
void processExtensionNamespace(StylesheetConstructionContext &theConstructionContext, const XalanDOMString &uri)
Add an extension namespace handler.
const ElemTemplate * findTemplate(StylesheetExecutionContext &executionContext, XalanNode *targetNode, XalanNode::NodeType targetNodeType, const XalanQName &mode, bool onlyUseImports) const
Given a target element, find the template that best matches in the given XSL document,...
NamespaceVectorType & getNamespaceDecls()
Retrieve the list of namespace declarations currently in effect.
Definition: Stylesheet.hpp:234
double getXSLTVerDeclared() const
Retrieve XSLT version number.
Definition: Stylesheet.hpp:145
NamespacesHandler & getNamespacesHandler()
Definition: Stylesheet.hpp:212
URLStackType & getIncludeStack()
Retrieve the stack of who's including who.
Definition: Stylesheet.hpp:507
void addImport(Stylesheet *theStylesheet)
Add an imported stylesheet.
Definition: Stylesheet.hpp:480
NamespacesStackType & getNamespaces()
Retrieve the stack of namespace lists.
Definition: Stylesheet.hpp:200
void addWhitespaceElement(const XalanSpaceNodeTester &theTester)
XalanVector< XalanDOMString > URLStackType
Definition: Stylesheet.hpp:98
PatternTableVectorTypeDecl PatternTableVectorType
Definition: Stylesheet.hpp:101
const XalanDOMString & getCurrentIncludeBaseIdentifier() const
Retrieve the base identifier for the most recently included stylesheet.
Definition: Stylesheet.hpp:435
const XalanDOMString & getXSLTNamespaceURI() const
Definition: Stylesheet.hpp:697
virtual const XalanDOMString * getNamespaceForPrefix(const XalanDOMString &prefix) const
Retrieve a namespace corresponding to a prefix.
void setNamespaceDecls(const NamespaceVectorType &ns)
Set the list of namespace declarations currently in effect.
Definition: Stylesheet.hpp:245
const XalanDOMString * getNamespaceFromStack(const XalanDOMChar *nodeName, XalanDOMString &theBuffer) const
Get the namespace from a qualified name.
void setXSLTVerDeclared(double ver)
Set XSLT version number.
Definition: Stylesheet.hpp:156
static const XalanQNameByReference s_emptyQName
Definition: Stylesheet.hpp:734
const XalanDOMString * getNamespaceForPrefix(const XalanDOMString &prefix, StylesheetConstructionContext &constructionContext) const
Get the namespace for a prefix, and report an error if it wasn't found.
KeyDeclarationVectorType m_keyDeclarations
Table of KeyDeclaration objects, which are set by the xsl:key element.
Definition: Stylesheet.hpp:730
XalanMap< XalanDOMString, PatternTableVectorType > PatternTableMapType
Definition: Stylesheet.hpp:110
XalanVector< Stylesheet * > StylesheetVectorType
Definition: Stylesheet.hpp:97
void addTemplate(ElemTemplate *theTemplate, StylesheetConstructionContext &constructionContext)
Add a template to the list of names templates.
const NamespaceVectorType & getNamespaceDecls() const
Retrieve the list of namespace declarations currently in effect.
Definition: Stylesheet.hpp:223
void processNSAliasElement(const XalanDOMChar *name, const AttributeListType &atts, StylesheetConstructionContext &constructionContext)
Process an xsl:namespace-alias element.
void setTopLevelVariable(ElemVariable *var)
Set a top level variable.
Definition: Stylesheet.hpp:670
void setXSLTNamespaceURI(const XalanDOMString &theURI)
Definition: Stylesheet.hpp:703
void pushTopLevelVariables(StylesheetExecutionContext &executionContext, const ParamVectorType &topLevelParams) const
Set a list of top level variables in the specified execution context stylesheet.
WhitespaceElementsVectorType m_whitespaceElements
Definition: Stylesheet.hpp:732
ElemTemplateElement * initWrapperless(StylesheetConstructionContext &constructionContext, const Locator *locator)
virtual ~Stylesheet()
void pushNamespaces(const AttributeListType &atts)
Push the namespace declarations from the current attribute list onto the namespace stack.
const PatternTableVectorType * locateElementMatchPatternDataList(const XalanDOMString &theName) const
Given a name, locate the start of a list of possible templates that match that name.
bool getYesOrNo(const XalanDOMChar *aname, const XalanDOMChar *val, StylesheetConstructionContext &constructionContext) const
Process an attribute that has the value of 'yes' or 'no'.
XalanVector< ElemVariable * > ElemVariableVectorType
Definition: Stylesheet.hpp:95
static Stylesheet * create(MemoryManager &theManager, StylesheetRoot &root, const XalanDOMString &baseIdentifier, StylesheetConstructionContext &constructionContext)
const XalanDOMString * getNamespaceForPrefix(const XalanDOMChar *prefix, StylesheetConstructionContext &constructionContext) const
Get the namespace for a prefix, and report an error if it wasn't found.
void processExcludeResultPrefixes(StylesheetConstructionContext &theConstructionContext, const XalanDOMChar *theValue)
See if a namespace should be excluded.
Definition: Stylesheet.hpp:380
const ElemTemplate * getFirstTemplate() const
Definition: Stylesheet.hpp:709
const XalanDOMString & getBaseIdentifier() const
Retrieve the base identifier with which this stylesheet is associated.
Definition: Stylesheet.hpp:421
bool isWrapperless() const
whether there is a wrapper template
Definition: Stylesheet.hpp:491
static void addObjectIfNotFound(const XalanMatchPatternData *thePattern, const XalanMatchPatternData *theArray[], XalanSize_t &theArraySize)
Add object to array of match patterns if not already there.
void processKeyElement(const PrefixResolver &nsContext, const AttributeListType &atts, const Locator *locator, StylesheetConstructionContext &constructionContext)
Process the xsl:key element.
XalanMap< XalanQNameByReference, const ElemTemplate * > ElemTemplateMapType
Definition: Stylesheet.hpp:106
const XalanDOMString * getNamespaceForPrefixFromStack(const XalanDOMChar *prefix) const
Get the namespace from a prefix by searching the stack of namespace lists.
Definition: Stylesheet.hpp:341
XalanQName::NamespaceVectorType NamespaceVectorType
Definition: Stylesheet.hpp:92
XalanDOMString m_baseIdent
The base URL of the XSL document.
Definition: Stylesheet.hpp:724
MemoryManager & getMemoryManager()
Definition: Stylesheet.hpp:134
StylesheetExecutionContext::ParamVectorType ParamVectorType
Definition: Stylesheet.hpp:91
virtual const XalanDOMString & getURI() const
Retrieve the base URI for the resolver.
const StylesheetRoot & getStylesheetRoot() const
Retrieve the root stylesheet object.
Definition: Stylesheet.hpp:167
const NamespacesStackType & getNamespaces() const
Retrieve the stack of namespace lists.
Definition: Stylesheet.hpp:189
bool isAttrOK(const XalanDOMChar *attrName, const AttributeListType &atts, XalanSize_t which, StylesheetConstructionContext &constructionContext) const
See if this is a xmlns attribute, and, if so, process it.
StylesheetRoot & m_stylesheetRoot
The root of the stylesheet tree.
Definition: Stylesheet.hpp:719
void popNamespaces()
Pop a namespace declaration from the namespace stack.
Definition: Stylesheet.hpp:263
const PatternTableVectorType * locateMatchPatternDataList(const XalanNode &theNode, XalanNode::NodeType targetNodeType) const
Given a XalanNode, locate the start of a list of possible templates that match it.
const PatternTableVectorType * locateAttributeMatchPatternDataList(const XalanDOMString &theName) const
Given a name, locate the start of a list of possible templates that match that name.
XalanQName::NamespacesStackType NamespacesStackType
Definition: Stylesheet.hpp:93
const NamespacesHandler & getNamespacesHandler() const
Definition: Stylesheet.hpp:206
const XalanDOMChar * c_str() const
Xalan implementation of deque.
Definition: XalanDeque.hpp:201
This class contains information concerning a match pattern in a stylesheet.
virtual NodeType getNodeType() const =0
An enum value representing the type of the underlying object.
Class to represent a qualified name.
Definition: XalanQName.hpp:71
size_t size_type
Definition: XalanMap.hpp:46
XalanVector< const XalanMatchPatternData * > PatternTableVectorTypeDecl
Definition: Stylesheet.hpp:78
xercesc::AttributeList AttributeListType
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)