protected fun addDefinitionRef(defRef: Element) { val ref: String = defRef.getAttributeNS(null, XBL_REF_ATTRIBUTE) val e: Element = ctx.getReferencedElement(defRef, ref) if (!XBL_NAMESPACE_URI.equals(e.getNamespaceURI()) || !XBL_DEFINITION_TAG.equals(e.getLocalName())) { throw BridgeException(ctx, defRef, ErrorConstants.ERR_URI_BAD_TARGET, arrayOf<Any>(ref)) } val ir = ImportRecord(defRef, e) imports.put(defRef, ir) val et: NodeEventTarget = defRef as NodeEventTarget et.addEventListenerNS( XMLConstants.XML_EVENTS_NAMESPACE_URI, "DOMAttrModified", refAttrListener, false, null ) val d: XBLOMDefinitionElement = defRef as XBLOMDefinitionElement val ns: String = d.getElementNamespaceURI() val ln: String = d.getElementLocalName() addDefinition(ns, ln, e as XBLOMDefinitionElement, defRef) }
Adds a definition through its referring definition element ( one with a 'ref ' attribute ) .