values.add(flattenXmlns(element));
}
for (final Attribute attr : element.getAttributes()) {
AttributeValidator attrValidator = elementValidator.getAttributeValidator(attr.getName());
Expression empty = new StringConstant(attr, elementSchema, "");
if (attrValidator.isFlagSet(AttributeValidator.Flag.BOOLEAN)) {
Expression attrValue = attr.getValue().acceptVisitor(this);
if (attrValue.hasStaticString()) {
values.add(buildBooleanAttrExpression(attr, element));
} else {
if (attrValue instanceof ConvertibleToContent) {
ConvertibleToContent ctc = (ConvertibleToContent)attrValue;
attrValue = ctc.getSubexpression();
}
values.add(new Conditional(element, elementSchema,
attrValue,
buildBooleanAttrExpression(attr, element),
empty));
}
} else {
Expression condition = attr.getCondition();
if (condition != null) {
values.add(new Conditional(element, elementSchema, condition,
buildAttrExpression(attr, element), empty));
} else {
values.add(buildAttrExpression(attr, element));