undeclaredNamespaceError(parts[0], "XTSE0280");
return null;
}
}
int nameCode = getNamePool().allocate(parts[0], nsuri, parts[1]);
FixedAttribute inst = new FixedAttribute(nameCode,
validationAction,
schemaType,
annotation);
inst.setContainer(this); // temporarily
compileContent(exec, inst, separator);
return inst;
} else if (namespace instanceof StringLiteral) {
String nsuri = ((StringLiteral)namespace).getStringValue();
if (nsuri.equals("")) {
parts[0] = "";
} else if (parts[0].equals("")) {
// Need to choose an arbitrary prefix
// First see if the requested namespace is declared in the stylesheet
AxisIterator iter = iterateAxis(Axis.NAMESPACE);
while (true) {
NodeInfo ns = (NodeInfo)iter.next();
if (ns == null) {
break;
}
if (ns.getStringValue().equals(nsuri)) {
parts[0] = ns.getLocalPart();
break;
}
}
// Otherwise see the URI is known to the namepool
if (parts[0].equals("")) {
String p = getNamePool().suggestPrefixForURI(
((StringLiteral)namespace).getStringValue());
if (p != null) {
parts[0] = p;
}
}
// Otherwise choose something arbitrary. This will get changed
// if it clashes with another attribute
if (parts[0].equals("")) {
parts[0] = "ns0";
}
}
int nameCode = getNamePool().allocate(parts[0], nsuri, parts[1]);
FixedAttribute inst = new FixedAttribute(nameCode,
validationAction,
schemaType,
annotation);
compileContent(exec, inst, separator);
return inst;