Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
XPathExecutionContext Class Referenceabstract
Inheritance diagram for XPathExecutionContext:
ExecutionContext StylesheetExecutionContext XPathExecutionContextDefault StylesheetExecutionContextDefault

Classes

class  BorrowReturnMutableNodeRefList
 
class  ContextNodeListPushAndPop
 
class  CurrentNodePushAndPop
 
class  GetAndReleaseCachedString
 
class  PrefixResolverSetAndRestore
 

Public Types

typedef XalanVector< XObjectPtrXObjectArgVectorType
 
typedef NodeRefListBase::size_type size_type
 
typedef GetAndReleaseCachedString GetCachedString
 

Public Member Functions

 XPathExecutionContext (MemoryManagerType &m_memoryManager, XObjectFactory *theXObjectFactory=0)
 
virtual ~XPathExecutionContext ()
 
virtual void reset ()=0
 Reset the instance. More...
 
virtual XalanNodegetCurrentNode () const =0
 Retrieve the node currently being executed. More...
 
virtual void pushCurrentNode (XalanNode *theCurrentNode)=0
 Change the node currently being executed. More...
 
virtual void popCurrentNode ()=0
 Reset the node currently being executed. More...
 
XObjectFactorygetXObjectFactory () const
 Retrieve the factory object for creating XObjects. More...
 
virtual bool isNodeAfter (const XalanNode &node1, const XalanNode &node2) const =0
 Determine if a node is after another node, in document order. More...
 
virtual void pushContextNodeList (const NodeRefListBase &theList)=0
 Push the node list for current context. More...
 
virtual void popContextNodeList ()=0
 Pop the node list for current context. More...
 
virtual const NodeRefListBasegetContextNodeList () const =0
 Get the node list for current context. More...
 
virtual size_type getContextNodeListLength () const =0
 
virtual size_type getContextNodeListPosition (const XalanNode &contextNode) const =0
 
virtual bool elementAvailable (const XalanQName &theQName) const =0
 Determine if an external element is available. More...
 
virtual bool elementAvailable (const XalanDOMString &theName, const LocatorType *locator) const =0
 Determine if an external element is available by resolving a string to a QName. More...
 
virtual bool functionAvailable (const XalanQName &theQName) const =0
 Determine if a function is available. More...
 
virtual bool functionAvailable (const XalanDOMString &theName, const LocatorType *locator) const =0
 Determine if a function is available. More...
 
virtual const XObjectPtr extFunction (const XalanDOMString &theNamespace, const XalanDOMString &functionName, XalanNode *context, const XObjectArgVectorType &argVec, const LocatorType *locator)=0
 Handle an extension function. More...
 
virtual XalanDocumentparseXML (MemoryManagerType &theManager, const XalanDOMString &urlString, const XalanDOMString &base) const =0
 Provides support for XML parsing service. More...
 
virtual MutableNodeRefListborrowMutableNodeRefList ()=0
 Borrow a cached MutableNodeRefList instance. More...
 
virtual bool returnMutableNodeRefList (MutableNodeRefList *theList)=0
 Return a previously borrowed MutableNodeRefList instance. More...
 
virtual XalanDOMStringgetCachedString ()=0
 Get a cached string for temporary use. More...
 
virtual bool releaseCachedString (XalanDOMString &theString)=0
 Return a cached string. More...
 
virtual MutableNodeRefListcreateMutableNodeRefList (MemoryManagerType &theManager) const =0
 Create a MutableNodeRefList with the appropriate context. More...
 
virtual void getNodeSetByKey (XalanDocument *doc, const XalanQName &qname, const XalanDOMString &ref, MutableNodeRefList &nodelist)=0
 Given a valid element key, return the corresponding node list. More...
 
virtual void getNodeSetByKey (XalanDocument *doc, const XalanDOMString &name, const XalanDOMString &ref, const LocatorType *locator, MutableNodeRefList &nodelist)=0
 Given a valid element key, return the corresponding node list. More...
 
virtual const XObjectPtr getVariable (const XalanQName &name, const LocatorType *locator=0)=0
 Given a name, locate a variable in the current context, and return a pointer to the object. More...
 
virtual const PrefixResolvergetPrefixResolver () const =0
 Retrieve the resolver for namespaces. More...
 
virtual void setPrefixResolver (const PrefixResolver *thePrefixResolver)=0
 Change the resolver for namespaces. More...
 
