OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   [Announce] Koala XML activities

[ Lists Home | Date Index | Thread Index ]
  • From: "Philippe Le Hégaret" <Philippe.Le_Hegaret@sophia.inria.fr>
  • To: "XML Developers' List" <xml-dev@ic.ac.uk>
  • Date: Tue, 22 Sep 1998 10:28:09 +0200

Hello,

 I am please to announce a new XML service on the Web.
  http://koala.inria.fr:8080/

 The goal of the Koala XML services is to show our
current work on XML.
 Current services are :

 - an XML validation service. This is my own work.
the current version has some troubles with entities.

 - an XSL engine by Jeremy Calles.
the current version doesn't support formatting objects 
yet. This web service can be invoked directly by the
XSLOnline Java program (see attachment).

 Hope you will find this helpful,

Jeremy Calles and Philippe Le Hegaret.
-------
Have fun with Koalas! :-)
http://www.inria.fr/koala/
import java.net.*;
import java.io.*;

/**
 * This class is a little tool to invoke the XSLEngine.
 * 
 */
public class XSLOnline {

    public static String baseURL = "http://koala.inria.fr:8080/Java/XSLEngine?";

    public static void main(String[] args) {
	try {
	    if ((!args[0].equals("-r")) || (args.length > 3)) {
		throw new ArrayIndexOutOfBoundsException();
	    }
	    String command = "";
	    command += "XMLuri=" + args[2];
	    command += "&XSLuri=" + args[1];
	    
	    URL url = new URL(baseURL + command);

	    InputStream in = openStream(url);
	    int i = 0;
	    
	
	    while ((i = in.read()) != -1) {
		System.err.print( (char) i );
	    }
	} catch (ArrayIndexOutOfBoundsException e) {
	    System.err.println("XSLOnline v 1.0 - "
			       + "jcalles@sophia.inria.fr");
	    System.err.println("Usage: -r xslUrl [xmlUrl]");
	} catch (FileNotFoundException e) {
	    System.err.println("File not found: " + e.getMessage());
	} catch (IOException e) {
	    System.err.println("I/O Error: " + e.getMessage());
	} catch (Exception e) {
	    System.err.println("Error: ");
	    System.err.println(e.toString());
	}
    }

    private static InputStream openStream(URL url) throws IOException {
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestProperty("Pragma", "no-cache"); // @@deprecated
        connection.setRequestProperty("Cache-Control", "no-cache");
        connection.setRequestProperty("Accept", "text/plain");
        connection.setRequestProperty("User-Agent", "Koala_XSLOnline/1.0");

	if (connection.getResponseCode() !=  HttpURLConnection.HTTP_OK) {
	    if (connection.getResponseMessage() != null) {
		throw new IOException(url + ": " + 
				      connection.getResponseMessage());
	    } else {
		throw new IOException(url + ": " + 
				      connection.getResponseCode());
	    }
	}
	return connection.getInputStream();
    }
}




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS