views:

63

answers:

1

Hi,

The text below is the dump of a multidimensional array, dumped by the var_dump() PHP function. I need a Java function that reads a file with a content like this (attached) and returns it in XML.

For a reference, in site http://pear.php.net/package/Var_Dump/ you can find the code (in PHP) that generates dumps in XML, so all neeeded logic is there (I think).

I will be waiting for your feedback.

Regards, Christian

array(1) { ["Processo"]=> array(60) { ["Sistema"]=> string(6) "E-PROC" ["UF"]=> string(2) "RS" ["DataConsulta"]=> string(19) "11/05/2010 17:59:17" ["Processo"]=> string(20) "50000135320104047100" ["NumRegistJudici"]=> string(20) "50000135320104047100" ["IdProcesso"]=> string(30) "711262958983115560390000000001" ["SeqProcesso"]=> string(1) "1" ["Autuado"]=> string(19) "08/01/2010 12:04:47" ["StatusProcesso"]=> string(1) "M" ["ComSituacaoProcesso"]=> string(2) "00" ["Situacao"]=> string(9) "MOVIMENTO" ["IdClasseJudicial"]=> string(10) "0000000112" ["DesClasse"]=> string(18) "INQUÉRITO POLICIAL" ["CodClasse"]=> string(6) "000120" ["SigClasse"]=> string(3) "INQ" ["DesTipoInquerito"]=> string(0) "" ["CodCompetencia"]=> string(2) "21" ["IdLocalidadeJudicial"]=> string(4) "7150" ["ClasseSigAutor"]=> string(5) "AUTOR" ["ClasseDesAutor"]=> string(5) "AUTOR" ["ClasseSigReu"]=> string(7) "INDICDO" ["ClasseDesReu"]=> string(9) "INDICIADO" ["ClasseCodReu"]=> string(2) "64" ["TipoAcao"]=> string(8) "Criminal" ["TipoProcessoJudicial"]=> string(1) "2" ["CodAssuntoPrincipal"]=> string(6) "051801" ["CodLocalidadeJudicial"]=> string(2) "00" ["IdAssuntoPrincipal"]=> string(4) "1504" ["IdLocalizadorOrgaoPrincipal"]=> string(30) "711264420823128430420000000001" ["ChaveConsulta"]=> string(12) "513009403710" ["NumAdministrativo"]=> NULL ["Magistrado"]=> string(28) "RICARDO HUMBERTO SILVA BORNE" ["IdOrgaoJuizo"]=> string(9) "710000085" ["IdOrgaoJuizoOriginario"]=> string(9) "710000085" ["DesOrgaoJuizo"]=> string(45) "JUÍZO FED. DA 02A VF CRIMINAL DE PORTO ALEGRE" ["SigOrgaoJuizo"]=> string(10) "RSPOACR02F" ["CodOrgaoJuizo"]=> string(9) "RS0000085" ["IdOrgaoSecretaria"]=> string(9) "710000084" ["DesOrgaoSecretaria"]=> string(31) "02a VF CRIMINAL DE PORTO ALEGRE" ["SigOrgaoSecretaria"]=> string(9) "RSPOACR02" ["CodOrgaoSecretaria"]=> string(9) "RS0000084" ["IdSigilo"]=> string(1) "0" ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["DesSigilo"]=> string(10) "Sem Sigilo" ["Localizador"]=> string(25) "EM TRÂMITE ENTRE PF E MPF" ["TotalCda"]=> int(0) ["DesIpl"]=> string(8) "012/2010" ["Assunto"]=> array(1) { [0]=> array(4) { ["IdAssuntoJudicial"]=> string(4) "1504" ["SeqAssunto"]=> string(1) "1" ["CodAssunto"]=> string(6) "051801" ["DesAssunto"]=> string(84) "Moeda Falsa / Assimilados (arts. 289 e parágrafos e 290), Crimes contra a Fé Pública" } } ["ParteAutor"]=> array(1) { [0]=> array(12) { ["IdPessoa"]=> string(30) "771230778800100040000000000508" ["TipoPessoa"]=> string(3) "ENT" ["Nome"]=> string(15) "POLÍCIA FEDERAL" ["Identificacao"]=> string(14) "79621439000191" ["SinPartePrincipal"]=> string(1) "S" ["IdProcessoParte"]=> string(30) "711262958983115560390000000002" ["IdProcessoParteAtributo"]=> NULL ["IdRepresentacao"]=> NULL ["TipoRepresentacao"]=> NULL ["AtributosProcessoParte"]=> NULL ["Relacao"]=> NULL ["Procurador"]=> array(6) { [0]=> array(4) { ["Nome"]=> string(25) "SOLON RAMOS CARDOSO FILHO" ["Sigla"]=> string(13) "cor-sr-dpf-rs" ["IdUsuarioProcurador"]=> string(30) "711262893271855450420000000001" ["TipoUsuario"]=> string(3) "CPF" } [1]=> array(4) { ["Nome"]=> string(18) "LUCIANA IOP CECHIN" ["Sigla"]=> string(11) "luciana.lic" ["IdUsuarioProcurador"]=> string(30) "711262946806708880420000000001" ["TipoUsuario"]=> string(3) "CPF" } [2]=> array(4) { ["Nome"]=> string(31) "ALEXANDRE DA SILVEIRA ISBARROLA" ["Sigla"]=> string(15) "drcor-sr-dpf-rs" ["IdUsuarioProcurador"]=> string(30) "711262949451860560420000000001" ["TipoUsuario"]=> string(3) "CPF" } [3]=> array(4) { ["Nome"]=> string(24) "JUCÉLIA TERESINHA PISONI" ["Sigla"]=> string(11) "jucelia.jtp" ["IdUsuarioProcurador"]=> string(30) "711262950492275450420000000001" ["TipoUsuario"]=> string(3) "CPF" } [4]=> array(4) { ["Nome"]=> string(32) "MARCOS ANTONIO SIQUEIRA PICININI" ["Sigla"]=> string(13) "picinini.masp" ["IdUsuarioProcurador"]=> string(30) "711262951173995330420000000001" ["TipoUsuario"]=> string(3) "APF" } [5]=> array(4) { ["Nome"]=> string(20) "PRISCILLA BURLACENKO" ["Sigla"]=> string(12) "priscilla.pb" ["IdUsuarioProcurador"]=> string(30) "711262955631630740420000000001" ["TipoUsuario"]=> string(3) "DPF" } } } } ["ParteReu"]=> array(1) { [0]=> array(11) { ["IdPessoa"]=> string(30) "711262958983115560390000000001" ["TipoPessoa"]=> string(2) "PF" ["Nome"]=> string(8) "A APURAR" ["Identificacao"]=> NULL ["SinPartePrincipal"]=> string(1) "S" ["IdProcessoParte"]=> string(30) "711262958983115560390000000001" ["IdProcessoParteAtributo"]=> NULL ["IdRepresentacao"]=> NULL ["TipoRepresentacao"]=> NULL ["AtributosProcessoParte"]=> NULL ["Relacao"]=> NULL } } ["OutraParte"]=> array(1) { [0]=> array(10) { ["Nome"]=> string(26) "MINISTÉRIO PÚBLICO FEDERAL" ["CodTipoParte"]=> string(3) "114" ["DesTipoParte"]=> string(3) "MPF" ["SinPolo"]=> string(1) "N" ["Identificacao"]=> string(13) "3636198000192" ["SinPartePrincipal"]=> string(1) "N" ["IdProcessoParte"]=> string(30) "711262958983115560390000000003" ["IdPessoa"]=> string(30) "771230778800100040000000000217" ["TipoPessoa"]=> string(3) "ENT" ["Procurador"]=> array(1) { [0]=> array(4) { ["Nome"]=> string(25) "MARIA VALESCA DE MESQUITA" ["IdUsuarioProcurador"]=> string(30) "711265220162198740420000000001" ["TipoUsuario"]=> string(1) "P" ["Sigla"]=> string(5) "pr528" } } } } ["DadoComplementar"]=> array(6) { [0]=> array(5) { ["DesDadoComplem"]=> string(21) "Antecipação de Tutela" ["ValorDadoComplem"]=> string(13) "Não Requerida" ["IdDadoComplementar"]=> string(1) "1" ["NumIdProcessoDadoComplem"]=> string(30) "711262958983115560390000000003" ["IdDadoComplementarValor"]=> string(1) "4" } [1]=> array(5) { ["DesDadoComplem"]=> string(16) "Justiça Gratuita" ["ValorDadoComplem"]=> string(13) "Não Requerida" ["IdDadoComplementar"]=> string(1) "4" ["NumIdProcessoDadoComplem"]=> string(30) "711262958983115560390000000001" ["IdDadoComplementarValor"]=> string(1) "3" } [2]=> array(5) { ["DesDadoComplem"]=> string(15) "Petição Urgente" ["ValorDadoComplem"]=> string(3) "Não" ["IdDadoComplementar"]=> string(1) "5" ["NumIdProcessoDadoComplem"]=> string(30) "711262958983115560390000000004" ["IdDadoComplementarValor"]=> string(1) "2" } [3]=> array(5) { ["DesDadoComplem"]=> string(22) "Prioridade Atendimento" ["ValorDadoComplem"]=> string(3) "Não" ["IdDadoComplementar"]=> string(1) "2" ["NumIdProcessoDadoComplem"]=> string(30) "711262958983115560390000000006" ["IdDadoComplementarValor"]=> string(1) "2" } [4]=> array(5) { ["DesDadoComplem"]=> string(9) "Réu Preso" ["ValorDadoComplem"]=> string(3) "Não" ["IdDadoComplementar"]=> string(1) "6" ["NumIdProcessoDadoComplem"]=> string(30) "711262958983115560390000000002" ["IdDadoComplementarValor"]=> string(1) "2" } [5]=> array(5) { ["DesDadoComplem"]=> string(24) "Vista Ministério Público" ["ValorDadoComplem"]=> string(3) "Sim" ["IdDadoComplementar"]=> string(1) "3" ["NumIdProcessoDadoComplem"]=> string(30) "711262958983115560390000000005" ["IdDadoComplementarValor"]=> string(1) "1" } } ["SemPrazoAbrir"]=> bool(true) ["Evento"]=> array(8) { [0]=> array(18) { ["IdProcessoEvento"]=> string(30) "711269271039215440420000000001" ["IdEvento"]=> string(3) "228" ["IdTipoPeticaoJudicial"]=> string(3) "166" ["SeqEvento"]=> string(1) "8" ["DataHora"]=> string(19) "22/03/2010 12:19:16" ["SinExibeDesEvento"]=> string(1) "S" ["SinUsuarioInterno"]=> string(1) "N" ["IdGrupoEvento"]=> string(1) "4" ["SinVisualizaDocumentoExterno"]=> string(1) "N" ["Complemento"]=> string(7) "90 DIAS" ["DesEventoSemComplemento"]=> string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]=> string(10) "0000000852" ["DesEvento"]=> string(37) "PETIÇÃO PROTOCOLADA JUNTADA - 90 DIAS" ["DesAlternativaEvento"]=> NULL ["Usuario"]=> string(7) "ap18785" ["idUsuario"]=> string(30) "711263330517182580420000000001" ["DesPeticao"]=> string(25) "DILAÇÃO DE PRAZO DEFERIDA" ["DescricaoCompleta"]=> string(75) "PETIÇÃO PROTOCOLADA JUNTADA - 90 DIAS - DILAÇÃO DE PRAZO DEFERIDA - 90 DIAS" } [1]=> array(18) { ["IdProcessoEvento"]=> string(30) "711269032501923580420000000001" ["IdEvento"]=> string(3) "228" ["IdTipoPeticaoJudicial"]=> string(3) "166" ["SeqEvento"]=> string(1) "7" ["DataHora"]=> string(19) "19/03/2010 18:04:59" ["SinExibeDesEvento"]=> string(1) "S" ["SinUsuarioInterno"]=> string(1) "N" ["IdGrupoEvento"]=> string(1) "4" ["SinVisualizaDocumentoExterno"]=> string(1) "N" ["Complemento"]=> string(7) "90 DIAS" ["DesEventoSemComplemento"]=> string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]=> string(10) "0000000852" ["DesEvento"]=> string(37) "PETIÇÃO PROTOCOLADA JUNTADA - 90 DIAS" ["DesAlternativaEvento"]=> NULL ["Usuario"]=> string(5) "pr700" ["idUsuario"]=> string(30) "711262976146980920420000000002" ["DesPeticao"]=> string(25) "DILAÇÃO DE PRAZO DEFERIDA" ["DescricaoCompleta"]=> string(75) "PETIÇÃO PROTOCOLADA JUNTADA - 90 DIAS - DILAÇÃO DE PRAZO DEFERIDA - 90 DIAS" } [2]=> array(19) { ["IdProcessoEvento"]=> string(30) "711268077089625240420000000001" ["IdEvento"]=> string(3) "228" ["IdTipoPeticaoJudicial"]=> string(3) "165" ["SeqEvento"]=> string(1) "6" ["DataHora"]=> string(19) "08/03/2010 16:55:48" ["SinExibeDesEvento"]=> string(1) "N" ["SinUsuarioInterno"]=> string(1) "N" ["IdGrupoEvento"]=> string(1) "4" ["SinVisualizaDocumentoExterno"]=> string(1) "N" ["Complemento"]=> NULL ["DesEventoSemComplemento"]=> string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]=> string(10) "0000000852" ["DesEvento"]=> string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["DesAlternativaEvento"]=> NULL ["Usuario"]=> string(13) "picinini.masp" ["idUsuario"]=> string(30) "711262951173995330420000000001" ["Documento"]=> array(2) { [0]=> array(6) { ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["IdDocumento"]=> string(30) "711268077089625240420000000001" ["SeqDocumento"]=> string(1) "1" ["SigTipoDocumento"]=> string(4) "CERT" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } [1]=> array(6) { ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["IdDocumento"]=> string(30) "711268077089625240420000000002" ["SeqDocumento"]=> string(1) "2" ["SigTipoDocumento"]=> string(4) "DESP" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } } ["DesPeticao"]=> string(26) "PEDIDO DE DILAÇÃO DE PRAZO" ["DescricaoCompleta"]=> string(26) "PEDIDO DE DILAÇÃO DE PRAZO" } [3]=> array(19) { ["IdProcessoEvento"]=> string(30) "711267732906972600420000000001" ["IdEvento"]=> string(3) "228" ["IdTipoPeticaoJudicial"]=> string(2) "52" ["SeqEvento"]=> string(1) "5" ["DataHora"]=> string(19) "04/03/2010 17:20:29" ["SinExibeDesEvento"]=> string(1) "N" ["SinUsuarioInterno"]=> string(1) "N" ["IdGrupoEvento"]=> string(1) "4" ["SinVisualizaDocumentoExterno"]=> string(1) "N" ["Complemento"]=> NULL ["DesEventoSemComplemento"]=> string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]=> string(10) "0000000852" ["DesEvento"]=> string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["DesAlternativaEvento"]=> NULL ["Usuario"]=> string(5) "pr700" ["idUsuario"]=> string(30) "711262976146980920420000000002" ["Documento"]=> array(1) { [0]=> array(6) { ["IdUsuario"]=> string(30) "711262976146980920420000000002" ["IdDocumento"]=> string(30) "711267732906972600420000000001" ["SeqDocumento"]=> string(1) "1" ["SigTipoDocumento"]=> string(3) "PET" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } } ["DesPeticao"]=> string(7) "PETIÇÃO" ["DescricaoCompleta"]=> string(7) "PETIÇÃO" } [4]=> array(19) { ["IdProcessoEvento"]=> string(30) "711265889365256290420000000001" ["IdEvento"]=> string(3) "228" ["IdTipoPeticaoJudicial"]=> string(3) "165" ["SeqEvento"]=> string(1) "4" ["DataHora"]=> string(19) "11/02/2010 09:59:04" ["SinExibeDesEvento"]=> string(1) "N" ["SinUsuarioInterno"]=> string(1) "N" ["IdGrupoEvento"]=> string(1) "4" ["SinVisualizaDocumentoExterno"]=> string(1) "N" ["Complemento"]=> NULL ["DesEventoSemComplemento"]=> string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]=> string(10) "0000000852" ["DesEvento"]=> string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["DesAlternativaEvento"]=> NULL ["Usuario"]=> string(13) "picinini.masp" ["idUsuario"]=> string(30) "711262951173995330420000000001" ["Documento"]=> array(2) { [0]=> array(6) { ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["IdDocumento"]=> string(30) "711265222866995860420000000001" ["SeqDocumento"]=> string(1) "1" ["SigTipoDocumento"]=> string(4) "PORT" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } [1]=> array(6) { ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["IdDocumento"]=> string(30) "711265222866995860420000000002" ["SeqDocumento"]=> string(1) "2" ["SigTipoDocumento"]=> string(3) "OUT" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } } ["DesPeticao"]=> string(26) "PEDIDO DE DILAÇÃO DE PRAZO" ["DescricaoCompleta"]=> string(26) "PEDIDO DE DILAÇÃO DE PRAZO" } [5]=> array(19) { ["IdProcessoEvento"]=> string(30) "711263991150788270420000000001" ["IdEvento"]=> string(3) "228" ["IdTipoPeticaoJudicial"]=> string(2) "52" ["SeqEvento"]=> string(1) "3" ["DataHora"]=> string(19) "20/01/2010 10:50:05" ["SinExibeDesEvento"]=> string(1) "N" ["SinUsuarioInterno"]=> string(1) "N" ["IdGrupoEvento"]=> string(1) "4" ["SinVisualizaDocumentoExterno"]=> string(1) "N" ["Complemento"]=> NULL ["DesEventoSemComplemento"]=> string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]=> string(10) "0000000852" ["DesEvento"]=> string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["DesAlternativaEvento"]=> NULL ["Usuario"]=> string(13) "picinini.masp" ["idUsuario"]=> string(30) "711262951173995330420000000001" ["Documento"]=> array(4) { [0]=> array(6) { ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["IdDocumento"]=> string(30) "711263991150788270420000000001" ["SeqDocumento"]=> string(1) "1" ["SigTipoDocumento"]=> string(4) "DECL" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } [1]=> array(6) { ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["IdDocumento"]=> string(30) "711263991150788270420000000002" ["SeqDocumento"]=> string(1) "2" ["SigTipoDocumento"]=> string(4) "DECL" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } [2]=> array(6) { ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["IdDocumento"]=> string(30) "711263991150788270420000000003" ["SeqDocumento"]=> string(1) "3" ["SigTipoDocumento"]=> string(4) "DECL" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } [3]=> array(6) { ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["IdDocumento"]=> string(30) "711263991150788270420000000004" ["SeqDocumento"]=> string(1) "4" ["SigTipoDocumento"]=> string(4) "DECL" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } } ["DesPeticao"]=> string(7) "PETIÇÃO" ["DescricaoCompleta"]=> string(7) "PETIÇÃO" } [6]=> array(19) { ["IdProcessoEvento"]=> string(30) "711263955058688620420000000001" ["IdEvento"]=> string(3) "228" ["IdTipoPeticaoJudicial"]=> string(2) "52" ["SeqEvento"]=> string(1) "2" ["DataHora"]=> string(19) "20/01/2010 00:40:39" ["SinExibeDesEvento"]=> string(1) "N" ["SinUsuarioInterno"]=> string(1) "N" ["IdGrupoEvento"]=> string(1) "4" ["SinVisualizaDocumentoExterno"]=> string(1) "N" ["Complemento"]=> NULL ["DesEventoSemComplemento"]=> string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]=> string(10) "0000000852" ["DesEvento"]=> string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["DesAlternativaEvento"]=> NULL ["Usuario"]=> string(13) "picinini.masp" ["idUsuario"]=> string(30) "711262951173995330420000000001" ["Documento"]=> array(6) { [0]=> array(6) { ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["IdDocumento"]=> string(30) "711263229632249660420000000001" ["SeqDocumento"]=> string(1) "1" ["SigTipoDocumento"]=> string(3) "OUT" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } [1]=> array(6) { ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["IdDocumento"]=> string(30) "711263229632249660420000000002" ["SeqDocumento"]=> string(1) "2" ["SigTipoDocumento"]=> string(3) "OUT" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } [2]=> array(6) { ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["IdDocumento"]=> string(30) "711263229632249660420000000003" ["SeqDocumento"]=> string(1) "3" ["SigTipoDocumento"]=> string(3) "OUT" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } [3]=> array(6) { ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["IdDocumento"]=> string(30) "711263229632249660420000000004" ["SeqDocumento"]=> string(1) "4" ["SigTipoDocumento"]=> string(3) "OUT" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } [4]=> array(6) { ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["IdDocumento"]=> string(30) "711263229632249660420000000005" ["SeqDocumento"]=> string(1) "5" ["SigTipoDocumento"]=> string(3) "OUT" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } [5]=> array(6) { ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["IdDocumento"]=> string(30) "711263229632249660420000000006" ["SeqDocumento"]=> string(1) "6" ["SigTipoDocumento"]=> string(3) "OUT" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } } ["DesPeticao"]=> string(7) "PETIÇÃO" ["DescricaoCompleta"]=> string(7) "PETIÇÃO" } [7]=> array(19) { ["IdProcessoEvento"]=> string(30) "711262958983115560390000000001" ["IdEvento"]=> string(3) "430" ["IdTipoPeticaoJudicial"]=> NULL ["SeqEvento"]=> string(1) "1" ["DataHora"]=> string(19) "08/01/2010 12:04:47" ["SinExibeDesEvento"]=> NULL ["SinUsuarioInterno"]=> string(1) "N" ["IdGrupoEvento"]=> string(1) "0" ["SinVisualizaDocumentoExterno"]=> string(1) "N" ["Complemento"]=> NULL ["DesEventoSemComplemento"]=> string(56) "Distribuição/Atribuição Ordinária por sorteio eletrônico" ["CodEvento"]=> string(6) "030101" ["DesEvento"]=> string(56) "Distribuição/Atribuição Ordinária por sorteio eletrônico" ["DesAlternativaEvento"]=> NULL ["Usuario"]=> string(13) "picinini.masp" ["idUsuario"]=> string(30) "711262951173995330420000000001" ["Documento"]=> array(4) { [0]=> array(6) { ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["IdDocumento"]=> string(30) "711262956008922510390000000001" ["SeqDocumento"]=> string(1) "1" ["SigTipoDocumento"]=> string(4) "PORT" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } [1]=> array(6) { ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["IdDocumento"]=> string(30) "711262956008922510390000000002" ["SeqDocumento"]=> string(1) "2" ["SigTipoDocumento"]=> string(4) "OFIC" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } [2]=> array(6) { ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["IdDocumento"]=> string(30) "711262956008922510390000000003" ["SeqDocumento"]=> string(1) "3" ["SigTipoDocumento"]=> string(3) "OUT" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } [3]=> array(6) { ["IdUsuario"]=> string(30) "711262951173995330420000000001" ["IdDocumento"]=> string(30) "711262956008922510390000000004" ["SeqDocumento"]=> string(1) "4" ["SigTipoDocumento"]=> string(3) "OUT" ["IdSigilo"]=> string(1) "0" ["DesSigilo"]=> string(10) "Sem Sigilo" } } ["DesPeticao"]=> string(56) "Distribuição/Atribuição Ordinária por sorteio eletrônico" ["DescricaoCompleta"]=> string(56) "Distribuição/Atribuição Ordinária por sorteio eletrônico" } } ["ValCausa"]=> string(4) "0.00" ["OrgaoJul"]=> string(45) "JUÍZO FED. DA 02A VF CRIMINAL DE PORTO ALEGRE" ["CodOrgaoJul"]=> string(9) "RS0000085" ["OrgaoColegiado"]=> NULL ["CodOrgaoColegiado"]=> NULL ["CodOrgaoColegiadoSecretaria"]=> NULL } }

+1  A: 

Is there a particular reason that you're married to that format?

If not, consider using something more standard. You could have php output the data as JSON (using json_encode()) -- you should be able to decode the json into native Java data structures easily enough, and then code away in java to generate your XML.

If you are married to the var_dump()'d output, then I'm afraid you'll have to do some ugly parsing in Java. var_dump() is really tuned to producing human-readable output -- so parsing could become tricky.

timdev
Hi there,Thanks for your reply.Yes, I am married to that format.Actually, the transactional system that sends us this kind of output is developed in PHP, and our solution is developed in Java.As there are many business rules involved and the business logic layer is mixed with the visual layer - and they do not want to redevelop these business rules in Java for the moment... They suggested sending us the output in an array. So I have to post a request to the webserver, the PHP page returns this array in an HTML page that I have to parse.Best Regards, Christian
Christian
That sucks. It's probably worth it to ask them to use `echo json_encode($data)` rather than `var_dump($data)`. It be a very quick change on their end, and save you a bunch of time, since I'm sure you can find an off-the-shelf JSON parser for java. If they refuse, they're being jerks, and you'll be on your own, I'm afraid. But really, all they need to change is the var_dump line to use json_encode.
timdev