Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.8

Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

ElemTemplateElement Class Reference

Inheritance diagram for ElemTemplateElement:

PrefixResolver ElemApplyImport ElemAttribute ElemCallTemplate ElemChoose ElemComment ElemCopyOf ElemDecimalFormat ElemEmpty ElemFallback ElemForEach ElemForwardCompatible ElemIf ElemMessage ElemNumber ElemOtherwise ElemPI ElemSort ElemTemplate ElemText ElemTextLiteral ElemUse ElemValueOf ElemVariable ElemWhen ElemWithParam List of all members.

Public Member Functions

Static Public Member Functions

Protected Member Functions

Static Protected Attributes


Constructor & Destructor Documentation

ElemTemplateElement::ElemTemplateElement StylesheetConstructionContext constructionContext,
Stylesheet stylesheetTree,
int  lineNumber,
int  columnNumber,
int  xslToken
 

Construct a template element instance.

Parameters:
constructionContext context when object constructed
stylesheetTree owning stylesheet
lineNumber line in the XSLT file where the element occurs
columnNumber column index in the XSLT file where the element occurs
xslToken an integer representing the type of instance.

ElemTemplateElement::ElemTemplateElement StylesheetConstructionContext constructionContext,
Stylesheet stylesheetTree,
int  xslToken,
const XalanDOMString baseURI = XalanDOMString(),
int  lineNumber = XalanLocator::getUnknownValue(),
int  columnNumber = XalanLocator::getUnknownValue()
 

Special constructor used by dummy elements which do not exist in the final stylesheet.

Parameters:
constructionContext context when object constructed
stylesheetTree owning stylesheet
baseURI The base URI of the XSLT file where the element occurs.
lineNumber line in the XSLT file where the element occurs
columnNumber column index in the XSLT file where the element occurs
xslToken an integer representing the type of instance.

virtual ElemTemplateElement::~ElemTemplateElement  )  [virtual]
 


Member Function Documentation

virtual void ElemTemplateElement::addToStylesheet StylesheetConstructionContext constructionContext,
Stylesheet theStylesheet
[virtual]
 

Called during compilation when an instance is not parented by another element, and thus, is a child of the stylesheet..

Parameters:
constructionContext The current construction context
theStylesheet The owning stylesheet
Returns:
nothing

Reimplemented in ElemAttributeSet, ElemTemplate, and ElemVariable.

virtual ElemTemplateElement* ElemTemplateElement::appendChildElem ElemTemplateElement newChild  )  [virtual]
 

Append a child.

theParent - the new value for the parent.

Returns:
nothing

Reimplemented in ElemApplyImport.

void ElemTemplateElement::canGenerateAttributes bool  value  )  [protected]
 

bool ElemTemplateElement::canGenerateAttributes  )  const
 

void ElemTemplateElement::childrenToResultAttribute StylesheetExecutionContext executionContext,
const XalanDOMString theName
const
 

Take the contents of a template element, process it, and convert it to a string.

Then, add an attribute to the result tree using the provided name and the string value.

Parameters:
executionContext The current execution context
theName The name for the result attribute

void ElemTemplateElement::childrenToResultComment StylesheetExecutionContext executionContext  )  const
 

Take the contents of a template element, process it, and convert it to a string.

Then, add a comment to the result tree using the string value.

Parameters:
executionContext The current execution context

void ElemTemplateElement::childrenToResultPI StylesheetExecutionContext executionContext,
const XalanDOMString theTarget
const
 

Take the contents of a template element, process it, and convert it to a string.

Then, add a processing instruction to the result tree using the string value, and the provided target.

Parameters:
executionContext The current execution context
theName The name for the result attribute

const XalanDOMString& ElemTemplateElement::childrenToString StylesheetExecutionContext executionContext,
XalanDOMString result
const
 

Take the contents of a template element, process it, and convert it to a string.

Returns a const reference to the resulting string value. Note that this may _not_ be the XalanDOMString instance passed in, if an optimization is available to return a pre-existing string.

Parameters:
executionContext The current execution context
result result of executing the elements children
Returns:
a reference to a string containing the result.

virtual bool ElemTemplateElement::childTypeAllowed int  xslToken  )  const [protected, virtual]
 

