Xalan-C++ API Documentation
Go to the documentation of this file.
18 #if !defined(XALAN_XSLTENGINEIMPL_HEADER_GUARD)
19 #define XALAN_XSLTENGINEIMPL_HEADER_GUARD
43 #if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION)
81 XALAN_DECLARE_XERCES_CLASS(InputSource)
82 XALAN_DECLARE_XERCES_CLASS(DocumentHandler)
86 XALAN_CPP_NAMESPACE_BEGIN
139 if (theLHS == 0 && theRHS != 0)
143 else if (theRHS == 0)
149 return theLHS->
compare(*theRHS) < 0 ? true :
false;
170 assert(theString != 0);
172 return *theString == m_string;
204 MemoryManager& theManager,
217 return m_xpathConstructionContext.getMemoryManager();
223 return m_xpathConstructionContext.getMemoryManager();
246 const Locator* locator,
342 const XPath* xpath)
const;
386 DocumentHandler* docHandler,
388 ErrorHandler* theErrorHandler = 0);
403 const InputSource& inputSource,
404 DocumentHandler* docHandler,
406 ErrorHandler* theErrorHandler = 0);
445 addResultNamespaceDecl(
447 namespaceVal.
c_str(),
461 const XalanDOMChar* namespaceVal,
464 m_resultNamespacesStack.addDeclaration(
485 bool fromCopy =
false,
486 const Locator* locator = 0)
510 const XalanDOMChar* value,
511 bool fromCopy =
false,
512 const Locator* locator = 0)
538 const XalanDOMChar* value,
540 bool fromCopy =
false,
541 const Locator* locator = 0);
555 const XalanDOMChar* value,
556 bool fromCopy =
false,
557 const Locator* locator = 0)
559 assert(m_outputContextStack.empty() ==
false);
562 getPendingAttributesImpl(),
582 bool fromCopy =
false,
583 const Locator* locator = 0)
585 assert(m_outputContextStack.empty() ==
false);
588 getPendingAttributesImpl(),
603 const Locator* locator);
616 const XalanDOMChar* name,
624 const XalanDOMChar* ch,
629 const XalanDOMChar* ch,
634 const XalanDOMChar* target,
635 const XalanDOMChar* data);
649 const XalanDOMChar* ch,
689 const XalanDOMChar* ch,
735 const XalanDOMChar* ch,
749 bool cloneTextNodesOnly,
750 const Locator* locator);
767 bool shouldCloneAttributes,
768 bool cloneTextNodesOnly,
769 const Locator* locator);
781 bool outputTextNodesOnly,
782 const Locator* locator);
795 bool outputTextNodesOnly,
796 const Locator* locator)
798 outputResultTreeFragment(
815 bool outputTextNodesOnly,
816 const Locator* locator);
851 return s_XSLNameSpaceURL;
862 return s_XalanNamespaceURL;
873 return m_quietConflictWarnings;
1013 return m_xpathFactory;
1024 return *m_xpathProcessor.get();
1042 return m_xpathEnvSupport;
1056 m_problemListener = l;
1070 return m_problemListener;
1081 m_outputContextStack.pushContext(theListener);
1090 m_outputContextStack.popContext();
1100 return getHasPendingStartDocumentImpl();
1110 setHasPendingStartDocumentImpl(b);
1120 return getMustFlushPendingStartDocumentImpl();
1130 setMustFlushPendingStartDocumentImpl(b);
1141 return getPendingAttributesImpl();
1152 getPendingAttributesImpl() = pendingAttributes;
1164 const XalanDOMChar* theName,
1165 const XalanDOMChar* theNewType,
1166 const XalanDOMChar* theNewValue)
1170 getPendingAttributesImpl().addAttribute(theName, theNewType, theNewValue);
1176 return !getPendingElementNameImpl().empty();
1187 return getPendingElementNameImpl();
1198 setPendingElementNameImpl(elementName);
1204 setPendingElementNameImpl(elementName);
1215 return m_stylesheetLocatorStack.empty() ==
true ? 0 : m_stylesheetLocatorStack.back();
1226 m_stylesheetLocatorStack.push_back(locator);
1235 if (m_stylesheetLocatorStack.empty() ==
false)
1237 m_stylesheetLocatorStack.pop_back();
1251 return m_outputContextStack.getPendingAttributes();
1262 return m_outputContextStack.getPendingAttributes();
1273 getPendingAttributesImpl() = pendingAttributes;
1284 return m_outputContextStack.getPendingElementName();
1295 return m_outputContextStack.getPendingElementName();
1306 m_outputContextStack.getPendingElementName() = elementName;
1317 assert(elementName != 0);
1319 m_outputContextStack.getPendingElementName() = elementName;
1329 return m_outputContextStack.getHasPendingStartDocument();
1339 m_outputContextStack.getHasPendingStartDocument() = b;
1349 return m_outputContextStack.getMustFlushPendingStartDocument();
1359 m_outputContextStack.getMustFlushPendingStartDocument() = b;
1365 return m_outputContextStack.getFormatterListener();
1371 m_outputContextStack.getFormatterListener() = flistener;
1421 warnCopyTextNodesOnly(
1423 const Locator* locator);
1434 bool overrideStrip);
1441 pendingAttributesHasDefaultNS()
const;
1449 bool fOnlyIfPrefixNotPresent);
1455 bool fOnlyIfPrefixNotPresent =
false);
1496 bool m_traceSelects;
1502 bool m_quietConflictWarnings;
1526 const Locator& locator,
1541 unsigned long m_uniqueNSValue;
1553 m_topLevelParams.
clear();
1559 generateCDATASection()
const
1561 if (m_hasCDATASectionElements ==
false)
1567 assert(m_cdataStack.
empty() ==
false);
1569 return m_cdataStack.
back();
1576 setMustFlushPendingStartDocument(
true);
1592 fireCharacterGenerateEvent(
1597 fireCharacterGenerateEvent(
1602 fireCharacterGenerateEvent(
1607 fireCharacterGenerateEvent(
1608 const XalanDOMChar* ch,
1614 checkDefaultNamespace(
1621 const Locator* theLocator,
1627 const Locator* theLocator,
1633 const Locator* theLocator,
1665 XalanDOMStringPointerVectorType m_attributeNamesVisited;
1667 bool m_hasCDATASectionElements;
1671 ParamMapType m_stylesheetParams;
1674 installFunctions(MemoryManager& theManager);
1677 uninstallFunctions();
1703 XALAN_CPP_NAMESPACE_END
1707 #endif // XALAN_XSLTENGINEIMPL_HEADER_GUARD
void setPendingAttributesImpl(const AttributeListType &pendingAttributes)
Set the list of attributes yet to be processed.
XERCES_CPP_NAMESPACE_QUALIFIER DocumentHandler DocumentHandlerType
XalanVector< const XalanDOMString * > XalanDOMStringPointerVectorType
Function::XObjectArgVectorType XObjectArgVectorType
MemoryManager & getMemoryManager() const
virtual XalanNode * getSourceTreeFromInput(const XSLTInputSource &inputSource)
Given an input source, get the source tree.
void setPendingElementName(const XalanDOMChar *elementName)
virtual bool getTraceSelects() const
If this is set to true, simple traces of template calls are made.
bool getQuietConflictWarnings() const
Whether to warn about pattern match conflicts.
bool operator()(const XalanDOMString *theString) const
bool getHasPendingStartDocument() const
StylesheetExecutionContext::ParamVectorType ParamVectorType
virtual void fireTraceEvent(const TracerEvent &te)
Fire a trace event.
virtual size_type getTraceListeners() const
Determine the number of trace listeners.
virtual void setQuietConflictWarnings(bool b)
If the quietConflictWarnings property is set to true, warnings about pattern conflicts won't be print...
This class defines an interface for classes that resolve namespace prefixes to their URIs.
virtual void fireGenerateEvent(const GenerateEvent &ge)
Fire a generate event.
Class to hold XPath return types.
static void terminate()
Perform termination of statics.
AttributeListImpl & getPendingAttributesImpl()
Get the list of attributes yet to be processed.
virtual const XalanDOMString * getNamespaceForPrefix(const XalanDOMString &prefix) const
Retrieve a namespace corresponding to a prefix.
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
Stylesheet * getStylesheetFromPIURL(const XalanDOMString &xslURLString, XalanNode &fragBase, const XalanDOMString &xmlBaseIdent, bool isRoot, StylesheetConstructionContext &constructionContext)
Reset the state of the XSL processor by reading in a new XSL stylesheet from a processing instruction...
bool operator()(const XalanDOMString *theLHS, const XalanDOMString *theRHS) const
void endElement(const XalanDOMChar *name)
double evalMatchPatternStr(const XalanDOMString &str, XalanNode *context, XPathExecutionContext &executionContext)
Evaluate an xpath string and return the result as a numberic score.
void copyAttributeToTarget(const XalanDOMString &attrName, const XalanDOMString &attrValue, AttributeListImpl &attrList)
Copy an attribute to an AttributeListImpl.
void setPendingElementNameImpl(const XalanDOMChar *elementName)
Changes the currently pending element name.
bool operator==(const ElemAttributeSet &theLHS, const ElemAttributeSet &theRHS)
This is the parent class of events generated for tracing the progress of the XSL processor.
virtual void problem(eSource source, eClassification classification, const XalanDOMString &msg, const Locator *locator, const XalanNode *sourceNode)
Function that is called when a problem event occurs.
virtual void addTraceListener(TraceListener *tl)
Add a trace listener for the purposes of debugging and diagnosis.
XalanDocument * parseXML(const InputSource &inputSource, DocumentHandler *docHandler, XalanDocument *docToRegister, ErrorHandler *theErrorHandler=0)
Read in the XML file, either producing a Document or calling SAX events, and register the document in...
void copyNamespaceAttributes(const XalanNode &src)
Copy XMLNS: attributes in if not already in scope.
void startElement(const XalanDOMChar *name)
Receive notification of the beginning of an element with an empty attribute list.
virtual void problem(eSource source, eClassification classification, const XalanDOMString &msg, const Locator *locator, const XalanNode *sourceNode)=0
Function that is called when a problem event occurs.
The implementation of the default error handling for Xalan.
void reportDuplicateNamespaceNodeError(const XalanDOMString &theName, const Locator *locator)
Report an error copying a duplicate namespace node.
void setFormatterListenerImpl(FormatterListener *flistener)
XSLTEngineImpl(MemoryManager &theManager, XMLParserLiaison &parserLiaison, XPathEnvSupport &xpathEnvSupport, DOMSupport &domSupport, XObjectFactory &xobjectFactory, XPathFactory &xpathFactory)
Construct an XSL processor that can call back to a XML processor, so it can handle included files,...
XObjectFactory & m_xobjectFactory
virtual void fireSelectEvent(const SelectionEvent &se)
Fire a selection event.
void startElement(const XalanDOMChar *name, AttributeListType &atts)
const XalanDOMString & getPendingElementNameImpl() const
Retrieve name of the pending element currently being processed.
virtual void process(const XSLTInputSource &inputSource, const XSLTInputSource &stylesheetSource, XSLTResultTarget &outputTarget, StylesheetConstructionContext &constructionContext, StylesheetExecutionContext &executionContext)
Transform the source tree to the output in the given result tree target.
XalanDOMString & getPendingElementNameImpl()
Retrieve name of the pending element currently being processed.
This is the class for events generated by the XSL processor after it generates a new node in the resu...
virtual StylesheetRoot * processStylesheet(const XSLTInputSource &stylesheetSource, StylesheetConstructionContext &constructionContext)
Given a stylesheet input source, compile the stylesheet into an internal representation.
#define XALAN_XSLT_EXPORT
void cdata(const XalanDOMChar *ch, size_type start, size_type length)
Receive notification of cdata.
void cloneToResultTree(const XalanNode &node, bool cloneTextNodesOnly, const Locator *locator)
Clone a node to the result tree.
virtual void problem(eSource source, eClassification classification, const XalanDOMString &msg, const XalanNode *sourceNode)
Function that is called when a problem event occurs.
void clearTopLevelParams()
Reset the vector of top level parameters.
int compare(const XalanDOMString &theString) const
FindStringPointerFunctor(const XalanDOMString &theString)
XPathExecutionContext::GetCachedString ECGetCachedString
XalanVector< TraceListener * > TraceListenerVectorType
virtual const StylesheetRoot * getStylesheetRoot() const
Retrieve the root stylesheet.
const XPathProcessorPtrType m_xpathProcessor
XPathConstructionContext::GetCachedString CCGetCachedString
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.
const XObjectPtr evalXPathStr(const XalanDOMString &str, XalanNode *contextNode, const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext)
Evaluate an xpath string and return the result.
virtual StylesheetRoot * processStylesheet(const XalanDOMString &xsldocURLString, StylesheetConstructionContext &constructionContext)
Given a URI to an XSL stylesheet, compile the stylesheet into an internal representation.
virtual void clearStylesheetParams()
Clear any stylesheet params.
virtual void setTraceSelects(bool b)
virtual void setStylesheetParam(const XalanDOMString &key, const XalanDOMString &expression)
Set a top-level parameter, which the stylesheet can access with a top-level xsl:param.
void setMustFlushPendingStartDocument(bool b)
void characters(const XalanDOMChar *ch, size_type start, size_type length)
Receive notification of character data.
XPathFactory & m_xpathFactory
void addResultNamespaceDecl(const XalanDOMString &prefix, const XalanDOMString &namespaceVal)
Add a namespace declaration to the namespace stack.
bool getHasPendingStartDocumentImpl() const
const XObjectPtr evalXPathStr(const XalanDOMString &str, XPathExecutionContext &executionContext)
Evaluate an xpath string and return the result.
void setHasPendingStartDocumentImpl(bool b)
XalanVector< bool > BoolVectorType
This class represents the base stylesheet or an "import" stylesheet.
void charactersRaw(const XalanNode &node)
Send raw character data from the node to the result tree.
void charactersRaw(const XObjectPtr &xobject)
Send raw character data from an XObject to the result tree.
void pushLocatorOnStack(const Locator *locator)
Push a locator on to the locator stack.
bool getMustFlushPendingStartDocument() const
virtual XMLParserLiaison & getXMLParserLiaison() const
Get the XML Parser Liaison that this processor uses.
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.
virtual void setExecutionContext(StylesheetExecutionContext *theExecutionContext)
Set the execution context.
static const XalanDOMString & getXSLNameSpaceURL()
Retrieve the URI for the current XSL namespace, for example, "http://www.w3.org/1999/XSL/Transform".
const XalanDOMChar * c_str() const
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER InputSource InputSourceType
An default implementation of an abtract class which provides support for constructing the internal re...
void replacePendingAttribute(const XalanDOMChar *theName, const XalanDOMChar *theNewType, const XalanDOMChar *theNewValue)
Replace the contents of a pending attribute.
const XalanDOMString * getResultNamespaceForPrefix(const XalanDOMString &prefix) const
Retrieve the result namespace corresponding to a prefix.
void setPendingElementName(const XalanDOMString &elementName)
Changes the currently pending element name.
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.
XPathEnvSupport & getXPathEnvSupport()
Retrieve the XPath environment support object.
virtual void resolveTopLevelParams(StylesheetExecutionContext &executionContext)
Resolve the params that were pushed by the caller.
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.
XalanDocument * parseXML(const XalanDOMString &urlString, DocumentHandler *docHandler, XalanDocument *docToRegister, ErrorHandler *theErrorHandler=0)
Read in the XML file, either producing a Document or calling SAX events, and register the document in...
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.
void setProblemListener(ProblemListener *l)
Set the problem listener property.
void traceSelect(StylesheetExecutionContext &executionContext, const ElemTemplateElement &theTemplate, const NodeRefListBase &nl, const XPath *xpath) const
Compose a diagnostic trace of the current selection.
bool getMustFlushPendingStartDocumentImpl() const
This class handles the creation of XObjects and manages their lifetime.
void entityReference(const XalanDOMChar *data)
Receive notification of a entityReference.
XalanDOMString m_resultNameSpaceURL
The URL that belongs to the result namespace.
void popLocatorStack()
Pop the locator from the top of the locator stack.
virtual void process(const XSLTInputSource &inputSource, XSLTResultTarget &outputTarget, StylesheetExecutionContext &executionContext)
Transform the source tree to the output in the given result tree target.
void addResultNamespaceDecl(const XalanDOMString &prefix, const XalanDOMChar *namespaceVal, size_type len)
Add a namespace declaration to the namespace stack.
const AttributeListImpl & getPendingAttributesImpl() const
Get the list of attributes yet to be processed.
void outputResultTreeFragment(const XalanDocumentFragment &theTree, bool outputTextNodesOnly, const Locator *locator)
Given a result tree fragment, walk the tree and output it to the result stream.
const XObjectPtr evalXPathStr(const XalanDOMString &str, XalanNode *contextNode, const XalanElement &prefixResolver, XPathExecutionContext &executionContext)
Evaluate an xpath string and return the result.
void setDocumentLocator(const Locator *locator)
void characters(const XalanNode &node)
Send character data from the node to the result tree.
This is the abstract class that the XSL processor uses when it has a problem of some kind,...
void setMustFlushPendingStartDocumentImpl(bool b)
XalanMap< XalanDOMString, XalanParamHolder > ParamMapType
void comment(const XalanDOMChar *data)
Called when a Comment is to be constructed.
void pushOutputContext(FormatterListener *theListener)
XALAN_CPP_NAMESPACE_BEGIN XALAN_USING_XERCES(Locator)
static void initialize(MemoryManager &theManager)
Perform initialization of statics – must be called before any processing occurs.
virtual void setStylesheetParam(const XalanDOMString &key, XObjectPtr value)
Set a top-level parameter, which the stylesheet can access with a top-level xsl:param.
virtual FormatterListener * getFormatterListener() const
Get the current formatter listener.
void outputToResultTree(const XObject &value, bool outputTextNodesOnly, const Locator *locator)
Output an object to the result tree by doing the right conversions.
virtual void setFormatterListener(FormatterListener *flistener)
Set the current formatter listener.
void copyAttributesToAttList(const XalanNode &node, AttributeListImpl &attList)
Copy the attributes from the XSL element to the created output element.
const AttributeListType & getPendingAttributes() const
Get the list of attributes yet to be processed.
Class to hold XObjectPtr return types.
const XPath * createMatchPattern(const XalanDOMString &str, const PrefixResolver &resolver)
Create and initialize an xpath and return it.
Local implementation of NodeRefList.
virtual ~XSLTEngineImpl()
XALAN_CPP_NAMESPACE_BEGIN typedef size_t size_type
void characters(const XObjectPtr &xobject)
Send character data from an XObject to the result tree.
XPathFactory & getXPathFactory()
Get the factory for making xpaths.
void setPendingAttributes(const AttributeListType &pendingAttributes)
Set the list of attributes yet to be processed.
XalanMemMgrAutoPtr< XPathProcessor > XPathProcessorPtrType
virtual void setDiagnosticsOutput(PrintWriter *pw)
If this is set, diagnostics will be written to the m_diagnosticsPrintWriter stream.
virtual void removeTraceListener(TraceListener *tl)
Remove a trace listener.
void setPendingElementNameImpl(const XalanDOMString &elementName)
Changes the currently pending element name.
void setHasPendingStartDocument(bool b)
This is an interface for an XSLT Processor engine.
void flushPending()
Flush the pending element.
ProblemListener * getProblemListener() const
Get the problem listener property.
XalanDOMString m_resultNameSpacePrefix
The namespace that the result tree conforms to.
This acts as the stylesheet root of the stylesheet tree, and holds values that are shared by all styl...
MemoryManager & getMemoryManager()
void characters(const XalanDOMChar *ch, size_type length)
virtual void setStylesheetRoot(const StylesheetRoot *theStylesheet)
Set the root stylesheet.
virtual const XalanDOMString & getURI() const
Retrieve the base URI for the resolver.
const Locator * getLocatorFromStack() const
Get the locator from the top of the locator stack.
const XalanDOMString & getPendingElementName() const
Retrieve name of the pending element currently being processed.
BoolVectorType m_cdataStack
Stack of Booleans to keep track of if we should be outputting cdata instead of escaped text.
FormatterListener * getFormatterListenerImpl() const
void addResultAttribute(AttributeListImpl &attList, const XalanDOMString &aname, const XalanDOMChar *value, size_type theLength, bool fromCopy=false, const Locator *locator=0)
Add attribute to attribute list, and if it is a namespace, add it to the namespaces stack.
const XalanDOMString * getResultPrefixForNamespace(const XalanDOMString &theNamespace) const
Retrieve the result prefix corresponding to a namespace.
bool isElementPending() const
XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType
XPathProcessor & getXPathProcessor()
Get the XPath processor object.
void returnXPath(const XPath *xpath)
Return the xpath created by createXPath() or createMatchPattern().
void charactersRaw(const XalanDOMChar *ch, size_type start, size_type length)
Receive notification of character data.
virtual void getUniqueNamespaceValue(XalanDOMString &theValue)
Generate a random namespace prefix guaranteed to be unique.
virtual const XalanDocumentFragment & rtree() const
Cast result object to a result tree fragment.
bool isPendingResultPrefix(const XalanDOMString &thePrefix) const
Determine whether or not a prefix is in use on the pending element or the pending attributes.
XalanVector< const Locator * > LocatorStack
It's the responsibility of the XSLTEngineImpl class, collaborating with the XML parser liaison,...
void ignorableWhitespace(const XalanDOMChar *ch, size_type length)
virtual void reset()
Reset the state.
static const XalanDOMString & getXalanXSLNameSpaceURL()
Special Xalan namespace for built-in extensions.
void processingInstruction(const XalanDOMChar *target, const XalanDOMChar *data)
void cloneToResultTree(const XalanNode &node, XalanNode::NodeType nodeType, bool overrideStrip, bool shouldCloneAttributes, bool cloneTextNodesOnly, const Locator *locator)
Clone a node to the result tree.
Interpreting class diagrams
Doxygen and
GraphViz are
used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11
Copyright © 1999-2012 The Apache Software Foundation.
All Rights Reserved.
|
|