Xalan-C++ API Reference  1.12.0
XSLTEngineImpl.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #if !defined(XALAN_XSLTENGINEIMPL_HEADER_GUARD)
19 #define XALAN_XSLTENGINEIMPL_HEADER_GUARD
20 
21 
22 
23 // Base include file. Must be first.
24 #include "XSLTDefinitions.hpp"
25 
26 
27 
28 // Base class
29 #include "XSLTProcessor.hpp"
30 
31 
32 
33 
34 // Standard library headers
35 #include <cassert>
36 
37 
38 
40 
41 
42 
43 #if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION)
45 #endif
46 
47 
48 
51 
52 
53 
57 
58 
59 
61 
62 
63 
65 
66 
67 
69 
70 
71 
72 #include "OutputContextStack.hpp"
77 #include "XalanParamHolder.hpp"
78 
79 
80 
81 namespace XERCES_CPP_NAMESPACE
82 {
83  class InputSource;
84  class DocumentHandler;
85 }
86 
87 
88 
89 namespace XALAN_CPP_NAMESPACE {
90 
91 
92 
93 typedef xercesc::InputSource InputSourceType;
94 typedef xercesc::DocumentHandler DocumentHandlerType;
95 
96 using xercesc::InputSource;
97 using xercesc::DocumentHandler;
98 
99 
100 
101 // Forward declarations...
102 class DOMSupport;
103 class GenerateEvent;
104 class PrintWriter;
105 class StylesheetConstructionContext;
106 class StylesheetRoot;
107 class XalanAttr;
108 class XalanSourceTreeDocument;
109 class XalanText;
110 class XMLParserLiaison;
111 class XObject;
112 class XPathEnvSupport;
113 class XPathFactory;
114 class XPathProcessor;
115 class XSLTResultTarget;
116 
117 
118 
119 /**
120  * It's the responsibility of the XSLTEngineImpl class, collaborating with the
121  * XML parser liaison, the DOM, and the XPath engine, to transform a source
122  * tree of nodes into a result tree according to instructions and templates
123  * specified by a stylesheet tree. The process method is the primary
124  * public entry points.
125  *
126  *
127  * If you reuse the processor instance, you should call reset() between calls.
128  *
129  */
130 
132 {
133 public:
134 
136  {
137  bool
139  const XalanDOMString* theLHS,
140  const XalanDOMString* theRHS) const
141  {
142  if (theLHS == 0 && theRHS != 0)
143  {
144  return true;
145  }
146  else if (theRHS == 0)
147  {
148  return false;
149  }
150  else
151  {
152  return theLHS->compare(*theRHS) < 0 ? true : false;
153  }
154  }
155  };
156 
160 
162 
164  {
166  m_string(theString)
167  {
168  }
169 
170  bool
171  operator()(const XalanDOMString* theString) const
172  {
173  assert(theString != 0);
174 
175  return *theString == m_string;
176  }
177 
178  private:
179 
180  const XalanDOMString& m_string;
181  };
182 
188 
190 
191  // Public members
192  //---------------------------------------------------------------------
193 
194  /**
195  * Construct an XSL processor that can call back to a XML processor, so it
196  * can handle included files, and the like. You must create a new instance
197  * of the XSLTEngineImpl class each time you run a transformation.
198  *
199  * @param XMLParserLiaison liaison to an object that can help with a
200  * specific parser implementation
201  * @param xpathEnvSupport An XPathEnvSupport instance
202  * @param domSupport A DOMSupport instance for the DOM being used
203  * @param xobjectFactory object responsible for XObject objects
204  * @param xpathFactory object responsible for XPath objects
205  */
207  MemoryManager& theManager,
208  XMLParserLiaison& parserLiaison,
209  XPathEnvSupport& xpathEnvSupport,
210  DOMSupport& domSupport,
211  XObjectFactory& xobjectFactory,
212  XPathFactory& xpathFactory);
213 
214  virtual
215  ~XSLTEngineImpl();
216 
217  MemoryManager&
219  {
220  return m_xpathConstructionContext.getMemoryManager();
221  }
222 
223  MemoryManager&
225  {
226  return m_xpathConstructionContext.getMemoryManager();
227  }
228 
229  /**
230  * Perform initialization of statics -- must be called before any
231  * processing occurs. See class XSLTInit.
232  */
233  static void
234  initialize(MemoryManager& theManager);
235 
236  /**
237  * Perform termination of statics. See class XSLTInit.
238  */
239  static void
240  terminate();
241 
242  // These methods are inherited from XSLTProcessor ...
243 
244  virtual void
245  problem(
246  eSource source,
247  eClassification classification,
248  const XalanDOMString& msg,
249  const Locator* locator,
250  const XalanNode* sourceNode);
251 
252  virtual void
253  problem(
254  eSource source,
255  eClassification classification,
256  const XalanDOMString& msg,
257  const XalanNode* sourceNode);
258 
259  virtual void
260  process(
261  const XSLTInputSource& inputSource,
262  const XSLTInputSource& stylesheetSource,
263  XSLTResultTarget& outputTarget,
264  StylesheetConstructionContext& constructionContext,
265  StylesheetExecutionContext& executionContext);
266 
267  virtual void
268  process(
269  const XSLTInputSource& inputSource,
270  XSLTResultTarget& outputTarget,
271  StylesheetExecutionContext& executionContext);
272 
273  virtual StylesheetRoot*
274  processStylesheet(
275  const XSLTInputSource& stylesheetSource,
276  StylesheetConstructionContext& constructionContext);
277 
278  virtual StylesheetRoot*
279  processStylesheet(
280  const XalanDOMString& xsldocURLString,
281  StylesheetConstructionContext& constructionContext);
282 
283  virtual XalanNode*
284  getSourceTreeFromInput(const XSLTInputSource& inputSource);
285 
286  virtual void
287  resolveTopLevelParams(StylesheetExecutionContext& executionContext);
288 
289  virtual XMLParserLiaison&
290  getXMLParserLiaison() const;
291 
292  virtual void
293  getUniqueNamespaceValue(XalanDOMString& theValue);
294 
295  virtual void
296  setStylesheetParam(
297  const XalanDOMString& key,
298  const XalanDOMString& expression);
299 
300  virtual void
301  setStylesheetParam(
302  const XalanDOMString& key,
303  XObjectPtr value);
304 
305  virtual void
306  clearStylesheetParams();
307 
308  virtual FormatterListener*
309  getFormatterListener() const;
310 
311  virtual void
312  setFormatterListener(FormatterListener* flistener);
313 
314  // Trace-related functions...
315 
316  virtual size_type
317  getTraceListeners() const;
318 
319  virtual void
320  addTraceListener(TraceListener* tl);
321 
322  virtual void
323  removeTraceListener(TraceListener* tl);
324 
325  virtual void
326  fireGenerateEvent(const GenerateEvent& ge);
327 
328  virtual void
329  fireTraceEvent(const TracerEvent& te);
330 
331  virtual void
332  fireSelectEvent(const SelectionEvent& se);
333 
334  virtual bool
335  getTraceSelects() const;
336 
337  virtual void
338  setTraceSelects(bool b);
339 
340  void
341  traceSelect(
342  StylesheetExecutionContext& executionContext,
343  const ElemTemplateElement& theTemplate,
344  const NodeRefListBase& nl,
345  const XPath* xpath) const;
346 
347  virtual void
348  setQuietConflictWarnings(bool b);
349 
350  virtual void
351  setDiagnosticsOutput(PrintWriter* pw);
352 
353 
354  // Inherited from PrefixResolver...
355 
356  /**
357  * Retrieve a namespace corresponding to a prefix. This assumes that
358  * the PrevixResolver hold's its own namespace context, or is a namespace
359  * context itself.
360  *
361  * @param prefix Prefix to resolve
362  * @return namespace that prefix resolves to, or null if prefix is not found
363  */
364  virtual const XalanDOMString*
365  getNamespaceForPrefix(const XalanDOMString& prefix) const;
366 
367  /**
368  * Retrieve the base URI for the resolver.
369  *
370  * @return URI string
371  */
372  virtual const XalanDOMString&
373  getURI() const;
374 
375  /**
376  * Read in the XML file, either producing a Document or calling SAX events,
377  * and register the document in a table. If the document has already been
378  * read in, it will not be reparsed.
379  *
380  * @param urlString location of the XML
381  * @param docHandler pointer to SAX event handler
382  * @param docToRegister if using a SAX event handler, the object to register in the source docs table.
383  * @return document object, which represents the parsed XML
384  * @exception SAXException
385  */
387  parseXML(
388  const XalanDOMString& urlString,
389  DocumentHandler* docHandler,
390  XalanDocument* docToRegister,
391  ErrorHandler* theErrorHandler = 0);
392 
393  /**
394  * Read in the XML file, either producing a Document or calling SAX events,
395  * and register the document in a table. If the document has already been
396  * read in, it will not be reparsed.
397  *
398  * @param inputSource location of the XML
399  * @param docHandler pointer to SAX event handler
400  * @param docToRegister if using a SAX event handler, the object to register in the source docs table.
401  * @return document object, which represents the parsed XML
402  * @exception SAXException
403  */
405  parseXML(
406  const InputSource& inputSource,
407  DocumentHandler* docHandler,
408  XalanDocument* docToRegister,
409  ErrorHandler* theErrorHandler = 0);
410 
411  /**
412  * Reset the state of the XSL processor by reading in a new XSL stylesheet
413  * from a processing instruction.
414  *
415  * @param xslURLString valid URI to an XSL stylesheet
416  * @param fragBase base of tree if URI represents document
417  * fragment
418  * @param xmlBaseIdent base identifier for stylesheet URI
419  * @param isRoot true if stylesheet is root of tree
420  * @param constructionContext context for construction of object
421  * @return pointer to stylesheet
422  */
423  Stylesheet*
424  getStylesheetFromPIURL(
425  const XalanDOMString& xslURLString,
426  XalanNode& fragBase,
427  const XalanDOMString& xmlBaseIdent,
428  bool isRoot,
429  StylesheetConstructionContext& constructionContext);
430 
431  /**
432  * Flush the pending element.
433  */
434  void
435  flushPending();
436 
437  /**
438  * Add a namespace declaration to the namespace stack
439  *
440  * @param prefix namespace prefix
441  * @param namespaceVal value of namespace
442  */
443  void
445  const XalanDOMString& prefix,
446  const XalanDOMString& namespaceVal)
447  {
448  addResultNamespaceDecl(
449  prefix,
450  namespaceVal.c_str(),
451  namespaceVal.length());
452  }
453 
454  /**
455  * Add a namespace declaration to the namespace stack
456  *
457  * @param prefix namespace prefix
458  * @param namespaceVal value of namespace
459  * @param len length of namespace
460  */
461  void
463  const XalanDOMString& prefix,
464  const XalanDOMChar* namespaceVal,
465  size_type len)
466  {
467  m_resultNamespacesStack.addDeclaration(
468  prefix,
469  namespaceVal,
470  len);
471  }
472 
473  /**
474  * Add attribute to attribute list, and if it is a namespace, add it to the
475  * namespaces stack.
476  *
477  * @param attList attribute list added to
478  * @param aname name of attribute
479  * @param value value of attribute
480  * @param fromCopy true if the attribute is being copied from the source tree
481  * @param locator The Locator for reporting errors.
482  */
483  void
485  AttributeListImpl& attList,
486  const XalanDOMString& aname,
487  const XalanDOMString& value,
488  bool fromCopy = false,
489  const Locator* locator = 0)
490  {
491  addResultAttribute(
492  attList,
493  aname,
494  value.c_str(),
495  fromCopy,
496  locator);
497  }
498 
499  /**
500  * Add attribute to attribute list, and if it is a namespace, add it to the
501  * namespaces stack.
502  *
503  * @param attList attribute list added to
504  * @param aname name of attribute
505  * @param value value of attribute
506  * @param fromCopy true if the attribute is being copied from the source tree
507  * @param locator The Locator for reporting errors.
508  */
509  void
511  AttributeListImpl& attList,
512  const XalanDOMString& aname,
513  const XalanDOMChar* value,
514  bool fromCopy = false,
515  const Locator* locator = 0)
516  {
517  addResultAttribute(
518  attList,
519  aname,
520  value,
521  length(value),
522  fromCopy,
523  locator);
524  }
525 
526  /**
527  * Add attribute to attribute list, and if it is a namespace, add it to the
528  * namespaces stack.
529  *
530  * @param attList attribute list added to
531  * @param aname name of attribute
532  * @param value value of attribute
533  * @param theLength The length of the value
534  * @param fromCopy true if the attribute is being copied from the source tree
535  * @param locator The Locator for reporting errors.
536  */
537  void
538  addResultAttribute(
539  AttributeListImpl& attList,
540  const XalanDOMString& aname,
541  const XalanDOMChar* value,
542  size_type theLength,
543  bool fromCopy = false,
544  const Locator* locator = 0);
545 
546  /**
547  * Add attribute to pending attributes list, and if it is a namespace, add
548  * it to the namespaces stack.
549  *
550  * @param aname name of attribute
551  * @param value value of attribute
552  * @param fromCopy true if the attribute is being copied from the source tree
553  * @param locator The Locator for reporting errors.
554  */
555  void
557  const XalanDOMString& aname,
558  const XalanDOMChar* value,
559  bool fromCopy = false,
560  const Locator* locator = 0)
561  {
562  assert(m_outputContextStack.empty() == false);
563 
564  addResultAttribute(
565  getPendingAttributesImpl(),
566  aname,
567  value,
568  fromCopy,
569  locator);
570  }
571 
572  /**
573  * Add attribute to pending attributes list, and if it is a namespace, add
574  * it to the namespaces stack.
575  *
576  * @param aname name of attribute
577  * @param value value of attribute
578  * @param fromCopy true if the attribute is being copied from the source tree
579  * @param locator The Locator for reporting errors.
580  */
581  void
583  const XalanDOMString& aname,
584  const XalanDOMString& value,
585  bool fromCopy = false,
586  const Locator* locator = 0)
587  {
588  assert(m_outputContextStack.empty() == false);
589 
590  addResultAttribute(
591  getPendingAttributesImpl(),
592  aname,
593  value,
594  fromCopy,
595  locator);
596  }
597 
598  /**
599  * Report an error copying a duplicate namespace node.
600  *
601  * @param theName The name of the node.
602  */
603  void
604  reportDuplicateNamespaceNodeError(
605  const XalanDOMString& theName,
606  const Locator* locator);
607 
608  void
609  setDocumentLocator(const Locator* locator);
610 
611  void
612  startDocument();
613 
614  void
615  endDocument();
616 
617  void
618  startElement(
619  const XalanDOMChar* name,
620  AttributeListType& atts);
621 
622  void
623  endElement(const XalanDOMChar* name);
624 
625  void
626  characters (
627  const XalanDOMChar* ch,
628  size_type length);
629 
630  void
631  ignorableWhitespace(
632  const XalanDOMChar* ch,
633  size_type length);
634 
635  void
636  processingInstruction(
637  const XalanDOMChar* target,
638  const XalanDOMChar* data);
639 
640  void
641  resetDocument();
642 
643  /**
644  * Receive notification of character data.
645  *
646  * @param ch pointer to characters from the XML document
647  * @param start startng offset in 'ch' array
648  * @param length number of characters to read from the array
649  */
650  void
651  characters(
652  const XalanDOMChar* ch,
653  size_type start,
654  size_type length);
655 
656  /**
657  * Send character data from the node to the result tree.
658  *
659  * @param node The node to send.
660  */
661  void
662  characters(const XalanNode& node);
663 
664  /**
665  * Send character data from an XObject to the result tree.
666  *
667  * @param node The xobject to send.
668  */
669  void
670  characters(const XObjectPtr& xobject);
671 
672  /**
673  * Receive notification of the beginning of an element with an empty
674  * attribute list
675  *
676  * @param name element type name
677  */
678  void
679  startElement(const XalanDOMChar* name);
680 
681  /**
682  * Receive notification of character data. If available, when the
683  * disable-output-escaping attribute is used, output raw text without
684  * escaping.
685  *
686  * @param ch pointer to characters from the XML document
687  * @param start start position in the array
688  * @param length number of characters to read from the array
689  */
690  void
691  charactersRaw(
692  const XalanDOMChar* ch,
693  size_type start,
694  size_type length);
695 
696  /**
697  * Send raw character data from the node to the result tree.
698  *
699  * @param node The node to send.
700  */
701  void
702  charactersRaw(const XalanNode& node);
703 
704  /**
705  * Send raw character data from an XObject to the result tree.
706  *
707  * @param node The xobject to send.
708  */
709  void
710  charactersRaw(const XObjectPtr& xobject);
711 
712  /**
713  * Called when a Comment is to be constructed.
714  *
715  * @param data pointer to comment data
716  */
717  void
718  comment(const XalanDOMChar* data);
719 
720  /**
721  * Receive notification of a entityReference.
722  *
723  * @param data pointer to characters from the XML document
724  * @exception SAXException
725  */
726  void
727  entityReference(const XalanDOMChar* data);
728 
729  /**
730  * Receive notification of cdata.
731  *
732  * @param ch pointer to characters from the XML document
733  * @param start start position in the array
734  * @param length number of characters to read from the array
735  */
736  void
737  cdata(
738  const XalanDOMChar* ch,
739  size_type start,
740  size_type length);
741 
742  /**
743  * Clone a node to the result tree
744  *
745  * @param node node to clone
746  * @param cloneTextNodesOnly if true, only text nodes will be cloned
747  * @param locator the Locator for the event, if any.
748  */
749  void
750  cloneToResultTree(
751  const XalanNode& node,
752  bool cloneTextNodesOnly,
753  const Locator* locator);
754 
755  /**
756  * Clone a node to the result tree
757  *
758  * @param node node to clone
759  * @param nodeType the type of the node
760  * @param overrideStrip false if white space stripping should be done
761  * @param shouldCloneAttributes true if attributes should be cloned
762  * @param cloneTextNodesOnly if true, only text nodes will be cloned
763  * @param locator the Locator for the event, if any.
764  */
765  void
766  cloneToResultTree(
767  const XalanNode& node,
768  XalanNode::NodeType nodeType,
769  bool overrideStrip,
770  bool shouldCloneAttributes,
771  bool cloneTextNodesOnly,
772  const Locator* locator);
773 
774  /**
775  * Output an object to the result tree by doing the right conversions.
776  *
777  * @param value the XObject to output
778  * @param outputTextNodesOnly if true, only text nodes will be copied
779  * @param locator the Locator for the event, if any.
780  */
781  void
782  outputToResultTree(
783  const XObject& value,
784  bool outputTextNodesOnly,
785  const Locator* locator);
786 
787  /**
788  * Given a result tree fragment, walk the tree and output it to the result
789  * stream.
790  *
791  * @param theTree result tree fragment
792  * @param outputTextNodesOnly if true, only text nodes will be copied
793  * @param locator the Locator for the event, if any.
794  */
795  void
797  const XObject& theTree,
798  bool outputTextNodesOnly,
799  const Locator* locator)
800  {
801  outputResultTreeFragment(
802  theTree.rtree(),
803  outputTextNodesOnly,
804  locator);
805  }
806 
807  /**
808  * Given a result tree fragment, walk the tree and output it to the result
809  * stream.
810  *
811  * @param theTree result tree fragment
812  * @param outputTextNodesOnly if true, only text nodes will be copied
813  * @param locator the Locator for the event, if any.
814  */
815  void
816  outputResultTreeFragment(
817  const XalanDocumentFragment& theTree,
818  bool outputTextNodesOnly,
819  const Locator* locator);
820 
821  /**
822  * Retrieve the root stylesheet.
823  *
824  * @return pointer to root stylesheet
825  */
826  virtual const StylesheetRoot*
827  getStylesheetRoot() const;
828 
829  /**
830  * Set the root stylesheet.
831  *
832  * @param theStylesheet pointer to new root stylesheet
833  */
834  virtual void
835  setStylesheetRoot(const StylesheetRoot* theStylesheet);
836 
837  /**
838  * Set the execution context.
839  *
840  * @param theExecutionContext pointer to new execution context.
841  */
842  virtual void
843  setExecutionContext(StylesheetExecutionContext* theExecutionContext);
844 
845  /**
846  * Retrieve the URI for the current XSL namespace, for example,
847  * "http://www.w3.org/1999/XSL/Transform"
848  *
849  * @return URI string
850  */
851  static const XalanDOMString&
853  {
854  return s_XSLNameSpaceURL;
855  }
856 
857  /**
858  * Special Xalan namespace for built-in extensions.
859  *
860  * @return Xalan namespace for extensions
861  */
862  static const XalanDOMString&
864  {
865  return s_XalanNamespaceURL;
866  }
867 
868  /**
869  * Whether to warn about pattern match conflicts.
870  *
871  * @return true to not warn about pattern match conflicts
872  */
873  bool
875  {
876  return m_quietConflictWarnings;
877  }
878 
879  /**
880  * Retrieve the result namespace corresponding to a prefix.
881  *
882  * @param prefix prefix for namespace
883  * @return string for namespace URI
884  */
885  const XalanDOMString*
886  getResultNamespaceForPrefix(const XalanDOMString& prefix) const;
887 
888  /**
889  * Retrieve the result prefix corresponding to a namespace.
890  *
891  * @param theNamespace namespace for prefix
892  * @return string for namespace prefix
893  */
894  const XalanDOMString*
895  getResultPrefixForNamespace(const XalanDOMString& theNamespace) const;
896 
897  /**
898  * Determine whether or not a prefix is in use on the pending element or
899  * the pending attributes.
900  *
901  * @param thePrefix prefix for namespace
902  *
903  * @return true if the prefix is in use, false if not.
904  */
905  bool
906  isPendingResultPrefix(const XalanDOMString& thePrefix) const;
907 
908  /**
909  * Evaluate an xpath string and return the result as a numberic score.
910  *
911  * @param str string to evaluate
912  * @param context context node
913  * @param executionContext current execution context
914  * @return score number, higher representing better match
915  */
916  double
917  evalMatchPatternStr(
918  const XalanDOMString& str,
919  XalanNode* context,
920  XPathExecutionContext& executionContext);
921 
922  /**
923  * Create and initialize an xpath and return it.
924  *
925  * @param str string for XPath
926  * @param resolver resolver for namespace resolution
927  * @return pointer to XPath created
928  */
929  const XPath*
930  createMatchPattern(
931  const XalanDOMString& str,
932  const PrefixResolver& resolver);
933 
934  /**
935  * Return the xpath created by createXPath() or
936  * createMatchPattern().
937  *
938  * @param xpath The XPath to return.
939  */
940  void
941  returnXPath(const XPath* xpath);
942 
943  /**
944  * Copy XMLNS: attributes in if not already in scope.
945  *
946  * @param src source node
947  */
948  void
949  copyNamespaceAttributes(const XalanNode& src);
950 
951  /**
952  * Evaluate an xpath string and return the result.
953  *
954  * @param str string to evaluate
955  * @param executionContext current execution context
956  * @return pointer to XObject result
957  */
958  const XObjectPtr
959  evalXPathStr(
960  const XalanDOMString& str,
961  XPathExecutionContext& executionContext);
962 
963  /**
964  * Evaluate an xpath string and return the result.
965  *
966  * @param str string to evaluate
967  * @param contextNode context node
968  * @param prefixResolver prefix resolver to use
969  * @param executionContext current execution context
970  * @return pointer to XObject result
971  */
972  const XObjectPtr
973  evalXPathStr(
974  const XalanDOMString& str,
975  XalanNode* contextNode,
976  const PrefixResolver& prefixResolver,
977  XPathExecutionContext& executionContext);
978 
979  /**
980  * Evaluate an xpath string and return the result.
981  *
982  * @param str string to evaluate
983  * @param contextNode context node
984  * @param prefixResolver prefix resolver to use
985  * @param executionContext current execution context
986  * @return pointer to XObject result
987  */
988  const XObjectPtr
989  evalXPathStr(
990  const XalanDOMString& str,
991  XalanNode* contextNode,
992  const XalanElement& prefixResolver,
993  XPathExecutionContext& executionContext);
994 
995  /**
996  * Copy an attribute to an AttributeListImpl.
997  *
998  * @param attrName The name of the attribute
999  * @param attrValue The value of the attribute
1000  * @param attrList The attribute list added to
1001  */
1002  void
1003  copyAttributeToTarget(
1004  const XalanDOMString& attrName,
1005  const XalanDOMString& attrValue,
1006  AttributeListImpl& attrList);
1007 
1008  /**
1009  * Get the factory for making xpaths.
1010  *
1011  * @return XPath factory object
1012  */
1013  XPathFactory&
1015  {
1016  return m_xpathFactory;
1017  }
1018 
1019  /**
1020  * Get the XPath processor object.
1021  *
1022  * @return XPathProcessor interface being used
1023  */
1026  {
1027  return *m_xpathProcessor.get();
1028  }
1029 
1030  /**
1031  * Reset the state. This needs to be called after a process() call
1032  * is invoked, if the processor is to be used again.
1033  */
1034  virtual void
1035  reset();
1036 
1037  /**
1038  * Retrieve the XPath environment support object
1039  *
1040  * @return XPath environment support object
1041  */
1044  {
1045  return m_xpathEnvSupport;
1046  }
1047 
1048  /**
1049  * Set the problem listener property. The XSL class can have a single
1050  * listener that can be informed of errors and warnings, and can normally
1051  * control if an exception is thrown or not (or the problem listeners can
1052  * throw their own RuntimeExceptions).
1053  *
1054  * @param l pointer to ProblemListener interface
1055  */
1056  void
1058  {
1059  m_problemListener = l;
1060  }
1061 
1062  /**
1063  * Get the problem listener property. The XSL class can have a single
1064  * listener that can be informed of errors and warnings, and can normally
1065  * control if an exception is thrown or not (or the problem listeners can
1066  * throw their own RuntimeExceptions).
1067  *
1068  * @return pointer to ProblemListener interface
1069  */
1072  {
1073  return m_problemListener;
1074  }
1075 
1076  /*
1077  * Push a new output context using the provided FormatterListener.
1078  *
1079  * @param A pointer to the FormatterListener instance for the new context.
1080  */
1081  void
1083  {
1084  m_outputContextStack.pushContext(theListener);
1085  }
1086 
1087  /*
1088  * Pop the current output context.
1089  */
1090  void
1092  {
1093  m_outputContextStack.popContext();
1094  }
1095 
1096  /*
1097  * See if there is a pending start document event waiting.
1098  * @return true if there is a start document event waiting.
1099  */
1100  bool
1102  {
1103  return getHasPendingStartDocumentImpl();
1104  }
1105 
1106  /*
1107  * Set the pending start document event state.
1108  * @param the new value
1109  */
1110  void
1112  {
1113  setHasPendingStartDocumentImpl(b);
1114  }
1115 
1116  /*
1117  * See if a pending start document event must be flushed.
1118  * @return true if the event must be flushed.
1119  */
1120  bool
1122  {
1123  return getMustFlushPendingStartDocumentImpl();
1124  }
1125 
1126  /*
1127  * Set the pending start document event flush state.
1128  * @param the new value
1129  */
1130  void
1132  {
1133  setMustFlushPendingStartDocumentImpl(b);
1134  }
1135 
1136  /**
1137  * Get the list of attributes yet to be processed
1138  *
1139  * @return attribute list
1140  */
1141  const AttributeListType&
1143  {
1144  return getPendingAttributesImpl();
1145  }
1146 
1147  /**
1148  * Set the list of attributes yet to be processed
1149  *
1150  * @param pendingAttributes The attribute list
1151  */
1152  void
1153  setPendingAttributes(const AttributeListType& pendingAttributes)
1154  {
1155  getPendingAttributesImpl() = pendingAttributes;
1156  }
1157 
1158  /**
1159  * Replace the contents of a pending attribute.
1160  *
1161  * @param theName name of attribute
1162  * @param theNewType type of attribute
1163  * @param theNewValue new value of attribute
1164  */
1165  void
1167  const XalanDOMChar* theName,
1168  const XalanDOMChar* theNewType,
1169  const XalanDOMChar* theNewValue)
1170  {
1171  // Remove the old attribute, then add the new one. AttributeListImpl::addAttribute()
1172  // does this for us.
1173  getPendingAttributesImpl().addAttribute(theName, theNewType, theNewValue);
1174  }
1175 
1176  bool
1178  {
1179  return !getPendingElementNameImpl().empty();
1180  }
1181 
1182  /**
1183  * Retrieve name of the pending element currently being processed.
1184  *
1185  * @return element name
1186  */
1187  const XalanDOMString&
1189  {
1190  return getPendingElementNameImpl();
1191  }
1192 
1193  /**
1194  * Changes the currently pending element name.
1195  *
1196  * @param elementName new name of element
1197  */
1198  void
1200  {
1201  setPendingElementNameImpl(elementName);
1202  }
1203 
1204  void
1205  setPendingElementName(const XalanDOMChar* elementName)
1206  {
1207  setPendingElementNameImpl(elementName);
1208  }
1209 
1210  /**
1211  * Get the locator from the top of the locator stack.
1212  *
1213  * @return A pointer to the Locator, or 0 if there is nothing on the stack.
1214  */
1215  const Locator*
1217  {
1218  return m_stylesheetLocatorStack.empty() == true ? 0 : m_stylesheetLocatorStack.back();
1219  }
1220 
1221  /**
1222  * Push a locator on to the locator stack.
1223  *
1224  * @param A pointer to the Locator to push.
1225  */
1226  void
1227  pushLocatorOnStack(const Locator* locator)
1228  {
1229  m_stylesheetLocatorStack.push_back(locator);
1230  }
1231 
1232  /**
1233  * Pop the locator from the top of the locator stack.
1234  */
1235  void
1237  {
1238  if (m_stylesheetLocatorStack.empty() == false)
1239  {
1240  m_stylesheetLocatorStack.pop_back();
1241  }
1242  }
1243 
1244 protected:
1245 
1246  /**
1247  * Get the list of attributes yet to be processed
1248  *
1249  * @return attribute list
1250  */
1251  const AttributeListImpl&
1253  {
1254  return m_outputContextStack.getPendingAttributes();
1255  }
1256 
1257  /**
1258  * Get the list of attributes yet to be processed
1259  *
1260  * @return attribute list
1261  */
1264  {
1265  return m_outputContextStack.getPendingAttributes();
1266  }
1267 
1268  /**
1269  * Set the list of attributes yet to be processed
1270  *
1271  * @param pendingAttributes The attribute list
1272  */
1273  void
1275  {
1276  getPendingAttributesImpl() = pendingAttributes;
1277  }
1278 
1279  /**
1280  * Retrieve name of the pending element currently being processed.
1281  *
1282  * @return element name
1283  */
1284  const XalanDOMString&
1286  {
1287  return m_outputContextStack.getPendingElementName();
1288  }
1289 
1290  /**
1291  * Retrieve name of the pending element currently being processed.
1292  *
1293  * @return element name
1294  */
1297  {
1298  return m_outputContextStack.getPendingElementName();
1299  }
1300 
1301  /**
1302  * Changes the currently pending element name.
1303  *
1304  * @param elementName new name of element
1305  */
1306  void
1308  {
1309  m_outputContextStack.getPendingElementName() = elementName;
1310  }
1311 
1312  /**
1313  * Changes the currently pending element name.
1314  *
1315  * @param elementName new name of element
1316  */
1317  void
1318  setPendingElementNameImpl(const XalanDOMChar* elementName)
1319  {
1320  assert(elementName != 0);
1321 
1322  m_outputContextStack.getPendingElementName() = elementName;
1323  }
1324 
1325  /*
1326  * See if there is a pending start document event waiting.
1327  * @return true if there is a start document event waiting.
1328  */
1329  bool
1331  {
1332  return m_outputContextStack.getHasPendingStartDocument();
1333  }
1334 
1335  /*
1336  * Set the pending start document event state.
1337  * @param the new value
1338  */
1339  void
1341  {
1342  m_outputContextStack.getHasPendingStartDocument() = b;
1343  }
1344 
1345  /*
1346  * See if a pending start document event must be flushed.
1347  * @return true if the event must be flushed.
1348  */
1349  bool
1351  {
1352  return m_outputContextStack.getMustFlushPendingStartDocument();
1353  }
1354 
1355  /*
1356  * Set the pending start document event flush state.
1357  * @param the new value
1358  */
1359  void
1361  {
1362  m_outputContextStack.getMustFlushPendingStartDocument() = b;
1363  }
1364 
1367  {
1368  return m_outputContextStack.getFormatterListener();
1369  }
1370 
1371  void
1373  {
1374  m_outputContextStack.getFormatterListener() = flistener;
1375  }
1376 
1377  /**
1378  * The namespace that the result tree conforms to. A null value
1379  * indicates that result-ns is not used and there is no checking.
1380  * A empty string indicates that the result tree conforms to the
1381  * default namespace.
1382  */
1384 
1385  /**
1386  * The URL that belongs to the result namespace.
1387  */
1389 
1390 
1391  /**
1392  * Copy the attributes from the XSL element to the created
1393  * output element.
1394  */
1395  void
1396  copyAttributesToAttList(
1397  const XalanNode& node,
1398  AttributeListImpl& attList);
1399 
1400  // Factory for creating xpaths.
1402 
1403  // Factory for creating xobjects
1405 
1406  // The query/pattern-matcher object.
1408 
1409  /**
1410  * Stack of Booleans to keep track of if we should be outputting
1411  * cdata instead of escaped text.
1412  */
1414 
1415 private:
1416 
1417  /**
1418  * Issue a warning that only text nodes can be copied.
1419  *
1420  * @param sourceNode node in source where error occurred
1421  * @param locator The Locator to use, if any.
1422  */
1423  void
1424  warnCopyTextNodesOnly(
1425  const XalanNode* sourceNode,
1426  const Locator* locator);
1427 
1428  /**
1429  * Clone a text node to the result tree
1430  *
1431  * @param node node to clone
1432  * @param overrideStrip false if white space stripping should be done
1433  */
1434  void
1435  cloneToResultTree(
1436  const XalanText& node,
1437  bool overrideStrip);
1438 
1439  /**
1440  * Determine if any pending attributes is a default
1441  * namespace.
1442  */
1443  bool
1444  pendingAttributesHasDefaultNS() const;
1445 
1446  void
1447  addResultNamespace(
1448  const XalanDOMString& thePrefix,
1449  const XalanDOMString& theName,
1450  const XalanNode& theNode,
1451  AttributeListImpl& thePendingAttributes,
1452  bool fOnlyIfPrefixNotPresent);
1453 
1454  void
1455  addResultNamespace(
1456  const XalanNode& theNode,
1457  AttributeListImpl& thePendingAttributes,
1458  bool fOnlyIfPrefixNotPresent = false);
1459 
1460  /**
1461  * The top of this stack should contain the currently processed
1462  * stylesheet SAX locator object.
1463  */
1464  LocatorStack m_stylesheetLocatorStack;
1465 
1466  /**
1467  * The XSL class can have a single listener that can be informed
1468  * of errors and warnings, and can normally control if an exception
1469  * is thrown or not (or the problem listeners can throw their
1470  * own RuntimeExceptions).
1471  */
1472  ProblemListenerDefault m_defaultProblemListener;
1473 
1474  ProblemListener* m_problemListener;
1475 
1476  /**
1477  * The root of a linked set of stylesheets.
1478  */
1479  const StylesheetRoot* m_stylesheetRoot;
1480 
1481  /**
1482  * The namespace that we must match as a minimum for XSLT.
1483  */
1484  static const XalanDOMString& s_XSLNameSpaceURL; //"http://www.w3.org/1999/XSL/Transform"
1485 
1486  /**
1487  * Special Xalan namespace for built-in extensions.
1488  */
1489  static const XalanDOMString& s_XalanNamespaceURL; // "http://xml.apache.org/xalan"
1490 
1491  /**
1492  * Prefix to use when generating unique namespaces.
1493  */
1494  static const XalanDOMString& s_uniqueNamespacePrefix;
1495 
1496  /**
1497  * If this is set to true, selects will be traced
1498  */
1499  bool m_traceSelects;
1500 
1501  /**
1502  * If this is set to true, do not warn about pattern
1503  * match conflicts.
1504  */
1505  bool m_quietConflictWarnings;
1506 
1507  /*
1508  * A stream to print diagnostics to.
1509  */
1510  PrintWriter* m_diagnosticsPrintWriter;
1511 
1512  /**
1513  * List of listeners who are interested in tracing what's
1514  * being generated.
1515  */
1516  TraceListenerVectorType m_traceListeners;
1517 
1518  void
1519  problem(
1520  const XalanDOMString& msg,
1521  ProblemListener::eClassification classification,
1522  const XalanNode* sourceNode,
1523  const ElemTemplateElement* styleNode) const;
1524 
1525  void
1526  problem(
1527  const XalanDOMString& msg,
1528  ProblemListener::eClassification classification,
1529  const Locator& locator,
1530  const XalanNode* sourceNode) const;
1531 
1532  void
1533  problem(
1534  const XalanDOMString& msg,
1535  ProblemListener::eClassification classification) const;
1536 
1537  //==========================================================
1538  // SECTION: Function to do with attribute handling
1539  //==========================================================
1540 
1541  /**
1542  * This is used whenever a unique namespace is needed.
1543  */
1544  XMLUInt32 m_uniqueNSValue;
1545 
1546  ParamVectorType m_topLevelParams;
1547 
1548 public:
1549 
1550  /**
1551  * Reset the vector of top level parameters
1552  */
1553  void
1555  {
1556  m_topLevelParams.clear();
1557  }
1558 
1559 private:
1560 
1561  bool
1562  generateCDATASection() const
1563  {
1564  if (m_hasCDATASectionElements == false)
1565  {
1566  return false;
1567  }
1568  else
1569  {
1570  assert(m_cdataStack.empty() == false);
1571 
1572  return m_cdataStack.back();
1573  }
1574  }
1575 
1576  void
1577  doFlushPending()
1578  {
1579  setMustFlushPendingStartDocument(true);
1580 
1581  flushPending();
1582  }
1583 
1584  /**
1585  * Tell if a given element name should output its text
1586  * as cdata.
1587  *
1588  * @param elementName name of element
1589  * @return true if it should output as cdata
1590  */
1591  bool
1592  isCDataResultElem(const XalanDOMString& elementName);
1593 
1594  void
1595  fireCharacterGenerateEvent(
1596  const XalanNode& theNode,
1597  bool isCDATA);
1598 
1599  void
1600  fireCharacterGenerateEvent(
1601  const XObjectPtr& theXObject,
1602  bool isCDATA);
1603 
1604  void
1605  fireCharacterGenerateEvent(
1606  const XalanDOMString& theString,
1607  bool isCDATA);
1608 
1609  void
1610  fireCharacterGenerateEvent(
1611  const XalanDOMChar* ch,
1612  size_type start,
1613  size_type length,
1614  bool isCDATA);
1615 
1616  void
1617  checkDefaultNamespace(
1618  const XalanDOMString& theElementName,
1619  const XalanDOMString& theElementNamespaceURI);
1620 
1621  void
1622  error(
1623  const XalanDOMString& theMessage,
1624  const Locator* theLocator,
1625  const XalanNode* theSourceNode);
1626 
1627  void
1628  warn(
1629  const XalanDOMString& theMessage,
1630  const Locator* theLocator,
1631  const XalanNode* theSourceNode);
1632 
1633  void
1634  message(
1635  const XalanDOMString& theMessage,
1636  const Locator* theLocator,
1637  const XalanNode* theSourceNode);
1638 
1639  // Data members...
1640  XMLParserLiaison& m_parserLiaison;
1641 
1642  XPathEnvSupport& m_xpathEnvSupport;
1643 
1644  DOMSupport& m_domSupport;
1645 
1646  /**
1647  * Current execution context...
1648  */
1649  StylesheetExecutionContext* m_executionContext;
1650 
1651  /*
1652  * Stack of current output contexts...
1653  */
1654  OutputContextStack m_outputContextStack;
1655 
1656  /*
1657  * Stack of current result namespaces...
1658  */
1659  XalanNamespacesStack m_resultNamespacesStack;
1660 
1661  /*
1662  * Dummy AttributeListImpl
1663  */
1664  AttributeListImpl m_dummyAttributesList;
1665 
1666  XalanDOMString m_scratchString;
1667 
1668  XalanDOMStringPointerVectorType m_attributeNamesVisited;
1669 
1670  bool m_hasCDATASectionElements;
1671 
1672  XPathConstructionContextDefault m_xpathConstructionContext;
1673 
1674  ParamMapType m_stylesheetParams;
1675 
1676  static void
1677  installFunctions(MemoryManager& theManager);
1678 
1679  static void
1680  uninstallFunctions();
1681 
1682 
1683  static const XalanDOMString s_emptyString;
1684 
1685  static const XalanDOMString& s_stylesheetNodeName;
1686  static const XalanDOMString& s_typeString;
1687  static const XalanDOMString& s_hrefString;
1688  static const XalanDOMString& s_piTokenizerString;
1689  static const XalanDOMString& s_typeValueString1;
1690  static const XalanDOMString& s_typeValueString2;
1691  static const XalanDOMString& s_typeValueString3;
1692  static const XalanDOMString& s_typeValueString4;
1693 
1694  // Not implemented...
1695  XSLTEngineImpl(const XSLTEngineImpl&);
1696 
1697  XSLTEngineImpl&
1698  operator=(const XSLTEngineImpl&);
1699 
1700  bool
1701  operator==(const XSLTEngineImpl&) const;
1702 };
1703 
1704 
1705 
1706 }
1707 
1708 
1709 
1710 #endif // XALAN_XSLTENGINEIMPL_HEADER_GUARD
xalanc::XSLTEngineImpl::replacePendingAttribute
void replacePendingAttribute(const XalanDOMChar *theName, const XalanDOMChar *theNewType, const XalanDOMChar *theNewValue)
Replace the contents of a pending attribute.
Definition: XSLTEngineImpl.hpp:1166
xalanc::XSLTEngineImpl::addResultAttribute
void addResultAttribute(AttributeListImpl &attList, const XalanDOMString &aname, const XalanDOMChar *value, bool fromCopy=false, const Locator *locator=0)
Add attribute to attribute list, and if it is a namespace, add it to the namespaces stack.
Definition: XSLTEngineImpl.hpp:510
xalanc::XSLTEngineImpl::getXPathProcessor
XPathProcessor & getXPathProcessor()
Get the XPath processor object.
Definition: XSLTEngineImpl.hpp:1025
xalanc::XSLTEngineImpl::BoolVectorType
XalanVector< bool > BoolVectorType
Definition: XSLTEngineImpl.hpp:161
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::XSLTEngineImpl::ParamMapType
XalanMap< XalanDOMString, XalanParamHolder > ParamMapType
Definition: XSLTEngineImpl.hpp:189
xalanc::XSLTEngineImpl::getMemoryManager
MemoryManager & getMemoryManager()
Definition: XSLTEngineImpl.hpp:224
xalanc::AttributeListType
xercesc::AttributeList AttributeListType
Definition: AttributeListImpl.hpp:41
xalanc::XalanVector::empty
bool empty() const
Definition: XalanVector.hpp:600
xalanc::XalanVector::back
reference back()
Definition: XalanVector.hpp:637
xalanc::StylesheetExecutionContext
Definition: StylesheetExecutionContext.hpp:106
xalanc::XSLTEngineImpl::getLocatorFromStack
const Locator * getLocatorFromStack() const
Get the locator from the top of the locator stack.
Definition: XSLTEngineImpl.hpp:1216
PrefixResolver.hpp
xalanc::XalanNode
Definition: XalanNode.hpp:38
XSLTProcessor.hpp
xalanc::XSLTEngineImpl::XObjectArgVectorType
Function::XObjectArgVectorType XObjectArgVectorType
Definition: XSLTEngineImpl.hpp:184
xalanc::XSLTEngineImpl::setFormatterListenerImpl
void setFormatterListenerImpl(FormatterListener *flistener)
Definition: XSLTEngineImpl.hpp:1372
xalanc::XalanNode::NodeType
NodeType
Definition: XalanNode.hpp:47
xalanc::XSLTEngineImpl::FindStringPointerFunctor::operator()
bool operator()(const XalanDOMString *theString) const
Definition: XSLTEngineImpl.hpp:171
XalanDOMString.hpp
xalanc::XalanVector< const Locator * >
xalanc::XalanText
Definition: XalanText.hpp:40
xalanc::XSLTEngineImpl::pushLocatorOnStack
void pushLocatorOnStack(const Locator *locator)
Push a locator on to the locator stack.
Definition: XSLTEngineImpl.hpp:1227
xalanc::XSLTEngineImpl::ECGetCachedString
XPathExecutionContext::GetCachedString ECGetCachedString
Definition: XSLTEngineImpl.hpp:187
xalanc::XObject::rtree
virtual const XalanDocumentFragment & rtree() const
Cast result object to a result tree fragment.
xalanc::XSLTEngineImpl::setPendingElementName
void setPendingElementName(const XalanDOMString &elementName)
Changes the currently pending element name.
Definition: XSLTEngineImpl.hpp:1199
xalanc::XSLTEngineImpl::m_cdataStack
BoolVectorType m_cdataStack
Stack of Booleans to keep track of if we should be outputting cdata instead of escaped text.
Definition: XSLTEngineImpl.hpp:1413
xalanc::XSLTEngineImpl::getXalanXSLNameSpaceURL
static const XalanDOMString & getXalanXSLNameSpaceURL()
Special Xalan namespace for built-in extensions.
Definition: XSLTEngineImpl.hpp:863
xalanc::XPath
Definition: XPath.hpp:67
xalanc::XSLTEngineImpl::getXPathEnvSupport
XPathEnvSupport & getXPathEnvSupport()
Retrieve the XPath environment support object.
Definition: XSLTEngineImpl.hpp:1043
XALAN_XSLT_EXPORT
#define XALAN_XSLT_EXPORT
Definition: XSLTDefinitions.hpp:27
xalanc::XPathFactory
Definition: XPathFactory.hpp:41
OutputContextStack.hpp
xalanc::XSLTEngineImpl::setPendingAttributes
void setPendingAttributes(const AttributeListType &pendingAttributes)
Set the list of attributes yet to be processed.
Definition: XSLTEngineImpl.hpp:1153
xalanc::TraceListener
Definition: TraceListener.hpp:36
xalanc::XalanDocument
Definition: XalanDocument.hpp:36
xalanc::size_type
size_t size_type
Definition: XalanMap.hpp:46
xalanc::XSLTEngineImpl::XalanDOMStringPointerVectorType
XalanVector< const XalanDOMString * > XalanDOMStringPointerVectorType
Definition: XSLTEngineImpl.hpp:159
xalanc::ElemTemplateElement
Definition: ElemTemplateElement.hpp:79
xalanc::XalanDOMString::compare
int compare(const XalanDOMString &theString) const
Definition: XalanDOMString.hpp:612
xalanc::XSLTEngineImpl::m_resultNameSpaceURL
XalanDOMString m_resultNameSpaceURL
The URL that belongs to the result namespace.
Definition: XSLTEngineImpl.hpp:1388
xalanc::XSLTEngineImpl::m_resultNameSpacePrefix
XalanDOMString m_resultNameSpacePrefix
The namespace that the result tree conforms to.
Definition: XSLTEngineImpl.hpp:1383
xalanc::XSLTEngineImpl::addResultAttribute
void addResultAttribute(const XalanDOMString &aname, const XalanDOMChar *value, bool fromCopy=false, const Locator *locator=0)
Add attribute to pending attributes list, and if it is a namespace, add it to the namespaces stack.
Definition: XSLTEngineImpl.hpp:556
xalanc::operator==
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
Definition: XalanVector.hpp:1118
xalanc::XSLTEngineImpl::setHasPendingStartDocument
void setHasPendingStartDocument(bool b)
Definition: XSLTEngineImpl.hpp:1111
XSLTProcessorException.hpp
xalanc::XSLTResultTarget
Definition: XSLTResultTarget.hpp:45
xalanc::XSLTEngineImpl::outputResultTreeFragment
void outputResultTreeFragment(const XObject &theTree, bool outputTextNodesOnly, const Locator *locator)
Given a result tree fragment, walk the tree and output it to the result stream.
Definition: XSLTEngineImpl.hpp:796
xalanc::XSLTEngineImpl::FindStringPointerFunctor::FindStringPointerFunctor
FindStringPointerFunctor(const XalanDOMString &theString)
Definition: XSLTEngineImpl.hpp:165
xalanc::XObjectPtr
Class to hold XObjectPtr return types.
Definition: XObject.hpp:883
XPathProcessor.hpp
xalanc::XSLTEngineImpl::getProblemListener
ProblemListener * getProblemListener() const
Get the problem listener property.
Definition: XSLTEngineImpl.hpp:1071
xalanc::XSLTEngineImpl
It's the responsibility of the XSLTEngineImpl class, collaborating with the XML parser liaison,...
Definition: XSLTEngineImpl.hpp:131
xalanc::XSLTEngineImpl::isElementPending
bool isElementPending() const
Definition: XSLTEngineImpl.hpp:1177
DOMStringHelper.hpp
xalanc::XPathConstructionContext::GetCachedString
Definition: XPathConstructionContext.hpp:140
xalanc::XSLTEngineImpl::getPendingElementName
const XalanDOMString & getPendingElementName() const
Retrieve name of the pending element currently being processed.
Definition: XSLTEngineImpl.hpp:1188
xalanc::DocumentHandlerType
xercesc::DocumentHandler DocumentHandlerType
Definition: XMLParserLiaison.hpp:47
xalanc::SelectionEvent
Definition: SelectionEvent.hpp:47
xalanc::XalanVector::clear
void clear()
Definition: XalanVector.hpp:752
xalanc::XSLTEngineImpl::addResultNamespaceDecl
void addResultNamespaceDecl(const XalanDOMString &prefix, const XalanDOMString &namespaceVal)
Add a namespace declaration to the namespace stack.
Definition: XSLTEngineImpl.hpp:444
xalanc::XSLTProcessor
This is an interface for an XSLT Processor engine.
Definition: XSLTProcessor.hpp:88
xalanc::XalanDOMString::length
size_type length() const
Definition: XalanDOMString.hpp:209
xalanc::XSLTEngineImpl::getHasPendingStartDocument
bool getHasPendingStartDocument() const
Definition: XSLTEngineImpl.hpp:1101
XalanNamespacesStack.hpp
xalanc::XSLTEngineImpl::m_xpathProcessor
const XPathProcessorPtrType m_xpathProcessor
Definition: XSLTEngineImpl.hpp:1407
xalanc::ProblemListener
This is the abstract class that the XSL processor uses when it has a problem of some kind,...
Definition: ProblemListener.hpp:48
XPathConstructionContextDefault.hpp
xalanc::XSLTEngineImpl::setMustFlushPendingStartDocument
void setMustFlushPendingStartDocument(bool b)
Definition: XSLTEngineImpl.hpp:1131
xalanc::XSLTEngineImpl::setPendingElementNameImpl
void setPendingElementNameImpl(const XalanDOMString &elementName)
Changes the currently pending element name.
Definition: XSLTEngineImpl.hpp:1307
xalanc::XSLTEngineImpl::pushOutputContext
void pushOutputContext(FormatterListener *theListener)
Definition: XSLTEngineImpl.hpp:1082
xalanc::XSLTInputSource
Definition: XSLTInputSource.hpp:62
xalanc::XSLTEngineImpl::addResultAttribute
void addResultAttribute(AttributeListImpl &attList, const XalanDOMString &aname, const XalanDOMString &value, bool fromCopy=false, const Locator *locator=0)
Add attribute to attribute list, and if it is a namespace, add it to the namespaces stack.
Definition: XSLTEngineImpl.hpp:484
xalanc::XSLTEngineImpl::getPendingAttributes
const AttributeListType & getPendingAttributes() const
Get the list of attributes yet to be processed.
Definition: XSLTEngineImpl.hpp:1142
xalanc::XSLTEngineImpl::getPendingAttributesImpl
AttributeListImpl & getPendingAttributesImpl()
Get the list of attributes yet to be processed.
Definition: XSLTEngineImpl.hpp:1263
xalanc::XSLTEngineImpl::setHasPendingStartDocumentImpl
void setHasPendingStartDocumentImpl(bool b)
Definition: XSLTEngineImpl.hpp:1340
xalanc::XObject
Class to hold XPath return types.
Definition: XObject.hpp:63
xalanc::length
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
Definition: DOMStringHelper.hpp:235
xalanc::XSLTEngineImpl::LessXalanDOMStringPointers
Definition: XSLTEngineImpl.hpp:135
xalanc::StylesheetConstructionContext
Definition: StylesheetConstructionContext.hpp:83
xalanc::XPathExecutionContext::GetCachedString
Definition: XPathExecutionContext.hpp:448
ProblemListenerDefault.hpp
xalanc::XSLTEngineImpl::setPendingElementName
void setPendingElementName(const XalanDOMChar *elementName)
Definition: XSLTEngineImpl.hpp:1205
xalanc::XSLTEngineImpl::getMustFlushPendingStartDocumentImpl
bool getMustFlushPendingStartDocumentImpl() const
Definition: XSLTEngineImpl.hpp:1350
xalanc::XSLTEngineImpl::XPathProcessorPtrType
XalanMemMgrAutoPtr< XPathProcessor > XPathProcessorPtrType
Definition: XSLTEngineImpl.hpp:183
xalanc::XSLTEngineImpl::TraceListenerVectorType
XalanVector< TraceListener * > TraceListenerVectorType
Definition: XSLTEngineImpl.hpp:158
xalanc::PrefixResolver
This class defines an interface for classes that resolve namespace prefixes to their URIs.
Definition: PrefixResolver.hpp:39
xalanc::ProblemListenerDefault
The implementation of the default error handling for Xalan.
Definition: ProblemListenerDefault.hpp:51
xalanc::XSLTEngineImpl::getFormatterListenerImpl
FormatterListener * getFormatterListenerImpl() const
Definition: XSLTEngineImpl.hpp:1366
xalanc::XSLTEngineImpl::setPendingElementNameImpl
void setPendingElementNameImpl(const XalanDOMChar *elementName)
Changes the currently pending element name.
Definition: XSLTEngineImpl.hpp:1318
XalanParamHolder.hpp
xalanc::PrintWriter
Definition: PrintWriter.hpp:37
xalanc::DOMSupport
Definition: DOMSupport.hpp:41
xalanc::XSLTEngineImpl::getPendingElementNameImpl
const XalanDOMString & getPendingElementNameImpl() const
Retrieve name of the pending element currently being processed.
Definition: XSLTEngineImpl.hpp:1285
xalanc::ProblemListenerBase::eClassification
eClassification
Definition: ProblemListenerBase.hpp:75
xalanc::XSLTEngineImpl::getHasPendingStartDocumentImpl
bool getHasPendingStartDocumentImpl() const
Definition: XSLTEngineImpl.hpp:1330
xalanc::XPathProcessor
Definition: XPathProcessor.hpp:56
xalanc::XSLTEngineImpl::setPendingAttributesImpl
void setPendingAttributesImpl(const AttributeListType &pendingAttributes)
Set the list of attributes yet to be processed.
Definition: XSLTEngineImpl.hpp:1274
xalanc::XSLTEngineImpl::CCGetCachedString
XPathConstructionContext::GetCachedString CCGetCachedString
Definition: XSLTEngineImpl.hpp:186
xalanc::XalanMap< XalanDOMString, XalanParamHolder >
xalanc::XSLTEngineImpl::getXSLNameSpaceURL
static const XalanDOMString & getXSLNameSpaceURL()
Retrieve the URI for the current XSL namespace, for example, "http://www.w3.org/1999/XSL/Transform".
Definition: XSLTEngineImpl.hpp:852
xalanc::XMLParserLiaison
Definition: XMLParserLiaison.hpp:68
AttributeListImpl.hpp
xalanc::XSLTEngineImpl::m_xobjectFactory
XObjectFactory & m_xobjectFactory
Definition: XSLTEngineImpl.hpp:1404
xalanc::XSLTEngineImpl::LessXalanDOMStringPointers::operator()
bool operator()(const XalanDOMString *theLHS, const XalanDOMString *theRHS) const
Definition: XSLTEngineImpl.hpp:138
xalanc::TracerEvent
This is the parent class of events generated for tracing the progress of the XSL processor.
Definition: TracerEvent.hpp:49
XalanMap.hpp
xalanc::XalanDOMString::c_str
const XalanDOMChar * c_str() const
Definition: XalanDOMString.hpp:344
xalanc::XSLTEngineImpl::setProblemListener
void setProblemListener(ProblemListener *l)
Set the problem listener property.
Definition: XSLTEngineImpl.hpp:1057
xalanc::StylesheetRoot
This acts as the stylesheet root of the stylesheet tree, and holds values that are shared by all styl...
Definition: StylesheetRoot.hpp:63
xalanc::XSLTEngineImpl::getPendingElementNameImpl
XalanDOMString & getPendingElementNameImpl()
Retrieve name of the pending element currently being processed.
Definition: XSLTEngineImpl.hpp:1296
xalanc::InputSourceType
xercesc::InputSource InputSourceType
Definition: XMLParserLiaison.hpp:50
xalanc::XalanMemMgrAutoPtr< XPathProcessor >
xalanc::XSLTEngineImpl::popLocatorStack
void popLocatorStack()
Pop the locator from the top of the locator stack.
Definition: XSLTEngineImpl.hpp:1236
xalanc::AttributeListImpl
Definition: AttributeListImpl.hpp:49
XSLTDefinitions.hpp
xalanc::XPathEnvSupport
Definition: XPathEnvSupport.hpp:60
xalanc::XSLTEngineImpl::getMemoryManager
MemoryManager & getMemoryManager() const
Definition: XSLTEngineImpl.hpp:218
xalanc::XalanElement
Definition: XalanElement.hpp:44
xalanc::XSLTEngineImpl::getPendingAttributesImpl
const AttributeListImpl & getPendingAttributesImpl() const
Get the list of attributes yet to be processed.
Definition: XSLTEngineImpl.hpp:1252
xalanc::Stylesheet
This class represents the base stylesheet or an "import" stylesheet.
Definition: Stylesheet.hpp:86
xalanc::FormatterListener
A SAX-based formatter interface for the XSL processor.
Definition: FormatterListener.hpp:56
xalanc::XPathExecutionContext
Definition: XPathExecutionContext.hpp:82
xalanc::NodeRefListBase
Local implementation of NodeRefList.
Definition: NodeRefListBase.hpp:44
xalanc::XSLTEngineImpl::getXPathFactory
XPathFactory & getXPathFactory()
Get the factory for making xpaths.
Definition: XSLTEngineImpl.hpp:1014
xalanc::XSLTEngineImpl::FindStringPointerFunctor
Definition: XSLTEngineImpl.hpp:163
xalanc::GenerateEvent
This is the class for events generated by the XSL processor after it generates a new node in the resu...
Definition: GenerateEvent.hpp:55
xalanc::XSLTEngineImpl::addResultAttribute
void addResultAttribute(const XalanDOMString &aname, const XalanDOMString &value, bool fromCopy=false, const Locator *locator=0)
Add attribute to pending attributes list, and if it is a namespace, add it to the namespaces stack.
Definition: XSLTEngineImpl.hpp:582
xalanc::XSLTEngineImpl::popOutputContext
void popOutputContext()
Definition: XSLTEngineImpl.hpp:1091
ResultNamespacesStack.hpp
xalanc::XSLTEngineImpl::clearTopLevelParams
void clearTopLevelParams()
Reset the vector of top level parameters.
Definition: XSLTEngineImpl.hpp:1554
xalanc::XSLTEngineImpl::m_xpathFactory
XPathFactory & m_xpathFactory
Definition: XSLTEngineImpl.hpp:1401
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:45
xalanc::XSLTEngineImpl::ParamVectorType
StylesheetExecutionContext::ParamVectorType ParamVectorType
Definition: XSLTEngineImpl.hpp:185
xalanc::XSLTEngineImpl::getQuietConflictWarnings
bool getQuietConflictWarnings() const
Whether to warn about pattern match conflicts.
Definition: XSLTEngineImpl.hpp:874
StylesheetExecutionContext.hpp
xalanc::XalanDocumentFragment
Definition: XalanDocumentFragment.hpp:32
xalanc::XObjectFactory
This class handles the creation of XObjects and manages their lifetime.
Definition: XObjectFactory.hpp:53
xalanc::XSLTEngineImpl::addResultNamespaceDecl
void addResultNamespaceDecl(const XalanDOMString &prefix, const XalanDOMChar *namespaceVal, size_type len)
Add a namespace declaration to the namespace stack.
Definition: XSLTEngineImpl.hpp:462
Function.hpp
xalanc::XSLTEngineImpl::setMustFlushPendingStartDocumentImpl
void setMustFlushPendingStartDocumentImpl(bool b)
Definition: XSLTEngineImpl.hpp:1360
xalanc::XSLTEngineImpl::getMustFlushPendingStartDocument
bool getMustFlushPendingStartDocument() const
Definition: XSLTEngineImpl.hpp:1121
xalanc::XSLTEngineImpl::LocatorStack
XalanVector< const Locator * > LocatorStack
Definition: XSLTEngineImpl.hpp:157
XalanMemMgrAutoPtr.hpp