com.icl.saxon.expr

Class FragmentValue

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.
Constructor Summary
FragmentValue(Controller c)
Method Summary
booleanasBoolean()
Convert the result tree fragment to a boolean
doubleasNumber()
Convert the result tree fragment to a number
StringasString()
Convert the result tree fragment to a string.
booleancompare(int operator, Value other)
Test how a FragmentValue compares to another Value under a relational comparison.
voidcopy(Outputter out)
Copy the result tree fragment value to a given Outputter
voiddisplay(int level)
Diagnostic print of expression structure
NodeEnumerationenumerate()
Return an enumeration of this nodeset value.
booleanequals(Value other)
Test whether a nodeset "equals" another Value
intgetCount()
Count the nodes in the node-set.
intgetDataType()
Determine the data type of the expression, if possible
EmittergetEmitter()
Get an Emitter that can be used to feed data to this result tree fragment
NodeInfogetFirst()
Get the first node in the nodeset (in document order)
DocumentInfogetRootNode()
Get the root (document) node
intgetType()
Return the type of the value
booleannotEquals(Value other)
Test whether a nodeset "not-equals" another Value
voidoutputStringValue(Outputter out, Context context)
Evaluate an expression as a String and write the result to the specified outputter.
voidreplay(Emitter emitter)
Replay the saved emitter events to a new emitter
voidsetBaseURI(String uri)
Set the Base URI for the nodes in the result tree fragment.
Expressionsimplify()
Simplify the expression

Constructor Detail

FragmentValue

public FragmentValue(Controller c)

Method Detail

asBoolean

public boolean asBoolean()
Convert the result tree fragment to a boolean

asNumber

public double asNumber()
Convert the result tree fragment to a number

asString

public String asString()
Convert the result tree fragment to a string.

compare

public boolean compare(int operator, Value other)
Test how a FragmentValue compares to another Value under a relational comparison.

copy

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

display

public void display(int level)
Diagnostic print of expression structure

enumerate

public NodeEnumeration enumerate()
Return an enumeration of this nodeset value.

equals

public boolean equals(Value other)
Test whether a nodeset "equals" another Value

getCount

public int getCount()
Count the nodes in the node-set.

getDataType

public int getDataType()
Determine the data type of the expression, if possible

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)

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)
Test whether a nodeset "not-equals" another Value

outputStringValue

public void outputStringValue(Outputter out, Context context)
Evaluate an expression as a String and write the result to the specified outputter.

Parameters: out The required outputter context The context in which the expression is to be evaluated

replay

public void replay(Emitter emitter)
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