com.icl.saxon.expr

Class TextFragmentValue

public final class TextFragmentValue extends SingletonNodeSet

This class represents a Value of type result tree fragment, specifically, an RTF whose root owns a single text node.
Constructor Summary
TextFragmentValue(String value, String systemId, Controller controller)
Constructor: create a result tree fragment containing a single text node
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
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.
Expressionsimplify()
Simplify the expression

Constructor Detail

TextFragmentValue

public TextFragmentValue(String value, String systemId, Controller controller)
Constructor: create a result tree fragment containing a single text node

Parameters: value: a String containing the value

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

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

simplify

public Expression simplify()
Simplify the expression