public void validate() throws XPathException {
if (select != null && hasChildNodes()) {
String errorCode = getErrorCodeForSelectPlusContent();
compileError("An " + getDisplayName() + " element with a select attribute must be empty", errorCode);
}
AxisIterator kids = iterateAxis(Axis.CHILD);
NodeInfo first = (NodeInfo)kids.next();
if (select == null) {
if (first == null) {
// there are no child nodes and no select attribute
//stringValue = "";
select = new StringLiteral(StringValue.EMPTY_STRING);
} 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
select = new StringLiteral(first.getStringValue());
}