Code example for QName

Methods: getNamespaceURI, getPrefix

0
     */ 
    private static void setQNameNamespace(Element xml, QName value)
    { 
        String elementPrefix = xml.getPrefix();
         
        String valueURI = value.getNamespaceURI();
        String valuePrefix = value.getPrefix();
         
        // 
        // check to make sure: 
        // 
        // 1. the value has a namespace URI 
        // 2. that the value's prefix isn't already bound on this element 
        //         
        if ((valueURI != null && valueURI.length() > 0) && 
            (elementPrefix != null && !valuePrefix.equals(elementPrefix))) 
            setNamespaceAttribute(xml, valuePrefix, valueURI);
    } 
     
    /** 
     *