Java XML QName addNamespace(Element element, QName qName)

Here you can find the source of addNamespace(Element element, QName qName)

Description

add Namespace

License

Open Source License

Declaration

public static void addNamespace(Element element, QName qName) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import org.w3c.dom.*;
import javax.xml.namespace.QName;

public class Main {
    public static void addNamespace(Element element, QName qName) {
        element.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:" + qName.getLocalPart(),
                qName.getNamespaceURI());
    }/*  w w  w . j a v a  2 s . c  o m*/
}

Related

  1. addInfo(final QName nm, final Integer kind, final Class cl)
  2. addTypeQname(QName elemntNameSpace, List propertyQnameValueList, PropertyDescriptor propDesc, QName beanName, boolean processingDocLitBare)
  3. compareQName(QName qname, Node node)
  4. compareRelation(QName a, QName b)
  5. compareWithOutNamespace(QName value, QName tagName)

  6. HOME | Copyright © www.java2s.com 2016