Here you can find the source of write_plain_content_tag(String name, String content, AttributesImpl atts, TransformerHandler hd)
Parameter | Description |
---|---|
name | The name of the tag. |
content | The context of the tag. |
atts | An attributesImpl instance, a structure needed for performance. |
hd | The transformer handler. |
Parameter | Description |
---|---|
SAXException | an exception |
public static void write_plain_content_tag(String name, String content, AttributesImpl atts, TransformerHandler hd) throws SAXException
//package com.java2s; /*/*from www . j a v a2 s . c o m*/ * utils-java8 * Copyright (C) 2014 Raffaele Ragni * * This program 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. * * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. */ import javax.xml.transform.sax.TransformerHandler; import org.xml.sax.SAXException; import org.xml.sax.helpers.AttributesImpl; public class Main { /** * Writes a normal tag containing a text only. * * @param name The name of the tag. * @param content The context of the tag. * @param atts An attributesImpl instance, a structure needed for * performance. * @param hd The transformer handler. * * @throws SAXException */ public static void write_plain_content_tag(String name, String content, AttributesImpl atts, TransformerHandler hd) throws SAXException { if (name != null && content != null) { atts.clear(); hd.startElement("", "", name, atts); hd.characters(content.toCharArray(), 0, content.length()); hd.endElement("", "", name); } } }