private Eventos getEventosArquivoEsocial(Collection<String> xmlEvento) throws SAXException, IOException, ParserConfigurationException { Eventos eventos = new Eventos(); Document doc = null; XMLDocumentBuilderFactory dbf = new XMLDocumentBuilderFactory(); String idEvento = null; for (String xml : xmlEvento) { if (xml != null) { TArquivoEsocial arquivoEsocial = new TArquivoEsocial(); doc = dbf.getDocumentBuilder().parse(new InputSource(new StringReader(xml))); idEvento = xml.substring(xml.indexOf("ID1"), xml.indexOf("ID1") + 36); arquivoEsocial.setId(idEvento); arquivoEsocial.setAny(doc.getDocumentElement()); eventos.getEvento().add(arquivoEsocial); } } return eventos; }
/** * Create an instance of {@link ESocial.EnvioLoteEventos.Eventos } * */ public ESocial.EnvioLoteEventos.Eventos createESocialEnvioLoteEventosEventos() { return new ESocial.EnvioLoteEventos.Eventos(); }