Project

Profile

Help

Revision d9af5b4c

Added by Michael Kay over 13 years ago

Fix bug 1990662 - spurious warnings in axis expressions

View differences:

latest9.0/bj/net/sf/saxon/Configuration.java
2915 2915
        		throw new IllegalArgumentException(
2916 2916
                        "SCHEMA_URI_RESOLVER value must be an instance of net.sf.saxon.type.SchemaURIResolver");
2917 2917
        	}
2918
        	setOutputURIResolver((OutputURIResolver)value);           
2918
        	setOutputURIResolver((OutputURIResolver)value);
2919 2919

  
2920 2920
        } else if (name.equals(FeatureKeys.SCHEMA_VALIDATION)) {
2921 2921
             if (!(value instanceof Integer)) {
......
3107 3107
        	return Boolean.valueOf(isTraceExternalFunctions());
3108 3108

  
3109 3109
        } else if (name.equals(FeatureKeys.TRACE_OPTIMIZER_DECISIONS)) {
3110
        	return Boolean.valueOf(isOptimizerTracing());            
3110
        	return Boolean.valueOf(isOptimizerTracing());
3111 3111

  
3112 3112
        } else if (name.equals(FeatureKeys.TREE_MODEL)) {
3113 3113
        	return new Integer(getTreeModel());
......
3139 3139
//    }
3140 3140

  
3141 3141

  
3142
    public Iterator getExtensionsOfType(SchemaType contentType) {
3143
        return Collections.EMPTY_LIST.iterator();
3144
    }
3142 3145
}
3143 3146

  
3144 3147

  
latest9.0/bj/net/sf/saxon/expr/AxisExpression.java
8 8
import net.sf.saxon.type.*;
9 9
import net.sf.saxon.value.Cardinality;
10 10

  
11
import java.util.Iterator;
12

  
11 13

  
12 14
/**
13 15
 * An AxisExpression is always obtained by simplifying a PathExpression.
......
168 170
                            ", as this type requires simple content", this);
169 171
                } else if (((ComplexType)contentType).isEmptyContent() &&
170 172
                        (axis==Axis.CHILD || axis==Axis.DESCENDANT || axis==Axis.DESCENDANT_OR_SELF)) {
173
                    for (Iterator iter=visitor.getConfiguration().getExtensionsOfType(contentType); iter.hasNext();) {
174
                        ComplexType extension = (ComplexType)iter.next();
175
                        if (!extension.isEmptyContent()) {
176
                            return this;
177
                        }
178
                    }
171 179
                    env.issueWarning("The " + Axis.axisName[axis] + " axis will never select any " +
172 180
                            " nodes when starting at a node with type " +
173 181
                            contentType.getDescription() +

Also available in: Unified diff