net.sf.saxon.style

Class LiteralResultElement

Implemented Interfaces:
Locator, Container, Locator, Serializable, Source, SourceLocator, FingerprintedNode, InstructionInfo, Item, LocationProvider, NamespaceResolver, NodeInfo, PullEvent, SaxonLocator, ValueRepresentation

public class LiteralResultElement
extends StyleElement

This class represents a literal result element in the style sheet (typically an HTML element to be output).
It is also used to represent unknown top-level elements, which are ignored.

Field Summary

Fields inherited from class net.sf.saxon.style.StyleElement

REPORT_ALWAYS, REPORT_IF_INSTANTIATED, REPORT_UNLESS_FALLBACK_AVAILABLE, REPORT_UNLESS_FORWARDS_COMPATIBLE, defaultCollationName, defaultXPathNamespace, extensionNamespaces, reportingCircumstances, staticContext, validationError, version

Fields inherited from class net.sf.saxon.tree.ElementWithAttributes

attributeList, namespaceList

Fields inherited from class net.sf.saxon.tree.ElementImpl

nameCode, root

Fields inherited from class net.sf.saxon.tree.ParentNodeImpl

sequence

Fields inherited from class net.sf.saxon.tree.NodeImpl

NODE_LETTER, index, parent

Fields inherited from interface net.sf.saxon.om.NodeInfo

ALL_NAMESPACES, EMPTY_NAMESPACE_LIST, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACES

Fields inherited from interface net.sf.saxon.om.ValueRepresentation

EMPTY_VALUE_ARRAY

Method Summary

Expression
compile(Executable exec)
Compile code to process the literal result element at runtime
int
getConstructType()
Get the type of construct.
int
getObjectNameCode()
Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc.
Object
getProperty(String name)
Get the value of a particular property of the instruction.
boolean
isInstruction()
Specify that this is an instruction
DocumentImpl
makeStylesheet(PreparedStylesheet pss, StyleNodeFactory nodeFactory)
Make a top-level literal result element into a stylesheet.
boolean
mayContainSequenceConstructor()
Determine whether this type of element is allowed to contain a sequence constructor
void
prepareAttributes()
Process the attribute list
void
validate()
Validate that this node is OK
protected void
validateChildren()
Validate the children of this node, recursively.

Methods inherited from class net.sf.saxon.style.StyleElement

allocateLocationId, allocatePatternSlots, allocateSlots, backwardsCompatibleModeIsEnabled, bindVariable, checkEmpty, checkSortComesFirst, checkTopLevel, checkUnknownAttribute, checkWithinTemplate, compile, compileError, compileError, compileError, compileSequenceConstructor, compileWarning, definesExcludedNamespace, definesExtensionElement, fallbackProcessing, fixupReferences, forwardsCompatibleModeIsEnabled, getAllStylesheetFunctions, getAttributeSets, getAttributeValue, getCommonChildItemType, getConstructType, getContainingSlotManager, getContainingStylesheet, getDefaultCollationName, getDefaultXPathNamespace, getExecutable, getHostLanguage, getLastChildInstruction, getLineNumber, getLineNumber, getLocationProvider, getNamespaceResolver, getObjectName, getObjectName, getPrecedence, getPreparedStylesheet, getPrincipalStylesheet, getProperties, getProperty, getReturnedItemType, getSchemaType, getStaticContext, getStylesheetFunction, getSystemId, getTypeAnnotation, getVersion, getWithParamInstructions, isExcludedNamespace, isExplaining, isExtensionNamespace, isInstruction, isPermittedChild, isTopLevel, issueWarning, issueWarning, makeAttributeValueTemplate, makeExpression, makeExpressionVisitor, makeNamespaceContext, makePattern, makeQName, makeSequenceType, makeSortKeys, makeTraceInstruction, markTailCalls, mayContainFallback, mayContainSequenceConstructor, postValidate, prepareAttributes, processAllAttributes, processAttributes, processDefaultCollationAttribute, processDefaultXPathNamespaceAttribute, processExcludedNamespaces, processExtensionElementAttribute, processVersionAttribute, replaceSubExpression, reportAbsence, setLineNumber, setObjectName, setValidationError, substituteFor, typeCheck, typeCheck, undeclaredNamespaceError, validate, validateChildren, validateSubtree

