/** * Get the string value of this sequence. The string value of an item is the result of applying the string() * function. The string value of an empty sequence is the zero-length string. * * @return the string value of the sequence. */ public CharSequence getStringValueCS() { return item == null ? "" : item.getStringValueCS(); }
/** * Get the string value of this sequence. The string value of an item is the result of applying the string() * function. The string value of an empty sequence is the zero-length string. * * @return the string value of the sequence. */ public CharSequence getStringValueCS() { return item == null ? "" : item.getStringValueCS(); }
/** * Evaluate the function in a string context */ public CharSequence evaluateAsString(XPathContext c) throws XPathException { return evaluateItem(c).getStringValueCS(); }
/** * Expand the stylesheet elements subordinate to this one, returning the result * as a string. The expansion must not generate any element or attribute nodes. * @param context The dynamic context for the transformation */ public CharSequence expandChildren(XPathContext context) throws XPathException { Item item = select.evaluateItem(context); if (item==null) { return (noNodeIfEmpty ? null : ""); } else { return item.getStringValueCS(); } }
public Item map(Item item) throws XPathException { if (item instanceof AnyURIValue) { return new StringValue(item.getStringValueCS()); } else { return item; } } };
@Override public AtomicValue evaluate(Item arg, XPathContext context) throws XPathException { CharSequence result; try { result = arg.getStringValueCS(); } catch (UnsupportedOperationException err) { throw new XPathException(err.getMessage(), "FOTY0014"); } return new StringValue(result); }
@Override public AtomicValue evaluate(Item arg, XPathContext context) throws XPathException { CharSequence result; try { result = arg.getStringValueCS(); } catch (UnsupportedOperationException err) { throw new XPathException(err.getMessage(), "FOTY0014"); } return new StringValue(result); }
@Override public AtomicValue evaluate(Item arg, XPathContext context) throws XPathException { final CharSequence s = arg.getStringValueCS(); return StringValue.makeStringValue(iriToUri(s)); }
@Override public AtomicValue evaluate(Item arg, XPathContext context) throws XPathException { final CharSequence s = arg.getStringValueCS(); return StringValue.makeStringValue(escape(s, "-_.~")); }
/** * Evaluate the function */ public Item evaluateItem(XPathContext c) throws XPathException { Item arg = argument[0].evaluateItem(c); if (arg==null) { return StringValue.EMPTY_STRING; } else { return StringValue.makeStringValue(arg.getStringValueCS()); } }
/** * Append an arbitrary item (node or atomic value) to the output */ public void append(/*@Nullable*/ Item item, Location locationId, int copyNamespaces) throws XPathException { if (item instanceof NodeInfo) { decompose(item, locationId, copyNamespaces); } else { characters(item.getStringValueCS(), locationId, 0); } }
@Override public Fold getFold(XPathContext context, Sequence... additionalArguments) throws XPathException { CharSequence separator = ""; if (additionalArguments.length > 0) { separator = additionalArguments[0].head().getStringValueCS(); } return new StringJoinFold(separator); }
private static String showKind(Item item) { if (item instanceof NodeInfo && ((NodeInfo) item).getNodeKind() == Type.TEXT && Whitespace.isWhite(item.getStringValueCS())) { return "whitespace text() node"; } else { return Type.displayTypeName(item); } }
private static String showKind(Item item) { if (item instanceof NodeInfo && ((NodeInfo) item).getNodeKind() == Type.TEXT && Whitespace.isWhite(item.getStringValueCS())) { return "whitespace text() node"; } else { return Type.displayTypeName(item); } }
public StringValue call(XPathContext context, Sequence[] arguments) throws XPathException { FastStringBuffer fsb = new FastStringBuffer(FastStringBuffer.C64); for (Sequence<?> arg : arguments) { Item item = arg.head(); if (item != null) { fsb.append(item.getStringValueCS()); } } return new StringValue(fsb); }
@Override public AtomicValue evaluate(Item arg, XPathContext context) throws XPathException { final CharSequence s = arg.getStringValueCS(); return StringValue.makeStringValue( HTMLURIEscaper.escapeURL(s, false, getRetainedStaticContext().getConfiguration())); }
public StringValue call(XPathContext context, Sequence[] arguments) throws XPathException { FastStringBuffer fsb = new FastStringBuffer(FastStringBuffer.C64); for (Sequence<?> arg : arguments) { Item item = arg.head(); if (item != null) { fsb.append(item.getStringValueCS()); } } return new StringValue(fsb); }
@Override public CharSequence evaluateAsString(XPathContext context) throws XPathException { FastStringBuffer buffer = new FastStringBuffer(256); for (Operand o: operands()) { Item it = o.getChildExpression().evaluateItem(context); if (it != null) { buffer.append(it.getStringValueCS()); } } return buffer; }
@Override public GroundedValue evaluate(Item item, XPathContext context) throws XPathException { SystemFunction f = SystemFunction.makeFunction(getDetails().name.getLocalPart(), getRetainedStaticContext(), 1); StringValue val = new StringValue(item.getStringValueCS()); return f.call(context, new Sequence[]{val}).materialize(); }
@Override public GroundedValue evaluate(Item item, XPathContext context) throws XPathException { SystemFunction f = SystemFunction.makeFunction(getDetails().name.getLocalPart(), getRetainedStaticContext(), 1); StringValue val = new StringValue(item.getStringValueCS()); return f.call(context, new Sequence[]{val}).materialize(); }