From d0afba319f95f0059d201c6b7cbfbc3322f2c0f6 Mon Sep 17 00:00:00 2001 From: jestin Date: Tue, 1 Aug 2006 09:24:10 +0000 Subject: Adding a correct example of translator in XML documentation update cleanup of IvyClient for Ping Pong --- examples/TranslateXML.java | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'examples/TranslateXML.java') diff --git a/examples/TranslateXML.java b/examples/TranslateXML.java index b7ec8fb..9dc3283 100644 --- a/examples/TranslateXML.java +++ b/examples/TranslateXML.java @@ -8,6 +8,8 @@ * this program is LGPL ... etc etc * * New: + * 1.2.12 + * leaving NanoXML in favor to the full featured xpath etc... * 1.2.6 * get compatible with new Ivy version * 1.2.3 @@ -16,10 +18,14 @@ * */ import fr.dgac.ivy.* ; +import gnu.getopt.Getopt; import java.io.* ; -import net.n3.nanoxml.*; import java.util.*; -import gnu.getopt.Getopt; +import javax.xml.parsers.*; +import javax.xml.xpath.*; +import org.xml.sax.*; +import org.w3c.dom.*; + class TranslateXML { @@ -42,19 +48,16 @@ class TranslateXML { private void parseFile(String filename) { try { - IXMLParser parser = XMLParserFactory.createDefaultXMLParser(); - IXMLReader reader = StdXMLReader.fileReader(filename); - parser.setReader(reader); - IXMLElement xml = (IXMLElement) parser.parse(); - // checks if everything is OK - // XMLWriter writer = new XMLWriter(System.out); - // writer.write(xml); - Vector translations = xml.getChildrenNamed("translate"); - for (int i=0;i