virtual const XalanDOMStringgetNamespaceForPrefix (const XalanDOMString &prefix) const =0
 Retrieve the URI corresponding to a namespace prefix. More...
 
virtual const XalanDOMStringfindURIFromDoc (const XalanDocument *owner) const =0
 Given a DOM Document, tell what URI was used to parse it. More...
 
virtual const XalanDOMStringgetUnparsedEntityURI (const XalanDOMString &theName, const XalanDocument &theDocument) const =0
 The getUnparsedEntityURI function returns the URI of the unparsed entity with the specified name in the same document as the context node (see [3.3 Unparsed Entities]). More...
 
virtual bool shouldStripSourceNode (const XalanText &node)=0
 Tells, through the combination of the default-space attribute on xsl:stylesheet, xsl:strip-space, xsl:preserve-space, and the xml:space attribute, whether or not extra whitespace should be stripped from the node. More...
 
virtual XalanDocumentgetSourceDocument (const XalanDOMString &theURI) const =0
 Get the document associated with the given URI. More...
 
virtual void setSourceDocument (const XalanDOMString &theURI, XalanDocument *theDocument)=0
 Associate a document with a given URI. More...
 
virtual void formatNumber (double number, const XalanDOMString &pattern, XalanDOMString &theResult, const XalanNode *context=0, const LocatorType *locator=0)=0
 Formats a number according to the specified pattern. More...
 
virtual void formatNumber (double number, const XalanDOMString &pattern, const XalanDOMString &dfsName, XalanDOMString &theResult, const XalanNode *context=0, const LocatorType *locator=0)=0
 Formats a number according to the specified pattern. More...
 
virtual void error (const XalanDOMString &msg, const XalanNode *sourceNode=0, const LocatorType *locator=0) const =0
 Report an error and throw an exception. More...
 
virtual void warn (const XalanDOMString &msg, const XalanNode *sourceNode=0, const LocatorType *locator=0) const =0
 Report a warning. More...
 
virtual void message (const XalanDOMString &msg, const XalanNode *sourceNode=0, const LocatorType *locator=0) const =0
 Output a message. More...
 
- Public Member Functions inherited from ExecutionContext
 ExecutionContext (MemoryManagerType &m_memoryManager)
 
virtual ~ExecutionContext ()
 
MemoryManagerTypegetMemoryManager ()
 

Protected Attributes

XObjectFactorym_xobjectFactory
 
- Protected Attributes inherited from ExecutionContext
MemoryManagerTypem_memoryManager
 

Member Typedef Documentation

Constructor & Destructor Documentation

XPathExecutionContext::XPathExecutionContext ( MemoryManagerType m_memoryManager,
XObjectFactory theXObjectFactory = 0 
)
explicit
virtual XPathExecutionContext::~XPathExecutionContext ( )
virtual

Member Function Documentation

virtual MutableNodeRefList* XPathExecutionContext::borrowMutableNodeRefList ( )
pure virtual

Borrow a cached MutableNodeRefList instance.

Returns
A pointer to the instance.

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual MutableNodeRefList* XPathExecutionContext::createMutableNodeRefList ( MemoryManagerType theManager) const
pure virtual

Create a MutableNodeRefList with the appropriate context.

Returns
pointer to node list created

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual bool XPathExecutionContext::elementAvailable ( const XalanQName theQName) const
pure virtual

Determine if an external element is available.

Parameters
theQNameThe QName of the element
Returns
whether the given element is available or not

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual bool XPathExecutionContext::elementAvailable ( const XalanDOMString theName,
const LocatorType locator 
) const
pure virtual

Determine if an external element is available by resolving a string to a QName.

Parameters
theNameThe name of the element
locatorA LocatorType instance for error reporting
Returns
whether the given element is available or not

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual void XPathExecutionContext::error ( const XalanDOMString msg,
const XalanNode sourceNode = 0,
const LocatorType locator = 0 
) const
pure virtual

Report an error and throw an exception.

Parameters
msgThe text of the message.
sourceNodeThe source node where the error occurred. May be 0.
locatorA Locator to determine where the error occurred. May be 0.

Implements ExecutionContext.

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual const XObjectPtr XPathExecutionContext::extFunction ( const XalanDOMString theNamespace,
const XalanDOMString functionName,
XalanNode context,
const XObjectArgVectorType argVec,
const LocatorType locator 
)
pure virtual

Handle an extension function.

