I have the following test to convert an xml doc to objects. If the xml is formatted one way I can parse it, I am trying to get the xml in another format. The last piece of xml is what I am trying to get to. Any suggestions? (Do I have to go with addCallMethod approach?) Thanks.
-Rick ///////////////// here's what I have /////// /////////////////////////////////////////////////////////// Digester digester = new Digester(); digester.push(this); <========== this has method, addEmp digester.setDebug(1); digester.setValidating(false); // Configure the processing rules digester.addObjectCreate("emp-config/EmployerAssnRequest", "testDigester.EmployerAssnRequest", "type"); digester.addSetProperties("emp-config/EmployerAssnRequest"); digester.addSetNext("emp-config/EmployerAssnRequest","addEmp","testDigester. EmployerAssnRequest"); // Process the web application deployment descriptor InputStream input= null; try { input = getClass().getResourceAsStream("/EmployerAssnRequest3.xml"); System.out.println(input); digester.parse(input); } catch (Throwable e) { System.out.println("EmployerAssnRequest3.xml crapped out...."); } finally { if (input != null) input = null; } ///////////////////////////////////// xml looks like this //////////////////////////////////// <?xml version="1.0" encoding="UTF-8"?> <!-- DOCTYPE EmployerAssnRequest SYSTEM "EmployerAssnRequest.dtd" --> <emp-config> <EmployerAssnRequest funtion="foo" returndtd="noway" theType="typeA"/> </emp-config> ///////////////////////////////////// I would like the xml looks like this... //////////////////////////////////// <?xml version="1.0" encoding="UTF-8"?> <!-- DOCTYPE EmployerAssnRequest SYSTEM "EmployerAssnRequest.dtd" --> <emp-config> <EmployerAssnRequest> <function>foo</function> <returndtd>noway</returndtd> <type>typeA</type> </EmployerAssnRequest> </emp-config> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>