protected Attr getNullNode(Document ownerDocument) { if (nullNode == null) { try { nullNode = ownerDocument.createAttributeNS( Constants.NamespaceSpecNS, XMLNS); nullNode.setValue(""); } catch (Exception e) { throw new RuntimeException("Unable to create nullNode: " + e); } } return nullNode; }
public static void putAt(Element self, String property, Object value) { if (property.startsWith("@")) { String attributeName = property.substring(1); Document doc = self.getOwnerDocument(); Attr newAttr = doc.createAttribute(attributeName); newAttr.setValue(value.toString()); self.setAttributeNode(newAttr); return; } InvokerHelper.setProperty(self, property, value); }
Name = XMLNS + ":" + NName; Attr n = e.getOwnerDocument().createAttributeNS("http://www.w3.org/2000/xmlns/", Name); n.setValue(NValue); ns.addMapping(NName, NValue, n);
/** * {@inheritDoc} */ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException { Keywords words = (Keywords) samlObject; if (words.getXMLLang() != null) { Attr attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), SAMLConstants.XML_NS, LangBearing.XML_LANG_ATTR_LOCAL_NAME, SAMLConstants.XML_PREFIX); attribute.setValue(words.getXMLLang()); domElement.setAttributeNodeNS(attribute); } }
private static void declare(Element node, String uri, String prefix) { String qualname; if (prefix != null && prefix.length() > 0) { qualname = "xmlns:" + prefix; } else { qualname = "xmlns"; } Attr attr = node.getOwnerDocument().createAttributeNS(XML_NS, qualname); attr.setValue(uri); node.setAttributeNodeNS(attr); } public static XMLStreamReader createXMLStreamReader(InputSource src) {
protected void setLocalIdAttribute(String attrName, String value) { if (value != null) { Attr attr = getDocument().createAttributeNS(null, attrName); attr.setValue(value); getElement().setAttributeNodeNS(attr); getElement().setIdAttributeNode(attr, true); } else { getElement().removeAttributeNS(null, attrName); } }
attr.setValue(attrValue); element.setAttributeNodeNS(attr); attr.setValue(attrValue); element.setAttributeNode(attr);
/** * {@inheritDoc} */ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException { LocalizedURI name = (LocalizedURI) samlObject; if (name.getXMLLang() != null) { Attr attribute = AttributeSupport.constructAttribute(domElement.getOwnerDocument(), XMLConstants.XML_NS, LangBearing.XML_LANG_ATTR_LOCAL_NAME, XMLConstants.XML_PREFIX); attribute.setValue(name.getXMLLang()); domElement.setAttributeNodeNS(attribute); } }
private static void declare(Element node, String uri, String prefix) { String qualname; if (prefix != null && prefix.length() > 0) { qualname = "xmlns:" + prefix; } else { qualname = "xmlns"; } Attr attr = node.getOwnerDocument().createAttributeNS(XML_NS, qualname); attr.setValue(uri); node.setAttributeNodeNS(attr); } public static XMLStreamReader createXMLStreamReader(InputSource src) {
Attr a = doc.createAttributeNS(attUri, attQName); a.setValue(attrs.getValue(i)); e.setAttributeNodeNS(a);
public static void putAt(Element self, String property, Object value) { if (property.startsWith("@")) { String attributeName = property.substring(1); Document doc = self.getOwnerDocument(); Attr newAttr = doc.createAttribute(attributeName); newAttr.setValue(value.toString()); self.setAttributeNode(newAttr); return; } InvokerHelper.setProperty(self, property, value); }
Name = "xmlns:" + NName; Attr n = e.getOwnerDocument().createAttributeNS("http://www.w3.org/2000/xmlns/", Name); n.setValue(NValue); ns.addMapping(NName, NValue, n);
protected Element writeBodyElement(Document d) { Element envelopeElement = d.createElementNS(Constants.SOAP_NS_ENVELOPE, "s:Envelope"); Attr encodingStyleAttr = d.createAttributeNS(Constants.SOAP_NS_ENVELOPE, "s:encodingStyle"); encodingStyleAttr.setValue(Constants.SOAP_URI_ENCODING_STYLE); envelopeElement.setAttributeNode(encodingStyleAttr); d.appendChild(envelopeElement); Element bodyElement = d.createElementNS(Constants.SOAP_NS_ENVELOPE, "s:Body"); envelopeElement.appendChild(bodyElement); return bodyElement; }
/** * {@inheritDoc} */ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException { LocalizedName name = (LocalizedName) samlObject; if (name.getXMLLang() != null) { Attr attribute = AttributeSupport.constructAttribute(domElement.getOwnerDocument(), XMLConstants.XML_NS, LangBearing.XML_LANG_ATTR_LOCAL_NAME, XMLConstants.XML_PREFIX); attribute.setValue(name.getXMLLang()); domElement.setAttributeNodeNS(attribute); } }
private static void declare(Element node, String uri, String prefix) { String qualname; if (prefix != null && prefix.length() > 0) { qualname = "xmlns:" + prefix; } else { qualname = "xmlns"; } Attr attr = node.getOwnerDocument().createAttributeNS(XML_NS, qualname); attr.setValue(uri); node.setAttributeNodeNS(attr); } public static XMLStreamReader createXMLStreamReader(InputSource src) {
public void writeAttribute(String namespace, String local, String value) throws XMLStreamException { Attr a = document.createAttributeNS(namespace, local); a.setValue(value); ((Element)currentNode).setAttributeNodeNS(a); }
@Override public void setAttribute(String name, String value) { NamedNodeMap attributes = element.getAttributes(); Attr attribute = element.getOwnerDocument().createAttribute(name); attribute.setValue(value); attributes.setNamedItem(attribute); }
Name = "xmlns:" + NName; Attr n = e.getOwnerDocument().createAttributeNS("http://www.w3.org/2000/xmlns/", Name); n.setValue(NValue); ns.addMapping(NName, NValue, n);
protected Element writeBodyElement(Document d) { Element envelopeElement = d.createElementNS(Constants.SOAP_NS_ENVELOPE, "s:Envelope"); Attr encodingStyleAttr = d.createAttributeNS(Constants.SOAP_NS_ENVELOPE, "s:encodingStyle"); encodingStyleAttr.setValue(Constants.SOAP_URI_ENCODING_STYLE); envelopeElement.setAttributeNode(encodingStyleAttr); d.appendChild(envelopeElement); Element bodyElement = d.createElementNS(Constants.SOAP_NS_ENVELOPE, "s:Body"); envelopeElement.appendChild(bodyElement); return bodyElement; }
/** * {@inheritDoc} */ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException { Keywords words = (Keywords) samlObject; if (words.getXMLLang() != null) { Attr attribute = AttributeSupport.constructAttribute(domElement.getOwnerDocument(), XMLConstants.XML_NS, LangBearing.XML_LANG_ATTR_LOCAL_NAME, XMLConstants.XML_PREFIX); attribute.setValue(words.getXMLLang()); domElement.setAttributeNodeNS(attribute); } }