throwUnexpectedChar(c, SUFFIX_IN_ELEMENT+" Expected a quote");
}
// And then the actual value
int startLen = -1;
TextBuilder tb;
if (prefix == sPrefixXmlns) { // non-default namespace declaration
tb = ac.getNsBuilder(localName);
// returns null if it's a dupe:
if (null == tb) {
throwParseError("Duplicate declaration for namespace prefix '"+localName+"'.");
}
startLen = tb.getCharSize();
} else if (localName == sPrefixXmlns && prefix == DEFAULT_NS_PREFIX) {
tb = ac.getDefaultNsBuilder();
// returns null if default ns was already declared
if (null == tb) {
throwParseError("Duplicate default namespace declaration.");
}
} else {
tb = ac.getAttrBuilder(prefix, localName);
}
tb.startNewEntry();
if (mCfgNormalizeAttrs) {
parseNormalizedAttrValue(c, tb);
} else {
parseNonNormalizedAttrValue(c, tb);
}
/* 19-Jul-2004, TSa: Need to check that non-default namespace
* URI is NOT empty, as per XML namespace specs, #2,
* ("...In such declarations, the namespace name may not
* be empty.")
*/
/* (note: startLen is only set to first char position for
* non-default NS declarations, see above...)
*/
/* 04-Feb-2005, TSa: Namespaces 1.1 does allow this, though,
* so for xml 1.1 documents we need to allow it
*/
if (!mXml11) {
if (startLen >= 0 && tb.getCharSize() == startLen) { // is empty!
throwParseError(ErrorConsts.ERR_NS_EMPTY);
}
}
// and then we need to iterate some more