private String getPrefix( String namespaceURI, String defaultPrefix ) { String prefix = nsBindings.getPrefix( namespaceURI ); if ( prefix == null ) { prefix = defaultPrefix; } return prefix; } }
private void writeWrapperElementWithNamespacesAndDummyLevel() throws XMLStreamException { activeWriter.writeStartElement( BUFFER_PREFIX, ELEMENT_NAME_CONTAINER_ROOT, BUFFER_NS ); activeWriter.writeNamespace( BUFFER_PREFIX, BUFFER_NS ); Iterator<String> namespaceIter = nsBindings.getNamespaceURIs(); while ( namespaceIter.hasNext() ) { String ns = namespaceIter.next(); String prefix = nsBindings.getPrefix( ns ); activeWriter.writeNamespace( prefix, ns ); LOG.debug( prefix + "->" + ns ); } if ( nsBindings.getPrefix( XSINS ) == null ) { activeWriter.writeNamespace( XSI_PREFIX, XSINS ); } for ( int i = 0; i < openElements; i++ ) { activeWriter.writeStartElement( BUFFER_PREFIX, ELEMENT_NAME_OPEN_ELEMENT, BUFFER_NS ); } activeWriter.writeEmptyElement( BUFFER_PREFIX, ELEMENT_NAME_UNCLEAR_REFERENCE, BUFFER_NS ); }
String nsUri = userHint.getNamespaceURI(); String prefix = userHint.getPrefix(); String oldPrefix = nsBindings.getPrefix( nsUri ); if ( oldPrefix != null && !oldPrefix.equals( prefix ) ) { LOG.warn( "Multiple prefices for namespace '" + nsUri + "': " + prefix + " / " + oldPrefix ); if ( prefix != null && !prefix.equals( XMLConstants.DEFAULT_NS_PREFIX ) ) { String nsUri = xmlStream.getNamespaceURI( i ); String oldPrefix = nsBindings.getPrefix( nsUri ); if ( oldPrefix != null && !oldPrefix.equals( prefix ) ) { LOG.debug( "Multiple prefices for namespace '" + nsUri + "': " + prefix + " / " for ( String prefix : schemaNSBindings.keySet() ) { String nsUri = schemaNSBindings.get( prefix ); String oldPrefix = nsBindings.getPrefix( nsUri ); if ( oldPrefix != null && !oldPrefix.equals( prefix ) ) { LOG.warn( "Multiple prefices for namespace '" + nsUri + "': " + prefix + " / " + oldPrefix ); for ( String prefix : schemaNSBindings.keySet() ) { String nsUri = schemaNSBindings.get( prefix ); String oldPrefix = nsBindings.getPrefix( nsUri ); if ( oldPrefix != null && !oldPrefix.equals( prefix ) ) { LOG.warn( "Multiple prefices for namespace '" + nsUri + "': " + prefix + " / " + oldPrefix );
while ( nsIter.hasNext() ) { String ns = nsIter.next(); nsToPrefix.put( ns, CommonNamespaces.getNamespaceContext().getPrefix( ns ) );