Here you can find the source of writeInsertPos(XMLStreamWriter w, boolean isBefore, int[] pos)
private static void writeInsertPos(XMLStreamWriter w, boolean isBefore, int[] pos) throws XMLStreamException
//package com.java2s; //License from project: LGPL import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; public class Main { private static void writeInsertPos(XMLStreamWriter w, boolean isBefore, int[] pos) throws XMLStreamException { if (isBefore) w.writeEmptyElement("before"); else/*from w w w . ja v a 2s . c om*/ w.writeEmptyElement("after"); w.writeAttribute("begin_line", Integer.toString(pos[0])); w.writeAttribute("begin_col", Integer.toString(pos[1])); w.writeAttribute("end_line", Integer.toString(pos[0])); w.writeAttribute("end_col", Integer.toString(pos[1])); } }