Here you can find the source of setTextValue(Node aNode, String aValue)
Parameter | Description |
---|---|
aNode | a parameter |
aValue | a parameter |
public static void setTextValue(Node aNode, String aValue)
//package com.java2s; /******************************************************************************* * Copyright (c) 2011 www.isandlatech.com (www.isandlatech.com) * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*from w w w. j a va2s. c o m*/ * ogattaz (isandlaTech) - initial API and implementation *******************************************************************************/ import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.Text; public class Main { /** * * @param aNode * @param aValue */ public static void setTextValue(Node aNode, String aValue) { Document wDocument = aNode.getOwnerDocument(); Text wText = wDocument.createTextNode(aValue); aNode.appendChild(wText); } }