private void putNamespaces(XMLStreamReader reader){
  for (int i=0; i < reader.getNamespaceCount(); i++) {
    final String prefix=reader.getNamespacePrefix(i);
    if (prefix != null) {
      putNamespace(prefix,reader.getNamespaceURI(i));
    }
  }
}

private void putNamespaces ( XMLStreamReader reader ) { for ( int i = 0 ; i < reader . getNamespaceCount ( ) ; i ++ ) { final String prefix = reader . getNamespacePrefix ( i ) ; if ( prefix != null ) { putNamespace ( prefix , reader . getNamespaceURI ( i ) ) ; } } }
should be invoked on element_start event
