Here you can find the source of isEventStartOrEndElementWithMatchingName(XMLEvent event, QName elementName)
static boolean isEventStartOrEndElementWithMatchingName(XMLEvent event, QName elementName)
//package com.java2s; import javax.xml.namespace.QName; import javax.xml.stream.events.XMLEvent; public class Main { static boolean isEventStartOrEndElementWithMatchingName(XMLEvent event, QName elementName) { if (event == null) throw new IllegalArgumentException("Event may not be null."); QName eventElementName = null; if (event.isStartElement()) eventElementName = event.asStartElement().getName(); else if (event.isEndElement()) eventElementName = event.asEndElement().getName(); else/*from w ww.j ava 2s. c om*/ return false; if (eventElementName.equals(elementName)) return true; return false; } }