[pkg-java] r12324 - in trunk/stylebook: . debian src/org/apache/stylebook src/org/apache/stylebook/printers

Torsten Werner twerner at alioth.debian.org
Thu May 6 20:22:36 UTC 2010


Author: twerner
Date: 2010-05-06 20:22:36 +0000 (Thu, 06 May 2010)
New Revision: 12324

Removed:
   trunk/stylebook/LICENSE.txt
   trunk/stylebook/bin/
   trunk/stylebook/build.bat
   trunk/stylebook/build.xml
   trunk/stylebook/debian/svn-deblayout
   trunk/stylebook/docs/
   trunk/stylebook/src/org/apache/stylebook/AbstractComponent.java
   trunk/stylebook/src/org/apache/stylebook/BasicContext.java
   trunk/stylebook/src/org/apache/stylebook/BasicEngine.java
   trunk/stylebook/src/org/apache/stylebook/BasicEntry.java
   trunk/stylebook/src/org/apache/stylebook/BasicParameters.java
   trunk/stylebook/src/org/apache/stylebook/Component.java
   trunk/stylebook/src/org/apache/stylebook/ComponentFactory.java
   trunk/stylebook/src/org/apache/stylebook/CreationContext.java
   trunk/stylebook/src/org/apache/stylebook/CreationException.java
   trunk/stylebook/src/org/apache/stylebook/Engine.java
   trunk/stylebook/src/org/apache/stylebook/Entry.java
   trunk/stylebook/src/org/apache/stylebook/InitializationException.java
   trunk/stylebook/src/org/apache/stylebook/Loader.java
   trunk/stylebook/src/org/apache/stylebook/LoadingException.java
   trunk/stylebook/src/org/apache/stylebook/Logger.java
   trunk/stylebook/src/org/apache/stylebook/NodeListParameters.java
   trunk/stylebook/src/org/apache/stylebook/Parameters.java
   trunk/stylebook/src/org/apache/stylebook/Parser.java
   trunk/stylebook/src/org/apache/stylebook/Printer.java
   trunk/stylebook/src/org/apache/stylebook/Processor.java
   trunk/stylebook/src/org/apache/stylebook/Producer.java
   trunk/stylebook/src/org/apache/stylebook/Project.java
   trunk/stylebook/src/org/apache/stylebook/ResourceEntry.java
   trunk/stylebook/src/org/apache/stylebook/StreamHandler.java
   trunk/stylebook/src/org/apache/stylebook/StyleBook.java
   trunk/stylebook/src/org/apache/stylebook/URLHandler.java
   trunk/stylebook/src/org/apache/stylebook/data/
   trunk/stylebook/src/org/apache/stylebook/parsers/
   trunk/stylebook/src/org/apache/stylebook/printers/HTMLPrinter.java
   trunk/stylebook/src/org/apache/stylebook/printers/HTMLSerializer.java
   trunk/stylebook/src/org/apache/stylebook/printers/XMLPrinter.java
   trunk/stylebook/src/org/apache/stylebook/processors/
   trunk/stylebook/src/org/apache/stylebook/producers/
   trunk/stylebook/styles/
Modified:
   trunk/stylebook/debian/
Log:
remove unneeded upstream files


Deleted: trunk/stylebook/LICENSE.txt
===================================================================
--- trunk/stylebook/LICENSE.txt	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/LICENSE.txt	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,56 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999 The Apache Software Foundation.  All rights 
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
- *    permission, please contact apache at apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */

Deleted: trunk/stylebook/build.bat
===================================================================
--- trunk/stylebook/build.bat	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/build.bat	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,23 +0,0 @@
- at echo off
-echo Xerces-Java Build System
-echo ------------------------
-
-if "%JAVA_HOME%" == "" goto error
-
-set TOOLS_DIR=../xml-xerces/java/tools
-set LOCALCLASSPATH=%JAVA_HOME%\lib\tools.jar;%TOOLS_DIR%\ant.jar;%TOOLS_DIR%\xerces.jar;%TOOLS_DIR%\xalan.jar;%TOOLS_DIR%\stylebook-1.0-b2.jar;%TOOLS_DIR%\style-apachexml.jar;
-set ANT_HOME=%TOOLS_DIR%
-
-echo Building with classpath %LOCALCLASSPATH%
-echo Starting Ant...
-%JAVA_HOME%\bin\java.exe -Dant.home="%ANT_HOME%" -classpath "%LOCALCLASSPATH%" org.apache.tools.ant.Main %1 %2 %3 %4 %5
-goto end
-
-:error
-echo "ERROR: JAVA_HOME not found in your environment."
-echo "Please, set the JAVA_HOME variable in your environment to match the"
-echo "location of the Java Virtual Machine you want to use."
-
-:end
-set LOCALCLASSPATH=
- at echo on

Deleted: trunk/stylebook/build.xml
===================================================================
--- trunk/stylebook/build.xml	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/build.xml	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,102 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- ===================================================================
-
-   Build file for Stylebook
-
-Notes:
-   This is a build file for use with the Jakarta Ant java build tool.
-
-Installation Instructions:
-   To install Ant on your system, you need to checkout the
-   "jakarta-tools" CVS module. Then you should place the files
-     - ant.jar
-     - projectx-tr2.jar
-     - javac.jar
-   in your classpath. (XML parser abstraction is currently in
-   the todo list, volunteers welcome!)
-
-Build Instructions:
-   To build, run
-
-     java org.apache.tools.ant.Main
-
-   on the directory where this file is located.
-   
-   Note: See build.bat in this directory for info on setting up your classpath
-   to build Stylebook. If you are using the compile2/package2 option to build
-   a version of Stylebook that works with Xalan-J 2, Xalan-J 2 (NOT Xalan-J 1) must be on the 
-   classpath and an up-to-date version of Xerces-J with javax.xml.parsers must also be on the
-   classpath. 
-      Donald Leslie <donald_leslie at lotus.com> 
-      9-11-00
-
-Authors:
-  Stefano Mazzocchi <stefano at apache.org>
-
-Copyright:
-  Copyright (c) 1999 The Apache Software Foundation.
-
-   $Id: build.xml 313292 2004-12-14 15:54:50Z dims $
-
-==================================================================== -->
-
-<project name="Stylebook" default="package2" basedir=".">
-
-  <target name="init">
-	  <property name="name" value="stylebook"/>
-	  <property name="version" value="1.0-b2"/>
- 	  <property name="version-xalan-2" value="1.0-b3_xalan-2"/> <!-- Version to use with Xalan-J 2 -->
-
-	  <property name="build.compiler" value="classic"/>
-	  <property name="debug" value="off"/>
-
-	  <property name="build.dir" value="./build"/>
-	  <property name="build.src" value="${build.dir}/src"/>
-	  <property name="build.dest" value="${build.dir}/classes"/>
-	  <property name="src.dir" value="./src"/>
-	  <property name="bin.dir" value="./bin"/>
-  </target>
-
-  <target name="prepare" depends="init">
-    <mkdir dir="${build.dir}"/>
-    <mkdir dir="${build.src}"/>
-    <mkdir dir="${build.dest}"/>
-    <copy todir="${build.src}">
-      <fileset dir="${src.dir}"/>
-    </copy>
-  </target>
-  
-  <!-- If compiling version to run with Xalan-J 1, must not include Xalan2Processor in the compile.
-       If compiling version to run with Xalan-J 2, must not include XalanProcessor in the compile. -->
-  
-  <target name="compile" depends="prepare">
-    <javac srcdir="${build.src}" excludes="org/apache/stylebook/processors/Xalan2Processor.java" destdir="${build.dest}" classpath="${classpath}" debug="${debug}"/>
-    <copy todir="${build.dest}/org/apache/stylebook/data">
-      <fileset dir="${build.src}/org/apache/stylebook/data"/>
-    </copy>
-  </target>
-
-  <target name="package" depends="compile">
-    <jar jarfile="${bin.dir}/${name}-${version}.jar" basedir="${build.dest}" includes="org/**"/>
-  </target>
-  
-<!--Compile and Package to work with Xalan-J 2 -->
-  <target name="compile2" depends="prepare">
-    <javac srcdir="${src.dir}" excludes="org/apache/stylebook/processors/XalanProcessor.java" destdir="${build.dest}" debug="${debug}">
-        <exclude name="**/org/apache/stylebook/processors/XalanProcessor.java"/>
-    </javac>
-    <copy todir="${build.dest}/org/apache/stylebook/data">
-      <fileset dir="${build.src}/org/apache/stylebook/data"/>
-    </copy>
-  </target>
-  <target name="package2" depends="compile2">
-    <replace file="${build.dest}/org/apache/stylebook/data/engine.xml" token="XalanProcessor" value="Xalan2Processor"/>
-    <jar jarfile="${bin.dir}/${name}-${version-xalan-2}.jar" basedir="${build.dest}" includes="org/**"/>
-  </target>
-
-  <target name="clean">
-    <deltree dir="${build.dir}"/>
-  </target>
-
-</project>


Property changes on: trunk/stylebook/debian
___________________________________________________________________
Added: mergeWithUpstream
   + 1

Deleted: trunk/stylebook/debian/svn-deblayout
===================================================================
--- trunk/stylebook/debian/svn-deblayout	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/debian/svn-deblayout	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,2 +0,0 @@
-buildArea=../../build-area
-origDir=..

