public Element createElementNS(String ns, String qualifiedName) throws DOMException { if (ns == null) ns = ""; String localName = DOMUtil.getLocalName(qualifiedName); String prefix = DOMUtil.getPrefix(qualifiedName); if(prefix == null) { prefix = ""; } //When the namespace is a default namespace if (prefix != null && !"".equals(prefix)) { this.checkQName(prefix, localName); } NamespaceImpl namespace = new NamespaceImpl(ns, prefix); return new ElementImpl(this, localName, namespace, this.factory); }
public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException { String localName = DOMUtil.getLocalName(qualifiedName); String prefix = DOMUtil.getPrefix(qualifiedName); if (!OMConstants.XMLNS_NS_PREFIX.equals(localName)) { this.checkQName(prefix, localName); } else { return this.createAttribute(localName); } return new AttrImpl(this, localName, new NamespaceImpl( namespaceURI, prefix), this.factory); }