Given an xsl token type, determine whether or not a child of that type is allowed.

This is so derived types can determine whether a particular type of child is allowed for the instance. It is called from appendChildElem().

The default is to allow no types (no children)

Parameters:
xslToken The xsl token value of the child.
Returns:
true if the child is allowed, or false if not.

Reimplemented in ElemApplyTemplates, ElemAttribute, ElemAttributeSet, ElemCallTemplate, ElemChoose, ElemComment, ElemEmpty, ElemPI, and ElemText.

bool ElemTemplateElement::disableOutputEscaping  )  const [protected]
 

void ElemTemplateElement::disableOutputEscaping bool  value  )  [protected]
 

virtual void ElemTemplateElement::execute StylesheetExecutionContext executionContext  )  const [virtual]
 

Execute the element's primary function.

Subclasses of this function may recursively execute down the element tree.

Parameters:
executionContext The current execution context

Reimplemented in ElemApplyImport, ElemApplyTemplates, ElemAttribute, ElemAttributeSet, ElemCallTemplate, ElemChoose, ElemComment, ElemCopy, ElemCopyOf, ElemDecimalFormat, ElemElement, ElemEmpty, ElemExtensionCall, ElemFallback, ElemForEach, ElemForwardCompatible, ElemIf, ElemLiteralResult, ElemMessage, ElemNumber, ElemOtherwise, ElemParam, ElemPI, ElemTemplate, ElemTextLiteral, ElemUse, ElemValueOf, ElemVariable, and ElemWhen.

virtual void ElemTemplateElement::executeChildren StylesheetExecutionContext executionContext,
XalanNode sourceNode
const [virtual]
 

Set the current node and process the children of a template.

Parameters:
processor XSLT processor instance
sourceNode current node

Reimplemented in ElemTemplate.

virtual void ElemTemplateElement::executeChildren StylesheetExecutionContext executionContext  )  const [virtual]
 

Process the children of a template.

Parameters:
processor XSLT processor instance

Reimplemented in ElemTemplate.

int ElemTemplateElement::getColumnNumber  )  const
 

Get the column number in the stylesheet where the element appears.

Returns:
the column number in the stylesheet

virtual const XalanDOMString& ElemTemplateElement::getElementName  )  const [pure virtual]
 

Get a string for the name of the element.

Useful for debugging purposes, and error reporting.

Returns:
A string containing the name of the element.

Implemented in ElemApplyImport, ElemApplyTemplates, ElemAttribute, ElemAttributeSet, ElemCallTemplate, ElemChoose, ElemComment, ElemCopy, ElemCopyOf, ElemDecimalFormat, ElemElement, ElemEmpty, ElemFallback, ElemForEach, ElemForwardCompatible, ElemIf, ElemLiteralResult, ElemMessage, ElemNumber, ElemOtherwise, ElemParam, ElemPI, ElemSort, ElemTemplate, ElemText, ElemTextLiteral, ElemUse, ElemValueOf, ElemVariable, ElemWhen, and ElemWithParam.

bool ElemTemplateElement::getFinishedConstruction  )  const
 

Get the flag indicating construction of the element is completed.

virtual ElemTemplateElement* ElemTemplateElement::getFirstChildElem  )  const [virtual]
 

Get the first child.

Returns:
first child node of this node

virtual ElemTemplateElement* ElemTemplateElement::getLastChildElem  )  const [virtual]
 

Get the last child.

Returns:
last child node of this node

int ElemTemplateElement::getLineNumber  )  const
 

Get the line number in the stylesheet where the element appears.

Returns:
the line number in the stylesheet

virtual const LocatorType* ElemTemplateElement::getLocator  )  const [virtual]
 

Get the Locator for the node.

This may return 0.

Returns:
The Locator for the node.

virtual const XalanQName& ElemTemplateElement::getNameAttribute  )  const [virtual]
 

Get the QName associated with any name attribute of this element.

If the element has no name attribute, this will be an empty QName.

Returns:
A string containing the name of the element.

Reimplemented in ElemTemplate, and ElemVariable.

virtual const XalanDOMString* ElemTemplateElement::getNamespaceForPrefix const XalanDOMString prefix  )  const [virtual]
 

