Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

StylesheetExecutionContext.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #if !defined(STYLESHEETEXECUTIONCONTEXT_HEADER_GUARD_1357924680)
17 #define STYLESHEETEXECUTIONCONTEXT_HEADER_GUARD_1357924680
18 
19 
20 
21 // Base include file. Must be first.
23 
24 
25 
26 #include <cstddef>
27 #include <cstdio>
28 #include <memory>
29 
30 
31 
32 // Base class header file...
34 
35 
36 
37 
39 
40 
41 
42 // Base class header file...
44 
45 
46 
47 #if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION)
49 #endif
50 
51 
52 
54 
55 
56 
57 
60 
61 
62 
64 
65 
66 
67 XALAN_CPP_NAMESPACE_BEGIN
68 
69 
70 
71 class CountersTable;
72 class ElemTemplate;
74 class ElemVariable;
75 class FormatterListener;
76 class FormatterToText;
77 class GenerateEvent;
78 class PrefixResolver;
79 class NodeRefListBase;
80 class NodeSorter;
81 class PrintWriter;
82 class XalanQName;
83 class SelectionEvent;
84 class Stylesheet;
85 class StylesheetRoot;
86 class XalanOutputStream;
87 class TracerEvent;
88 class Writer;
89 class XalanDocument;
91 class XalanElement;
92 class XalanNode;
93 class XalanNumberFormat;
94 class XPath;
95 class XObject;
96 class XObjectPtr;
97 class XResultTreeFrag;
98 
99 
100 
101 //
102 // An abstract class which provides support for executing stylesheets.
103 //
105 {
106 public:
107 
108 #if defined(XALAN_STRICT_ANSI_HEADERS)
109  typedef std::size_t tl_size_type;
110 #else
111  typedef size_t tl_size_type;
112 #endif
113 
114 #if defined(XALAN_NO_STD_NAMESPACE)
115  typedef ostream StreamType;
116 #else
117  typedef std::ostream StreamType;
118 #endif
119 
120  explicit
121  StylesheetExecutionContext(MemoryManagerType& m_memoryManager, XObjectFactory* theXObjectFactory = 0);
122 
123  virtual
125 
126  // These interfaces are new...
127 
135  virtual void
136  error(
137  const XalanDOMString& msg,
138  const ElemTemplateElement& styleNode,
139  const XalanNode* sourceNode = 0) const = 0;
140 
148  virtual void
149  warn(
150  const XalanDOMString& msg,
151  const ElemTemplateElement& styleNode,
152  const XalanNode* sourceNode = 0) const = 0;
153 
161  virtual void
162  message(
163  const XalanDOMString& msg,
164  const ElemTemplateElement& styleNode,
165  const XalanNode* sourceNode = 0) const = 0;
166 
167 
173  virtual bool
174  getQuietConflictWarnings() const = 0;
175 
182  virtual bool
183  getCopyTextNodesOnly() const = 0;
184 
191  virtual void
192  pushCopyTextNodesOnly(bool copyTextNodesOnly) = 0;
193 
198  virtual bool
199  popCopyTextNodesOnly() = 0;
200 
201  /*
202  * A class to manage setting and restoring the flag
203  * for restricting copying only text nodes to the
204  * result tree
205  */
207  {
208  public:
209 
211  StylesheetExecutionContext& executionContext,
212  bool fValue) :
213  m_executionContext(executionContext)
214  {
215  executionContext.pushCopyTextNodesOnly(fValue);
216  }
217 
219  {
220  m_executionContext.popCopyTextNodesOnly();
221  }
222 
223  private:
224 
225  // Not implemented...
227 
229  operator=(const SetAndRestoreCopyTextNodesOnly&);
230 
231  // Data members...
232  StylesheetExecutionContext& m_executionContext;
233 
234  };
235 
236 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
237 
241  virtual void
242  pushProcessCurrentAttribute(bool processAttribute) = 0;
243 
247  virtual bool
248  popProcessCurrentAttribute() = 0;
249 
255  virtual void
256  pushSkipElementAttributes(bool skipAttributes) = 0;
257 
262  virtual bool
263  getSkipElementAttributes() const = 0;
264 
268  virtual bool
269  popSkipElementAttributes() = 0;
270 
276  virtual void
277  pushExecuteIf(bool executeIf) = 0;
278 
284  virtual bool
285  popExecuteIf() = 0;
286 #endif
287 
295  virtual XalanNode*
296  getRootDocument() const = 0;
297 
305  virtual void
306  setRootDocument(XalanNode* theDocument) = 0;
307 
313  virtual void
314  setStylesheetRoot(const StylesheetRoot* theStylesheet) = 0;
315 
321  virtual const XalanQName*
322  getCurrentMode() const = 0;
323 
329  virtual void
330  pushCurrentMode(const XalanQName* theMode) = 0;
331 
332 
336  virtual void
337  popCurrentMode() =0;
338 
344  virtual const ElemTemplate*
345  getCurrentTemplate() const = 0;
346 
352  virtual void
353  pushCurrentTemplate(const ElemTemplate* theTemplate) = 0;
354 
355  virtual void
356  popCurrentTemplate() = 0;
357 
358 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
359  /*
360  * A class to manage pushing and popping the current
361  * template instance.
362  */
363  class PushAndPopCurrentTemplate
364  {
365  public:
366 
367  PushAndPopCurrentTemplate(
368  StylesheetExecutionContext& executionContext,
369  const ElemTemplate* theTemplate) :
370  m_executionContext(executionContext)
371  {
372  executionContext.pushCurrentTemplate(theTemplate);
373  }
374 
375  ~PushAndPopCurrentTemplate()
376  {
377  m_executionContext.popCurrentTemplate();
378  }
379 
380  private:
381 
382  // Data members...
383  StylesheetExecutionContext& m_executionContext;
384  };
385 #endif
386 
390  virtual bool
391  isElementPending() const = 0;
392 
400  virtual void
401  replacePendingAttribute(
402  const XalanDOMChar* theName,
403  const XalanDOMChar* theNewType,
404  const XalanDOMChar* theNewValue) = 0;
405 
411  virtual FormatterListener*
412  getFormatterListener() const = 0;
413 
419  virtual void
420  setFormatterListener(FormatterListener* flistener) = 0;
421 
422  virtual void
423  pushOutputContext(FormatterListener* flistener = 0) = 0;
424 
425  virtual void
426  popOutputContext() = 0;
427 
429  {
430  public:
431 
439  StylesheetExecutionContext& theExecutionContext,
440  FormatterListener* theNewListener = 0) :
441  m_executionContext(theExecutionContext)
442  {
443  m_executionContext.pushOutputContext(theNewListener);
444  }
445 
447  {
448  m_executionContext.popOutputContext();
449  }
450 
451  private:
452 
453  StylesheetExecutionContext& m_executionContext;
454  };
455 
462  virtual void
463  addResultAttribute(
464  const XalanDOMString& aname,
465  const XalanDOMString& value) = 0;
466 
473  virtual void
474  addResultAttribute(
475  const XalanDOMString& aname,
476  const XalanDOMChar* value) = 0;
477 
483  virtual void
484  copyNamespaceAttributes(const XalanNode& src) = 0;
485 
493  virtual const XalanDOMString*
494  getResultPrefixForNamespace(const XalanDOMString& theNamespace) const = 0;
495 
503  virtual const XalanDOMString*
504  getResultNamespaceForPrefix(const XalanDOMString& thePrefix) const = 0;
505 
514  virtual bool
515  isPendingResultPrefix(const XalanDOMString& thePrefix) = 0;
516 
517 
523  virtual void
524  getUniqueNamespaceValue(XalanDOMString& theValue) const = 0;
525 
531  virtual int
532  getIndent() const = 0;
533 
539  virtual void
540  setIndent(int indentAmount) = 0;
541 
550  virtual const XPath*
551  createMatchPattern(
552  const XalanDOMString& str,
553  const PrefixResolver& resolver) = 0;
554 
560  virtual void
561  returnXPath(const XPath* xpath) = 0;
562 
563  // A helper class to automatically return an XPath instance.
565  {
566  public:
567 
570  const XPath* xpath = 0) :
571  m_context(context),
572  m_xpath(xpath)
573  {
574  }
575 
577  {
578  if (m_xpath != 0)
579  {
580  m_context.returnXPath(m_xpath);
581  }
582  }
583 
584  const XPath*
585  get() const
586  {
587  return m_xpath;
588  }
589 
590  const XPath*
592  {
593  const XPath* const temp = m_xpath;
594 
595  m_xpath = 0;
596 
597  return temp;
598  }
599 
600  void
601  reset(const XPath* xpath)
602  {
603  if (m_xpath != 0)
604  {
605  m_context.returnXPath(m_xpath);
606  }
607 
608  m_xpath = xpath;
609  }
610 
611  private:
612 
613  StylesheetExecutionContext& m_context;
614 
615  const XPath* m_xpath;
616  };
617 
619 
626  virtual void
627  pushTopLevelVariables(const ParamVectorType& topLevelParams) = 0;
628 
638  virtual const XObjectPtr
639  createVariable(
640  const XPath& xpath,
641  XalanNode* contextNode,
642  const PrefixResolver& resolver) = 0;
643 
644 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
645 
653  virtual const XObjectPtr
654  createVariable(
655  const ElemTemplateElement& templateChild,
656  XalanNode* sourceNode) = 0;
657 #endif
658 
671  virtual void
672  pushVariable(
673  const XalanQName& name,
674  const ElemTemplateElement* element,
675  const XalanDOMString& str,
676  XalanNode* contextNode,
677  const PrefixResolver& resolver) = 0;
678 
690  virtual void
691  pushVariable(
692  const XalanQName& name,
693  const ElemTemplateElement* element,
694  const XPath& xpath,
695  XalanNode* contextNode,
696  const PrefixResolver& resolver) = 0;
697 
698 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
699 
708  virtual void
709  pushVariable(
710  const XalanQName& name,
711  const ElemTemplateElement* element,
712  const ElemTemplateElement& templateChild,
713  XalanNode* sourceNode) = 0;
714 #endif
715 
724  virtual void
725  pushVariable(
726  const XalanQName& name,
727  const XObjectPtr val,
728  const ElemTemplateElement* element) = 0;
729 
738  virtual void
739  pushVariable(
740  const XalanQName& name,
741  const ElemVariable* var,
742  const ElemTemplateElement* element) = 0;
743 
748  virtual void
749  pushContextMarker() = 0;
750 
754  virtual void
755  popContextMarker() = 0;
756 
757 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
758  /*
759  * A class to manage pushing and popping an element's stack
760  * frame context.
761  */
762  class PushAndPopContextMarker
763  {
764  public:
765 
766  PushAndPopContextMarker(StylesheetExecutionContext& executionContext) :
767  m_executionContext(executionContext)
768  {
769  executionContext.pushContextMarker();
770  }
771 
772  PushAndPopContextMarker(
773  StylesheetExecutionContext& executionContext,
774  int& currentStackFrameIndex) :
775  m_executionContext(executionContext)
776  {
777  currentStackFrameIndex = executionContext.getCurrentStackFrameIndex();
778 
779  executionContext.pushContextMarker();
780  }
781 
782  ~PushAndPopContextMarker()
783  {
784  m_executionContext.popContextMarker();
785  }
786 
788  getExecutionContext() const
789  {
790  return m_executionContext;
791  }
792 
793  private:
794 
795  StylesheetExecutionContext& m_executionContext;
796  };
797 #endif
798 
802  virtual void
803  resolveTopLevelParams() = 0;
804 
808  virtual void
809  clearTopLevelParams() = 0;
810 
811 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
812  class ResolveAndClearTopLevelParams
813  {
814  public:
815 
816  ResolveAndClearTopLevelParams(StylesheetExecutionContext& executionContext) :
817  m_executionContext(executionContext)
818  {
819  m_executionContext.resolveTopLevelParams();
820  }
821 
822  ~ResolveAndClearTopLevelParams()
823  {
824  m_executionContext.clearTopLevelParams();
825  }
826 
827  private:
828 
829  StylesheetExecutionContext& m_executionContext;
830  };
831 
838  virtual void
839  pushParams(const ElemTemplateElement& xslCallTemplateElement) = 0;
840 
841 #else
842 
846  virtual void beginParams() = 0;
847 
851  virtual void endParams() = 0;
852 
858  virtual void pushParam(const XalanQName& qName,const XObjectPtr& theValue) = 0;
859 #endif
860 
871  virtual const XObjectPtr
872  getParamVariable(const XalanQName& theName) = 0;
873 
879  virtual void
880  pushElementFrame(const ElemTemplateElement* elem) = 0;
881 
887  virtual void
888  popElementFrame() = 0;
889 
890 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
891  /*
892  * A class to manage pushing and popping an element's stack
893  * frame context.
894  */
895  class PushAndPopElementFrame
896  {
897  public:
898 
899  PushAndPopElementFrame(
900  StylesheetExecutionContext& executionContext,
901  const ElemTemplateElement* element) :
902  m_executionContext(executionContext)
903  {
904  executionContext.pushElementFrame(element);
905  }
906 
907  ~PushAndPopElementFrame()
908  {
909  m_executionContext.popElementFrame();
910  }
911 
912  private:
913 
914  StylesheetExecutionContext& m_executionContext;
915  };
916 #endif
917 
923  virtual int
924  getGlobalStackFrameIndex() const = 0;
925 
932  virtual int
933  getCurrentStackFrameIndex() const = 0;
934 
941  virtual void
942  pushCurrentStackFrameIndex(int currentStackFrameIndex = -1) = 0;
943 
947  virtual void
948  popCurrentStackFrameIndex() = 0;
949 
950  /*
951  * A class to manage the state of the variable stacks frame index.
952  */
954  {
955  public:
956 
958  StylesheetExecutionContext& executionContext,
959  int newIndex) :
960  m_executionContext(executionContext),
961  m_savedIndex(executionContext.getCurrentStackFrameIndex())
962  {
963  executionContext.pushCurrentStackFrameIndex(newIndex);
964  }
965 
967  {
968  m_executionContext.popCurrentStackFrameIndex();
969  }
970 
971  private:
972 
973  StylesheetExecutionContext& m_executionContext;
974 
975  const int m_savedIndex;
976  };
977 
978 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
979  /*
980  * A class to manage stack state during execution.
981  */
982  class ParamsPushPop : public PushAndPopContextMarker
983  {
984  public:
985 
986  ParamsPushPop(
987  StylesheetExecutionContext& executionContext,
988  const ElemTemplateElement& xslCallTemplateElement) :
989  PushAndPopContextMarker(executionContext)
990  {
991  doPush(xslCallTemplateElement);
992  }
993 
994  ParamsPushPop(
995  StylesheetExecutionContext& executionContext,
996  const ElemTemplateElement& xslCallTemplateElement,
997  int& savedStackFrameIndex) :
998  PushAndPopContextMarker(executionContext, savedStackFrameIndex)
999  {
1000  doPush(
1001  xslCallTemplateElement,
1002  savedStackFrameIndex);
1003  }
1004 
1005  ~ParamsPushPop()
1006  {
1007  }
1008 
1009  private:
1010 
1011  void
1012  doPush(
1013  const ElemTemplateElement& xslCallTemplateElement,
1014  int stackFrameIndex);
1015 
1016  void
1017  doPush(const ElemTemplateElement& xslCallTemplateElement);
1018  };
1019 #endif
1020 
1030  virtual void
1031  startDocument() = 0;
1032 
1044  virtual void
1045  endDocument() = 0;
1046 
1052  virtual void
1053  startElement(const XalanDOMChar* name) = 0;
1054 
1060  virtual void
1061  endElement(const XalanDOMChar* name) = 0;
1062 
1070  virtual void
1071  characters(
1072  const XalanDOMChar* ch,
1075 
1085  virtual void
1086  charactersRaw(
1087  const XalanDOMChar* ch,
1090 
1096  virtual void
1097  comment(const XalanDOMChar* data) = 0;
1098 
1105  virtual void
1106  processingInstruction(
1107  const XalanDOMChar* target,
1108  const XalanDOMChar* data) = 0;
1109 
1113  virtual void
1114  flushPending() = 0;
1115 
1122  virtual void
1123  cloneToResultTree(
1124  const XalanNode& node,
1125  const LocatorType* locator) = 0;
1126 
1136  virtual void
1137  cloneToResultTree(
1138  const XalanNode& node,
1139  XalanNode::NodeType nodeType,
1140  bool overrideStrip,
1141  bool shouldCloneAttributes,
1142  const LocatorType* locator) = 0;
1143 
1144 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
1145 
1149  virtual void
1150  beginCreateXResultTreeFrag(
1151  XalanNode* sourceNode) = 0;
1152 
1157  virtual const XObjectPtr
1158  endCreateXResultTreeFrag() = 0;
1159 
1165  virtual void
1166  beginFormatToText(
1167  XalanDOMString& theResult) = 0;
1168 
1173  virtual void
1174  endFormatToText() = 0;
1175 #else
1176 
1183  virtual const XObjectPtr
1184  createXResultTreeFrag(
1185  const ElemTemplateElement& templateChild,
1186  XalanNode* sourceNode) = 0;
1187 #endif
1188 
1196  virtual void
1197  outputToResultTree(
1198  const XObject& xobj,
1199  const LocatorType* locator) = 0;
1200 
1208  virtual void
1209  outputResultTreeFragment(
1210  const XObject& theTree,
1211  const LocatorType* locator) = 0;
1212 
1218  virtual const XalanDOMString&
1219  getXSLNameSpaceURL() const = 0;
1220 
1226  virtual const XalanDOMString&
1227  getXalanXSLNameSpaceURL() const = 0;
1228 
1234  virtual bool
1235  findOnElementRecursionStack(const ElemTemplateElement* theElement) const = 0;
1236 
1242  virtual void
1243  pushOnElementRecursionStack(const ElemTemplateElement* theElement) = 0;
1244 
1250  virtual const ElemTemplateElement*
1251  popElementRecursionStack() = 0;
1252 
1257  {
1258  public:
1259 
1267  StylesheetExecutionContext& executionContext,
1268  const ElemTemplateElement* element) :
1269  m_executionContext(executionContext)
1270  {
1271  m_executionContext.pushOnElementRecursionStack(element);
1272  }
1273 
1275  {
1276  m_executionContext.popElementRecursionStack();
1277  }
1278 
1279  private:
1280 
1281  StylesheetExecutionContext& m_executionContext;
1282  };
1283 
1284 
1294  virtual bool
1295  returnXResultTreeFrag(XResultTreeFrag* theXResultTreeFrag) = 0;
1296 
1297 
1298  enum eDummy
1299  {
1300  eDefaultXMLIndentAmount = 0,
1301  eDefaultHTMLIndentAmount = 0
1302  };
1303 
1308  {
1309  eEscapeURLsDefault, // Use the value in the stylesheet
1310  eEscapeURLsNo, // Don't escape URLs
1311  eEscapeURLsYes // Escape URLs
1312  };
1313 
1321  virtual eEscapeURLs
1322  getEscapeURLs() const = 0;
1323 
1331  virtual void
1332  setEscapeURLs(eEscapeURLs value) = 0;
1333 
1334 
1339  {
1340  eOmitMETATagDefault, // Use the value in the stylesheet
1341  eOmitMETATagNo, // Don't omit the META tag
1342  eOmitMETATagYes // Omit the META tag
1343  };
1344 
1352  virtual eOmitMETATag
1353  getOmitMETATag() const = 0;
1354 
1362  virtual void
1363  setOmitMETATag(eOmitMETATag value) = 0;
1364 
1386  virtual FormatterListener*
1387  createFormatterToXML(
1388  Writer& writer,
1390  bool doIndent = false,
1391  int indent = eDefaultXMLIndentAmount,
1396  bool xmlDecl = true,
1397  const XalanDOMString& standalone = XalanDOMString(XalanMemMgrs::getDummyMemMgr())) = 0;
1398 
1416  virtual FormatterListener*
1417  createFormatterToHTML(
1418  Writer& writer,
1423  bool doIndent = true,
1424  int indent = eDefaultHTMLIndentAmount,
1425  bool escapeURLs = true,
1426  bool omitMetaTag = false) = 0;
1427 
1434  virtual FormatterListener*
1435  createFormatterToText(
1436  Writer& writer,
1437  const XalanDOMString& encoding) = 0;
1438 
1439 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
1440  class BorrowReturnFormatterToText
1441  {
1442  public:
1443 
1444  BorrowReturnFormatterToText(
1445  StylesheetExecutionContext& executionContext,
1446  Writer& writer,
1447  bool normalizeLinefeed = true,
1448  bool handleIgnorableWhitespace = true);
1449 
1450  ~BorrowReturnFormatterToText()
1451  {
1452  assert(m_formatter != 0);
1453 
1454  m_executionContext.returnFormatterToText(m_formatter);
1455  }
1456 
1458  operator*() const
1459  {
1460  assert(m_formatter != 0);
1461 
1462  return *m_formatter;
1463  }
1464 
1466  get() const
1467  {
1468  assert(m_formatter != 0);
1469 
1470  return m_formatter;
1471  }
1472 
1474  operator->() const
1475  {
1476  return get();
1477  }
1478 
1479  private:
1480 
1481  StylesheetExecutionContext& m_executionContext;
1482 
1483  FormatterToText* m_formatter;
1484  };
1485 
1486 
1487  friend class BorrowReturnFormatterToText;
1488 #endif
1489 
1490 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
1491 
1494  virtual NodeSorter*
1495  getNodeSorter() = 0;
1496 
1497 #else
1498 
1503  virtual NodeSorter*
1504  borrowNodeSorter() = 0;
1505 
1512  virtual bool
1513  returnNodeSorter(NodeSorter* theSorter) = 0;
1514 
1515  class BorrowReturnNodeSorter
1516  {
1517  public:
1518 
1519  BorrowReturnNodeSorter(StylesheetExecutionContext& executionContext) :
1520  m_executionContext(executionContext),
1521  m_sorter(executionContext.borrowNodeSorter())
1522  {
1523  assert(m_sorter != 0);
1524  }
1525 
1526  ~BorrowReturnNodeSorter()
1527  {
1528  assert(m_sorter != 0);
1529 
1530  m_executionContext.returnNodeSorter(m_sorter);
1531  }
1532 
1533  NodeSorter&
1534  operator*() const
1535  {
1536  assert(m_sorter != 0);
1537 
1538  return *m_sorter;
1539  }
1540 
1541  NodeSorter*
1542  get() const
1543  {
1544  assert(m_sorter != 0);
1545 
1546  return m_sorter;
1547  }
1548 
1549  NodeSorter*
1550  operator->() const
1551  {
1552  return get();
1553  }
1554 
1555  private:
1556 
1557  StylesheetExecutionContext& m_executionContext;
1558 
1559  NodeSorter* m_sorter;
1560  };
1561 #endif
1562 
1564 
1571  virtual XalanNumberFormatAutoPtr
1572  createXalanNumberFormat() = 0;
1573 
1574 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
1575  /*
1576  * A class to manage the attribute sets that have been executed
1577  * by an element
1578  */
1580  {
1582  attributeSetNameIndex(0),
1583  matchingAttributeSetIndex(0) {}
1584 
1587 
1588 
1589  };
1590 
1591  virtual void
1592  createUseAttributeSetIndexesOnStack() = 0;
1593 
1594  virtual UseAttributeSetIndexes&
1595  getUseAttributeSetIndexes() = 0;
1596 
1597  virtual void
1598  popUseAttributeSetIndexesFromStack() = 0;
1599 
1606  virtual void
1607  pushInvoker(const ElemTemplateElement * invoker) = 0;
1608 
1612  virtual void
1613  popInvoker() = 0;
1614 
1619  virtual const ElemTemplateElement*
1620  getInvoker() const = 0;
1621 #endif
1622 
1628  virtual tl_size_type
1629  getTraceListeners() const = 0;
1630 
1636  virtual void
1637  fireGenerateEvent(const GenerateEvent& ge) = 0;
1638 
1644  virtual void
1645  fireTraceEvent(const TracerEvent& te) = 0;
1646 
1652  virtual void
1653  fireSelectEvent(const SelectionEvent& se) = 0;
1654 
1660  virtual bool
1661  getTraceSelects() const = 0;
1662 
1670  virtual void
1671  traceSelect(
1672  const ElemTemplateElement& theStylesheetElement,
1673  const NodeRefListBase& nl,
1674  const XPath* xpath) = 0;
1675 
1685  virtual int
1687  const XalanDOMString& theLHS,
1688  const XalanDOMString& theRHS,
1690 
1701  virtual int
1703  const XalanDOMString& theLHS,
1704  const XalanDOMString& theRHS,
1705  const XalanDOMString& theLocale,
1707 
1717  virtual int
1719  const XalanDOMChar* theLHS,
1720  const XalanDOMChar* theRHS,
1722 
1733  virtual int
1735  const XalanDOMChar* theLHS,
1736  const XalanDOMChar* theRHS,
1737  const XalanDOMChar* theLocale,
1739 
1746  virtual PrintWriter*
1747  createPrintWriter(XalanOutputStream* theTextOutputStream) = 0;
1748 
1757  virtual PrintWriter*
1758  createPrintWriter(
1759  const XalanDOMString& theFileName,
1760  const XalanDOMString& theEncoding) = 0;
1761 
1768  virtual PrintWriter*
1769  createPrintWriter(StreamType& theStream) = 0;
1770 
1777  virtual PrintWriter*
1778  createPrintWriter(FILE* theStream) = 0;
1779 
1786  virtual CountersTable&
1787  getCountersTable() = 0;
1788 
1794  virtual void
1795  characters(const XalanNode& node) = 0;
1796 
1802  virtual void
1803  characters(const XObjectPtr& xobject) = 0;
1804 
1811  virtual void
1812  charactersRaw(const XalanNode& node) = 0;
1813 
1819  virtual void
1820  charactersRaw(const XObjectPtr& xobject) = 0;
1821 
1822 
1823  // These interfaces are inherited from XPathExecutionContext...
1824 
1825  virtual void
1826  reset() = 0;
1827 
1828  virtual XalanNode*
1829  getCurrentNode() const = 0;
1830 
1831  virtual void
1832  pushCurrentNode(XalanNode* theCurrentNode) = 0;
1833 
1834  virtual void
1835  popCurrentNode() = 0;
1836 
1837  virtual bool
1838  isNodeAfter(
1839  const XalanNode& node1,
1840  const XalanNode& node2) const = 0;
1841 
1842  virtual void
1843  pushContextNodeList(const NodeRefListBase& theList) = 0;
1844 
1845  virtual void
1846  popContextNodeList() = 0;
1847 
1848  virtual const NodeRefListBase&
1849  getContextNodeList() const = 0;
1850 
1851  virtual size_type
1852  getContextNodeListLength() const = 0;
1853 
1854  virtual size_type
1855  getContextNodeListPosition(const XalanNode& contextNode) const = 0;
1856 
1864  virtual bool
1865  elementAvailable(const XalanQName& theQName) const = 0;
1866 
1876  virtual bool
1878  const XalanDOMString& theName,
1879  const LocatorType* locator) const = 0;
1880 
1888  virtual bool
1889  functionAvailable(const XalanQName& theQName) const = 0;
1890 
1899  virtual bool
1901  const XalanDOMString& theName,
1902  const LocatorType* locator) const = 0;
1903 
1904  virtual const XObjectPtr
1905  extFunction(
1906  const XalanDOMString& theNamespace,
1907  const XalanDOMString& functionName,
1908  XalanNode* context,
1909  const XObjectArgVectorType& argVec,
1910  const LocatorType* locator) = 0;
1911 
1912  virtual XalanDocument*
1913  parseXML(
1914  MemoryManagerType& theManager,
1915  const XalanDOMString& urlString,
1916  const XalanDOMString& base) const = 0;
1917 
1918  virtual MutableNodeRefList*
1920 
1921  virtual bool
1923 
1924  virtual MutableNodeRefList*
1925  createMutableNodeRefList(MemoryManagerType& theManager) const = 0;
1926 
1927 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
1928 
1929  virtual MutableNodeRefList&
1930  createAndPushMutableNodeRefList() = 0;
1931 
1932  virtual void
1933  releaseAndPopMutableNodeRefList() = 0;
1934 
1935  virtual void
1936  pushXObjectPtr(const XObjectPtr& xobjectPtr) = 0;
1937 
1938  virtual void
1939  popXObjectPtr() = 0;
1940 
1941  virtual void
1942  createAndPushNodesToTransformList(const NodeRefListBase* nodeList) = 0;
1943 
1944  virtual XalanNode*
1945  getNextNodeToTransform() = 0;
1946 
1947  virtual void
1948  popNodesToTransformList() = 0;
1949 
1954  virtual XalanDOMString&
1955  getAndPushCachedString() = 0;
1956 
1961  virtual XalanDOMString&
1962  getLastCachedString() = 0;
1963 
1971  virtual XalanDOMString&
1972  getAndPopCachedString() = 0;
1973 #endif
1974 
1975  virtual XalanDOMString&
1976  getCachedString() = 0;
1977 
1978  virtual bool
1979  releaseCachedString(XalanDOMString& theString) = 0;
1980 
1981 
1982  virtual void
1984  XalanDocument* doc,
1985  const XalanQName& qname,
1986  const XalanDOMString& ref,
1987  MutableNodeRefList& nodelist) = 0;
1988 
1989  virtual void
1991  XalanDocument* doc,
1992  const XalanDOMString& name,
1993  const XalanDOMString& ref,
1994  const LocatorType* locator,
1995  MutableNodeRefList& nodelist) = 0;
1996 
1997  virtual const XObjectPtr
1998  getVariable(
1999  const XalanQName& name,
2000  const LocatorType* locator = 0) = 0;
2001 
2002  virtual const PrefixResolver*
2003  getPrefixResolver() const = 0;
2004 
2005  virtual void
2006  setPrefixResolver(const PrefixResolver* thePrefixResolver) = 0;
2007 
2008  virtual const XalanDOMString*
2009  getNamespaceForPrefix(const XalanDOMString& prefix) const = 0;
2010 
2011  virtual const XalanDOMString&
2012  findURIFromDoc(const XalanDocument* owner) const = 0;
2013 
2014  virtual const XalanDOMString&
2016  const XalanDOMString& theName,
2017  const XalanDocument& theDocument) const = 0;
2018 
2019  virtual bool
2020  shouldStripSourceNode(const XalanText& node) = 0;
2021 
2022  virtual XalanDocument*
2023  getSourceDocument(const XalanDOMString& theURI) const = 0;
2024 
2025  virtual void
2027  const XalanDOMString& theURI,
2028  XalanDocument* theDocument) = 0;
2029 
2030  virtual void
2031  formatNumber(
2032  double number,
2033  const XalanDOMString& pattern,
2034  XalanDOMString& theResult,
2035  const XalanNode* context = 0,
2036  const LocatorType* locator = 0) = 0;
2037 
2038  virtual void
2039  formatNumber(
2040  double number,
2041  const XalanDOMString& pattern,
2042  const XalanDOMString& dfsName,
2043  XalanDOMString& theResult,
2044  const XalanNode* context = 0,
2045  const LocatorType* locator = 0) = 0;
2046 
2047  // These interfaces are inherited from ExecutionContext...
2048 
2049  virtual void
2050  error(
2051  const XalanDOMString& msg,
2052  const XalanNode* sourceNode,
2053  const LocatorType* locator) const = 0;
2054 
2055  virtual void
2056  warn(
2057  const XalanDOMString& msg,
2058  const XalanNode* sourceNode = 0,
2059  const LocatorType* locator = 0) const = 0;
2060 
2061  virtual void
2062  message(
2063  const XalanDOMString& msg,
2064  const XalanNode* sourceNode = 0,
2065  const LocatorType* locator = 0) const = 0;
2066 
2067 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
2068 protected:
2074  virtual FormatterToText*
2075  borrowFormatterToText() = 0;
2076 
2083  virtual bool
2084  returnFormatterToText(FormatterToText* theFormatter) = 0;
2085 #endif
2086 };
2087 
2088 
2089 
2090 XALAN_CPP_NAMESPACE_END
2091 
2092 
2093 
2094 #endif // STYLESHEETEXECUTIONCONTEXT_HEADER_GUARD_1357924680
Definition: StylesheetExecutionContext.hpp:1310
virtual void setPrefixResolver(const PrefixResolver *thePrefixResolver)=0
Change the resolver for namespaces.
virtual void pushContextNodeList(const NodeRefListBase &theList)=0
Push the node list for current context.
virtual MutableNodeRefList * borrowMutableNodeRefList()=0
Borrow a cached MutableNodeRefList instance.
Definition: ElemVariable.hpp:52
virtual bool shouldStripSourceNode(const XalanText &node)=0
Tells, through the combination of the default-space attribute on xsl:stylesheet, xsl:strip-space, xsl:preserve-space, and the xml:space attribute, whether or not extra whitespace should be stripped from the node.
Definition: XalanNode.hpp:44
Definition: XalanText.hpp:38
virtual void message(const XalanDOMString &msg, const XalanNode *sourceNode=0, const LocatorType *locator=0) const =0
Output a message.
SetAndRestoreCopyTextNodesOnly(StylesheetExecutionContext &executionContext, bool fValue)
Definition: StylesheetExecutionContext.hpp:210
Definition: ElemTemplate.hpp:41
virtual bool returnMutableNodeRefList(MutableNodeRefList *theList)=0
Return a previously borrowed MutableNodeRefList instance.
Local implementation of MutableNodeRefList.
Definition: MutableNodeRefList.hpp:44
XPathGuard(StylesheetExecutionContext &context, const XPath *xpath=0)
Definition: StylesheetExecutionContext.hpp:568
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType
Definition: XalanMemoryManagement.hpp:39
ElementRecursionStackPusher(StylesheetExecutionContext &executionContext, const ElemTemplateElement *element)
Construct an instance of the recursion stack pusher.
Definition: StylesheetExecutionContext.hpp:1266
UseAttributeSetIndexes()
Definition: StylesheetExecutionContext.hpp:1581
Definition: Writer.hpp:42
XalanVector< TopLevelArg > ParamVectorType
Definition: StylesheetExecutionContext.hpp:618
virtual void pushCurrentTemplate(const ElemTemplate *theTemplate)=0
Set the current template.
This is a table of counters, keyed by ElemNumber objects...
Definition: CountersTable.hpp:160
~SetAndRestoreCopyTextNodesOnly()
Definition: StylesheetExecutionContext.hpp:218
Definition: ElemTemplateElement.hpp:74
virtual void pushCopyTextNodesOnly(bool copyTextNodesOnly)=0
Set the flag that determines if only text nodes can be copied to the result tree. ...
void reset(const XPath *xpath)
Definition: StylesheetExecutionContext.hpp:601
Definition: StylesheetExecutionContext.hpp:1579
virtual const PrefixResolver * getPrefixResolver() const =0
Retrieve the resolver for namespaces.
virtual void pushElementFrame(const ElemTemplateElement *elem)=0
Push a frame marker for an element.
Definition: XalanNumberFormat.hpp:34
virtual const NodeRefListBase & getContextNodeList() const =0
Get the node list for current context.
virtual void pushCurrentNode(XalanNode *theCurrentNode)=0
Change the node currently being executed.
virtual void reset()=0
Reset the instance.
Definition: XalanDocumentFragment.hpp:38
This acts as the stylesheet root of the stylesheet tree, and holds values that are shared by all styl...
Definition: StylesheetRoot.hpp:61
NodeType
Definition: XalanNode.hpp:53
Definition: StylesheetExecutionContext.hpp:104
Definition: XalanElement.hpp:42
virtual bool releaseCachedString(XalanDOMString &theString)=0
Return a cached string.
virtual int getCurrentStackFrameIndex() const =0
Get the top of the stack frame from where a search for a variable or param should take place...
Definition: StylesheetExecutionContext.hpp:564
Class to hold XObjectPtr return types.
Definition: XObject.hpp:584
Definition: XPath.hpp:62
XalanMemMgrAutoPtr< XalanNumberFormat, true > XalanNumberFormatAutoPtr
Definition: StylesheetExecutionContext.hpp:1563
eOmitMETATag
Enums to determine whether or not run-time omission of the META tag has been set. ...
Definition: StylesheetExecutionContext.hpp:1338
size_type matchingAttributeSetIndex
Definition: StylesheetExecutionContext.hpp:1586
virtual MutableNodeRefList * createMutableNodeRefList(MemoryManagerType &theManager) const =0
Create a MutableNodeRefList with the appropriate context.
This is the class for events generated by the XSL processor after it generates a new node in the resu...
Definition: GenerateEvent.hpp:50
Definition: XPathExecutionContext.hpp:72
~OutputContextPushPop()
Definition: StylesheetExecutionContext.hpp:446
Class for keeping track of elements pushed on the element recursion stack.
Definition: StylesheetExecutionContext.hpp:1256
SetAndRestoreCurrentStackFrameIndex(StylesheetExecutionContext &executionContext, int newIndex)
Definition: StylesheetExecutionContext.hpp:957
Definition: PrintWriter.hpp:35
Definition: StylesheetExecutionContext.hpp:1340
Local implementation of NodeRefList.
Definition: NodeRefListBase.hpp:42
virtual void setSourceDocument(const XalanDOMString &theURI, XalanDocument *theDocument)=0
Associate a document with a given URI.
Definition: StylesheetExecutionContext.hpp:1309
size_t tl_size_type
Definition: StylesheetExecutionContext.hpp:111
A SAX-based formatter interface for the XSL processor.
Definition: FormatterListener.hpp:62
~SetAndRestoreCurrentStackFrameIndex()
Definition: StylesheetExecutionContext.hpp:966
virtual void popCurrentNode()=0
Reset the node currently being executed.
Definition: StylesheetExecutionContext.hpp:1341
Definition: StylesheetExecutionContext.hpp:953
virtual const XObjectPtr extFunction(const XalanDOMString &theNamespace, const XalanDOMString &functionName, XalanNode *context, const XObjectArgVectorType &argVec, const LocatorType *locator)=0
Handle an extension function.
static MemoryManager & getDummyMemMgr()
eDummy
Definition: StylesheetExecutionContext.hpp:1298
virtual size_type getContextNodeListLength() const =0
virtual XalanDocument * getSourceDocument(const XalanDOMString &theURI) const =0
Get the document associated with the given URI.
virtual bool isNodeAfter(const XalanNode &node1, const XalanNode &node2) const =0
Determine if a node is after another node, in document order.
OutputContextPushPop(StylesheetExecutionContext &theExecutionContext, FormatterListener *theNewListener=0)
Construct an object to push and pop the current output context.
Definition: StylesheetExecutionContext.hpp:438
Definition: StylesheetExecutionContext.hpp:206
virtual void popContextNodeList()=0
Pop the node list for current context.
collationCompare(const XalanDOMChar *theLHS, XalanDOMString::size_type theLHSLength, const XalanDOMChar *theRHS, XalanDOMString::size_type theRHSLength)
Compare the contents of two character arrays.
Definition: XalanCollationServices.hpp:38
eEscapeURLs
Enums to determine whether or not run-time escaping of URLs has been set.
Definition: StylesheetExecutionContext.hpp:1307
virtual bool elementAvailable(const XalanQName &theQName) const =0
Determine if an external element is available.
virtual XalanNode * getCurrentNode() const =0
Retrieve the node currently being executed.
This class defines an interface for classes that resolve namespace prefixes to their URIs...
Definition: PrefixResolver.hpp:37
virtual XalanDOMString & getCachedString()=0
Get a cached string for temporary use.
virtual const XalanDOMString & getUnparsedEntityURI(const XalanDOMString &theName, const XalanDocument &theDocument) const =0
The getUnparsedEntityURI function returns the URI of the unparsed entity with the specified name in t...
virtual void warn(const XalanDOMString &msg, const XalanNode *sourceNode=0, const LocatorType *locator=0) const =0
Report a warning.
Class to hold XPath return types.
Definition: XObject.hpp:61
This is the parent class of events generated for tracing the progress of the XSL processor.
Definition: TracerEvent.hpp:47
XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType
Definition: FormatterListener.hpp:47
virtual void pushContextMarker()=0
Push a context marker onto the stack to let us know when to stop searching for a var.
Definition: XalanDocument.hpp:51
const XPath * release()
Definition: StylesheetExecutionContext.hpp:591
virtual void pushCurrentStackFrameIndex(int currentStackFrameIndex=-1)=0
Set the top of the stack frame from where a search for a variable or param should take place...
eCaseOrder
Definition: XalanCollationServices.hpp:38
Definition: XalanMemMgrAutoPtr.hpp:46
std::ostream StreamType
Definition: StylesheetExecutionContext.hpp:117
~XPathGuard()
Definition: StylesheetExecutionContext.hpp:576
virtual const XalanDOMString & findURIFromDoc(const XalanDocument *owner) const =0
Given a DOM Document, tell what URI was used to parse it.
Definition: XalanOutputStream.hpp:47
virtual bool functionAvailable(const XalanQName &theQName) const =0
Determine if a function is available.
~ElementRecursionStackPusher()
Definition: StylesheetExecutionContext.hpp:1274
size_type attributeSetNameIndex
Definition: StylesheetExecutionContext.hpp:1585
#define XALAN_XSLT_EXPORT
Definition: XSLTDefinitions.hpp:25
virtual void getNodeSetByKey(XalanDocument *doc, const XalanQName &qname, const XalanDOMString &ref, MutableNodeRefList &nodelist)=0
Given a valid element key, return the corresponding node list.
NodeRefListBase::size_type size_type
Definition: XPathExecutionContext.hpp:78
Definition: XalanDOMString.hpp:42
Definition: SelectionEvent.hpp:45
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
Definition: DOMStringHelper.hpp:277
This class takes SAX events (in addition to some extra events that SAX doesn't handle yet) and produc...
Definition: FormatterToText.hpp:47
This class represents the base stylesheet or an "import" stylesheet.
Definition: Stylesheet.hpp:84
virtual size_type getContextNodeListPosition(const XalanNode &contextNode) const =0
Definition: XResultTreeFrag.hpp:55
This class can sort vectors of nodes according to a select pattern.
Definition: NodeSorter.hpp:66
unsigned int size_type
Definition: XalanDOMString.hpp:53
virtual const XObjectPtr getVariable(const XalanQName &name, const LocatorType *locator=0)=0
Given a name, locate a variable in the current context, and return a pointer to the object...
virtual void formatNumber(double number, const XalanDOMString &pattern, XalanDOMString &theResult, const XalanNode *context=0, const LocatorType *locator=0)=0
Formats a number according to the specified pattern.
virtual XalanDocument * parseXML(MemoryManagerType &theManager, const XalanDOMString &urlString, const XalanDOMString &base) const =0
Provides support for XML parsing service.
virtual void error(const XalanDOMString &msg, const XalanNode *sourceNode=0, const LocatorType *locator=0) const =0
Report an error and throw an exception.
Definition: StylesheetExecutionContext.hpp:428
This class handles the creation of XObjects and manages their lifetime.
Definition: XObjectFactory.hpp:51
Class to represent a qualified name: "The name of an internal XSLT object, specifically a named templ...
Definition: XalanQName.hpp:68
Definition: XalanVector.hpp:61
virtual const XalanDOMString * getNamespaceForPrefix(const XalanDOMString &prefix) const =0
Retrieve the URI corresponding to a namespace prefix.

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

dot

Xalan-C++ XSLT Processor Version 1.10
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.

Apache Logo