public void postValidate() throws XPathException {
checkAgainstRequiredType(requiredType);
if (select==null && allowsValue()) {
textonly = true;
AxisIterator kids = iterateAxis(Axis.CHILD);
NodeInfo first = (NodeInfo)kids.next();
if (first == null) {
if (requiredType == null) {
select = new StringLiteral(StringValue.EMPTY_STRING);
} else {
if (this instanceof XSLParam) {
if (!requiredParam) {
if (Cardinality.allowsZero(requiredType.getCardinality())) {
select = Literal.makeEmptySequence();
} else {
// The implicit default value () is not valid for the required type, so
// it is treated as if there is no default
implicitlyRequiredParam = true;
}
}
} else {
if (Cardinality.allowsZero(requiredType.getCardinality())) {
select = Literal.makeEmptySequence();
} else {
compileError("The implicit value () is not valid for the declared type", "XTTE0570");
}
}
}
} else {
if (kids.next() == null) {
// there is exactly one child node
if (first.getNodeKind() == Type.TEXT) {
// it is a text node: optimize for this case
constantText = first.getStringValue();
}