Retrieve a namespace corresponding to a prefix.

This assumes that the PrevixResolver holds its own namespace context, or is a namespace context itself.

Parameters:
prefix Prefix to resolve
Returns:
namespace that prefix resolves to, or null if prefix is not found

Implements PrefixResolver.

const XalanDOMString* ElemTemplateElement::getNamespaceForPrefixInternal const XalanDOMString prefix  )  const [protected]
 

Get the namespace for a given prefix.

Parameters:
prefix The prefix to search for
fExists If not null, set to true if the namespace was defined.
Returns:
The namespace string.

const NamespacesHandler& ElemTemplateElement::getNamespaces  )  const [protected]
 

const NamespacesHandler& ElemTemplateElement::getNamespacesHandler  )  const
 

Get the namespaces handler for this element.

Returns:
The element's NamespacesHandler instance.

virtual ElemTemplateElement* ElemTemplateElement::getNextSiblingElem  )  const [virtual]
 

Get the next sibling.

Returns:
next sibling node of this node

virtual ElemTemplateElement* ElemTemplateElement::getParentNodeElem  )  const [virtual]
 

Get the parent node.

Returns:
parent node of this node

virtual ElemTemplateElement* ElemTemplateElement::getPreviousSiblingElem  )  const [virtual]
 

Get the previous sibling.

Returns:
previous sibling node of this node

const Stylesheet& ElemTemplateElement::getStylesheet  )  const
 

Retrieve the stylesheet from which this element comes.

Returns:
reference to source stylesheet

virtual const XalanDOMString& ElemTemplateElement::getURI  )  const [virtual]
 

Retrieve the base URI for the resolver.

Returns:
URI string

Implements PrefixResolver.

virtual const XPath* ElemTemplateElement::getXPath unsigned int  index = 0  )  const [virtual]
 

Get XPath pattern/expression of one of the element atribute.

number of the attribute. If an attribute has more then one attribute with pattern/expression,the order of the returned expressions are undefined

Returns:
pointer or null

Reimplemented in ElemCopyOf, ElemDecimalFormat, ElemForEach, ElemIf, ElemNumber, ElemSort, ElemTemplate, ElemValueOf, ElemVariable, ElemWhen, and ElemWithParam.

int ElemTemplateElement::getXSLToken  )  const
 

Get an integer representation of the element type.

Returns:
integer representation of the element, defined in the Constants class
See also:
class Constants

bool ElemTemplateElement::hasChildren  )  const
 

bool ElemTemplateElement::hasDirectTemplate  )  const
 

bool ElemTemplateElement::hasParams  )  const
 

bool ElemTemplateElement::hasPrefix  )  const [protected]
 

void ElemTemplateElement::hasPrefix bool  value  )  [protected]
 

bool ElemTemplateElement::hasSingleTextChild  )  const
 

bool ElemTemplateElement::hasVariables  )  const
 

virtual bool ElemTemplateElement::isAttrOK const XalanDOMChar *  attrName,
const AttributeListType atts,
int  which,
StylesheetConstructionContext constructionContext
const [virtual]
 

See if this is a xmlns attribute or in a non-XSLT.

Parameters:
attrName qualified name of attribute
atts attribute list where the element comes from (not used at this time)
which index into the attribute list (not used at this time)
constructionContext The current construction context
Returns:
true if this is a namespace name

Reimplemented in ElemLiteralResult.

bool ElemTemplateElement::isDefaultTemplate  )  const
 

bool ElemTemplateElement::isValidNCName const XalanDOMString s  )  [static]
 

Validate that the string is an NCName.

Parameters:
s name in question
Returns:
true if the string is a valid NCName according to XML rules
See also:
http://www.w3.org/TR/REC-xml-names#NT-NCName

virtual bool ElemTemplateElement::isWhitespace  )  const [virtual]
 

Tell if the element will generate text which is XML whitespace.

Returns:
true if the text is pure whitespace

Reimplemented in ElemTextLiteral.

virtual void ElemTemplateElement::namespacesPostConstruction StylesheetConstructionContext constructionContext,
const NamespacesHandler theParentHandler,
NamespacesHandler theHandler
[protected, virtual]
 

Called after construction is completed.

