public void writeToElement(Element rootElement){
  for (  String packageName : packageNameToPrefix.keys()) {
    for (    String prefix : packageNameToPrefix.getElements(packageName)) {
      rootElement.setAttributeNS(UiBinderConstants.XMLNS_NAMESPACE,UiBinderConstants.XMLNS_PREFIX + ":" + prefix,UiBinderConstants.URN_IMPORT_NAMESPACE_BEGINNING + packageName);
    }
  }
}

public void writeToElement ( Element rootElement ) { for ( String packageName : packageNameToPrefix . keys ( ) ) { for ( String prefix : packageNameToPrefix . getElements ( packageName ) ) { rootElement . setAttributeNS ( UiBinderConstants . XMLNS_NAMESPACE , UiBinderConstants . XMLNS_PREFIX + ":" + prefix , UiBinderConstants . URN_IMPORT_NAMESPACE_BEGINNING + packageName ) ; } } }
writes all of the managed package to namespace mappings to the root element as namespace definition attributes . < p > note : there isn ' t duplicate checking for attributes pointing to the same namespace . if there is a name conflict between an prefix name managed by this class and an existing attribute on the root element , the existing attribute will be replaced .
