Java tutorial
//package com.java2s; //License from project: Open Source License import javax.xml.stream.Location; import javax.xml.stream.events.*; public class Main { private static String format(String message, XMLEvent event) { Location location = event == null ? null : event.getLocation(); return location == null ? message : (message + " at line " + location.getLineNumber()); } }