I am trying to write an XML element tag that should look like this:
<case type="" player=""/>
My code is:
doc.writeStartElement("case");
doc.writeAttribute("type", type);
doc.writeAttribute("player", "");
doc.writeEndElement();
But, as I expected, a closing tag is added at the end, so it looks like this:
<case type="" player=""></case>
I am trying to write a tag for the closing element but cannot find. Does anyone know how to do this?
source share