Methods inherited from class net.sf.saxon.tree.ElementWithAttributes

copy, getAttributeList, getAttributeValue, getDeclaredNamespaces, getInScopeNamespaceCodes, getPrefixForURI, getURICodeForPrefix, getURIForPrefix, initialise, iteratePrefixes, setNamespaceDeclarations

Methods inherited from class net.sf.saxon.tree.ElementImpl

copy, generateId, getAttributeList, getBaseURI, getDeclaredNamespaces, getDocumentRoot, getLineNumber, getNameCode, getNodeKind, getRoot, getSystemId, initialise, setLineNumber, setNameCode, setSystemId

Methods inherited from class net.sf.saxon.tree.ParentNodeImpl

addChild, compact, enumerateChildren, getFirstChild, getLastChild, getNthChild, getSequenceNumber, getStringValue, getStringValueCS, hasChildNodes, useChildrenArray

Methods inherited from class net.sf.saxon.tree.NodeImpl

atomize, compareOrder, equals, generateId, getAttributeValue, getBaseURI, getColumnNumber, getConfiguration, getDeclaredNamespaces, getDisplayName, getDocumentNumber, getDocumentRoot, getFingerprint, getFirstChild, getLastChild, getLineNumber, getLocalPart, getNameCode, getNamePool, getNextInDocument, getNextSibling, getParent, getPrefix, getPreviousInDocument, getPreviousSibling, getPublicId, getRoot, getSequenceNumber, getStringValueCS, getSystemId, getTypeAnnotation, getTypedValue, getURI, hasChildNodes, hashCode, isSameNodeInfo, iterateAxis, iterateAxis, setSystemId

Method Details

compile

public Expression compile(Executable exec)
            throws XPathException
Compile code to process the literal result element at runtime
Overrides:
compile in interface StyleElement

getConstructType

public int getConstructType()
Specified by:
getConstructType in interface InstructionInfo
Overrides:
getConstructType in interface StyleElement

getObjectNameCode

public int getObjectNameCode()
Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc. This is used only where the name is known statically. If there is no name, the value will be -1.
Returns:
the name of the literal result element

getProperty

public Object getProperty(String name)
Get the value of a particular property of the instruction. This is part of the InstructionInfo interface for run-time tracing and debugging. The properties available include all the attributes of the source instruction (named by the attribute name): these are all provided as string values.
Specified by:
getProperty in interface InstructionInfo
Overrides:
getProperty in interface StyleElement
Parameters:
name - The name of the required property
Returns:
The value of the requested property, or null if the property is not available

isInstruction

public boolean isInstruction()
Specify that this is an instruction
Overrides:
isInstruction in interface StyleElement

makeStylesheet

public DocumentImpl makeStylesheet(PreparedStylesheet pss,
                                   StyleNodeFactory nodeFactory)
            throws XPathException
Make a top-level literal result element into a stylesheet. This implements the "Simplified Stylesheet" facility.
Parameters:
pss - the PreparedStylesheet (the compiled stylesheet as provided)
nodeFactory - the node factory used to construct the stylesheet tree
Returns:
the reconstructed stylesheet with an xsl:stylesheet and xsl:template element added

mayContainSequenceConstructor

public boolean mayContainSequenceConstructor()
Determine whether this type of element is allowed to contain a sequence constructor
Overrides:
mayContainSequenceConstructor in interface StyleElement
Returns:
true: yes, it may contain a sequence constructor

prepareAttributes

public void prepareAttributes()
            throws XPathException
Process the attribute list
Overrides:
prepareAttributes in interface StyleElement

validate

public void validate()
            throws XPathException
Validate that this node is OK
Overrides:
validate in interface StyleElement

validateChildren

protected void validateChildren()
            throws XPathException
Validate the children of this node, recursively. Overridden for top-level data elements.
Overrides:
validateChildren in interface StyleElement