public void setLang(String lang) { langAttr = new AttrImpl(this.ownerNode, SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME, langNamespace, lang, this.factory); this.addAttribute(langAttr); }
public OMAttribute createOMAttribute(String localName, OMNamespace ns, String value) { return new AttrImpl(this.getDocument(), localName, ns, value, this); }
public Attr createAttribute(String name) throws DOMException { if (!DOMUtil.isQualifiedName(name)) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null); throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg); } return new AttrImpl(this, name, this.factory); }
/** * Retrieves an attribute node by local name and namespace URI. * * @see org.w3c.dom.Element#getAttributeNodeNS(String, String) */ public Attr getAttributeNodeNS(String namespaceURI, String localName) { if (OMConstants.XMLNS_NS_URI.equals(namespaceURI)) { OMNamespace ns = this.findNamespaceURI(localName); String nsuri = ns != null ? ns.getNamespaceURI() : ""; AttrImpl namespaceAttr = new AttrImpl(this.ownerNode, localName, nsuri, this.factory); NamespaceImpl xmlNs = new NamespaceImpl(OMConstants.XMLNS_NS_URI); namespaceAttr.setOMNamespace(xmlNs); return namespaceAttr; } return (this.attributes == null) ? null : (Attr) this.attributes .getNamedItemNS(namespaceURI, localName); }
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); }
/** * @param attributeName * @param attrValue * @param soapEnvelopeNamespaceURI */ protected void setAttribute(String attributeName, String attrValue, String soapEnvelopeNamespaceURI) { OMAttribute omAttribute = this.getAttribute( new QName(soapEnvelopeNamespaceURI, attributeName)); if (omAttribute != null) { omAttribute.setAttributeValue(attrValue); } else { OMAttribute attribute = new AttrImpl(this.ownerNode, attributeName, new NamespaceImpl(soapEnvelopeNamespaceURI, SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX), attrValue, this.factory); this.addAttribute(attribute); } }
public void setAttribute(String name, String value) throws DOMException { // Check for invalid charaters if (!DOMUtil.isQualifiedName(name)) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null); throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg); } if (name.startsWith(OMConstants.XMLNS_NS_PREFIX + ":")) { // This is a ns declaration this.declareNamespace(value, DOMUtil.getLocalName(name)); } else if (name.equals(OMConstants.XMLNS_NS_PREFIX)) { this.declareDefaultNamespace(value); } else { this.setAttributeNode(new AttrImpl(this.ownerNode, name, value, this.factory)); } }
&& !prefix.equals(OMConstants.XMLNS_NS_PREFIX)) { OMNamespace ns = (OMNamespace) this.namespaces.get(prefix); AttrImpl attr = new AttrImpl(this.ownerNode, prefix, ns .getNamespaceURI(), this.factory); attr.setOMNamespace(new NamespaceImpl( AttrImpl attr = new AttrImpl(this.ownerNode, "xmlns", this.namespace.getNamespaceURI(), this.factory); attr.setOMNamespace(new NamespaceImpl(
/** * 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); } }
private void internalSerializeLocal(XMLStreamWriter writer2) throws XMLStreamException { MTOMXMLStreamWriter writer = (MTOMXMLStreamWriter) writer2; if (!this.isBinary) { writeOutput(writer); } else { if (writer.isOptimized()) { if (contentID == null) { contentID = writer.getNextContentId(); } // send binary as MTOM optimised this.attribute = new AttrImpl(this.ownerNode, "href", new NamespaceImpl("", ""), "cid:" + getContentID(), this.factory); this.serializeStartpart(writer); writer.writeOptimized(this); writer.writeEndElement(); } else { writer.writeCharacters(this.getText()); } } }
NamespaceImpl ns = new NamespaceImpl(namespaceURI, DOMUtil .getPrefix(qualifiedName)); AttrImpl attr = new AttrImpl((DocumentImpl) this .getOwnerDocument(), DOMUtil .getLocalName(qualifiedName), ns, value, this.factory); return tempAttr; } else { AttrImpl attr = new AttrImpl((DocumentImpl) this .getOwnerDocument(), qualifiedName, value, this.factory); this.attributes.setNamedItem(attr);