Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

XSLTEngineImpl.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(XALAN_XSLTENGINEIMPL_HEADER_GUARD)
17 #define XALAN_XSLTENGINEIMPL_HEADER_GUARD
18 
19 
20 
21 // Base include file. Must be first.
22 #include "XSLTDefinitions.hpp"
23 
24 
25 
26 // Base class
27 #include "XSLTProcessor.hpp"
28 
29 
30 
31 
32 // Standard library headers
33 #include <cassert>
34 
35 
36 
38 
39 
40 
41 #if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION)
43 #endif
44 
45 
46 
49 
50 
51 
55 
56 
57 
59 
60 
61 
63 
64 
65 
67 
68 
69 
70 #include "OutputContextStack.hpp"
75 
76 
77 
78 XALAN_DECLARE_XERCES_CLASS(InputSource)
79 XALAN_DECLARE_XERCES_CLASS(DocumentHandler)
80 
81 
82 
83 XALAN_CPP_NAMESPACE_BEGIN
84 
85 
86 
87 typedef XERCES_CPP_NAMESPACE_QUALIFIER InputSource InputSourceType;
88 typedef XERCES_CPP_NAMESPACE_QUALIFIER DocumentHandler DocumentHandlerType;
89 
90 
91 
92 // Forward declarations...
93 class DOMSupport;
94 class GenerateEvent;
95 class PrintWriter;
97 class StylesheetRoot;
98 class XalanAttr;
100 class XalanText;
101 class XMLParserLiaison;
102 class XObject;
103 class XPathEnvSupport;
104 class XPathFactory;
105 class XPathProcessor;
106 class XSLTResultTarget;
107 
108 
109 
123 {
124 public:
125 
127  {
128  bool
130  const XalanDOMString* theLHS,
131  const XalanDOMString* theRHS) const
132  {
133  if (theLHS == 0 && theRHS != 0)
134  {
135  return true;
136  }
137  else if (theRHS == 0)
138  {
139  return false;
140  }
141  else
142  {
143  return theLHS->compare(*theRHS) < 0 ? true : false;
144  }
145  }
146  };
147 
151 
153 
155  {
157  m_string(theString)
158  {
159  }
160 
161  bool
162  operator()(const XalanDOMString* theString) const
163  {
164  assert(theString != 0);
165 
166  return *theString == m_string;
167  }
168 
169  private:
170 
171  const XalanDOMString& m_string;
172  };
173 
179 
180  // Public members
181  //---------------------------------------------------------------------
182 
196  MemoryManagerType& theManager,
197  XMLParserLiaison& parserLiaison,
198  XPathEnvSupport& xpathEnvSupport,
199  DOMSupport& domSupport,
200  XObjectFactory& xobjectFactory,
201  XPathFactory& xpathFactory);
202 
203  virtual
204  ~XSLTEngineImpl();
205 
208  {
209  return m_xpathConstructionContext.getMemoryManager();
210  }
211 
216  static void
217  initialize(MemoryManagerType& theManager);
218 
222  static void
223  terminate();
224 
225  // These methods are inherited from XSLTProcessor ...
226 
227  virtual void
228  process(
229  const XSLTInputSource& inputSource,
230  const XSLTInputSource& stylesheetSource,
231  XSLTResultTarget& outputTarget,
232  StylesheetConstructionContext& constructionContext,
233  StylesheetExecutionContext& executionContext);
234 
235  virtual void
236  process(
237  const XSLTInputSource& inputSource,
238  XSLTResultTarget& outputTarget,
239  StylesheetExecutionContext& executionContext);
240 
241  virtual StylesheetRoot*
242  processStylesheet(
243  const XSLTInputSource& stylesheetSource,
244  StylesheetConstructionContext& constructionContext);
245 
246  virtual StylesheetRoot*
247  processStylesheet(
248  const XalanDOMString& xsldocURLString,
249  StylesheetConstructionContext& constructionContext);
250 
251  virtual XalanNode*
252  getSourceTreeFromInput(const XSLTInputSource& inputSource);
253 
254  virtual void
255  resolveTopLevelParams(StylesheetExecutionContext& executionContext);
256 
257  virtual XMLParserLiaison&
258  getXMLParserLiaison() const;
259 
260  virtual void
261  getUniqueNamespaceValue(XalanDOMString& theValue);
262 
263  virtual void
264  setStylesheetParam(
265  const XalanDOMString& key,
266  const XalanDOMString& expression);
267 
268  virtual void
269  setStylesheetParam(
270  const XalanDOMString& key,
271  XObjectPtr value);
272 
273  virtual FormatterListener*
274  getFormatterListener() const;
275 
276  virtual void
277  setFormatterListener(FormatterListener* flistener);
278 
279  // Trace-related functions...
280 
281  virtual size_type
282  getTraceListeners() const;
283 
284  virtual void
285  addTraceListener(TraceListener* tl);
286 
287  virtual void
288  removeTraceListener(TraceListener* tl);
289 
290  virtual void
291  fireGenerateEvent(const GenerateEvent& ge);
292 
293  virtual void
294  fireTraceEvent(const TracerEvent& te);
295 
296  virtual void
297  fireSelectEvent(const SelectionEvent& se);
298 
299  virtual bool
300  getTraceSelects() const;
301 
302  virtual void
303  setTraceSelects(bool b);
304 
305  void
306  traceSelect(
307  StylesheetExecutionContext& executionContext,
308  const ElemTemplateElement& theTemplate,
309  const NodeRefListBase& nl,
310  const XPath* xpath) const;
311 
312  virtual void
313  setQuietConflictWarnings(bool b);
314 
315  virtual void
316  setDiagnosticsOutput(PrintWriter* pw);
317 
318 
319  // Inherited from PrefixResolver...
320 
329  virtual const XalanDOMString*
330  getNamespaceForPrefix(const XalanDOMString& prefix) const;
331 
337  virtual const XalanDOMString&
338  getURI() const;
339 
352  parseXML(
353  const XalanDOMString& urlString,
354  DocumentHandlerType* docHandler,
355  XalanDocument* docToRegister);
356 
369  parseXML(
370  const InputSourceType& inputSource,
371  DocumentHandlerType* docHandler,
372  XalanDocument* docToRegister);
373 
386  Stylesheet*
387  getStylesheetFromPIURL(
388  const XalanDOMString& xslURLString,
389  XalanNode& fragBase,
390  const XalanDOMString& xmlBaseIdent,
391  bool isRoot,
392  StylesheetConstructionContext& constructionContext);
393 
397  void
398  flushPending();
399 
406  void
408  const XalanDOMString& prefix,
409  const XalanDOMString& namespaceVal)
410  {
411  addResultNamespaceDecl(
412  prefix,
413  namespaceVal.c_str(),
414  namespaceVal.length());
415  }
416 
424  void
426  const XalanDOMString& prefix,
427  const XalanDOMChar* namespaceVal,
429  {
430  m_resultNamespacesStack.addDeclaration(
431  prefix,
432  namespaceVal,
433  len);
434  }
435 
446  void
448  AttributeListImpl& attList,
449  const XalanDOMString& aname,
450  const XalanDOMString& value,
451  bool fromCopy = false,
452  const LocatorType* locator = 0)
453  {
454  addResultAttribute(
455  attList,
456  aname,
457  value.c_str(),
458  fromCopy,
459  locator);
460  }
461 
472  void
474  AttributeListImpl& attList,
475  const XalanDOMString& aname,
476  const XalanDOMChar* value,
477  bool fromCopy = false,
478  const LocatorType* locator = 0)
479  {
480  addResultAttribute(
481  attList,
482  aname,
483  value,
484  length(value),
485  fromCopy,
486  locator);
487  }
488 
500  void
501  addResultAttribute(
502  AttributeListImpl& attList,
503  const XalanDOMString& aname,
504  const XalanDOMChar* value,
505  XalanDOMString::size_type theLength,
506  bool fromCopy = false,
507  const LocatorType* locator = 0);
508 
518  void
520  const XalanDOMString& aname,
521  const XalanDOMChar* value,
522  bool fromCopy = false,
523  const LocatorType* locator = 0)
524  {
525  assert(m_outputContextStack.empty() == false);
526 
527  addResultAttribute(
528  getPendingAttributesImpl(),
529  aname,
530  value,
531  fromCopy,
532  locator);
533  }
534 
544  void
546  const XalanDOMString& aname,
547  const XalanDOMString& value,
548  bool fromCopy = false,
549  const LocatorType* locator = 0)
550  {
551  assert(m_outputContextStack.empty() == false);
552 
553  addResultAttribute(
554  getPendingAttributesImpl(),
555  aname,
556  value,
557  fromCopy,
558  locator);
559  }
560 
566  void
567  reportDuplicateNamespaceNodeError(
568  const XalanDOMString& theName,
569  const LocatorType* locator);
570 
571  void
572  setDocumentLocator(const LocatorType* locator);
573 
574  void
575  startDocument();
576 
577  void
578  endDocument();
579 
580  void
581  startElement(
582  const XalanDOMChar* name,
583  AttributeListType& atts);
584 
585  void
586  endElement(const XalanDOMChar* name);
587 
588  void
589  characters (
590  const XalanDOMChar* ch,
592 
593  void
594  ignorableWhitespace(
595  const XalanDOMChar* ch,
597 
598  void
599  processingInstruction(
600  const XalanDOMChar* target,
601  const XalanDOMChar* data);
602 
603  void
604  resetDocument();
605 
613  void
614  characters(
615  const XalanDOMChar* ch,
618 
624  void
625  characters(const XalanNode& node);
626 
632  void
633  characters(const XObjectPtr& xobject);
634 
641  void
642  startElement(const XalanDOMChar* name);
643 
653  void
654  charactersRaw(
655  const XalanDOMChar* ch,
658 
664  void
665  charactersRaw(const XalanNode& node);
666 
672  void
673  charactersRaw(const XObjectPtr& xobject);
674 
680  void
681  comment(const XalanDOMChar* data);
682 
689  void
690  entityReference(const XalanDOMChar* data);
691 
699  void
700  cdata(
701  const XalanDOMChar* ch,
704 
712  void
713  cloneToResultTree(
714  const XalanNode& node,
715  bool cloneTextNodesOnly,
716  const LocatorType* locator);
717 
728  void
729  cloneToResultTree(
730  const XalanNode& node,
731  XalanNode::NodeType nodeType,
732  bool overrideStrip,
733  bool shouldCloneAttributes,
734  bool cloneTextNodesOnly,
735  const LocatorType* locator);
736 
744  void
745  outputToResultTree(
746  const XObject& value,
747  bool outputTextNodesOnly,
748  const LocatorType* locator);
749 
758  void
760  const XObject& theTree,
761  bool outputTextNodesOnly,
762  const LocatorType* locator)
763  {
764  outputResultTreeFragment(theTree.rtree(), outputTextNodesOnly, locator);
765  }
766 
775  void
776  outputResultTreeFragment(
777  const XalanDocumentFragment& theTree,
778  bool outputTextNodesOnly,
779  const LocatorType* locator);
780 
786  virtual const StylesheetRoot*
787  getStylesheetRoot() const;
788 
794  virtual void
795  setStylesheetRoot(const StylesheetRoot* theStylesheet);
796 
802  virtual void
803  setExecutionContext(StylesheetExecutionContext* theExecutionContext);
804 
811  static const XalanDOMString&
813  {
814  return s_XSLNameSpaceURL;
815  }
816 
822  static const XalanDOMString&
824  {
825  return s_XalanNamespaceURL;
826  }
827 
833  bool
835  {
836  return m_quietConflictWarnings;
837  }
838 
839  virtual void
840  message(
841  const XalanDOMString& msg,
842  const XalanNode* sourceNode = 0,
843  const ElemTemplateElement* styleNode = 0) const;
844 
845  virtual void
846  message(
847  const XalanDOMString& msg,
848  const LocatorType& locator,
849  const XalanNode* sourceNode = 0) const;
850 
851  virtual void
852  warn(
853  const XalanDOMString& msg,
854  const XalanNode* sourceNode = 0,
855  const ElemTemplateElement* styleNode = 0) const;
856 
857 
858  virtual void
859  warn(
860  const XalanDOMString& msg,
861  const LocatorType& locator,
862  const XalanNode* sourceNode = 0) const;
863 
864  virtual void
865  error(
866  const XalanDOMString& msg,
867  const XalanNode* sourceNode = 0,
868  const ElemTemplateElement* styleNode = 0) const;
869 
870  virtual void
871  error(
872  const XalanDOMString& msg,
873  const LocatorType& locator,
874  const XalanNode* sourceNode = 0) const;
875 
876 public:
877 
884  const XalanDOMString*
885  getResultNamespaceForPrefix(const XalanDOMString& prefix) const;
886 
893  const XalanDOMString*
894  getResultPrefixForNamespace(const XalanDOMString& theNamespace) const;
895 
904  bool
905  isPendingResultPrefix(const XalanDOMString& thePrefix) const;
906 
915  double
916  evalMatchPatternStr(
917  const XalanDOMString& str,
918  XalanNode* context,
919  XPathExecutionContext& executionContext);
920 
928  const XPath*
929  createMatchPattern(
930  const XalanDOMString& str,
931  const PrefixResolver& resolver);
932 
939  void
940  returnXPath(const XPath* xpath);
941 
947  void
948  copyNamespaceAttributes(const XalanNode& src);
949 
957  const XObjectPtr
958  evalXPathStr(
959  const XalanDOMString& str,
960  XPathExecutionContext& executionContext);
961 
971  const XObjectPtr
972  evalXPathStr(
973  const XalanDOMString& str,
974  XalanNode* contextNode,
975  const PrefixResolver& prefixResolver,
976  XPathExecutionContext& executionContext);
977 
987  const XObjectPtr
988  evalXPathStr(
989  const XalanDOMString& str,
990  XalanNode* contextNode,
991  const XalanElement& prefixResolver,
992  XPathExecutionContext& executionContext);
993 
1001  void
1002  copyAttributeToTarget(
1003  const XalanDOMString& attrName,
1004  const XalanDOMString& attrValue,
1005  AttributeListImpl& attrList);
1006 
1012  XPathFactory&
1014  {
1015  return m_xpathFactory;
1016  }
1017 
1023  XPathProcessor&
1025  {
1026  return *m_xpathProcessor.get();
1027  }
1028 
1033  virtual void
1034  reset();
1035 
1041  XPathEnvSupport&
1043  {
1044  return m_xpathEnvSupport;
1045  }
1046 
1055  void
1057  {
1058  m_problemListener = l;
1059  }
1060 
1071  {
1072  return m_problemListener;
1073  }
1074 
1075  /*
1076  * Push a new output context using the provided FormatterListener.
1077  *
1078  * @param A pointer to the FormatterListener instance for the new context.
1079  */
1080  void
1082  {
1083  m_outputContextStack.pushContext(theListener);
1084  }
1085 
1086  /*
1087  * Pop the current output context.
1088  */
1089  void
1091  {
1092  m_outputContextStack.popContext();
1093  }
1094 
1095  /*
1096  * See if there is a pending start document event waiting.
1097  * @return true if there is a start document event waiting.
1098  */
1099  bool
1101  {
1102  return getHasPendingStartDocumentImpl();
1103  }
1104 
1105  /*
1106  * Set the pending start document event state.
1107  * @param the new value
1108  */
1109  void
1111  {
1112  setHasPendingStartDocumentImpl(b);
1113  }
1114 
1115  /*
1116  * See if a pending start document event must be flushed.
1117  * @return true if the event must be flushed.
1118  */
1119  bool
1121  {
1122  return getMustFlushPendingStartDocumentImpl();
1123  }
1124 
1125  /*
1126  * Set the pending start document event flush state.
1127  * @param the new value
1128  */
1129  void
1131  {
1132  setMustFlushPendingStartDocumentImpl(b);
1133  }
1134 
1140  const AttributeListType&
1142  {
1143  return getPendingAttributesImpl();
1144  }
1145 
1151  void
1152  setPendingAttributes(const AttributeListType& pendingAttributes)
1153  {
1154  getPendingAttributesImpl() = pendingAttributes;
1155  }
1156 
1164  void
1166  const XalanDOMChar* theName,
1167  const XalanDOMChar* theNewType,
1168  const XalanDOMChar* theNewValue)
1169  {
1170  // Remove the old attribute, then add the new one. AttributeListImpl::addAttribute()
1171  // does this for us.
1172  getPendingAttributesImpl().addAttribute(theName, theNewType, theNewValue);
1173  }
1174 
1175  bool
1177  {
1178  return length(getPendingElementNameImpl()) != 0 ? true : false;
1179  }
1180 
1186  const XalanDOMString&
1188  {
1189  return getPendingElementNameImpl();
1190  }
1191 
1197  void
1199  {
1200  setPendingElementNameImpl(elementName);
1201  }
1202 
1203  void
1204  setPendingElementName(const XalanDOMChar* elementName)
1205  {
1206  setPendingElementNameImpl(elementName);
1207  }
1208 
1214  const LocatorType*
1216  {
1217  return m_stylesheetLocatorStack.empty() == true ? 0 : m_stylesheetLocatorStack.back();
1218  }
1219 
1225  void
1227  {
1228  m_stylesheetLocatorStack.push_back(locator);
1229  }
1230 
1234  void
1236  {
1237  if (m_stylesheetLocatorStack.empty() == false)
1238  {
1239  m_stylesheetLocatorStack.pop_back();
1240  }
1241  }
1242 
1243 protected:
1244 
1250  const AttributeListImpl&
1252  {
1253  return m_outputContextStack.getPendingAttributes();
1254  }
1255 
1263  {
1264  return m_outputContextStack.getPendingAttributes();
1265  }
1266 
1272  void
1274  {
1275  getPendingAttributesImpl() = pendingAttributes;
1276  }
1277 
1283  const XalanDOMString&
1285  {
1286  return m_outputContextStack.getPendingElementName();
1287  }
1288 
1296  {
1297  return m_outputContextStack.getPendingElementName();
1298  }
1299 
1305  void
1307  {
1308  m_outputContextStack.getPendingElementName() = elementName;
1309  }
1310 
1316  void
1317  setPendingElementNameImpl(const XalanDOMChar* elementName)
1318  {
1319  assert(elementName != 0);
1320 
1321  m_outputContextStack.getPendingElementName() = elementName;
1322  }
1323 
1324  /*
1325  * See if there is a pending start document event waiting.
1326  * @return true if there is a start document event waiting.
1327  */
1328  bool
1330  {
1331  return m_outputContextStack.getHasPendingStartDocument();
1332  }
1333 
1334  /*
1335  * Set the pending start document event state.
1336  * @param the new value
1337  */
1338  void
1340  {
1341  m_outputContextStack.getHasPendingStartDocument() = b;
1342  }
1343 
1344  /*
1345  * See if a pending start document event must be flushed.
1346  * @return true if the event must be flushed.
1347  */
1348  bool
1350  {
1351  return m_outputContextStack.getMustFlushPendingStartDocument();
1352  }
1353 
1354  /*
1355  * Set the pending start document event flush state.
1356  * @param the new value
1357  */
1358  void
1360  {
1361  m_outputContextStack.getMustFlushPendingStartDocument() = b;
1362  }
1363 
1366  {
1367  return m_outputContextStack.getFormatterListener();
1368  }
1369 
1370  void
1372  {
1373  m_outputContextStack.getFormatterListener() = flistener;
1374  }
1375 
1383 
1388 
1389 
1394  void
1395  copyAttributesToAttList(
1396  const XalanNode& node,
1397  AttributeListImpl& attList);
1398 
1399  // Factory for creating xpaths.
1400  XPathFactory& m_xpathFactory;
1401 
1402  // Factory for creating xobjects
1404 
1405  // The query/pattern-matcher object.
1406  const XPathProcessorPtrType m_xpathProcessor;
1407 
1412  BoolVectorType m_cdataStack;
1413 
1414 private:
1415 
1422  void
1423  warnCopyTextNodesOnly(
1424  const XalanNode* sourceNode,
1425  const LocatorType* locator);
1426 
1433  void
1434  cloneToResultTree(
1435  const XalanText& node,
1436  bool overrideStrip);
1437 
1442  bool
1443  pendingAttributesHasDefaultNS() const;
1444 
1445  void
1446  addResultNamespace(
1447  const XalanDOMString& thePrefix,
1448  const XalanDOMString& theName,
1449  const XalanNode& theNode,
1450  AttributeListImpl& thePendingAttributes,
1451  bool fOnlyIfPrefixNotPresent);
1452 
1453  void
1454  addResultNamespace(
1455  const XalanNode& theNode,
1456  AttributeListImpl& thePendingAttributes,
1457  bool fOnlyIfPrefixNotPresent = false);
1458 
1463  LocatorStack m_stylesheetLocatorStack;
1464 
1471  ProblemListenerDefault m_defaultProblemListener;
1472 
1473  ProblemListener* m_problemListener;
1474 
1478  const StylesheetRoot* m_stylesheetRoot;
1479 
1483  static const XalanDOMString& s_XSLNameSpaceURL; //"http://www.w3.org/1999/XSL/Transform"
1484 
1488  static const XalanDOMString& s_XalanNamespaceURL; // "http://xml.apache.org/xalan"
1489 
1493  static const XalanDOMString& s_uniqueNamespacePrefix;
1494 
1498  bool m_traceSelects;
1499 
1504  bool m_quietConflictWarnings;
1505 
1506  /*
1507  * A stream to print diagnostics to.
1508  */
1509  PrintWriter* m_diagnosticsPrintWriter;
1510 
1515  TraceListenerVectorType m_traceListeners;
1516 
1517  void
1518  problem(
1519  const XalanDOMString& msg,
1520  ProblemListener::eClassification classification,
1521  const XalanNode* sourceNode,
1522  const ElemTemplateElement* styleNode) const;
1523 
1524  void
1525  problem(
1526  const XalanDOMString& msg,
1527  ProblemListener::eClassification classification,
1528  const LocatorType& locator,
1529  const XalanNode* sourceNode) const;
1530 
1531  //==========================================================
1532  // SECTION: Function to do with attribute handling
1533  //==========================================================
1534 
1538  unsigned long m_uniqueNSValue;
1539 
1540  ParamVectorType m_topLevelParams;
1541 
1542 public:
1543 
1547  void
1549  {
1550  m_topLevelParams.clear();
1551  }
1552 
1553 private:
1554 
1555  bool
1556  generateCDATASection() const
1557  {
1558  if (m_hasCDATASectionElements == false)
1559  {
1560  return false;
1561  }
1562  else
1563  {
1564  assert(m_cdataStack.empty() == false);
1565 
1566  return m_cdataStack.back();
1567  }
1568  }
1569 
1570  void
1571  doFlushPending()
1572  {
1573  setMustFlushPendingStartDocument(true);
1574 
1575  flushPending();
1576  }
1577 
1585  bool
1586  isCDataResultElem(const XalanDOMString& elementName) const;
1587 
1588  void
1589  fireCharacterGenerateEvent(
1590  const XalanNode& theNode,
1591  bool isCDATA);
1592 
1593  void
1594  fireCharacterGenerateEvent(
1595  const XObjectPtr& theXObject,
1596  bool isCDATA);
1597 
1598  void
1599  fireCharacterGenerateEvent(
1600  const XalanDOMString& theString,
1601  bool isCDATA);
1602 
1603  void
1604  fireCharacterGenerateEvent(
1605  const XalanDOMChar* ch,
1608  bool isCDATA);
1609 
1610  void
1611  checkDefaultNamespace(
1612  const XalanDOMString& theElementName,
1613  const XalanDOMString& theElementNamespaceURI);
1614 
1615 
1616 
1617  // Data members...
1618  XMLParserLiaison& m_parserLiaison;
1619 
1620  XPathEnvSupport& m_xpathEnvSupport;
1621 
1622  DOMSupport& m_domSupport;
1623 
1627  StylesheetExecutionContext* m_executionContext;
1628 
1629  /*
1630  * Stack of current output contexts...
1631  */
1632  OutputContextStack m_outputContextStack;
1633 
1634  /*
1635  * Stack of current result namespaces...
1636  */
1637  XalanNamespacesStack m_resultNamespacesStack;
1638 
1639  /*
1640  * Dummy AttributeListImpl
1641  */
1642  AttributeListImpl m_dummyAttributesList;
1643 
1644  XalanDOMString m_scratchString;
1645 
1646  XalanDOMStringPointerVectorType m_attributeNamesVisited;
1647 
1648  bool m_hasCDATASectionElements;
1649 
1650  XPathConstructionContextDefault m_xpathConstructionContext;
1651 
1652  static void
1653  installFunctions(MemoryManagerType& theManager);
1654 
1655  static void
1656  uninstallFunctions();
1657 
1658 
1659  static const XalanDOMString s_emptyString;
1660 
1661  static const XalanDOMString& s_stylesheetNodeName;
1662  static const XalanDOMString& s_typeString;
1663  static const XalanDOMString& s_hrefString;
1664  static const XalanDOMString& s_piTokenizerString;
1665  static const XalanDOMString& s_typeValueString1;
1666  static const XalanDOMString& s_typeValueString2;
1667  static const XalanDOMString& s_typeValueString3;
1668  static const XalanDOMString& s_typeValueString4;
1669 
1670  // Not implemented...
1672 
1674  operator=(const XSLTEngineImpl&);
1675 
1676  bool
1677  operator==(const XSLTEngineImpl&) const;
1678 };
1679 
1680 
1681 
1682 XALAN_CPP_NAMESPACE_END
1683 
1684 
1685 
1686 #endif // XALAN_XSLTENGINEIMPL_HEADER_GUARD
XObjectFactory & m_xobjectFactory
Definition: XSLTEngineImpl.hpp:1403
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
Definition: XalanVector.hpp:1111
Definition: XalanNode.hpp:44
size_type length() const
Definition: XalanDOMString.hpp:209
Definition: XalanText.hpp:38
XPathFactory & m_xpathFactory
Definition: XSLTEngineImpl.hpp:1400
void addResultNamespaceDecl(const XalanDOMString &prefix, const XalanDOMString &namespaceVal)
Add a namespace declaration to the namespace stack.
Definition: XSLTEngineImpl.hpp:407
void outputResultTreeFragment(const XObject &theTree, bool outputTextNodesOnly, const LocatorType *locator)
Given a result tree fragment, walk the tree and output it to the result stream.
Definition: XSLTEngineImpl.hpp:759
XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType
Definition: AttributeListImpl.hpp:39
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType
Definition: XalanMemoryManagement.hpp:39
bool isElementPending() const
Definition: XSLTEngineImpl.hpp:1176
ProblemListener * getProblemListener() const
Get the problem listener property.
Definition: XSLTEngineImpl.hpp:1070
void clearTopLevelParams()
Reset the vector of top level parameters.
Definition: XSLTEngineImpl.hpp:1548
const AttributeListType & getPendingAttributes() const
Get the list of attributes yet to be processed.
Definition: XSLTEngineImpl.hpp:1141
bool getQuietConflictWarnings() const
Whether to warn about pattern match conflicts.
Definition: XSLTEngineImpl.hpp:834
Definition: XalanAttr.hpp:38
void addResultAttribute(const XalanDOMString &aname, const XalanDOMChar *value, bool fromCopy=false, const LocatorType *locator=0)
Add attribute to pending attributes list, and if it is a namespace, add it to the namespaces stack...
Definition: XSLTEngineImpl.hpp:519
FindStringPointerFunctor(const XalanDOMString &theString)
Definition: XSLTEngineImpl.hpp:156
Definition: ElemTemplateElement.hpp:74
Definition: DOMSupport.hpp:39
static const XalanDOMString & getXalanXSLNameSpaceURL()
Special Xalan namespace for built-in extensions.
Definition: XSLTEngineImpl.hpp:823
StylesheetExecutionContext::ParamVectorType ParamVectorType
Definition: XSLTEngineImpl.hpp:176
Definition: AttributeListImpl.hpp:47
Definition: XalanDocumentFragment.hpp:38
const XPathProcessorPtrType m_xpathProcessor
Definition: XSLTEngineImpl.hpp:1406
This acts as the stylesheet root of the stylesheet tree, and holds values that are shared by all styl...
Definition: StylesheetRoot.hpp:61
const LocatorType * getLocatorFromStack() const
Get the locator from the top of the locator stack.
Definition: XSLTEngineImpl.hpp:1215
XERCES_CPP_NAMESPACE_QUALIFIER InputSource InputSourceType
Definition: XMLParserLiaison.hpp:44
NodeType
Definition: XalanNode.hpp:53
reference back()
Definition: XalanVector.hpp:673
Definition: StylesheetExecutionContext.hpp:104
Definition: XalanElement.hpp:42
void setFormatterListenerImpl(FormatterListener *flistener)
Definition: XSLTEngineImpl.hpp:1371
eClassification
Severity of problem.
Definition: ProblemListener.hpp:59
Class to hold XObjectPtr return types.
Definition: XObject.hpp:584
bool empty() const
Definition: XalanVector.hpp:636
Definition: XPath.hpp:62
void setPendingElementName(const XalanDOMChar *elementName)
Definition: XSLTEngineImpl.hpp:1204
This is the abstract class that the XSL processor uses when it has a problem of some kind...
Definition: ProblemListener.hpp:49
XalanMemMgrAutoPtr< XPathProcessor, true > XPathProcessorPtrType
Definition: XSLTEngineImpl.hpp:174
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
XalanDOMString m_resultNameSpaceURL
The URL that belongs to the result namespace.
Definition: XSLTEngineImpl.hpp:1387
XPathExecutionContext::GetAndReleaseCachedString ECGetAndReleaseCachedString
Definition: XSLTEngineImpl.hpp:178
void popLocatorStack()
Pop the locator from the top of the locator stack.
Definition: XSLTEngineImpl.hpp:1235
It's the responsibility of the XSLTEngineImpl class, collaborating with the XML parser liaison...
Definition: XSLTEngineImpl.hpp:122
MemoryManagerType & getMemoryManager()
Definition: XSLTEngineImpl.hpp:207
bool getMustFlushPendingStartDocumentImpl() const
Definition: XSLTEngineImpl.hpp:1349
Definition: PrintWriter.hpp:35
int compare(const XalanDOMString &theString) const
Definition: XalanDOMString.hpp:583
XPathEnvSupport & getXPathEnvSupport()
Retrieve the XPath environment support object.
Definition: XSLTEngineImpl.hpp:1042
AttributeListImpl & getPendingAttributesImpl()
Get the list of attributes yet to be processed.
Definition: XSLTEngineImpl.hpp:1262
void setPendingAttributes(const AttributeListType &pendingAttributes)
Set the list of attributes yet to be processed.
Definition: XSLTEngineImpl.hpp:1152
Local implementation of NodeRefList.
Definition: NodeRefListBase.hpp:42
const XalanDOMString & getPendingElementNameImpl() const
Retrieve name of the pending element currently being processed.
Definition: XSLTEngineImpl.hpp:1284
void pushOutputContext(FormatterListener *theListener)
Definition: XSLTEngineImpl.hpp:1081
A SAX-based formatter interface for the XSL processor.
Definition: FormatterListener.hpp:62
XalanVector< TraceListener * > TraceListenerVectorType
Definition: XSLTEngineImpl.hpp:149
bool getHasPendingStartDocument() const
Definition: XSLTEngineImpl.hpp:1100
const AttributeListImpl & getPendingAttributesImpl() const
Get the list of attributes yet to be processed.
Definition: XSLTEngineImpl.hpp:1251
Definition: XSLTInputSource.hpp:61
bool operator()(const XalanDOMString *theString) const
Definition: XSLTEngineImpl.hpp:162
XalanDOMString & getPendingElementNameImpl()
Retrieve name of the pending element currently being processed.
Definition: XSLTEngineImpl.hpp:1295
Definition: XPathEnvSupport.hpp:62
XALAN_CPP_NAMESPACE_BEGIN typedef size_t size_type
Definition: XalanMap.hpp:44
const XalanDOMChar * c_str() const
Definition: XalanDOMString.hpp:314
void setHasPendingStartDocumentImpl(bool b)
Definition: XSLTEngineImpl.hpp:1339
BoolVectorType m_cdataStack
Stack of Booleans to keep track of if we should be outputting cdata instead of escaped text...
Definition: XSLTEngineImpl.hpp:1412
const XalanDOMString & getPendingElementName() const
Retrieve name of the pending element currently being processed.
Definition: XSLTEngineImpl.hpp:1187
Definition: XSLTResultTarget.hpp:47
This class defines an interface for classes that resolve namespace prefixes to their URIs...
Definition: PrefixResolver.hpp:37
XalanVector< const LocatorType * > LocatorStack
Definition: XSLTEngineImpl.hpp:148
void replacePendingAttribute(const XalanDOMChar *theName, const XalanDOMChar *theNewType, const XalanDOMChar *theNewValue)
Replace the contents of a pending attribute.
Definition: XSLTEngineImpl.hpp:1165
Definition: XMLParserLiaison.hpp:54
Definition: TraceListener.hpp:34
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
Definition: XalanDocument.hpp:51
void setPendingElementNameImpl(const XalanDOMString &elementName)
Changes the currently pending element name.
Definition: XSLTEngineImpl.hpp:1306
void setMustFlushPendingStartDocument(bool b)
Definition: XSLTEngineImpl.hpp:1130
void setPendingAttributesImpl(const AttributeListType &pendingAttributes)
Set the list of attributes yet to be processed.
Definition: XSLTEngineImpl.hpp:1273
Definition: XalanNamespacesStack.hpp:43
XERCES_CPP_NAMESPACE_QUALIFIER DocumentHandler DocumentHandlerType
Definition: StylesheetConstructionContext.hpp:50
Function::XObjectArgVectorType XObjectArgVectorType
Definition: XSLTEngineImpl.hpp:175
#define XALAN_XSLT_EXPORT
Definition: XSLTDefinitions.hpp:25
FormatterListener * getFormatterListenerImpl() const
Definition: XSLTEngineImpl.hpp:1365
virtual const XalanDocumentFragment & rtree() const
Cast result object to a result tree fragment.
void setProblemListener(ProblemListener *l)
Set the problem listener property.
Definition: XSLTEngineImpl.hpp:1056
The implementation of the default error handling for Xalan.
Definition: ProblemListenerDefault.hpp:38
Definition: XPathConstructionContext.hpp:116
XalanVector< bool > BoolVectorType
Definition: XSLTEngineImpl.hpp:152
XPathConstructionContext::GetAndReleaseCachedString CCGetAndReleaseCachedString
Definition: XSLTEngineImpl.hpp:177
void pushLocatorOnStack(const LocatorType *locator)
Push a locator on to the locator stack.
Definition: XSLTEngineImpl.hpp:1226
static const XalanDOMString & getXSLNameSpaceURL()
Retrieve the URI for the current XSL namespace, for example, "http://www.w3.org/1999/XSL/Transform".
Definition: XSLTEngineImpl.hpp:812
Definition: XPathExecutionContext.hpp:430
Definition: XPathProcessor.hpp:47
Definition: OutputContextStack.hpp:47
bool operator()(const XalanDOMString *theLHS, const XalanDOMString *theRHS) const
Definition: XSLTEngineImpl.hpp:129
XPathProcessor & getXPathProcessor()
Get the XPath processor object.
Definition: XSLTEngineImpl.hpp:1024
void setPendingElementName(const XalanDOMString &elementName)
Changes the currently pending element name.
Definition: XSLTEngineImpl.hpp:1198
Definition: XPathFactory.hpp:39
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
XalanVector< const XalanDOMString * > XalanDOMStringPointerVectorType
Definition: XSLTEngineImpl.hpp:150
bool getHasPendingStartDocumentImpl() const
Definition: XSLTEngineImpl.hpp:1329
void addResultAttribute(const XalanDOMString &aname, const XalanDOMString &value, bool fromCopy=false, const LocatorType *locator=0)
Add attribute to pending attributes list, and if it is a namespace, add it to the namespaces stack...
Definition: XSLTEngineImpl.hpp:545
Definition: StylesheetConstructionContext.hpp:73
void setMustFlushPendingStartDocumentImpl(bool b)
Definition: XSLTEngineImpl.hpp:1359
This is an interface for an XSLT Processor engine.
Definition: XSLTProcessor.hpp:79
Definition: XalanSourceTreeDocument.hpp:73
This class represents the base stylesheet or an "import" stylesheet.
Definition: Stylesheet.hpp:84
void clear()
Definition: XalanVector.hpp:788
An default implementation of an abtract class which provides support for constructing the internal re...
Definition: XPathConstructionContextDefault.hpp:49
void addResultNamespaceDecl(const XalanDOMString &prefix, const XalanDOMChar *namespaceVal, XalanDOMString::size_type len)
Add a namespace declaration to the namespace stack.
Definition: XSLTEngineImpl.hpp:425
bool getMustFlushPendingStartDocument() const
Definition: XSLTEngineImpl.hpp:1120
unsigned int size_type
Definition: XalanDOMString.hpp:53
Definition: XSLTEngineImpl.hpp:126
void popOutputContext()
Definition: XSLTEngineImpl.hpp:1090
XPathFactory & getXPathFactory()
Get the factory for making xpaths.
Definition: XSLTEngineImpl.hpp:1013
void addResultAttribute(AttributeListImpl &attList, const XalanDOMString &aname, const XalanDOMChar *value, bool fromCopy=false, const LocatorType *locator=0)
Add attribute to attribute list, and if it is a namespace, add it to the namespaces stack...
Definition: XSLTEngineImpl.hpp:473
This class handles the creation of XObjects and manages their lifetime.
Definition: XObjectFactory.hpp:51
void addResultAttribute(AttributeListImpl &attList, const XalanDOMString &aname, const XalanDOMString &value, bool fromCopy=false, const LocatorType *locator=0)
Add attribute to attribute list, and if it is a namespace, add it to the namespaces stack...
Definition: XSLTEngineImpl.hpp:447
void setPendingElementNameImpl(const XalanDOMChar *elementName)
Changes the currently pending element name.
Definition: XSLTEngineImpl.hpp:1317
void setHasPendingStartDocument(bool b)
Definition: XSLTEngineImpl.hpp:1110
XalanDOMString m_resultNameSpacePrefix
The namespace that the result tree conforms to.
Definition: XSLTEngineImpl.hpp:1382
Definition: XSLTEngineImpl.hpp:154

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