.getChildrenWithName(new QName(this.tagName)); } else { if (DOMUtil.getPrefix(this.tagName) != null) { children = ((OMContainerEx) rootNode) .getChildrenWithName(new QName(this.nsName, DOMUtil .getLocalName(this.tagName), DOMUtil .getPrefix(this.tagName))); } else { children = ((OMContainerEx) rootNode)
.getChildrenWithName(new QName(this.tagName)); } else { if (DOMUtil.getPrefix(this.tagName) != null) { children = ((OMContainerEx) rootNode) .getChildrenWithName(new QName(this.nsName, DOMUtil .getLocalName(this.tagName), DOMUtil .getPrefix(this.tagName))); } else { children = ((OMContainerEx) rootNode)
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); }
public Document createDocument(String namespaceURI, String qualifiedName, DocumentType doctype) throws DOMException { // TODO Handle docType stuff OMDOMFactory fac = new OMDOMFactory(); DocumentImpl doc = new DocumentImpl(fac); fac.setDocument(doc); new ElementImpl(doc, DOMUtil.getLocalName(qualifiedName), new NamespaceImpl(namespaceURI, DOMUtil .getPrefix(qualifiedName)), fac); return doc; }
/** * Adds a new attribute. * * @see org.w3c.dom.Element#setAttributeNS(String, String, String) */ public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException { if (namespaceURI != null && !"".equals(namespaceURI)) { if (namespaceURI.equals(OMConstants.XMLNS_NS_URI)) { this.declareNamespace(value, DOMUtil .getLocalName(qualifiedName)); } else { AttrImpl attr = new AttrImpl(this.ownerNode, DOMUtil .getLocalName(qualifiedName), value, this.factory); attr.setOMNamespace(new NamespaceImpl(namespaceURI, DOMUtil .getPrefix(qualifiedName))); this.setAttributeNodeNS(attr); } } else { // When the namespace is null, the attr name given better not be // a qualified name // But anyway check and set it this.setAttribute(DOMUtil.getLocalName(qualifiedName), value); } }
AttrImpl tempAttr = ((AttrImpl) attributeNode); tempAttr.setOMNamespace(new NamespaceImpl(namespaceURI, DOMUtil .getPrefix(qualifiedName))); tempAttr.setAttributeValue(value); this.attributes.setNamedItem(tempAttr); } else { NamespaceImpl ns = new NamespaceImpl(namespaceURI, DOMUtil .getPrefix(qualifiedName)); AttrImpl attr = new AttrImpl((DocumentImpl) this .getOwnerDocument(), DOMUtil