Java examples for XML:XML Element Value
write xml element start tag, data and end tag into XmlStreamWriter
//package com.java2s; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; public class Main { /**/*from www . ja v a2 s. c o m*/ * write xml element start tag, data and end tag into XmlStreamWriter * * @param writer * @param element * @param value * @throws XMLStreamException */ public static void writeSimpleDataElement(XMLStreamWriter writer, String element, String value) throws XMLStreamException { writer.writeStartElement(element); writer.writeCharacters(value); writer.writeEndElement(); } }