* @see org.apache.axiom.om.OMFactory#createOMElement( javax.xml.namespace.QName,
* org.apache.axiom.om.OMContainer)
*/
public OMElement createOMElement(QName qname, OMContainer parent)
throws OMException {
OMNamespaceImpl ns;
if (qname.getNamespaceURI().length() == 0) {
if (qname.getPrefix().length() > 0) {
throw new IllegalArgumentException("Cannot create a prefixed element with an empty namespace name");
}
ns = null;
} else if (qname.getPrefix() != null) {
ns = new OMNamespaceImpl(qname.getNamespaceURI(), qname.getPrefix());
} else {
ns = new OMNamespaceImpl(qname.getNamespaceURI(), null);
}
return createOMElement(qname.getLocalPart(), ns, parent);
}