SimpleType base = getItemType();
SequenceIterator iter = new StringTokenIterator(value.toString());
int count = 0;
try {
while (true) {
StringValue val = (StringValue)iter.next();
if (val == null) break;
base.validateContent(val.getStringValue(), nsResolver);
count++;
}
Iterator fi = getFacets();
while (fi.hasNext()) {
Facet f = (Facet)fi.next();
if (!f.testLength(count)) {
throw new ValidationException(
"Length of list (" + count + ") violates " +
f.getName() + " facet " + Err.wrap(f.getValue()));
}
if (f.appliesToWholeList()) {
boolean match = f.testAtomicValue(new StringValue(NormalizeSpace.normalize(value.toString())));
if (!match) {
throw new ValidationException(
"List " + Err.wrap(value) + " violates the " + f.getName() + " facet " +
Err.wrap(f.getValue()));
}