@Override public void setNodeValue(String nodeValue) throws DOMException { element.setNodeValue(nodeValue); }
// Creating a DOMSource Object for the request DocumentBuilder db = DocumentBuilderFactory.newDocumentBuilder(); Document requestDoc = db.newDocument(); Element root = requestDoc.createElementNS("http://org.apache.cxf/stockExample", "getStockPrice"); root.setNodeValue("DOW"); DOMSource request = new DOMSource(requestDoc);
public TuscanyEPR(QName processName, Endpoint endpoint) { Element serviceref = doc.createElementNS(EndpointReference.SERVICE_REF_QNAME.getNamespaceURI(), EndpointReference.SERVICE_REF_QNAME.getLocalPart()); serviceref.setNodeValue(endpoint.serviceName + ":" + endpoint.portName); doc.appendChild(serviceref); }
public Element createElementSetValue(String elementName, String value) { Element element = this.responseDocument.createElementNS(DAV_NAMESPACE_URI, elementName); element.appendChild(element.getOwnerDocument().createTextNode(value)); element.setNodeValue(value); return element; }
final Document docToSave = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); final Element fileInfo = docToSave.createElement("fileInfo"); docToSave.appendChild(fileInfo); final Element fileName = docToSave.createElement("fileName"); fileName.setNodeValue("filename.bin"); fileInfo.appendChild(fileName); return docToSave;
DocumentBuilderFactory df = DocumentBuilderFactory.newInstance(); DocumentBuilder documentBuilder = df.newDocumentBuilder(); Document doc = documentBuilder.newDocument(); Element root = doc.createElement("RootElement"); doc.appendChild(root); Element child = doc.createElement("ChildElement"); child.setNodeValue("Hello World"); root.appendChild(child); TransformerFactory tf = TransformerFactory.newInstance(); Transformer transformer = tf.newTransformer(); StreamResult resultStream = new StreamResult(response.getOutputStream()); transformer.transform(new DOMSource(doc), resultStream);
/** * @see org.w3c.dom.Node#setNodeValue(String) */ public void setNodeValue(String arg0) throws DOMException { getCurrentInternal().setNodeValue(arg0); }
/** * @see org.w3c.dom.Node#setNodeValue(String) */ @Override public void setNodeValue(String arg0) { original.get().setNodeValue(arg0); }
public EndpointReference activateMyRoleEndpoint(QName processId, Endpoint myRoleEndpoint) { final Document doc = DOMUtils.newDocument(); Element serviceref = doc.createElementNS(EndpointReference.SERVICE_REF_QNAME.getNamespaceURI(), EndpointReference.SERVICE_REF_QNAME.getLocalPart()); serviceref.setNodeValue(myRoleEndpoint.serviceName +":" +myRoleEndpoint.portName); doc.appendChild(serviceref); return new EndpointReference() { public Document toXML() { return doc; } }; }
DocumentBuilderFactory df = DocumentBuilderFactory.newInstance(); DocumentBuilder documentBuilder = df.newDocumentBuilder(); Document doc = documentBuilder.newDocument(); Element root = doc.createElement("RootElement"); doc.appendChild(root); Element child = doc.createElement("ChildElement"); child.setNodeValue("Hello World"); root.appendChild(child); TransformerFactory tf = TransformerFactory.newInstance(); Transformer transformer = tf.newTransformer(); File f = new File("c:\\temp\\dummy.xml"); StreamResult resultStream = new StreamResult(f); transformer.transform(new DOMSource(doc), resultStream);
/** * @see org.w3c.dom.Node#setNodeValue(String) */ @Override public void setNodeValue(String arg0) { original.get().setNodeValue(arg0); }
/** * @see org.w3c.dom.Node#setNodeValue(String) */ public void setNodeValue(String arg0) throws DOMException { getAtualInterno().setNodeValue(arg0); }
@Override public void setNodeValue(String nodeValue) throws DOMException { final Element elem = getElement(); if (elem != null) elem.setNodeValue(nodeValue); }
/** * * @param name * @param definitionURI * @return */ private Element createCSymbol(String name, String definitionURI) { lastElementCreated = document.createElement("csymbol"); lastElementCreated.setAttribute("encoding", "text"); lastElementCreated.setAttribute("definitionURL", definitionURI); lastElementCreated.setNodeValue(writeName(name)); //lastElementCreated.setTextContent(writeName(name)); return lastElementCreated; }
public void updateElementValue(String s) { try { xmlElement.setNodeValue(s); } catch (DOMException ex) { NodeList nodelist = xmlElement.getChildNodes(); int i = nodelist == null ? 0 : nodelist.getLength(); if (i > 0) { for (int j = 0; j < i; j++) if (nodelist.item(j) instanceof Text) { ((Text) nodelist.item(j)).setData(s); return; } } else { xmlElement.appendChild(factory.document.createTextNode(s)); } } }
/** * * @param name * @return */ private ASTNodeValue createCiElement(String name) { lastElementCreated = document.createElement("ci"); lastElementCreated.setNodeValue(writeName(name.trim())); //lastElementCreated.setTextContent(writeName(name.trim())); return new ASTNodeValue(lastElementCreated, this); }
protected static void setElementValue(Element element, String value) { String s = element.getNodeValue(); if (s != null) { element.setNodeValue(value); return; } NodeList nodelist = element.getChildNodes(); for (int i = 0; i < nodelist.getLength(); i++) if (nodelist.item(i) instanceof Text) { Text text = (Text) nodelist.item(i); text.setData(value); return; } return; }
private org.w3c.dom.Element createElement(String value){ org.w3c.dom.Element elem = w3cDocument.createElementNS(WSDL11_NS, "documentation"); String prefix = getNamespacePrefix(WSDL11_NS); elem.setPrefix(prefix); elem.setNodeValue(value); return elem; }
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; Element newNode; String newValue; doc = (Document) load("hc_staff", true); newNode = doc.createElement("acronym"); newValue = newNode.getNodeValue(); assertNull("initiallyNull", newValue); newNode.setNodeValue("This should have no effect"); newValue = newNode.getNodeValue(); assertNull("nullAfterAttemptedChange", newValue); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; Element newNode; String newValue; doc = (Document) load("staff", true); newNode = doc.createElement("address"); newValue = newNode.getNodeValue(); assertNull("initiallyNull", newValue); newNode.setNodeValue("This should have no effect"); newValue = newNode.getNodeValue(); assertNull("nullAfterAttemptedChange", newValue); } /**