// "prefix:localpart" or "localpart"
// get prefix and local part out of content
String prefix, localpart;
int colonptr = content.indexOf(":");
if (colonptr > 0) {
prefix = context.getSymbol(content.substring(0,colonptr));
localpart = content.substring(colonptr+1);
} else {
prefix = EMPTY_STRING;
localpart = content;
}
// both prefix (if any) a nd localpart must be valid NCName
if (prefix.length() > 0 && !XMLChar.isValidNCName(prefix))
throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "QName"});
if(!XMLChar.isValidNCName(localpart))
throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "QName"});
// resove prefix to a uri, report an error if failed
String uri = context.getURI(prefix);
if (prefix.length() > 0 && uri == null)
throw new InvalidDatatypeValueException("UndeclaredPrefix", new Object[]{content, prefix});
return new XQName(prefix, context.getSymbol(localpart), context.getSymbol(content), uri);