This is a hook for deriving classes to handle post-construction with the instances HamespaceHandler instance, which is otherwise only available through a const accessor.

Reimplemented in ElemElement, and ElemLiteralResult.

virtual void ElemTemplateElement::postConstruction StylesheetConstructionContext constructionContext,
const NamespacesHandler theParentHandler
[virtual]
 

Called after construction is completed.

Reimplemented in ElemCallTemplate, ElemForEach, ElemLiteralResult, and ElemUse.

bool ElemTemplateElement::preserveSpace  )  const [protected]
 

void ElemTemplateElement::preserveSpace bool  value  )  [protected]
 

bool ElemTemplateElement::processPrefixControl StylesheetConstructionContext constructionContext,
const Stylesheet stylesheetTree,
const XalanDOMString localName,
const XalanDOMChar *  attrValue
[protected]
 

Process the exclude-result-prefixes or the extension-element-prefixes attributes, for the purpose of prefix exclusion.

Parameters:
constructionContext context when object consructed
stylesheetTree The current Stylesheet object.
localName The local name of the attribute.
attrValue The value of the attribute.

virtual void ElemTemplateElement::processSortElement StylesheetConstructionContext constructionContext,
Stylesheet theStylesheet,
const AttributeListType atts,
const LocatorType locator = 0
[virtual]
 

Called during compilation to process xsl:sort elements in the stylesheet.

Parameters:
constructionContext The current construction context
theStylesheet The owning stylesheet
atts The list of attributes for the sort element
locator A Locator instance for error reporting, if available.
Returns:
nothing

Reimplemented in ElemForEach.

bool ElemTemplateElement::processSpaceAttr const XalanDOMChar *  aname,
const AttributeListType atts,
int  which,
StylesheetConstructionContext constructionContext
 

Tell whether or not this is a xml:space attribute and, if so, process it.

Parameters:
aname name of the attribute in question
atts attribute list that owns the attribute
which index of the attribute into the attribute list
constructionContext The current construction context
Returns:
true if this is a xml:space attribute

virtual void ElemTemplateElement::setDefaultTemplate bool  value  )  [virtual]
 

Sets a flag indicating this is the default template.

Parameters:
value The value of flag.

void ElemTemplateElement::setFinishedConstruction bool  fValue  ) 
 

Set the flag indicating construction of the element is completed.

Parameters:
fValue The value to set

virtual void ElemTemplateElement::setFirstChildElem ElemTemplateElement theChild  )  [virtual]
 

Set the first child.

theChild - the new value for the first child.

Returns:
nothing

virtual void ElemTemplateElement::setNextSiblingElem ElemTemplateElement theSibling  )  [virtual]
 

Set the next sibling.

theSibling - the new value for the next sibling.

Returns:
nothing

virtual void ElemTemplateElement::setParentNodeElem ElemTemplateElement theParent  )  [virtual]
 

Set the parent node.

theParent - the new value for the parent.

Returns:
nothing

Reimplemented in ElemVariable.

virtual void ElemTemplateElement::setPreviousSiblingElem ElemTemplateElement theSibling  )  [virtual]
 

Set the previous sibling.

theSibling - the new value for the previous sibling.

Returns:
nothing

virtual void ElemTemplateElement::transformChild StylesheetExecutionContext executionContext,
const ElemTemplateElement xslInstruction,
const ElemTemplateElement theTemplate,
XalanNode child,
XalanNode::NodeType  nodeType
const [protected, virtual]
 

Given an element, find the corresponding template and process the contents.

Parameters:
executionContext The current execution context
xslInstruction The calling element
template The template to use if xsl:for-each, or null.
child The source context node.
nodeType The type of child.

virtual void ElemTemplateElement::transformChild StylesheetExecutionContext executionContext,
const ElemTemplateElement xslInstruction,
const ElemTemplateElement theTemplate,
XalanNode child
const [protected, virtual]
 

Given an element, find the corresponding template and process the contents.

Parameters:
executionContext The current execution context
xslInstruction The calling element
template The template to use if xsl:for-each, or null.
child The source context node.

Reimplemented in ElemApplyTemplates.


Member Data Documentation

const XalanDOMString ElemTemplateElement::s_emptyString [static, 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.

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