public ValidationFailure validate( CharSequence input) { if (NameChecker.isValidNCName(Whitespace.trimWhitespace(input))) { return null; } else { return new ValidationFailure("The value '" + input + "' is not a valid " + targetType.getDisplayName()); } } }
@Override public String toShortString() { return getTargetType().getDisplayName() + "(" + getBaseExpression().toShortString() + ")"; }
public ValidationFailure validate( CharSequence input) { if (NameChecker.isValidNCName(Whitespace.trimWhitespace(input))) { return null; } else { return new ValidationFailure("The value '" + input + "' is not a valid " + targetType.getDisplayName()); } } }
@Override public String toShortString() { return getTargetType().getDisplayName() + "(" + getBaseExpression().toShortString() + ")"; }
public ConversionResult convertString( CharSequence input) { CharSequence trimmed = Whitespace.trimWhitespace(input); if (NameChecker.isValidNCName(trimmed)) { return new StringValue(trimmed, targetType); } else { return new ValidationFailure("The value '" + input + "' is not a valid " + targetType.getDisplayName()); } }
public ConversionResult convertString( CharSequence input) { CharSequence trimmed = Whitespace.trimWhitespace(input); if (NameChecker.isValidNCName(trimmed)) { return new StringValue(trimmed, targetType); } else { return new ValidationFailure("The value '" + input + "' is not a valid " + targetType.getDisplayName()); } }
/** * Simplify the expression * @return the simplified expression * @param visitor an expression visitor */ public Expression simplify(ExpressionVisitor visitor) throws XPathException { StaticContext env = visitor.getStaticContext(); if ((targetType instanceof BuiltInAtomicType) && !env.isAllowedBuiltInType((BuiltInAtomicType)targetType)) { // this is checked here because the ConstructorFunctionLibrary doesn't have access to the static // context at bind time XPathException err = new XPathException("The type " + targetType.getDisplayName() + " is not recognized by a Basic XSLT Processor", this); err.setErrorCode("XPST0080"); err.setIsStaticError(true); throw err; } operand = visitor.simplify(operand); if (Literal.isAtomic(operand)) { return typeCheck(visitor, Type.ITEM_TYPE); } return this; }
/** * Simplify the expression * @return the simplified expression * @param visitor an expression visitor */ public Expression simplify(ExpressionVisitor visitor) throws XPathException { StaticContext env = visitor.getStaticContext(); if ((targetType instanceof BuiltInAtomicType) && !env.isAllowedBuiltInType((BuiltInAtomicType)targetType)) { // this is checked here because the ConstructorFunctionLibrary doesn't have access to the static // context at bind time XPathException err = new XPathException("The type " + targetType.getDisplayName() + " is not recognized by a Basic XSLT Processor", this); err.setErrorCode("XPST0080"); err.setIsStaticError(true); throw err; } operand = visitor.simplify(operand); if (Literal.isAtomic(operand)) { return typeCheck(visitor, Type.ITEM_TYPE); } return this; }
message.append(((AtomicValue)item).getItemType().getDisplayName()); message.append(" is not any of these"); return Optional.of(message.toString());
message.append(((AtomicValue)item).getItemType().getDisplayName()); message.append(" is not any of these"); return Optional.of(message.toString());
out.emitAttribute("type", ((AtomicValue)value).getTypeLabel().getDisplayName()); } else { try { out.startElement("atomicValue"); out.emitAttribute("value", it.getStringValue()); out.emitAttribute("type", ((AtomicValue)it).getTypeLabel().getDisplayName()); out.endElement();
out.emitAttribute("type", ((AtomicValue)value).getTypeLabel().getDisplayName()); } else { try { out.startElement("atomicValue"); out.emitAttribute("value", it.getStringValue()); out.emitAttribute("type", ((AtomicValue)it).getTypeLabel().getDisplayName()); out.endElement();