Here you can find the source of createElement(String tag, String textContent, Document xml)
Parameter | Description |
---|---|
tag | the tag of the element |
textContent | the text content of the element |
xml | the Document to use to create the element |
public static Element createElement(String tag, String textContent, Document xml)
//package com.java2s; /*// ww w. ja v a 2s . c o m * PackJacket - GUI frontend to IzPack to make Java-based installers * Copyright (C) 2008 - 2009 Amandeep Grewal, Manodasan Wignarajah * * PackJacket is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * PackJacket is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with PackJacket. If not, see <http://www.gnu.org/licenses/>. */ import org.w3c.dom.Document; import org.w3c.dom.Element; public class Main { /** * Creates and returns an element with the specified tag and text content * @param tag the tag of the element * @param textContent the text content of the element * @param xml the Document to use to create the element * @return The element with the specified tag and text content */ public static Element createElement(String tag, String textContent, Document xml) { Element element = xml.createElement(tag); //Sets the text content of the element element.setTextContent(textContent); return element; } }