com.icl.saxon.expr

Class FragmentValue

Implemented Interfaces:
NodeList

public final class FragmentValue
extends SingletonNodeSet

This class represents a Value of type result tree fragment.
A Result Tree Fragment can be created by defining a variable in XSL whose value is defined by the contents of the xsl:variable element, possibly including start and end element tags.

Field Summary

Fields inherited from class com.icl.saxon.expr.SingletonNodeSet

generalUseAllowed, node

Fields inherited from class com.icl.saxon.expr.Value

ANY, BOOLEAN, NODESET, NUMBER, OBJECT, STRING

Fields inherited from class com.icl.saxon.expr.Expression

staticContext

Constructor Summary

FragmentValue(Controller c)

Method Summary

boolean
asBoolean()
Convert the result tree fragment to a boolean
double
asNumber()
Convert the result tree fragment to a number
String
asString()
Convert the result tree fragment to a string.
boolean
compare(int operator, Value other)
Test how a FragmentValue compares to another Value under a relational comparison.
void
copy(Outputter out)
Copy the result tree fragment value to a given Outputter
void
display(int level)
Diagnostic print of expression structure
NodeEnumeration
enumerate()
Return an enumeration of this nodeset value.
boolean
equals(Value other)
Test whether a nodeset "equals" another Value
int
getCount()
Count the nodes in the node-set.
int
getDataType()
Determine the data type of the expression, if possible
Emitter
getEmitter()
Get an Emitter that can be used to feed data to this result tree fragment
NodeInfo
getFirst()
Get the first node in the nodeset (in document order)
DocumentInfo
getRootNode()
Get the root (document) node
int
getType()
Return the type of the value
boolean
notEquals(Value other)
Test whether a nodeset "not-equals" another Value
void
outputStringValue(Outputter out, Context context)
Evaluate an expression as a String and write the result to the specified outputter.
void
replay(Emitter emitter)
Replay the saved emitter events to a new emitter
void
setBaseURI(String uri)
Set the Base URI for the nodes in the result tree fragment.
Expression
simplify()
Simplify the expression

Methods inherited from class com.icl.saxon.expr.SingletonNodeSet

allowGeneralUse, asBoolean, asString, enumerate, equals, evaluate, evaluateAsNodeSet, getCount, getFirst, getLength, isGeneralUseAllowed, isSorted, item, notEquals, setSorted, simplify, sort

Methods inherited from class com.icl.saxon.expr.NodeSetValue

asBoolean, asNumber, asString, compare, conversionPreference, convertToJava, display, enumerate, enumerate, equals, evaluate, evaluateAsNodeSet, getCount, getDataType, getFirst, isSorted, notEquals, setSorted, sort

Methods inherited from class com.icl.saxon.expr.Value

asBoolean, asNumber, asString, compare, conversionPreference, convertToJava, equals, evaluate, getDependencies, inverse, notEquals, numericCompare, reduce, simplify, stringToNumber

Methods inherited from class com.icl.saxon.expr.Expression

containsReferences, display, enumerate, evaluate, evaluateAsBoolean, evaluateAsNodeSet, evaluateAsNumber, evaluateAsString, getDataType, getDependencies, getStaticContext, indent, isContextDocumentNodeSet, make, outputStringValue, reduce, setStaticContext, simplify, usesCurrent

Constructor Details

FragmentValue

public FragmentValue(Controller c)

Method Details

asBoolean

public boolean asBoolean()
Convert the result tree fragment to a boolean
Overrides:
asBoolean in interface SingletonNodeSet

asNumber

public double asNumber()
Convert the result tree fragment to a number
Overrides:
asNumber in interface NodeSetValue

asString

public String asString()
Convert the result tree fragment to a string.
Overrides:
asString in interface SingletonNodeSet

compare

public boolean compare(int operator,
                       Value other)
            throws XPathException
Test how a FragmentValue compares to another Value under a relational comparison.
Overrides:
compare in interface NodeSetValue

copy

public void copy(Outputter out)
            throws TransformerException
Copy the result tree fragment value to a given Outputter

display

public void display(int level)
Diagnostic print of expression structure
Overrides:
display in interface NodeSetValue

enumerate

public NodeEnumeration enumerate()
            throws XPathException
Return an enumeration of this nodeset value.
Overrides:
enumerate in interface SingletonNodeSet

equals

public boolean equals(Value other)
            throws XPathException
Test whether a nodeset "equals" another Value
Overrides:
equals in interface SingletonNodeSet

getCount

public int getCount()
Count the nodes in the node-set.
Overrides:
getCount in interface SingletonNodeSet

getDataType

public int getDataType()
Determine the data type of the expression, if possible
Overrides:
getDataType in interface NodeSetValue
Returns:
Value.NODESET

getEmitter

public Emitter getEmitter()
Get an Emitter that can be used to feed data to this result tree fragment

getFirst

public NodeInfo getFirst()
Get the first node in the nodeset (in document order)
Overrides:
getFirst in interface SingletonNodeSet
Returns:
the first node

getRootNode

public DocumentInfo getRootNode()
Get the root (document) node

getType

public int getType()
Return the type of the value
Returns:
Value.NODESET (always)

notEquals

public boolean notEquals(Value other)
            throws XPathException
Test whether a nodeset "not-equals" another Value
Overrides:
notEquals in interface SingletonNodeSet

outputStringValue

public void outputStringValue(Outputter out,
                              Context context)
            throws TransformerException
Evaluate an expression as a String and write the result to the specified outputter.
Overrides:
outputStringValue in interface Expression
Parameters:
out - The required outputter
context - The context in which the expression is to be evaluated

replay

public void replay(Emitter emitter)
            throws TransformerException
Replay the saved emitter events to a new emitter

setBaseURI

public void setBaseURI(String uri)
Set the Base URI for the nodes in the result tree fragment. This is defined to be the Base URI of the relevant xsl:variable element in the stylesheet.

simplify

public Expression simplify()
Simplify the expression
Overrides:
simplify in interface SingletonNodeSet