*/
String def = attr.getDefaultValue(mContext, this);
if (def == null) {
ExceptionUtil.throwInternal("null default attribute value");
}
PrefixedName an = attr.getName();
// Ok, do we need to find the URI?
String prefix = an.getPrefix();
String uri = "";
if (prefix != null && prefix.length() > 0) {
uri = mContext.getNamespaceURI(prefix);
// Can not map to empty NS!
if (uri == null || uri.length() == 0) {
/* Hmmh. This is a weird case where we do have to
* throw a validity exception; even though it really
* is more a ns-well-formedness error...
*/
reportValidationProblem("Unbound namespace prefix \"{0}\" for default attribute \"{1}\"", prefix, attr);
// May continue if we don't throw errors, just collect them to a list
uri = "";
}
}
int defIx = mContext.addDefaultAttribute(an.getLocalName(), uri, prefix, def);
if (defIx < 0) {
/* 13-Dec-2005, Tatus: Hmmh. For readers this is an error
* condition, but writers may just indicate they are not
* interested in defaults. So let's let context report
* problem(s) if it has any regarding the request.