Parameters
theNamespacenamespace of function
functionNameextension function name
contextThe context node
argVecvector of arguments to function
locatorA LocatorType instance for error reporting
Returns
pointer to XObject result

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual const XalanDOMString& XPathExecutionContext::findURIFromDoc ( const XalanDocument owner) const
pure virtual

Given a DOM Document, tell what URI was used to parse it.

Needed for relative resolution.

Parameters
ownersource document
Returns
document URI

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual void XPathExecutionContext::formatNumber ( double  number,
const XalanDOMString pattern,
XalanDOMString theResult,
const XalanNode context = 0,
const LocatorType locator = 0 
)
pure virtual

Formats a number according to the specified pattern.

Parameters
numberthe number to be formatted
patternthe format pattern
theResultthe formatted number
contextthe source node
locatorthe locator

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual void XPathExecutionContext::formatNumber ( double  number,
const XalanDOMString pattern,
const XalanDOMString dfsName,
XalanDOMString theResult,
const XalanNode context = 0,
const LocatorType locator = 0 
)
pure virtual

Formats a number according to the specified pattern.

Parameters
numberthe number to be formatted
patternthe format pattern
dfsNamethe name of decimal format to use
theResultthe formatted number
contextthe source node
locatorthe locator
Returns
a pointer to the functor, 0 if none was found

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual bool XPathExecutionContext::functionAvailable ( const XalanQName theQName) const
pure virtual

Determine if a function is available.

Parameters
theQNameThe QName of the function
Returns
whether the function is available or not

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual bool XPathExecutionContext::functionAvailable ( const XalanDOMString theName,
const LocatorType locator 
) const
pure virtual

Determine if a function is available.

Parameters
theNameThe name of the function
locatorA LocatorType instance for error reporting
Returns
whether the function is available or not

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual XalanDOMString& XPathExecutionContext::getCachedString ( )
pure virtual

Get a cached string for temporary use.

Returns
A reference to the string

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual const NodeRefListBase& XPathExecutionContext::getContextNodeList ( ) const
pure virtual

Get the node list for current context.

Returns
node list

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual size_type XPathExecutionContext::getContextNodeListLength ( ) const
pure virtual
virtual size_type XPathExecutionContext::getContextNodeListPosition ( const XalanNode contextNode) const
pure virtual
virtual XalanNode* XPathExecutionContext::getCurrentNode ( ) const
pure virtual

Retrieve the node currently being executed.

Returns
current node

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual const XalanDOMString* XPathExecutionContext::getNamespaceForPrefix ( const XalanDOMString prefix) const
pure virtual

Retrieve the URI corresponding to a namespace prefix.

Parameters
prefixprefix for a namespace
Returns
URI corresponding to namespace

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual void XPathExecutionContext::getNodeSetByKey ( XalanDocument doc,
const XalanQName qname,
const XalanDOMString ref,
MutableNodeRefList nodelist 
)
pure virtual

Given a valid element key, return the corresponding node list.

Parameters
docsource document
nameqname of the key, which must match the 'name' attribute on xsl:key
refvalue that must match the value found by the 'match' attribute on xsl:key
nodelistA node list to contain the nodes found

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual void XPathExecutionContext::getNodeSetByKey ( XalanDocument doc,
const XalanDOMString name,
const XalanDOMString ref,
const LocatorType locator,
MutableNodeRefList nodelist 
)
pure virtual

Given a valid element key, return the corresponding node list.

Parameters
docsource document
namename of the key, which must match the 'name' attribute on xsl:key. Will be resolved to a qname using the provided resolver.
refvalue that must match the value found by the 'match' attribute on xsl:key
locatorThe LocatorType to use for error reporting. Can be 0.
nodelistA node list to contain the nodes found

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual const PrefixResolver* XPathExecutionContext::getPrefixResolver ( ) const
pure virtual

Retrieve the resolver for namespaces.

Returns
object for namespace resolution

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual XalanDocument* XPathExecutionContext::getSourceDocument ( const XalanDOMString theURI) const
pure virtual

Get the document associated with the given URI.

Parameters
theURIdocument URI
Returns
a pointer to the document instance, if any.

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual const XalanDOMString& XPathExecutionContext::getUnparsedEntityURI ( const XalanDOMString theName,
const XalanDocument theDocument 
) const
pure virtual

