DomInvocationHandler (final AttributeChildDescriptionImpl description) { final EvaluatedXmlName evaluatedXmlName = createEvaluatedXmlName(description.getXmlName()); if (myStub != null && description.isStubbed()) { AttributeStub stub = myStub.getAttributeStub(description.getXmlName()); StubParentStrategy strategy = StubParentStrategy.createAttributeStrategy(stub, myStub); return new AttributeChildInvocationHandler(evaluatedXmlName, description, myManager, strategy, stub); } final XmlTag tag = getXmlTag(); if (tag != null) { // TODO: this seems ugly String ns = evaluatedXmlName.getNamespace(tag, getFile()); final XmlAttribute attribute = tag.getAttribute(description.getXmlName().getLocalName(), ns.equals(tag.getNamespace())? null:ns); if (attribute != null) { PsiUtilCore.ensureValid(attribute); DomInvocationHandler handler = myManager.getDomHandler(attribute); if (!(handler instanceof AttributeChildInvocationHandler)) { throw new AssertionError("Expected indexed DOM, but got " + handler + "; ns=" + ns + "; description=" + description + "; attribute=" + attribute.getName() + "; XML consistent=" + (PhysicalDomParentStrategy.getParentTag(attribute) == tag) + "; DOM consistent =" + equals(DomCreator.getParentDom(tag)) + "; re-creation=" + DomCreator.createAttributeHandler(attribute)); } return handler; } } return new AttributeChildInvocationHandler(evaluatedXmlName, description, myManager, new VirtualDomParentStrategy(this), null); }