qName = XSNotation.getInstance().getName();
} else {
qName = XSNMToken.getInstance().getName();
}
XsTLocalSimpleType simpleType = attr.createSimpleType();
XsERestriction restriction = simpleType.createRestriction();
restriction.setBase(new XsQName(qName.getNamespaceURI(), qName.getLocalName(), "xs"));
if (type.startsWith("(")) {
type = type.substring(1).trim();
} else {
throw new SAXParseException("The enumeration in the type of attribute "
+ pAttribute.getName()
+ " must begin with an '('.",
pAttribute.getLocator());
}
if (type.endsWith(")")) {
type = type.substring(0, type.length()-1).trim();
} else {
throw new SAXParseException("The enumeration in the type of attribute "
+ pAttribute.getName()
+ " must begin with an '('.",
pAttribute.getLocator());
}
StringTokenizer st = new StringTokenizer(type, "|");
if (!st.hasMoreTokens()) {
throw new SAXParseException("The enumeration in the type of attribute "
+ pAttribute.getName()
+ " contains no tokens.",
pAttribute.getLocator());
}
while (st.hasMoreTokens()) {
String token = st.nextToken().trim();
if ("".equals(token)) {
throw new SAXParseException("The enumeration in the type of attribute "
+ pAttribute.getName()
+ " contains an empty token.",
pAttribute.getLocator());
}
XsEEnumeration enumeration = restriction.createEnumeration();
enumeration.setValue(token);
}
qName = null;
}
if (qName != null) {