Search in sources :

Example 1 with ItemType

use of net.sf.saxon.type.ItemType in project intellij-community by JetBrains.

the class Saxon9StyleFrame method createValue.

private Value createValue(ValueFacade expression) throws XPathException {
    final TypeHierarchy typeHierarchy = myXPathContext.getConfiguration().getTypeHierarchy();
    final ItemType itemType = expression.getItemType(typeHierarchy);
    final SequenceIterator it = expression.iterate(myXPathContext);
    Item value = null;
    if (it.next() != null) {
        value = it.current();
    }
    if (it.next() == null) {
        return new SingleValue(value, itemType);
    }
    return new SequenceValue(value, it, itemType);
}
Also used : Item(net.sf.saxon.om.Item) SequenceIterator(net.sf.saxon.om.SequenceIterator) ItemType(net.sf.saxon.type.ItemType) AnyItemType(net.sf.saxon.type.AnyItemType) TypeHierarchy(net.sf.saxon.type.TypeHierarchy)

Aggregations

Item (net.sf.saxon.om.Item)1 SequenceIterator (net.sf.saxon.om.SequenceIterator)1 AnyItemType (net.sf.saxon.type.AnyItemType)1 ItemType (net.sf.saxon.type.ItemType)1 TypeHierarchy (net.sf.saxon.type.TypeHierarchy)1