Class FragmentValue
java.lang.Object
com.icl.saxon.expr.Expression
com.icl.saxon.expr.Value
com.icl.saxon.expr.NodeSetValue
com.icl.saxon.expr.SingletonNodeSet
com.icl.saxon.expr.FragmentValue
- All Implemented Interfaces:
NodeList
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.
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 SingletonNodeSet
generalUseAllowed, nodeFields inherited from class Expression
staticContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanConvert the result tree fragment to a booleandoubleasNumber()Convert the result tree fragment to a numberasString()Convert the result tree fragment to a string.booleanTest how a FragmentValue compares to another Value under a relational comparison.voidCopy the result tree fragment value to a given Outputtervoiddisplay(int level) Diagnostic print of expression structureReturn an enumeration of this nodeset value.booleanTest whether a nodeset "equals" another ValueintgetCount()Count the nodes in the node-set.intDetermine the data type of the expression, if possibleGet an Emitter that can be used to feed data to this result tree fragmentgetFirst()Get the first node in the nodeset (in document order)Get the root (document) nodeintgetType()Return the type of the valuebooleanTest whether a nodeset "not-equals" another ValuevoidoutputStringValue(Outputter out, Context context) Evaluate an expression as a String and write the result to the specified outputter.voidReplay the saved emitter events to a new emittervoidsetBaseURI(String uri) Set the Base URI for the nodes in the result tree fragment.simplify()Simplify the expressionMethods inherited from class SingletonNodeSet
allowGeneralUse, evaluate, evaluateAsNodeSet, getLength, isGeneralUseAllowed, isSorted, item, setSorted, sortMethods inherited from class NodeSetValue
conversionPreference, convertToJava, enumerateMethods inherited from class Value
getDependencies, inverse, numericCompare, reduce, stringToNumberMethods inherited from class Expression
containsReferences, evaluateAsBoolean, evaluateAsNumber, evaluateAsString, getStaticContext, indent, isContextDocumentNodeSet, make, setStaticContext, usesCurrent
-
Constructor Details
-
FragmentValue
-
-
Method Details
-
setBaseURI
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. -
getEmitter
Get an Emitter that can be used to feed data to this result tree fragment -
asString
Convert the result tree fragment to a string.- Overrides:
asStringin classSingletonNodeSet- Returns:
- the value of the first node in the node-set if there is one, otherwise an empty string
-
outputStringValue
Evaluate an expression as a String and write the result to the specified outputter.- Overrides:
outputStringValuein classExpression- Parameters:
out- The required outputtercontext- The context in which the expression is to be evaluated- Throws:
TransformerException
-
asNumber
public double asNumber()Convert the result tree fragment to a number- Overrides:
asNumberin classNodeSetValue- Returns:
- the number obtained by evaluating as a String and converting the string to a number
-
asBoolean
public boolean asBoolean()Convert the result tree fragment to a boolean- Overrides:
asBooleanin classSingletonNodeSet- Returns:
- true if the node set is not empty
-
getCount
public int getCount()Count the nodes in the node-set.- Overrides:
getCountin classSingletonNodeSet
-
simplify
Simplify the expression- Overrides:
simplifyin classSingletonNodeSet- Returns:
- the simplified expression
-
getFirst
Get the first node in the nodeset (in document order)- Overrides:
getFirstin classSingletonNodeSet- Returns:
- the first node
-
enumerate
Return an enumeration of this nodeset value.- Overrides:
enumeratein classSingletonNodeSet- Throws:
XPathException
-
equals
Test whether a nodeset "equals" another Value- Overrides:
equalsin classSingletonNodeSet- Returns:
- a boolean giving the value of the expression, evaluated in the current context
- Throws:
XPathException
-
notEquals
Test whether a nodeset "not-equals" another Value- Overrides:
notEqualsin classSingletonNodeSet- Returns:
- a boolean giving the value of the expression, evaluated in the current context
- Throws:
XPathException
-
compare
Test how a FragmentValue compares to another Value under a relational comparison.- Overrides:
comparein classNodeSetValue- Parameters:
operator- The comparison operator, one of Tokenizer.LE, Tokenizer.LT, Tokenizer.GE, Tokenizer.GT,- Throws:
XPathException
-
getType
public int getType()Return the type of the value- Returns:
- Value.NODESET (always)
-
getDataType
public int getDataType()Determine the data type of the expression, if possible- Overrides:
getDataTypein classNodeSetValue- Returns:
- Value.NODESET
-
getRootNode
Get the root (document) node -
copy
Copy the result tree fragment value to a given Outputter- Throws:
TransformerException
-
replay
Replay the saved emitter events to a new emitter- Throws:
TransformerException
-
display
public void display(int level) Diagnostic print of expression structure- Overrides:
displayin classNodeSetValue
-