Deleted: trunk/stylebook/src/org/apache/stylebook/AbstractComponent.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/AbstractComponent.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/AbstractComponent.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,56 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313195 $ $Date: 1999-11-15 23:08:18 +0100 (mån, 15 nov 1999) $
- */
-public abstract class AbstractComponent implements Component {
-    /** The Engine owning this Component instance. */
-    protected Engine engine=null;
-    /** This component initialization Parameters. */
-    protected Parameters params=null;
-
-    /**
-     * Initialize this component instance.
-     *
-     * @param e The Engine owning this Component instance
-     * @param p This component initialization Parameters
-     */
-    public void init(Engine e, Parameters p)
-    throws InitializationException {
-        if (e==null) throw new NullPointerException("Null Engine");
-        if (p==null) throw new NullPointerException("Null Parameters");
-        this.engine=e;
-        this.params=p;
-        this.debug("Initializing");
-    }
-
-    /**
-     * Report a debug message to the owning Engine.
-     *
-     * @param msg The debug message to report.
-     */
-    protected void debug(String message) {
-        this.engine.debug(this, message);
-    }
-
-    /**
-     * Report a log message to the owning Engine.
-     *
-     * @param msg The log message to report.
-     */
-    protected void log(String message) {
-        this.engine.log(this, message);
-    }
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/BasicContext.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/BasicContext.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/BasicContext.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,39 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.net.URL;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313202 $ $Date: 1999-11-30 13:28:55 +0100 (tis, 30 nov 1999) $
- */
-public class BasicContext extends BasicParameters implements CreationContext {
-    /** Our Source */
-    private URL source=null;
-    /** Our Target */
-    private String target=null;
-
-    public BasicContext(URL source, String target) {
-        super();
-        this.source=source;
-        this.target=target;
-    }
-
-    public URL getSourceURL() {
-        return(this.source);
-    }
-
-    public String getTargetName() {
-        return(this.target);
-    }
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/BasicEngine.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/BasicEngine.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/BasicEngine.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,200 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313202 $ $Date: 1999-11-30 13:28:55 +0100 (tis, 30 nov 1999) $
- */
-public class BasicEngine implements Engine {
-    /** Our Parser instance */
-    private Parser parser=null;
-    /** The Producer table */
-    private Hashtable producers=new Hashtable();
-    /** The Processor table */
-    private Hashtable processors=new Hashtable();
-    /** The Printers table */
-    private Hashtable printers=new Hashtable();
-    /** The Logger instance */
-    private Logger logger=null;
-    /** The debug() activation flag */
-    private boolean debug=false;
-
-    /**
-     * Create a new instance of this Engine.
-     *
-     * @param parser The name of the Parser class used to read configuration.
-     * @param cont The SystemID of the configuration file.
-     * @param logger The Logger used by this Engine.
-     */
-    public BasicEngine(String parser, URL conf, Logger logger)
-    throws InitializationException {
-        super();
-        // Check the Logger
-        if (logger==null)
-            throw new InitializationException("No Logger instance specified");
-        else this.logger=logger;
-        // Parse the configuration file with the specified Parser
-        Parser pars=ComponentFactory.getParser(parser);
-        pars.init(this,new BasicParameters());
-        Document d=null;
-        try {
-            if ((d=pars.parse(conf))==null)
-                throw new InitializationException("Parser returned null doc");
-        } catch (Exception e) {
-            throw new InitializationException("Cannot parse configurations \""+
-                                              conf+"\"");
-        }
-        // Step thru the different elements to configure the engine
-        this.logger.log(this,"Initializing");
-        Element e=d.getDocumentElement();
-        if (!e.getTagName().equals("engine"))
-            throw new InitializationException("Conf don't begin with <engine>");
-        NodeList l=e.getChildNodes();
-        for (int x=0; x<l.getLength(); x++) {
-            if (l.item(x).getNodeType()!=Node.ELEMENT_NODE) continue;
-            Element n=(Element)l.item(x);
-            String t=n.getTagName();
-            if (t.equals("debug"))
-                if(n.getAttribute("enabled").equalsIgnoreCase("true"))
-                    this.debug=true;
-                else this.debug=false;
-            else if (t.equals("parser")) configureParser(n);
-            else if (t.equals("producer")) configureProducer(n);
-            else if (t.equals("processor")) configureProcessor(n);
-            else if (t.equals("printer")) configurePrinter(n);
-            else throw new InitializationException("Unknown Element <"+t+">");
-        }
-        if(this.parser==null) this.parser=pars;
-    }
-
-    /** Configure the Parser from a givent Element */
-    private void configureParser(Element e)
-    throws InitializationException {
-        if (this.parser!=null)
-            throw new InitializationException("Parser already configured");
-        String classname=e.getAttribute("class");
-        this.parser=ComponentFactory.getParser(classname);
-        this.parser.init(this,new NodeListParameters(e.getChildNodes()));
-    }
-
-    /** Configure a Producer from a givent Element */
-    private void configureProducer(Element e)
-    throws InitializationException {
-        String name=e.getAttribute("name");
-        String cls=e.getAttribute("class");
-        if(name.length()==0)
-            throw new InitializationException("No name specified for Producer");
-        Producer p=ComponentFactory.getProducer(cls);
-        p.init(this,new NodeListParameters(e.getChildNodes()));
-        if(this.producers.put(name,p)!=null)
-            throw new InitializationException("Duplucate Producer \""+
-                                              name+"\"");
-    }
-
-    /** Configure a Processor from a givent Element */
-    private void configureProcessor(Element e)
-    throws InitializationException {
-        String name=e.getAttribute("name");
-        String cls=e.getAttribute("class");
-        if(name.length()==0)
-            throw new InitializationException("No name specified for Processor");
-        Processor p=ComponentFactory.getProcessor(cls);
-        p.init(this,new NodeListParameters(e.getChildNodes()));
-        if(this.processors.put(name,p)!=null)
-            throw new InitializationException("Duplucate Processor \""+
-                                              name+"\"");
-    }
-
-    /** Configure a Printer from a givent Element */
-    private void configurePrinter(Element e)
-    throws InitializationException {
-        String name=e.getAttribute("name");
-        String cls=e.getAttribute("class");
-        if(name.length()==0)
-            throw new InitializationException("No name specified for Printer");
-        Printer p=ComponentFactory.getPrinter(cls);
-        p.init(this,new NodeListParameters(e.getChildNodes()));
-        if(this.printers.put(name,p)!=null)
-            throw new InitializationException("Duplucate Printer \""+
-                                              name+"\"");
-    }
-
-    /**
-     * Return the Parser instance owned by this Engine.
-     *
-     * @return A non-null Parser instance.
-     */
-    public Parser getParser() {
-        return(this.parser);
-    }
-
-    /**
-     * Return a Producer instance associated with the specified name.
-     *
-     * @param name A non-null String representing the Producer name.
-     * @return A non-null Producer instance or null if no Producer is associated
-     *         with the specified name.
-     */
-    public Producer getProducer(String name) {
-        return((Producer)this.producers.get(name));
-    }
-
-    /**
-     * Return a Processor instance associated with the specified name.
-     *
-     * @param name A non-null String representing the Processor name.
-     * @return A non-null Processor instance or null if no Processor is
-     *         associated with the specified name.
-     */
-    public Processor getProcessor(String name) {
-        return((Processor)this.processors.get(name));
-    }
-
-    /**
-     * Return a Printer instance associated with the specified name.
-     *
-     * @param name A non-null String representing the Printer name.
-     * @return A non-null Printer instance or null if no Printer is
-     *         associated with the specified name.
-     */
-    public Printer getPrinter(String name) {
-        return((Printer)this.printers.get(name));
-    }
-
-    /**
-     * Report a debug message to the user.
-     *
-     * @param msg The debug message to report.
-     */
-    public void debug(Object source, String msg) {
-        if(this.debug) this.logger.log(source,msg);
-    }
-
-    /**
-     * Report a log message to the user.
-     *
-     * @param msg The log message to report.
-     */
-    public void log(Object source, String msg) {
-        this.logger.log(source,msg);
-    }
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/BasicEntry.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/BasicEntry.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/BasicEntry.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,85 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.Vector;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313221 $ $Date: 1999-12-01 19:39:14 +0100 (ons, 01 dec 1999) $
- */
-public class BasicEntry extends BasicContext implements Entry {
-    private Producer producer=null;
-    private Printer printer=null;
-    private Vector tasks=new Vector();
-
-    public BasicEntry(Engine e, URL s, String t, Element d, Parameters p)
-    throws LoadingException {
-        super(s,t);
-        String prod=d.getAttribute("producer");
-        String prnt=d.getAttribute("printer");
-        e.debug(this,"Creating Entry Source=\""+s+"\" Target=\""+t+"\""+
-                     " ["+prod+"/"+prnt+"]");
-        if ((this.producer=e.getProducer(prod))==null)
-            throw new LoadingException("Invalid Producer \""+prod+"\"");
-        if ((this.printer=e.getPrinter(prnt))==null)
-            throw new LoadingException("Invalid Printer \""+prnt+"\"");
-        NodeList l=d.getChildNodes();
-        Parameters p2=new NodeListParameters(l).merge(p);
-        for(int x=0;x<l.getLength();x++) {
-            if(l.item(x).getNodeType()!=Node.ELEMENT_NODE) continue;
-            Element el=(Element)l.item(x);
-            if(el.getTagName().equals("parameter")) continue;
-            if(!el.getTagName().equals("processor"))
-                throw new LoadingException("Invalid Tag <"+el.getTagName()+">");
-            Processor proc=e.getProcessor(el.getAttribute("name"));
-            if(proc==null)
-                    throw new LoadingException("Invalid Processr \""+proc+"\"");
-            Parameters par=new NodeListParameters(el.getChildNodes()).merge(p2);
-            this.tasks.add(new Task(proc,par));
-        }
-        this.merge(p2);
-    }
-
-    public void create(OutputStream out)
-    throws IOException, CreationException {
-        Document d=this.producer.produce(this);
-        Enumeration e=this.tasks.elements();
-        while(e.hasMoreElements()) {
-            Task t=(Task)e.nextElement();
-            d=t.processor.process(d,this,t.parameters);
-        }
-        this.printer.print(d,this,out);
-    }
-
-    private class Task {
-        public Processor processor=null;
-        public Parameters parameters=null;
-
-        public Task(Processor proc, Parameters param) {
-            this.processor=proc;
-            this.parameters=param;
-        }
-    }
-    
-    public boolean equals(Entry e) {
-        return(false);
-    }
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/BasicParameters.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/BasicParameters.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/BasicParameters.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,90 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313195 $ $Date: 1999-11-15 23:08:18 +0100 (mån, 15 nov 1999) $
- */
-public class BasicParameters implements Parameters {
-    private Hashtable table=null;
-
-    public BasicParameters() {
-        super();
-        this.table=new Hashtable();
-    }
-
-    /**
-     * Retrieve a value for a specified parameter.
-     *
-     * @param name The parameter name.
-     * @return The parameter value or null if the parameter has no specified
-     *         value.
-     */
-    public String getParameter(String name) {
-        return((String)this.table.get(name));
-    }
-
-    /**
-     * Retrieve a value for a specified parameter.
-     *
-     * @param name The parameter name.
-     * @param def The parameter default value.
-     * @return The parameter value or def if the parameter has no specified
-     *         value.
-     */
-    public String getParameter(String name, String def) {
-        String val=getParameter(name);
-        if (val==null) return(def);
-        else return(val);
-    }
-
-    /**
-     * Get all valid parameter names.
-     *
-     * @return A non-null (maybe empty) Enumeration.
-     */
-    public Enumeration getParameterNames() {
-        return(table.keys());
-    }
-
-    /**
-     * Set or update parameter value.
-     *
-     * @parameter name The parameter name.
-     * @parameter value The parameter value.
-     * @return The old value of the parameter or null.
-     */
-    public String setParameter(String name, String value) {
-        if (value==null) return((String)this.table.remove(name));
-        else return((String)this.table.put(name,value));
-    }
-
-    /**
-     * Merge the values from another Parameters object into this instance.
-     *
-     * @param p The Parameters object from wich values must be retrieved.
-     */
-    public Parameters merge(Parameters p) {
-        if (p==null) return(this);
-        Enumeration e=p.getParameterNames();
-        while (e.hasMoreElements()) {
-            String name=(String)e.nextElement();
-            String value=p.getParameter(name);
-            this.setParameter(name,value);
-        }
-        return(this);
-    }
-}
\ No newline at end of file

Deleted: trunk/stylebook/src/org/apache/stylebook/Component.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/Component.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/Component.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,29 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313195 $ $Date: 1999-11-15 23:08:18 +0100 (mån, 15 nov 1999) $
- */
-public interface Component {
-    /**
-     * Initialize this component instance.
-     *
-     * @param e The Engine owning this Component instance
-     * @param p This component initialization Parameters
-     * @exception InitializationException If this Component instance cannot be
-     *                                    initialized.
-     */
-    public void init(Engine e, Parameters p)
-    throws InitializationException;
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/ComponentFactory.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/ComponentFactory.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/ComponentFactory.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,122 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313195 $ $Date: 1999-11-15 23:08:18 +0100 (mån, 15 nov 1999) $
- */
-public class ComponentFactory {
-    /** Deny construction. */
-    private ComponentFactory() {
-        super();
-    }
-
-    /**
-     * Create a new Component instance.
-     *
-     * @param classname The name of the Component class.
-     * @return A non-null Component instance.
-     * @exception InitializationException If the Component instance cannot be
-     *                                    created.
-     */
-    public static Component getComponent(String classname)
-    throws InitializationException {
-        try {
-            return ((Component)Class.forName(classname).newInstance());
-        } catch (ClassCastException e) {
-            throw new InitializationException("Class \""+classname+
-                                              "\" is not a Component");
-        } catch (InstantiationException e) {
-            throw new InitializationException("Class \""+classname+
-                                              "\" cannot be instantiated");
-        } catch (IllegalAccessException e) {
-            throw new InitializationException("Class \""+classname+
-                                              "\" cannot be accessed");
-        } catch (ClassNotFoundException e) {
-            throw new InitializationException("Class \""+classname+
-                                              "\" not found");
-        }
-    }
-
-    /**
-     * Create a new Parser instance.
-     *
-     * @param classname The name of the Parser class.
-     * @return A non-null Parser instance.
-     * @exception InitializationException If the Parser instance cannot be
-     *                                    created.
-     */
-    public static Parser getParser(String classname)
-    throws InitializationException {
-        try {
-            return ((Parser)getComponent(classname));
-        } catch (ClassCastException e) {
-            throw new InitializationException("Class \""+classname+
-                                              "\" is not a Parser");
-        }
-    }
-
-    /**
-     * Create a new Producer instance.
-     *
-     * @param classname The name of the Producer class.
-     * @return A non-null Producer instance.
-     * @exception InitializationException If the Producer instance cannot be
-     *                                    created.
-     */
-    public static Producer getProducer(String classname)
-    throws InitializationException {
-        try {
-            return ((Producer)getComponent(classname));
-        } catch (ClassCastException e) {
-            throw new InitializationException("Class \""+classname+
-                                              "\" is not a Producer");
-        }
-    }
-
-    /**
-     * Create a new Processor instance.
-     *
-     * @param classname The name of the Processor class.
-     * @return A non-null Processor instance.
-     * @exception InitializationException If the Processor instance cannot be
-     *                                    created.
-     */
-    public static Processor getProcessor(String classname)
-    throws InitializationException {
-        try {
-            return ((Processor)getComponent(classname));
-        } catch (ClassCastException e) {
-            throw new InitializationException("Class \""+classname+
-                                              "\" is not a Processor");
-        }
-    }
-
-    /**
-     * Create a new Printer instance.
-     *
-     * @param classname The name of the Printer class.
-     * @return A non-null Printer instance.
-     * @exception InitializationException If the Printer instance cannot be
-     *                                    created.
-     */
-    public static Printer getPrinter(String classname)
-    throws InitializationException {
-        try {
-            return ((Printer)getComponent(classname));
-        } catch (ClassCastException e) {
-            throw new InitializationException("Class \""+classname+
-                                              "\" is not a Printer");
-        }
-    }
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/CreationContext.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/CreationContext.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/CreationContext.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,23 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.net.URL;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313202 $ $Date: 1999-11-30 13:28:55 +0100 (tis, 30 nov 1999) $
- */
-public interface CreationContext extends Parameters {
-    public URL getSourceURL();
-    public String getTargetName();
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/CreationException.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/CreationException.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/CreationException.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,125 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import org.w3c.dom.Document;
-
-/**
- * A CreationException is thrown whenever an Entry cannot be produced for
- * any reason.
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313195 $ $Date: 1999-11-15 23:08:18 +0100 (mån, 15 nov 1999) $
- */
-public class CreationException extends Exception {
-    private transient Exception exception=null;
-    private transient Document document=null;
-
-    /**
-     * Create a new CreationException instance.
-     */
-    public CreationException() {
-        this(null,null,null);
-    }
-
-    /**
-     * Create a new CreationException instance with a specified detail message.
-     *
-     * @param m The detail message.
-     */
-    public CreationException(String m) {
-        this(m,null,null);
-    }
-
-    /**
-     * Create a new CreationException instance with a specified nested
-     * exception.
-     *
-     * @param e The nested exception.
-     */
-    public CreationException(Exception e) {
-        this(null,e,null);
-    }
-
-    /**
-     * Create a new CreationException instance with a specified invalid
-     * document.
-     *
-     * @param d The invalid document.
-     */
-    public CreationException(Document d) {
-        this(null,null,d);
-    }
-
-    /**
-     * Create a new CreationException instance with a specified detail message
-     * and a specified nested exception.
-     *
-     * @param m The detail message.
-     * @param e The nested exception.
-     */
-    public CreationException(String m, Exception e) {
-        this(m,e,null);
-    }
-
-    /**
-     * Create a new CreationException instance with a specified detail message
-     * and a specified invalid document.
-     *
-     * @param m The detail message.
-     * @param d The invalid document.
-     */
-    public CreationException(String m, Document d) {
-        this(m,null,d);
-    }
-
-    /**
-     * Create a new CreationException instance with a specified nested
-     * exception and a specified invalid document.
-     *
-     * @param e The nested exception.
-     * @param d The invalid document.
-     */
-    public CreationException(Exception e, Document d) {
-        this(null,e,d);
-    }
-
-    /**
-     * Create a new CreationException instance with a specified detail message,
-     * a specified nested exception and a specified invalid document.
-     *
-     * @param m The detail message.
-     * @param e The nested exception.
-     * @param d The invalid document.
-     */
-    public CreationException(String m, Exception e, Document d) {
-        super(m);
-        this.exception=e;
-        this.document=d;
-    }
-
-    /**
-     * Retrieve the nested exception of this CreationException.
-     *
-     * @return The invalid document or null if this wasn't specified.
-     */
-    public Exception getException() {
-        return(this.exception);
-    }
-
-    /**
-     * Retrieve the invalid document of this CreationException.
-     *
-     * @return The invalid document or null if this wasn't specified.
-     */
-    public Document getDocument() {
-        return(this.document);
-    }
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/Engine.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/Engine.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/Engine.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,69 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.util.Enumeration;
-import org.w3c.dom.Document;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313195 $ $Date: 1999-11-15 23:08:18 +0100 (mån, 15 nov 1999) $
- */
-public interface Engine {
-    /**
-     * Return the Parser instance owned by this Engine.
-     *
-     * @return A non-null Parser instance.
-     */
-    public Parser getParser();
-
-    /**
-     * Return a Producer instance associated with the specified name.
-     *
-     * @param name A non-null String representing the Producer name.
-     * @return A non-null Producer instance or null if no Producer is associated
-     *         with the specified name.
-     */
-    public Producer getProducer(String name);
-
-    /**
-     * Return a Processor instance associated with the specified name.
-     *
-     * @param name A non-null String representing the Processor name.
-     * @return A non-null Processor instance or null if no Processor is
-     *         associated with the specified name.
-     */
-    public Processor getProcessor(String name);
-
-    /**
-     * Return a Printer instance associated with the specified name.
-     *
-     * @param name A non-null String representing the Printer name.
-     * @return A non-null Printer instance or null if no Printer is
-     *         associated with the specified name.
-     */
-    public Printer getPrinter(String name);
-
-    /**
-     * Report a debug message to the user.
-     *
-     * @param msg The debug message to report.
-     */
-    public void debug(Object source, String message);
-
-    /**
-     * Report a log message to the user.
-     *
-     * @param msg The log message to report.
-     */
-    public void log(Object source, String message);
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/Entry.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/Entry.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/Entry.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,26 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313221 $ $Date: 1999-12-01 19:39:14 +0100 (ons, 01 dec 1999) $
- */
-public interface Entry {
-    public void create(OutputStream out)
-    throws IOException, CreationException;
-    
-    public boolean equals(Entry e);
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/InitializationException.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/InitializationException.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/InitializationException.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,37 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-/**
- * A InitializationException is thrown whenever a Component cannot be
- * initialized for any reason.
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313195 $ $Date: 1999-11-15 23:08:18 +0100 (mån, 15 nov 1999) $
- */
-public class InitializationException extends Exception {
-    /**
-     * Create a new InitializationException instance.
-     */
-    public InitializationException() {
-        super();
-    }
-
-    /**
-     * Create a new InitializationException instance with a specified detail
-     * message.
-     *
-     * @param m The detail message.
-     */
-    public InitializationException(String m) {
-        super(m);
-    }
-
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/Loader.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/Loader.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/Loader.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,77 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import org.xml.sax.InputSource;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313202 $ $Date: 1999-11-30 13:28:55 +0100 (tis, 30 nov 1999) $
- */
-public class Loader {
-    private Engine engine=null;
-
-    public Loader(Engine e) {
-        this.engine=e;
-    }
-
-    public Project load(URL loader, URL project)
-    throws LoadingException {
-        try {
-            // Parse the project file
-            this.engine.log(this,"Parsing Project file");
-            Document p=this.engine.getParser().parse(project);
-            // Prepare a temporary creationcontext
-            CreationContext c=new BasicContext(project,"");
-            // Parse the loader configuration file
-            this.engine.debug(this,"Parsing Loader configuration");
-            Document d=this.engine.getParser().parse(loader);
-            // Check the parsed loader configuration root element
-            if (!d.getDocumentElement().getTagName().equals("loader"))
-                throw new LoadingException("Loader config is not <loader>");
-            // Apply the different processors
-            NodeList l=d.getDocumentElement().getChildNodes();
-            for(int x=0;x<l.getLength();x++) {
-                if (l.item(x).getNodeType()!=Node.ELEMENT_NODE) continue;
-                p=process(p,(Element)l.item(x),c);
-            }
-            // Create the project
-            Parameters param=new BasicParameters();
-            param.setParameter("stylebook.project",project.toExternalForm());
-            Project pr=new Project(this.engine,p,param,project);
-            return(pr);
-        } catch (IOException e) {
-            this.engine.log(this,"Caught "+e.getClass().getName());
-            throw new LoadingException(e.getMessage());
-        } catch (CreationException e) {
-            this.engine.log(this,"Caught "+e.getClass().getName());
-            throw new LoadingException(e.getMessage());
-        }
-    }
-
-    private Document process(Document d, Element e, CreationContext c)
-    throws IOException, CreationException, LoadingException {
-        if(!e.getTagName().equals("processor"))
-            throw new LoadingException("Unknown element <"+e.getTagName()+">");
-        String name=e.getAttribute("name");
-        Parameters p=new NodeListParameters(e.getChildNodes());
-        d=this.engine.getProcessor(name).process(d,c,p);
-        return(d);
-    }
-}
\ No newline at end of file

Deleted: trunk/stylebook/src/org/apache/stylebook/LoadingException.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/LoadingException.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/LoadingException.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,37 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-/**
- * A LoadingException is thrown whenever the Loaded cannot load and create a
- * project.
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313195 $ $Date: 1999-11-15 23:08:18 +0100 (mån, 15 nov 1999) $
- */
-public class LoadingException extends Exception {
-    /**
-     * Create a new LoadingException instance.
-     */
-    public LoadingException() {
-        super();
-    }
-
-    /**
-     * Create a new LoadingException instance with a specified detail
-     * message.
-     *
-     * @param m The detail message.
-     */
-    public LoadingException(String m) {
-        super(m);
-    }
-
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/Logger.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/Logger.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/Logger.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,25 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313195 $ $Date: 1999-11-15 23:08:18 +0100 (mån, 15 nov 1999) $
- */
-public interface Logger {
-    /**
-     * Report a message to the user.
-     *
-     * @param msg The log message to report.
-     */
-    public void log(Object source, String message);
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/NodeListParameters.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/NodeListParameters.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/NodeListParameters.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,35 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313195 $ $Date: 1999-11-15 23:08:18 +0100 (mån, 15 nov 1999) $
- */
-public class NodeListParameters extends BasicParameters implements Parameters {
-
-    public NodeListParameters(NodeList l) {
-        super();
-        if (l!=null) for (int x=0; x<l.getLength(); x++) {
-            if (l.item(x).getNodeType()!=Node.ELEMENT_NODE) continue;
-            Element e=(Element)l.item(x);
-            if (!e.getTagName().equals("parameter")) continue;
-            this.setParameter(e.getAttribute("name"),e.getAttribute("value"));
-        }
-    }
-}
\ No newline at end of file

Deleted: trunk/stylebook/src/org/apache/stylebook/Parameters.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/Parameters.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/Parameters.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,62 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.util.Enumeration;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313195 $ $Date: 1999-11-15 23:08:18 +0100 (mån, 15 nov 1999) $
- */
-public interface Parameters {
-    /**
-     * Retrieve a value for a specified parameter.
-     *
-     * @param name The parameter name.
-     * @return The parameter value or null if the parameter has no specified
-     *         value.
-     */
-    public String getParameter(String name);
-
-    /**
-     * Retrieve a value for a specified parameter.
-     *
-     * @param name The parameter name.
-     * @param def The parameter default value.
-     * @return The parameter value or def if the parameter has no specified
-     *         value.
-     */
-    public String getParameter(String name, String def);
-
-    /**
-     * Get all valid parameter names.
-     *
-     * @return A non-null (maybe empty) Enumeration.
-     */
-    public Enumeration getParameterNames();
-
-    /**
-     * Set or update parameter value.
-     *
-     * @parameter name The parameter name.
-     * @parameter value The parameter value.
-     * @return The old value of the parameter or null.
-     */
-    public String setParameter(String name, String value);
-
-    /**
-     * Merge the values from another Parameters object into this instance.
-     *
-     * @param p The Parameters object from wich values must be retrieved.
-     */
-    public Parameters merge(Parameters p);
-}
\ No newline at end of file

Deleted: trunk/stylebook/src/org/apache/stylebook/Parser.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/Parser.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/Parser.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,54 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.io.IOException;
-import java.net.URL;
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313202 $ $Date: 1999-11-30 13:28:55 +0100 (tis, 30 nov 1999) $
- */
-public interface Parser extends Component{
-    /**
-     * Parse the specified InputSource.
-     *
-     * @param in The InputSource to parse.
-     * @return A non-null DOM Document object.
-     * @exception IOException If an I/O error occourred accessing the specified
-     *                        System-ID.
-     * @exception CreationException If an error occourred parsing the document.
-     */
-    public Document parse(InputSource in)
-    throws IOException, CreationException;
-
-    /**
-     * Parse the specified InputSource.
-     *
-     * @param in The InputSource to parse.
-     * @return A non-null DOM Document object.
-     * @exception IOException If an I/O error occourred accessing the specified
-     *                        System-ID.
-     * @exception CreationException If an error occourred parsing the document.
-     */
-    public Document parse(URL url)
-    throws IOException, CreationException;
-
-    /**
-     * Create a new empty DOM Document object.
-     *
-     * @return A non-null DOM Document object.
-     */
-    public Document create();
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/Printer.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/Printer.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/Printer.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,25 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import org.w3c.dom.Document;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313195 $ $Date: 1999-11-15 23:08:18 +0100 (mån, 15 nov 1999) $
- */
-public interface Printer extends Component {
-    public void print(Document doc, CreationContext c, OutputStream out)
-    throws CreationException, IOException;
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/Processor.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/Processor.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/Processor.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,24 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.io.IOException;
-import org.w3c.dom.Document;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313195 $ $Date: 1999-11-15 23:08:18 +0100 (mån, 15 nov 1999) $
- */
-public interface Processor extends Component {
-    public Document process(Document doc, CreationContext c, Parameters p)
-    throws CreationException, IOException;
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/Producer.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/Producer.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/Producer.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,24 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.io.IOException;
-import org.w3c.dom.Document;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313195 $ $Date: 1999-11-15 23:08:18 +0100 (mån, 15 nov 1999) $
- */
-public interface Producer extends Component{
-    public Document produce(CreationContext c)
-    throws CreationException, IOException;
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/Project.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/Project.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/Project.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,139 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313221 $ $Date: 1999-12-01 19:39:14 +0100 (ons, 01 dec 1999) $
- */
-public class Project {
-    private Hashtable entries=new Hashtable();
-    private Engine engine=null;
-    private URL urlbase=null;
-
-    public Project(Engine engine, Document project, Parameters parambase, URL u)
-    throws LoadingException, IOException {
-        this.engine=engine;
-        this.urlbase=u;
-        Element root=project.getDocumentElement();
-        if(!root.getTagName().equals("project"))
-            throw new LoadingException("Project does not start with <project>");
-        NodeList l=root.getChildNodes();
-        Parameters parameters=new NodeListParameters(l).merge(parambase);
-        processNodeList(l,this.urlbase,parameters);
-    }
-
-    private void processNodeList(NodeList l, URL urlbase, Parameters parambase)
-    throws LoadingException, IOException {
-        for(int x=0;x<l.getLength();x++) {
-            if(l.item(x).getNodeType()!=Node.ELEMENT_NODE) continue;
-            Element e=(Element)l.item(x);
-            String name=e.getTagName();
-            if(name.equals("parameter")) continue;
-            else if(name.equals("create")) setCreateEntry(e,urlbase,parambase);
-            else if(name.equals("resource")) setResourceEntry(e,urlbase);
-            else if(name.equals("process")) processEntry(e,urlbase,parambase);
-            else throw new LoadingException("Invalid element <"+name+">");
-        }
-    }
-
-    public Enumeration getEntryNames() {
-        return(this.entries.keys());
-    }
-
-    public void create(String name, OutputStream out)
-    throws IOException, CreationException {
-        this.engine.log(this,"Creating \""+name+"\"");
-        Entry e=(Entry)this.entries.get(name);
-        if(e==null) throw new CreationException("No Entry \""+name+"\"");
-        e.create(out);
-    }
-
-    private void setCreateEntry(Element e, URL urlbase, Parameters parambase)
-    throws LoadingException, IOException {
-        URL source=new URL(urlbase,e.getAttribute("source"));
-        String target=e.getAttribute("target");
-        Entry entry=new BasicEntry(this.engine,source,target,e,parambase);
-        Entry old=(Entry)this.entries.put(target,entry);
-        if(old!=null) if(!old.equals(entry))
-            throw new LoadingException("Duplicate Entry \""+target+"\"");
-    }
-
-    private void setResourceEntry(Element e, URL urlbase)
-    throws LoadingException, IOException {
-        URL source=new URL(urlbase,e.getAttribute("source"));
-        String target=e.getAttribute("target");
-        Entry entry=new ResourceEntry(this.engine,source,target);
-        Entry old=(Entry)this.entries.put(target,entry);
-        if(old!=null) if(!old.equals(entry))
-            throw new LoadingException("Duplicate Entry \""+target+"\"");
-    }
-    
-    private void processEntry(Element e, URL urlbase, Parameters parambase)
-    throws LoadingException, IOException {
-        // Get the producer and the source, create a temporary context
-        String prod=e.getAttribute("producer");
-        URL source=new URL(urlbase,e.getAttribute("source"));
-        CreationContext ctx=new BasicContext(source,"");
-        ctx.merge(parambase);
-        // Try to load the producer
-        this.engine.debug(this,"Processing Source=\""+source+"\" ["+prod+"]");
-        Producer producer=this.engine.getProducer(prod);
-        if (producer==null)
-            throw new LoadingException("Invalid Producer \""+prod+"\"");
-        // Get local parameters
-        NodeList l=e.getChildNodes();
-        ctx.merge(new NodeListParameters(l));
-        // Try to create the subproject
-        Document doc=null;
-        try {        
-            // Produce the document
-            doc=producer.produce(ctx);
-            // For every processor, generate the project
-            for(int x=0;x<l.getLength();x++) {
-                if(l.item(x).getNodeType()!=Node.ELEMENT_NODE) continue;
-                Element el=(Element)l.item(x);
-                if(el.getTagName().equals("parameter")) continue;
-                if(!el.getTagName().equals("processor"))
-                    throw new LoadingException("Invalid <"+el.getTagName()+">");
-                Processor proc=this.engine.getProcessor(el.getAttribute("name"));
-                if(proc==null)
-                        throw new LoadingException("No Processr \""+proc+"\"");
-                Parameters p=new NodeListParameters(el.getChildNodes()).merge(ctx);
-                doc=proc.process(doc,ctx,p);
-            }
-        } catch (CreationException x) {
-            x.printStackTrace(System.out);
-            throw new LoadingException("Processing Entry ("+x.getMessage()+")");
-        }
-        // Check for proper document
-        if (doc==null) return;
-        // Do as a top-level project recursively
-        Element root=doc.getDocumentElement();
-        if(!root.getTagName().equals("project"))
-            throw new LoadingException("Result of process is not <project>");
-        l=root.getChildNodes();
-        Parameters p=new NodeListParameters(l).merge(ctx);
-        processNodeList(l,source,p);
-
-    }
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/ResourceEntry.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/ResourceEntry.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/ResourceEntry.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,53 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.io.IOException;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URL;
-
-/**
- * 
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313221 $ $Date: 1999-12-01 19:39:14 +0100 (ons, 01 dec 1999) $
- */
-public class ResourceEntry implements Entry {
-    private URL src=null;
-
-    public ResourceEntry(Engine e, URL s, String t) {
-        e.debug(this,"Creating Resource Source=\""+s+"\" Target=\""+t+"\"");
-        this.src=s;
-    }
-
-    public void create(OutputStream o)
-    throws IOException, CreationException {
-        InputStream in=new BufferedInputStream(this.src.openStream());
-        OutputStream out=new BufferedOutputStream(o);
-        int data=-1;
-        while((data=in.read())!=-1) out.write(data);
-        in.close();
-        out.flush();
-    }
-    
-    public boolean equals(Entry e) {
-        try {
-            ResourceEntry r=(ResourceEntry)e;
-            if(r.src.equals(this.src)) return(true);
-            return(false);
-        } catch (Exception x) {
-            return(false);
-        }
-    }
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/StreamHandler.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/StreamHandler.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/StreamHandler.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,50 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313195 $ $Date: 1999-11-15 23:08:18 +0100 (mån, 15 nov 1999) $
- */
-public class StreamHandler {
-    private File base=null;
-
-    public StreamHandler(String base) throws IOException {
-        if(base==null) base=System.getProperty("user.dir");
-        this.base=new File(base).getCanonicalFile();
-        if(!this.base.isDirectory()) {
-            mkdir(this.base);
-        }
-    }
-
-    public OutputStream getOutputStream(String name)
-    throws IOException {
-        File f=new File(name);
-        if (f.isAbsolute()) return new FileOutputStream(f);
-        if (f.getParent()!=null) mkdir(new File(base,f.getParent()));
-        return(new FileOutputStream(new File(base,name)));
-    }
-
-    private void mkdir(File file)
-    throws IOException {
-        if (file==null) return;
-        mkdir(file.getParentFile());
-        if (file.isDirectory()) return;
-        else file.mkdir();
-    }
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/StyleBook.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/StyleBook.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/StyleBook.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,163 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.Properties;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313278 $ $Date: 2000-07-14 20:31:36 +0200 (fre, 14 jul 2000) $
- */
-public class StyleBook implements Logger {
-    /** The project on wich we must operate */
-    private URL project=null;
-    /** Our properties */
-    private Properties properties=null;
-    /** The properties file */
-    private String propertiesfile="org/apache/stylebook/data/stylebook.properties";
-    /** Deny construction */
-    private StyleBook() {}
-
-    /** Create the StyleBook object */
-    private StyleBook(String argv[])
-    throws IOException {
-        super();
-        this.properties=new Properties();
-        ClassLoader loader=this.getClass().getClassLoader();
-        InputStream in=loader.getResourceAsStream(propertiesfile);
-        this.properties.load(in);
-
-        String project=null;
-        String style=null;
-
-        for(int x=0;x<argv.length;x++) {
-            String line=argv[x];
-            int pos=line.indexOf('=');
-            if (pos<0) {
-                if(project!=null) {
-                    if(style!=null) {
-                        exit("Duplicate Style (\""+style+ "\",\""+line+
-                             "\")",1);
-                    } else style=line;
-                } else project=line;
-            } else {
-                String name=line.substring(0,pos);
-                String value=line.substring(pos+1);
-                String old=(String)this.properties.setProperty(name,value);
-                log("Overriding "+name+"=\""+value+"\" (Old=\""+old+"\")");
-            }
-        }
-        if(project==null) exit("Project file non specified",1);
-        if(style==null) exit("Style file non specified",1);
-        File projectFile=new File(project);
-        File styleFile=new File(style);
-        URLHandler u=new URLHandler(projectFile,styleFile);
-        URL.setURLStreamHandlerFactory(u);
-        this.project=new URL("sbk:/sources/"+projectFile.getName());
-        log("Project URL: \""+this.project+"\"");
-    }
-
-    /**
-     * Run StyleBook.
-     *
-     * @param argv Command Line Arguments
-     */
-    public static void main(String argv[]) throws IOException{
-        try {
-            StyleBook sb=new StyleBook(argv);
-            Engine e=sb.getEngine();
-            if (e==null) exit("Error creating engine",3);
-            Project p=sb.getProject(e);
-            if (p==null) exit("Error creating project",3);
-            String targets=sb.properties.getProperty("targetDirectory");
-            StreamHandler s=new StreamHandler(targets);
-            Enumeration n=p.getEntryNames();
-            while (n.hasMoreElements()) {
-                String t=(String)n.nextElement();
-                p.create(t,s.getOutputStream(t));
-            }
-        } catch (CreationException x) {
-            Exception x2=x.getException();
-            if(x2!=null) log(x2);
-            exit(x,255);
-        } catch (Exception x) {
-            exit(x,255);
-        }
-        exit("All done successfully",0);
-    }
-
-    /** Create and Initialize Engine */
-    private Engine getEngine() throws IOException {
-        try {
-            String parser=properties.getProperty("parserClass");
-            URL config=new URL(properties.getProperty("engineConfig"));
-            return(new BasicEngine(parser,config,this));
-        } catch (InitializationException e) {
-            log(e);
-            return(null);
-        }
-    }
-
-    /** Create and Initialize Project */
-    private Project getProject(Engine e) throws IOException {
-        try {
-            Loader l=new Loader(e);
-            URL u=new URL(properties.getProperty("loaderConfig"));
-            return(l.load(u,project));
-        } catch (LoadingException x) {
-            log(x);
-            return(null);
-        }
-    }
-
-/* ************************************************************************** */
-
-    /**
-     * Report a message to the user.
-     *
-     * @param msg The log message to report.
-     */
-    public void log(Object source, String msg) {
-        String cls=source.getClass().getName();
-        cls=cls.substring(cls.lastIndexOf('.')+1);
-        System.out.println("["+cls+"] "+msg);
-    }
-
-    /** Report a message thru System.out */
-    private static void log(String msg) {
-        System.out.println("[StyleBook] "+msg);
-    }
-
-    /** Report an exception thru System.out */
-    private static void log(Exception e) {
-        log("Caught "+e.getClass().getName());
-        e.printStackTrace(System.out);
-    }
-
-    /** Report a message and exit with the specified error number */
-    private static void exit(String msg, int exit) {
-        log(msg);
-        System.exit(exit);
-    }
-
-    /** Report an exception and exit with the specified error number */
-    private static void exit(Exception e, int exit) {
-        log(e);
-        System.exit(exit);
-    }
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/URLHandler.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/URLHandler.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/URLHandler.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,124 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLStreamHandler;
-import java.net.URLStreamHandlerFactory;
-import java.util.zip.ZipFile;
-
-/**
- * The URLHandler class implements URLStreamHandlerFactory, wich is the 
- * factory used by StyleBook to produce URLConnections.<br>
- * Handled by this factory are the &quot;res&quot; protocol (wich handles
- * resources derived from the actual or the system class loaders) and the
- * &quot;sbk&quot; protocol wich handles files in the style name space and the
- * sources name space.
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313217 $ $Date: 1999-12-01 15:21:27 +0100 (ons, 01 dec 1999) $
- */
-public class URLHandler implements URLStreamHandlerFactory {
-    private URL sty=null;
-    private URL src=null;
-    
-    public URLHandler() {
-        super();
-    }
-
-    public URLHandler(File sources, File style)
-    throws IOException {
-        super();
-        if (sources==null) throw new IOException("Null Sources");
-        if (style==null) throw new IOException("Null Style");
-
-        if (style.isDirectory()) {
-            this.sty=style.getCanonicalFile().toURL();
-        } else if (style.exists()) {
-            // Check if it's a proper ZipFile
-            new ZipFile(style).close();
-            this.sty=new URL("jar:"+style.getCanonicalFile().toURL()+"!/");
-        } else throw new IOException("Style File/Directory not found");
-
-        if (sources.isFile()) {
-            this.src=sources.getCanonicalFile().toURL();
-        } else throw new IOException("Sources File/Directory not found");
-    }
-    
-    public URLStreamHandler createURLStreamHandler(String protocol) {
-        if (protocol==null) return(null);
-        try {
-            if (protocol.equalsIgnoreCase("sbk"))
-                return(new StylebookStreamHandler(this.sty,this.src));
-            if (protocol.equalsIgnoreCase("res"))
-                return(new ResourceStreamHandler());
-            else return(null);
-        } catch (IOException e) {
-            return(null);
-        }
-    }
-
-    private class StylebookStreamHandler extends URLStreamHandler {
-        private URL style=null;
-        private URL sources=null;
-
-        private StylebookStreamHandler() {
-            super();
-        }
-
-        private StylebookStreamHandler(URL style, URL sources)
-        throws IOException {
-            this();
-            this.style=style;
-            this.sources=sources;
-        }
-
-        public URLConnection openConnection(URL u) throws IOException {
-            if (u==null) return(null);
-            String file=u.getFile();
-            for(int x=0;x<file.length();x++) if (file.charAt(x)!='/') {
-                file=file.substring(x);
-                break;
-            }
-            if (file.startsWith("style/")) {
-                if (file.length()==6) return(this.style.openConnection());
-                return new URL(this.style,file.substring(6)).openConnection();
-            } else if (file.startsWith("sources/")) {
-                if (file.length()==8) return(this.sources.openConnection());
-                return new URL(this.sources,file.substring(8)).openConnection();
-            } else throw new IOException("Invalid StyleBook URL \""+u+"\"");
-        }
-    }
-
-    private class ResourceStreamHandler extends URLStreamHandler {
-
-        private ResourceStreamHandler() {
-            super();
-        }
-
-        public URLConnection openConnection(URL u) throws IOException {
-            ClassLoader l=this.getClass().getClassLoader();
-            if (l==null) return(null);
-            String file=u.getFile();
-            for(int x=0;x<file.length();x++) if (file.charAt(x)!='/') {
-                file=file.substring(x);
-                break;
-            }
-            URL x=l.getResource(file);
-            if (x==null) x=ClassLoader.getSystemResource(u.getFile());
-            if (x==null) return(null);
-            return(x.openConnection());
-        }
-    }
-}
-    
\ No newline at end of file

Deleted: trunk/stylebook/src/org/apache/stylebook/printers/HTMLPrinter.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/printers/HTMLPrinter.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/printers/HTMLPrinter.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,314 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook.printers;
-
-import org.apache.stylebook.*;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.BufferedWriter;
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Entity;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Notation;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313270 $ $Date: 2000-06-23 23:21:08 +0200 (fre, 23 jun 2000) $
- */
-public class HTMLPrinter extends AbstractComponent implements Printer
-{
-
-    final static String ENCODING = "UTF8";
-
-    /**
-     * Print a DOM Document.
-     *
-     * @param doc The Document to print.
-     * @param out The OutputStream used for printing.
-     * @param env The Environment of this printing request.
-     * @exception IOException If an I/O error occourred accessing resources.
-     * @exception CreationException If the Document cannot be printed.
-     */
-    public void print(Document doc, CreationContext c, OutputStream out)
-    throws CreationException, IOException {       
-        BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(out,ENCODING));
-        printDocument(doc, writer);
-        writer.flush();        
-    }     
-
-
-    /** Process a nodelist calling the appropriate print...() method. */
-    private void printNodeList(NodeList list, BufferedWriter out) throws IOException {
-        for ( int x=0;x<list.getLength();x++ )
-        {
-            Node node=list.item(x);
-            switch ( node.getNodeType() )
-            {
-            case Node.ATTRIBUTE_NODE:
-                printAttribute((Attr)node,out);
-                break;
-            case Node.CDATA_SECTION_NODE:
-                printCDATASection((CDATASection)node,out);
-                break;
-            case Node.COMMENT_NODE:
-                printComment((Comment)node,out);
-                break;
-            case Node.DOCUMENT_FRAGMENT_NODE:
-                printDocumentFragment((DocumentFragment)node,out);
-                break;
-            case Node.DOCUMENT_NODE:
-                printDocument((Document)node,out);
-                break;
-            case Node.DOCUMENT_TYPE_NODE:
-                printDocumentType((DocumentType)node,out);
-                break;
-            case Node.ELEMENT_NODE:
-                printElement((Element)node,out);
-                break;
-            case Node.ENTITY_NODE:
-                printEntity((Entity)node,out);
-                break;
-            case Node.ENTITY_REFERENCE_NODE:
-                printEntityReference((EntityReference)node,out);
-                break;
-            case Node.NOTATION_NODE:
-                printNotation((Notation)node,out);
-                break;
-            case Node.PROCESSING_INSTRUCTION_NODE:
-                printProcessingInstruction((ProcessingInstruction)node,out);
-                break;
-            case Node.TEXT_NODE:
-                printText((Text)node,out);                   
-                break;
-            }
-        }
-    }
-
-    /** Print an ATTRIBUTE (name="value") node. */
-    private void printAttribute(Attr node, BufferedWriter out) throws IOException {
-        out.write(node.getName()+"=\""+node.getValue()+"\"");
-    }
-
-    /** Print a CDATA (<[CDATA[ ... ]]>) node. */
-    private void printCDATASection(CDATASection node, BufferedWriter out) throws IOException {
-        printString(node.getData(),out);
-    }
-
-    /** Print a COMMENT (<!-- ... -->) node. */
-    private void printComment(Comment node, BufferedWriter out) throws IOException {
-        out.write("<!--"+node.getData()+"-->");
-    }
-
-    /** Print a DOCUMENT FRAGMENT (????) node. */
-    private void printDocumentFragment(DocumentFragment node, BufferedWriter out) throws IOException {
-        out.write("<!-- Document Fragment Node -->");
-    }
-
-    /** Print a DOCUMENT node. */
-    private void printDocument(Document node, BufferedWriter out) throws IOException {
-        printNodeList(node.getChildNodes(),out);
-    }
-
-    /** Print a DOCUMENT TYPE (<!DOCTYPE ... bla bla bla>) node. */
-    private void printDocumentType(DocumentType node, BufferedWriter out) throws IOException {
-        out.write("<!-- DOCTYPE "+node.getName()+" -->");
-    }
-
-    /** Print a ELEMENT (do I need to supply the example ??? :) node. */
-    private void printElement(Element node, BufferedWriter out) throws IOException {
-        String tag=node.getTagName().toUpperCase();
-        out.write("<"+tag);
-        // Process attributes
-        NamedNodeMap atts=node.getAttributes();
-        if ( (null!=atts) && (atts.getLength()>0) )
-        {
-            for ( int x=0; x<atts.getLength(); x++ )
-            {
-                out.write(' ');
-                printAttribute((Attr)atts.item(x),out);
-            }
-        }
-        out.write(">");
-        // Process child nodes
-        if ( (null!=node.getChildNodes()) && 
-        (node.getChildNodes().getLength()>0) )
-        {
-            printNodeList(node.getChildNodes(),out);
-        }
-
-        // Print the END tag...
-        if ( tag.equals("AREA") ) return;
-        else if ( tag.equals("BASE") ) return;
-        else if ( tag.equals("BASEFONT") ) return;
-        else if ( tag.equals("BR") ) return;
-        else if ( tag.equals("COL") ) return;
-        else if ( tag.equals("FRAME") ) return;
-        else if ( tag.equals("HR") ) return;
-        else if ( tag.equals("IMG") ) return;
-        else if ( tag.equals("INPUT") ) return;
-        else if ( tag.equals("ISINDEX") ) return;
-        else if ( tag.equals("LINK") ) return;
-        else if ( tag.equals("META") ) return;
-        else if ( tag.equals("PARAM") ) return;
-        out.write("</"+tag+">");
-    }
-
-    /** Print a ENTITY node (NOTE: This should be used with DOCTYPE). */
-    private void printEntity(Entity node, BufferedWriter out) throws IOException {
-        out.write("<!-- Entity Node -->");
-    }
-
-    /** Print a ENTITY REFERENCE node (NOTE: Again, used in within DOCTYPE). */
-    private void printEntityReference(EntityReference node, BufferedWriter out) throws IOException {
-        printString(node.getFirstChild().getNodeValue(),out);
-    }
-
-    /** Print a NOTATION node (NOTE: Again -3rd-, used in within DOCTYPE). */
-    private void printNotation(Notation node, BufferedWriter out) throws IOException {
-        out.write("<!-- Notation Node -->");
-    }
-
-    /** Print a PROCESSING INSTRUCTION (<?name ...?>) node. */
-    private void printProcessingInstruction(ProcessingInstruction node, BufferedWriter out) throws IOException {
-        out.write("<!-- PI:"+node.getTarget()+" "+node.getData()+"-->");
-    }
-
-    /** Print a TEXT (see example for ELEMENT) node. */
-    private void printText(Text node, BufferedWriter out) throws IOException {
-        printString(node.getData(),out);
-    }
-
-    private void printString(String data, BufferedWriter out) throws IOException {
-        for ( int x=0; x<data.length(); x++ )
-        {
-            char c=data.charAt(x);           
-            if ( c=='\n' ) out.write("\n");
-            else if ( c==34 ) out.write("&quot;");
-            else if ( c==38 ) out.write("&amp;");
-            else if ( c==60 ) out.write("&lt;");
-            else if ( c==62 ) out.write("&gt;");
-            else if ( c==8364 ) out.write("&euro;");
-            else if ( (c>=160) && (c<=255) ) switch ( c )
-                {
-                case 160: out.write("&nbsp;");   break;
-                case 161: out.write("&iexcl;");  break;
-                case 162: out.write("&cent;");   break;
-                case 163: out.write("&pound;");  break;
-                case 164: out.write("&curren;"); break;
-                case 165: out.write("&yen;");    break;
-                case 166: out.write("&brvbar;"); break;
-                case 167: out.write("&sect;");   break;
-                case 168: out.write("&uml;");    break;
-                case 169: out.write("&copy;");   break;
-                case 170: out.write("&ordf;");   break;
-                case 171: out.write("&laquo;");  break;
-                case 172: out.write("&not;");    break;
-                case 173: out.write("&shy;");    break;
-                case 174: out.write("&reg;");    break;
-                case 175: out.write("&macr;");   break;
-                case 176: out.write("&deg;");    break;
-                case 177: out.write("&plusmn;"); break;
-                case 178: out.write("&sup2;");   break;
-                case 179: out.write("&sup3;");   break;
-                case 180: out.write("&acute;");  break;
-                case 181: out.write("&micro;");  break;
-                case 182: out.write("&para;");   break;
-                case 183: out.write("&middot;"); break;
-                case 184: out.write("&cedil;");  break;
-                case 185: out.write("&sup1;");   break;
-                case 186: out.write("&ordm;");   break;
-                case 187: out.write("&raquo;");  break;
-                case 188: out.write("&frac14;"); break;
-                case 189: out.write("&frac12;"); break;
-                case 190: out.write("&frac34;"); break;
-                case 191: out.write("&iquest;"); break;
-                case 192: out.write("&Agrave;"); break;
-                case 193: out.write("&Aacute;"); break;
-                case 194: out.write("&Acirc;");  break;
-                case 195: out.write("&Atilde;"); break;
-                case 196: out.write("&Auml;");   break;
-                case 197: out.write("&Aring;");  break;
-                case 198: out.write("&AElig;");  break;
-                case 199: out.write("&Ccedil;"); break;
-                case 200: out.write("&Egrave;"); break;
-                case 201: out.write("&Eacute;"); break;
-                case 202: out.write("&Ecirc;");  break;
-                case 203: out.write("&Euml;");   break;
-                case 204: out.write("&Igrave;"); break;
-                case 205: out.write("&Iacute;"); break;
-                case 206: out.write("&Icirc;");  break;
-                case 207: out.write("&Iuml;");   break;
-                case 208: out.write("&ETH;");    break;
-                case 209: out.write("&Ntilde;"); break;
-                case 210: out.write("&Ograve;"); break;
-                case 211: out.write("&Oacute;"); break;
-                case 212: out.write("&Ocirc;");  break;
-                case 213: out.write("&Otilde;"); break;
-                case 214: out.write("&Ouml;");   break;
-                case 215: out.write("&times;");  break;
-                case 216: out.write("&Oslash;"); break;
-                case 217: out.write("&Ugrave;"); break;
-                case 218: out.write("&Uacute;"); break;
-                case 219: out.write("&Ucirc;");  break;
-                case 220: out.write("&Uuml;");   break;
-                case 221: out.write("&Yacute;"); break;
-                case 222: out.write("&THORN;");  break;
-                case 223: out.write("&szlig;");  break;
-                case 224: out.write("&agrave;"); break;
-                case 225: out.write("&aacute;"); break;
-                case 226: out.write("&acirc;");  break;
-                case 227: out.write("&atilde;"); break;
-                case 228: out.write("&auml;");   break;
-                case 229: out.write("&aring;");  break;
-                case 230: out.write("&aelig;");  break;
-                case 231: out.write("&ccedil;"); break;
-                case 232: out.write("&egrave;"); break;
-                case 233: out.write("&eacute;"); break;
-                case 234: out.write("&ecirc;");  break;
-                case 235: out.write("&euml;");   break;
-                case 236: out.write("&igrave;"); break;
-                case 237: out.write("&iacute;"); break;
-                case 238: out.write("&icirc;");  break;
-                case 239: out.write("&iuml;");   break;
-                case 240: out.write("&eth;");    break;
-                case 241: out.write("&ntilde;"); break;
-                case 242: out.write("&ograve;"); break;
-                case 243: out.write("&oacute;"); break;
-                case 244: out.write("&ocirc;");  break;
-                case 245: out.write("&otilde;"); break;
-                case 246: out.write("&ouml;");   break;
-                case 247: out.write("&divide;"); break;
-                case 248: out.write("&oslash;"); break;
-                case 249: out.write("&ugrave;"); break;
-                case 250: out.write("&uacute;"); break;
-                case 251: out.write("&ucirc;");  break;
-                case 252: out.write("&uuml;");   break;
-                case 253: out.write("&yacute;"); break;
-                case 254: out.write("&thorn;");  break;
-                case 255: out.write("&yuml;");   break;
-                }
-            else out.write(c);
-        }
-    }        
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/printers/HTMLSerializer.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/printers/HTMLSerializer.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/printers/HTMLSerializer.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,48 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook.printers;
-
-import org.apache.stylebook.*;
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.Method;
-import org.apache.xml.serialize.XHTMLSerializer;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintStream;
-import org.w3c.dom.Document;
-
-/**
- *
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313265 $ $Date: 2000-06-06 03:03:21 +0200 (tis, 06 jun 2000) $
- */
-public class HTMLSerializer extends AbstractComponent implements org.apache.stylebook.Printer {
-
-    /**
-     * Print a DOM Document.
-     *
-     * @param doc The Document to print.
-     * @param out The OutputStream used for printing.
-     * @param env The Environment of this printing request.
-     * @exception IOException If an I/O error occourred accessing resources.
-     * @exception CreationException If the Document cannot be printed.
-     */
-    public void print(Document doc, CreationContext c, OutputStream out)
-    throws CreationException, IOException {
-        // Thanks to  Ingo Macherius <macherius at darmstadt.gmd.de>
-        //OutputFormat f=new OutputFormat(OutputFormat.METHOD_XHTML,
-        OutputFormat f=new OutputFormat(Method.XHTML,
-                                        "US-ASCII",true);
-        //Serializer s=Serializer.makeSerializer(out,f);
-        XHTMLSerializer s = new XHTMLSerializer(out, f);
-        s.serialize(doc);
-    }
-}

Deleted: trunk/stylebook/src/org/apache/stylebook/printers/XMLPrinter.java
===================================================================
--- trunk/stylebook/src/org/apache/stylebook/printers/XMLPrinter.java	2010-05-06 16:00:41 UTC (rev 12323)
+++ trunk/stylebook/src/org/apache/stylebook/printers/XMLPrinter.java	2010-05-06 20:22:36 UTC (rev 12324)
@@ -1,241 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 1999 The Apache Software Foundation.   All rights reserved. *
- * ------------------------------------------------------------------------- *
- * This software is published under the terms of the Apache Software License *
- * version 1.1,  a copy of wich has been included  with this distribution in *
- * the LICENSE file.                                                         *
- *****************************************************************************/
-package org.apache.stylebook.printers;
-
-import org.apache.stylebook.*;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintStream;
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Entity;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Notation;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-/**
- * The XMLPrinter Printer writes documents in their canonical XML form.
- *
- * @author <a href="mailto:pier at apache.org">Pierpaolo Fumagalli</a>
- * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
- *         Software Foundation</a>. All rights reserved.
- * @version CVS $Revision: 313195 $ $Date: 1999-11-15 23:08:18 +0100 (mån, 15 nov 1999) $
- */
-public class XMLPrinter extends AbstractComponent implements Printer {
-    /**
-     * Print a DOM Document.
-     */
-    public void print(Document doc, CreationContext c, OutputStream out)
-    throws CreationException, IOException {
-        printDocument(doc,new PrintStream(out),0);
-    }
-
-    /** Process a nodelist calling the appropriate print...() method. */
-    private void printNodeList(NodeList list, PrintStream out, int indent) {
-        for (int x=0;x<list.getLength();x++) {
-            Node node=list.item(x);
-            switch (node.getNodeType()) {
-                case Node.ATTRIBUTE_NODE:
-                    printAttribute((Attr)node,out,indent);
-                    break;
-                case Node.CDATA_SECTION_NODE:
-                    printCDATASection((CDATASection)node,out,indent);
-                    break;
-                case Node.COMMENT_NODE:
-                    printComment((Comment)node,out,indent);
-                    break;
-                case Node.DOCUMENT_FRAGMENT_NODE:
-                    printDocumentFragment((DocumentFragment)node,out,indent);
-                    break;
-                case Node.DOCUMENT_NODE:
-                    printDocument((Document)node,out,indent);
-                    break;
-                case Node.DOCUMENT_TYPE_NODE:
-                    printDocumentType((DocumentType)node,out,indent);
-                    break;
-                case Node.ELEMENT_NODE:
-                    printElement((Element)node,out,indent);
-                    break;
-                case Node.ENTITY_NODE:
-                    printEntity((Entity)node,out,indent);
-                    break;
-                case Node.ENTITY_REFERENCE_NODE:
-                    printEntityReference((EntityReference)node,out,indent);
-                    break;
-                case Node.NOTATION_NODE:
-                    printNotation((Notation)node,out,indent);
-                    break;
-                case Node.PROCESSING_INSTRUCTION_NODE:
-                    printProcessingInstruction((ProcessingInstruction)node,out,indent);
-                    break;
-                case Node.TEXT_NODE:
-                    printText((Text)node,out,indent);
-                    break;
-            }
-        }
-    }
-
-    /** Print an ATTRIBUTE (name="value") node. */
-    private void printAttribute(Attr node, PrintStream out, int indent) {
-        out.print(node.getName()+"=\""+node.getValue()+"\"");
-    }
-
-    /** Print a CDATA (<[CDATA[ ... ]]>) node. */
-    private void printCDATASection(CDATASection node, PrintStream out, int indent) {
-        indent(out,indent);
-        out.println("<[CDATA["+node.getData()+"]]>");
-    }
-
-    /** Print a COMMENT (<!-- ... -->) node. */
-    private void printComment(Comment node, PrintStream out, int indent) {
-        indent(out,indent);
-        out.println("<!--"+node.getData()+"-->");
-    }
-
-    /** Print a DOCUMENT FRAGMENT (????) node. */
-    private void printDocumentFragment(DocumentFragment node, PrintStream out, int indent) {
-        indent(out,indent);
-        out.println("<!-- Document Fragment Node -->");
-    }
-
-    /** Print a DOCUMENT node. */
-    private void printDocument(Document node, PrintStream out, int indent) {
-        indent(out,indent);
-        out.println("<?xml version=\"1.0\"?>");
-        printNodeList(node.getChildNodes(),out,indent);
-    }
-
-    /** Print a DOCUMENT TYPE (<!DOCTYPE ... bla bla bla>) node. */
-    private void printDocumentType(DocumentType node, PrintStream out, int indent) {
-        indent(out,indent);
-        out.println("<!DOCTYPE "+node.getName()+">");
-        // Should we insert ENTITIES and NOTATIONS?
-    }
-
-    /** Print a ELEMENT (do I need to supply the example ??? :) node. */
-    private void printElement(Element node, PrintStream out, int indent) {
-        // Print the tag name
-        indent(out,indent);
-        out.print("<"+node.getTagName());
-        // Process attributes
-        NamedNodeMap atts=node.getAttributes();
-        if ((null!=atts) && (atts.getLength()>0)) {
-            for (int x=0; x<atts.getLength(); x++) {
-                out.print(' ');
-                printAttribute((Attr)atts.item(x),out,indent);
-            }
-        }
-        // Process child nodes
-        if ((null!=node.getChildNodes()) &&
-                (node.getChildNodes().getLength()>0)) {
-            out.println(">");
-            printNodeList(node.getChildNodes(),out,indent+1);
-            indent(out,indent);
-            out.println("</"+node.getTagName()+">");
-        } else {
-            out.println("/>");
-        }
-    }
-
-    /** Print a ENTITY node (NOTE: This should be used with DOCTYPE). */
-    private void printEntity(Entity node, PrintStream out, int indent) {
-        indent(out,indent);
-        out.println("<!-- Entity Node -->");
-    }
-
-    /** Print a ENTITY REFERENCE node (NOTE: Again, used in within DOCTYPE). */
-    private void printEntityReference(EntityReference node, PrintStream out, int indent) {
-        indent(out,indent);
-        out.println("<!-- Entity Reference Node -->");
-    }
-
-    /** Print a NOTATION node (NOTE: Again -3rd-, used in within DOCTYPE). */
-    private void printNotation(Notation node, PrintStream out, int indent) {
-        indent(out,indent);
-        out.println("<!-- Notation Node -->");
-    }
-
-    /** Print a PROCESSING INSTRUCTION (<?name ...?>) node. */
-    private void printProcessingInstruction(ProcessingInstruction node, PrintStream out, int indent) {
-        indent(out,indent);
-        out.println("<?"+node.getTarget()+" "+node.getData()+"?>");
-    }
-
-    /** Print a TEXT (see example for ELEMENT) node. */
-    private void printText(Text node, PrintStream out, int indent) {
-        String data=node.getData();
-        if (data.length()==0) return;
-        data=leftTrim(data);
-        if (data.length()==0) return;
-        Text curr=node;
-        while(true) {
-            Node nextnode=curr.getNextSibling();
-            if (nextnode==null) break;
-            if (nextnode.getNodeType()!=Node.TEXT_NODE) break;
-            Text next=(Text)nextnode;
-            String app=next.getData();
-            if (app.length()>0) {
-                if (Character.isWhitespace(app.charAt(0))) {
-                    data=trim(data)+' '+leftTrim(app);
-                } else {
-                    data=trim(data)+leftTrim(app);
-                }
-            }
-            next.setData("");
-            curr=next;
-        }
-        data=trim(data);
-        node.setData(data);
-        if (data.length()>0) {
-            indent(out,indent);
-            out.println(data);
-        }
-    }
-
-    /** Remove white space at string beginning. */
-    private String leftTrim(String data) {
-        if (data.length()==0) return(data);
-        int index=0;
-        for (int x=0;x<data.length();x++) {
-            if (Character.isWhitespace(data.charAt(x))) index=x+1;
-            else break;
-        }
-        if (index==data.length()) return("");
-        return(data.substring(index));
-    }
-
-    /** Remove white space at string ending. */
-    private String rightTrim(String data) {
-        if (data.length()==0) return(data);
-        int index=data.length();
-        for (int x=index-1;x>=0;x--) {
-            if (Character.isWhitespace(data.charAt(x))) index=x;
-            else break;
-        }
-        return(data.substring(0,index));
-    }
-
-    /** Remove white space at string beginning and ending. */
-    private String trim(String data) {
-        return(leftTrim(rightTrim(data)));
-    }
-
-    /** Indent data (print whitespaces). */
-    private void indent(PrintStream out, int indent) {
-        for (int x=0; x<indent; x++) out.print("  ");
-    }
-}




More information about the pkg-java-commits mailing list