Well, that would have come in handy THIS MORNING! :-)  

-----Original Message-----
From: Howard Lewis Ship [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 03, 2004 10:25 AM
To: [email protected]
Subject: Re: [RESULT] Discard SDL? -- PASSED

I've done most of the work of stripping SDL support out of HiveMind. I
have a ways to go in terms of documentation, the HiveDoc stylesheets,
etc. Time to pitch in, folks!

BTW .. wrote a quicky tool for converting SDL to XML:

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.apache.hivemind.Resource;
import org.apache.hivemind.sdl.SDLDocumentAdaptor;
import org.apache.hivemind.util.FileResource;
import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.XMLSerializer;
import org.w3c.dom.Document;
import org.xml.sax.SAXParseException;

public class ScrapeSDL
{
    public static void main(String[] args)
    {
        for (int i = 0; i < args.length; i++)
            process(args[i]);
    }

    private static void process(String path)
    {
        try
        {

            int lastDotx = path.lastIndexOf('.');

            String newPath = path.substring(0, lastDotx) + ".xml";

            DocumentBuilder builder = getBuilder();

            Resource r = new FileResource(path);

            Document d = parseSDL(builder, r);

            writeDocument(d, new File(newPath));

            System.out.println("OUTPUT: " + newPath);
        }
        catch (Exception ex)
        {
            System.err.println("ERROR processing " + path + ": " + ex);
        }
    }

    private static DocumentBuilder getBuilder() throws
ParserConfigurationException
    {
        DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();

        factory.setIgnoringComments(true);

        return factory.newDocumentBuilder();
    }

    private static Document parseSDL(DocumentBuilder builder, Resource
descriptor)
        throws SAXParseException, IOException
    {
        Document result = builder.newDocument();
        SDLDocumentAdaptor parser = new SDLDocumentAdaptor(result);

        parser.parse(descriptor);

        return result;
    }

    private static void writeDocument(Document document, File file)
throws Exception
    {
        OutputStream out = new FileOutputStream(file);
        BufferedOutputStream buffered = new BufferedOutputStream(out);

        writeDocument(document, buffered);

        buffered.close();

    }

    private static void writeDocument(Document document, OutputStream
out) throws IOException
    {
        XMLSerializer serializer = new XMLSerializer(out, new
OutputFormat(document, null, true));
        serializer.serialize(document);
    }
}


On Tue, 3 Aug 2004 07:46:36 -0400, Howard Lewis Ship <[EMAIL PROTECTED]>
wrote:
> All this divisive talk about SDL vs. XML (vs. ???) is getting to be a
> distraction from what HiveMind is all about. I think people are very
> correct with the idea that the important thing is to minimize the
> *amount* of content in the XML, regardless of the expression of that
> content. That's where we should be concentrating ... and I have a few
> ideas along that line.
> 
> Anyway, a +1 vote indicates that you feel SDL should be stripped out
> of HiveMind (as a failed experment).  I'm cool with that, as long as
> people piitch in to convert the many SDL into XML.
> 
> Howard Lewis Ship: -0 (binding)
> Knut Wannheden: +0 (binding)
> Harish Krishnaswamy: +0 (binding)
> Erik Hatcher: +1 (binding)
> 
> robertj: -1 (non-binding)
> Achim Huegen: +1 (not binding)
> Pablo Lalloni: -1 (non-binidng)
> Marcus Brito: +1 (non-binding)
> James Carman: +1 (non-binding)
> Naresh Sikha: +1 (non-binding)
> 
> OK .. for consensus approval, we need 3 binding +1's and no vetos.
> It's a pretty wild mix, actually ... but it appears that the
> developers are leaning towards removal of SDL and the larger community
> is more emphatic (both ways, but more towards removal).
> 
> 
> --
> Howard M. Lewis Ship
> Independent J2EE / Open-Source Java Consultant
> Creator, Jakarta Tapestry
> Creator, Jakarta HiveMind
> http://howardlewisship.com
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to