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 = StringValue.EMPTY_STRING;
} else {
if (this instanceof XSLParam) {
if (!requiredParam) {
if (Cardinality.allowsZero(requiredType.getCardinality())) {
select = EmptySequence.getInstance();
} else {
requiredParam = true;
}
}
} else {
if (Cardinality.allowsZero(requiredType.getCardinality())) {
select = EmptySequence.getInstance();
} else {
compileError("Default value () is not valid for the declared type");
}
}
}
} 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();
}