// Get this attribute set's name
final String name = getAttribute("name");
if (!XML11Char.isXML11ValidQName(name)) {
ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, name, this);
parser.reportError(Constants.ERROR, err);
}
_name = parser.getQNameIgnoreDefaultNs(name);
if ((_name == null) || (_name.equals(EMPTYSTRING))) {
ErrorMsg msg = new ErrorMsg(ErrorMsg.UNNAMED_ATTRIBSET_ERR, this);
parser.reportError(Constants.ERROR, msg);
}
// Get any included attribute sets (similar to inheritance...)
final String useSets = getAttribute("use-attribute-sets");
if (useSets.length() > 0) {
if (!Util.isValidQNames(useSets)) {
ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, useSets, this);
parser.reportError(Constants.ERROR, err);
}
_useSets = new UseAttributeSets(useSets, parser);
}
// Parse the contents of this node. All child elements must be
// <xsl:attribute> elements. Other elements cause an error.
final Vector contents = getContents();
final int count = contents.size();
for (int i=0; i<count; i++) {
SyntaxTreeNode child = (SyntaxTreeNode)contents.elementAt(i);
if (child instanceof XslAttribute) {
parser.getSymbolTable().setCurrentNode(child);
child.parseContents(parser);
}
else if (child instanceof Text) {
// ignore
}
else {
ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_CHILD_ERR, this);
parser.reportError(Constants.ERROR, msg);
}
}
// Point the symbol table back at us...