The getUnparsedEntityURI function returns the URI of the unparsed entity with the specified name in the same document as the context node (see [3.3 Unparsed Entities]).

It returns the empty string if there is no such entity.

Parameters
theNamename of entity
theDocumentdocument containing entity
Returns
URI for the entity

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual const XObjectPtr XPathExecutionContext::getVariable ( const XalanQName name,
const LocatorType locator = 0 
)
pure virtual

Given a name, locate a variable in the current context, and return a pointer to the object.

Parameters
theNamename of variable
Returns
An XObjectPtr instance. If the variable is not found, an exception is thrown, or the routine returns an instance of XUnknown.

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

XObjectFactory& XPathExecutionContext::getXObjectFactory ( ) const

Retrieve the factory object for creating XObjects.

Returns
factory object instance
virtual bool XPathExecutionContext::isNodeAfter ( const XalanNode node1,
const XalanNode node2 
) const
pure virtual

Determine if a node is after another node, in document order.

Parameters
node1The first node
node2The second node
Returns
true if node1 one is after node2, or false if it is not.

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual void XPathExecutionContext::message ( const XalanDOMString msg,
const XalanNode sourceNode = 0,
const LocatorType locator = 0 
) const
pure virtual

Output a message.

Parameters
msgThe text of the message.
sourceNodeThe source node where the message occurred. May be 0.
locatorA Locator to determine where the message occurred. May be 0.

Implements ExecutionContext.

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual XalanDocument* XPathExecutionContext::parseXML ( MemoryManagerType theManager,
const XalanDOMString urlString,
const XalanDOMString base 
) const
pure virtual

Provides support for XML parsing service.

Parameters
urlStringlocation of the XML
basebase location for URI
Returns
parsed document

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual void XPathExecutionContext::popContextNodeList ( )
pure virtual

Pop the node list for current context.

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual void XPathExecutionContext::popCurrentNode ( )
pure virtual

Reset the node currently being executed.

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual void XPathExecutionContext::pushContextNodeList ( const NodeRefListBase theList)
pure virtual

Push the node list for current context.

Parameters
theListnew node list

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual void XPathExecutionContext::pushCurrentNode ( XalanNode theCurrentNode)
pure virtual

Change the node currently being executed.

Parameters
theCurrentNodenew current node

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual bool XPathExecutionContext::releaseCachedString ( XalanDOMString theString)
pure virtual

Return a cached string.

Parameters
theStringThe string to release.
Returns
true if the string was released successfully.

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual void XPathExecutionContext::reset ( )
pure virtual

Reset the instance.

This must be called before another execution is attempted.

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual bool XPathExecutionContext::returnMutableNodeRefList ( MutableNodeRefList theList)
pure virtual

Return a previously borrowed MutableNodeRefList instance.

Parameters
theListA pointer the to previously borrowed instance.
Returns
true if the list was borrowed (at therefore, destroyed), false if not.

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual void XPathExecutionContext::setPrefixResolver ( const PrefixResolver thePrefixResolver)
pure virtual

Change the resolver for namespaces.

Parameters
thePrefixResolvernew object for namespace resolution

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual void XPathExecutionContext::setSourceDocument ( const XalanDOMString theURI,
XalanDocument theDocument 
)
pure virtual

Associate a document with a given URI.

Parameters
theURIdocument URI
theDocumentsource document

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual bool XPathExecutionContext::shouldStripSourceNode ( const XalanText node)
pure virtual

Tells, through the combination of the default-space attribute on xsl:stylesheet, xsl:strip-space, xsl:preserve-space, and the xml:space attribute, whether or not extra whitespace should be stripped from the node.

Literal elements from template elements should not be tested with this function.

Parameters
textNodetext node from the source tree
Returns
true if the text node should be stripped of extra whitespace

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

virtual void XPathExecutionContext::warn ( const XalanDOMString msg,
const XalanNode sourceNode = 0,
const LocatorType locator = 0 
) const
pure virtual

Report a warning.

Parameters
msgThe text of the message.
sourceNodeThe source node where the warning occurred. May be 0.
locatorA Locator to determine where the warning occurred. May be 0.

Implements ExecutionContext.

Implemented in StylesheetExecutionContext, StylesheetExecutionContextDefault, and XPathExecutionContextDefault.

Member Data Documentation

XObjectFactory* XPathExecutionContext::m_xobjectFactory
protected

The documentation for this class was generated from the following file:

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