Here you can find the source of setAttribute(Element targetElem, String name, String value)
protected static void setAttribute(Element targetElem, String name, String value)
//package com.java2s; /******************************************************************************* * Copyright (c) 2015 Bruno Medeiros and other Contributors. * 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:/* w w w. j a va 2s . c o m*/ * Bruno Medeiros - initial API and implementation *******************************************************************************/ import org.w3c.dom.Element; public class Main { protected static void setAttribute(Element targetElem, String name, String value) { if (value != null) { targetElem.setAttribute(name, value); } } }