/** * Adds the specified namespace URI to the jaxb:extensionBindingPrefixes * attribute of the target document. */ private void declareExtensionNamespace( Element target, String nsUri ) { // look for the attribute Element root = target.getOwnerDocument().getDocumentElement(); Attr att = root.getAttributeNodeNS(Const.JAXB_NSURI,EXTENSION_PREFIXES); if( att==null ) { String jaxbPrefix = allocatePrefix(root,Const.JAXB_NSURI); // no such attribute. Create one. att = target.getOwnerDocument().createAttributeNS( Const.JAXB_NSURI,jaxbPrefix+':'+EXTENSION_PREFIXES); root.setAttributeNodeNS(att); } String prefix = allocatePrefix(root,nsUri); if( att.getValue().indexOf(prefix)==-1 ) // avoid redeclaring the same namespace twice. att.setValue( att.getValue()+' '+prefix); }
/** * Adds the specified namespace URI to the jaxb:extensionBindingPrefixes * attribute of the target document. */ private void declareExtensionNamespace( Element target, String nsUri ) { // look for the attribute Element root = target.getOwnerDocument().getDocumentElement(); Attr att = root.getAttributeNodeNS(Const.JAXB_NSURI,EXTENSION_PREFIXES); if( att==null ) { String jaxbPrefix = allocatePrefix(root,Const.JAXB_NSURI); // no such attribute. Create one. att = target.getOwnerDocument().createAttributeNS( Const.JAXB_NSURI,jaxbPrefix+':'+EXTENSION_PREFIXES); root.setAttributeNodeNS(att); } String prefix = allocatePrefix(root,nsUri); if( att.getValue().indexOf(prefix)==-1 ) // avoid redeclaring the same namespace twice. att.setValue( att.getValue()+' '+prefix); }
/** * Adds the specified namespace URI to the jaxb:extensionBindingPrefixes * attribute of the target document. */ private void declareExtensionNamespace( Element target, String nsUri ) { // look for the attribute Element root = target.getOwnerDocument().getDocumentElement(); Attr att = root.getAttributeNodeNS(Const.JAXB_NSURI,EXTENSION_PREFIXES); if( att==null ) { String jaxbPrefix = allocatePrefix(root,Const.JAXB_NSURI); // no such attribute. Create one. att = target.getOwnerDocument().createAttributeNS( Const.JAXB_NSURI,jaxbPrefix+':'+EXTENSION_PREFIXES); root.setAttributeNodeNS(att); } String prefix = allocatePrefix(root,nsUri); if( att.getValue().indexOf(prefix)==-1 ) // avoid redeclaring the same namespace twice. att.setValue( att.getValue()+' '+prefix); }
/** * Adds the specified namespace URI to the jaxb:extensionBindingPrefixes * attribute of the target document. */ private void declareExtensionNamespace( Element target, String nsUri ) { // look for the attribute Element root = target.getOwnerDocument().getDocumentElement(); Attr att = root.getAttributeNodeNS(Const.JAXB_NSURI,EXTENSION_PREFIXES); if( att==null ) { String jaxbPrefix = allocatePrefix(root,Const.JAXB_NSURI); // no such attribute. Create one. att = target.getOwnerDocument().createAttributeNS( Const.JAXB_NSURI,jaxbPrefix+':'+EXTENSION_PREFIXES); root.setAttributeNodeNS(att); } String prefix = allocatePrefix(root,nsUri); if( att.getValue().indexOf(prefix)==-1 ) // avoid redeclaring the same namespace twice. att.setValue( att.getValue()+' '+prefix); }
/** * Adds the specified namespace URI to the jaxb:extensionBindingPrefixes * attribute of the target document. */ private void declareExtensionNamespace( Element target, String nsUri ) { // look for the attribute Element root = target.getOwnerDocument().getDocumentElement(); Attr att = root.getAttributeNodeNS(Const.JAXB_NSURI,EXTENSION_PREFIXES); if( att==null ) { String jaxbPrefix = allocatePrefix(root,Const.JAXB_NSURI); // no such attribute. Create one. att = target.getOwnerDocument().createAttributeNS( Const.JAXB_NSURI,jaxbPrefix+':'+EXTENSION_PREFIXES); root.setAttributeNodeNS(att); } String prefix = allocatePrefix(root,nsUri); if( att.getValue().indexOf(prefix)==-1 ) // avoid redeclaring the same namespace twice. att.setValue( att.getValue()+' '+prefix); }