net.sf.saxon.style

Class LiteralResultElement

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.
Method Summary
Expressioncompile(Executable exec)
Compile code to process the literal result element at runtime
intgetConstructType()
Get the type of construct.
intgetObjectNameCode()
Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc.
ObjectgetProperty(String name)
Get the value of a particular property of the instruction.
booleanisInstruction()
Specify that this is an instruction
DocumentImplmakeStylesheet(PreparedStylesheet pss, StyleNodeFactory nodeFactory)
Make a top-level literal result element into a stylesheet.
booleanmayContainSequenceConstructor()
Determine whether this type of element is allowed to contain a sequence constructor
voidprepareAttributes()
Process the attribute list
voidvalidate()
Validate that this node is OK
protected voidvalidateChildren()
Validate the children of this node, recursively.

Method Detail

compile

public Expression compile(Executable exec)
Compile code to process the literal result element at runtime

getConstructType

public int getConstructType()
Get the type of construct. This will be a constant in class Location. This method is part of the InstructionInfo interface

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.

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

makeStylesheet

public DocumentImpl makeStylesheet(PreparedStylesheet pss, StyleNodeFactory nodeFactory)
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

Returns: true: yes, it may contain a sequence constructor

prepareAttributes

public void prepareAttributes()
Process the attribute list

validate

public void validate()
Validate that this node is OK

validateChildren

protected void validateChildren()
Validate the children of this node, recursively. Overridden for top-level data elements.