|
|
Stefan Ram wrote:
Martin Honnen <mahotrash@xxxxxxxx> writes:
Java 6 has XMLStreamWriter
Often, people use »tag« for »element«.
Here, it seems to be the other way round:
xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a");
xtw.writeAttribute("href", " www.java2s.com"">http://www.java2s.com");
xtw.writeCharacters("here");
xtw.writeEndElement();
. It seems as »writeEndElement« is supposed
to write the end /tag/, i.e., "</a>".
So, more correct names to me would be:
»writeEndTag()«,
»writeEndOfElement()«, or
»writeElementEnding()«.
You're not writing tags with this, you're writing /events/.
So writeStartElement means you are sending the StartElement
/event/ into the stream. writeEndElement means you are
sending the EndElement /event/ into the stream.
When using XMLStreamWriter, you must remember that you are
acting as the parser.
--
Tony Lavinio <> DataDirect <> Stylus Studio XML <> alavinio@xxxxxxxxxxxx
XQuery, XSLT, XML Schema and EDI Toolset <> www.stylusstudio.com/">http://www.stylusstudio.com/
<> There is no problem that brute force and ignorance cannot overcome <>
|
|