case XMLStreamConstants.END_ENTITY:
case END_ENTITY:
  public static void main(String[] args)    throws Exception  {    boolean xIncludeAware = false;    if (args.length > 1 && "-x".equals(args[1]))      xIncludeAware = true;    XMLParser p = new XMLParser(new java.io.FileInputStream(args[0]),                                absolutize(null, args[0]),                                true, // validating                                true, // namespaceAware                                true, // coalescing,                                true, // replaceERefs                                true, // externalEntities                                true, // supportDTD                                true, // baseAware                                true, // stringInterning                                null,                                null);    XMLStreamReader reader = p;    if (xIncludeAware)      reader = new XIncludeFilter(p, args[0], true, true, true);    try      {        int event;        //do        while (reader.hasNext())          {            event = reader.next();            Location loc = reader.getLocation();            System.out.print(loc.getLineNumber()+":"+loc.getColumnNumber()+" ");            switch (event)              {              case XMLStreamConstants.START_DOCUMENT:                System.out.println("START_DOCUMENT version="+reader.getVersion()+                                   " encoding="+reader.getEncoding());                break;              case XMLStreamConstants.END_DOCUMENT:                System.out.println("END_DOCUMENT");                break;              case XMLStreamConstants.START_ELEMENT:                System.out.println("START_ELEMENT "+reader.getName());                int l = reader.getNamespaceCount();                for (int i = 0; i < l; i++)                  System.out.println("\tnamespace "+reader.getNamespacePrefix(i)+                                     "='"+reader.getNamespaceURI(i)+"'");                l = reader.getAttributeCount();                for (int i = 0; i < l; i++)                  System.out.println("\tattribute "+reader.getAttributeQName(i)+                                     "='"+reader.getAttributeValue(i)+"'");                break;              case XMLStreamConstants.END_ELEMENT:                System.out.println("END_ELEMENT "+reader.getName());                break;              case XMLStreamConstants.CHARACTERS:                System.out.println("CHARACTERS '"+encodeText(reader.getText())+"'");                break;              case XMLStreamConstants.CDATA:                System.out.println("CDATA '"+encodeText(reader.getText())+"'");                break;              case XMLStreamConstants.SPACE:                System.out.println("SPACE '"+encodeText(reader.getText())+"'");                break;              case XMLStreamConstants.DTD:                System.out.println("DTD "+reader.getText());                break;              case XMLStreamConstants.ENTITY_REFERENCE:                System.out.println("ENTITY_REFERENCE "+reader.getText());                break;              case XMLStreamConstants.COMMENT:                System.out.println("COMMENT '"+encodeText(reader.getText())+"'");                break;              case XMLStreamConstants.PROCESSING_INSTRUCTION:                System.out.println("PROCESSING_INSTRUCTION "+reader.getPITarget()+                                   " "+reader.getPIData());                break;              case XMLStreamConstants.START_ENTITY:                System.out.println("START_ENTITY "+reader.getText());                break;              case XMLStreamConstants.END_ENTITY:                System.out.println("END_ENTITY "+reader.getText());                break;              default:                System.out.println("Unknown event: "+event);              }          }      }    catch (XMLStreamException e)      {        Location l = reader.getLocation();        System.out.println("At line "+l.getLineNumber()+                           ", column "+l.getColumnNumber()+                           " of "+l.getLocationURI());        throw e;      }  }