FileDocCategorySizeDatePackage
CallFile.javaAPI DocExample761Fri Feb 01 13:08:52 GMT 2002None

CallFile.java

import gnu.xml.pipeline.*;
import gnu.xml.util.Resolver;
import org.xml.sax.*;
import org.xml.sax.helpers.XMLReaderFactory;

/**
 * Exchanging XML with Server (GNU Pipeline Version)
 */
public class CallFile
{
    // argv [0] == in.xml (file name)
    // argv [1] == url for posting service
    public static void main (String argv [])
    {
	try {
	    EventConsumer	out;
	    XMLReader		in;

	    out = new TextConsumer (System.out);
	    out = new NSFilter (out);
	    out = new CallFilter (argv [1], out);
	    out = new NSFilter (out);

	    in = XMLReaderFactory.createXMLReader ();
	    EventFilter.bind (in, out);

	    in.parse (Resolver.fileNameToURL (argv [0]));

	} catch (Exception  e) {
	    e.printStackTrace ();
	    System.exit (1);
	}
    }
}