craigmcc    01/04/19 13:42:31

  Modified:    digester build.xml
  Added:       digester/src/java/org/apache/commons/digester/rss
                        Channel.java Image.java Item.java RSSDigester.java
                        TextInput.java rss-0.9.dtd rss-0.91.dtd
                        rss-example.xml
  Log:
  Add a nice usage example of using a customized Digester subclass to
  process XML data in the "Rich Site Summary" format used by the My Netscape
  Network (and many other portal sites).
  
  The example doesn't necessarily belong inside the "commons-digester"
  package JAR file, but I'd like to see it somewhere nearby -- it answers a
  common question on STRUTS-USER about how Digester can be applied to
  application specific data formats.
  
  As an extra added bonus :-), the implementation objects (Channel, Image,
  Item, and TextInput) know how to render themselves back out in RSS syntax,
  so you've got complete two-way processing available.
  
  Revision  Changes    Path
  1.4       +19 -2     jakarta-commons-sandbox/digester/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/digester/build.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- build.xml 2001/04/16 23:06:28     1.3
  +++ build.xml 2001/04/19 20:42:28     1.4
  @@ -3,7 +3,7 @@
   
   <!--
           "Digester" component of the Jakarta Commons Subproject
  -        $Id: build.xml,v 1.3 2001/04/16 23:06:28 sanders Exp $
  +        $Id: build.xml,v 1.4 2001/04/19 20:42:28 craigmcc Exp $
   -->
   
   
  @@ -98,6 +98,15 @@
       <pathelement location="${junit.jar}"/>
     </path>
   
  +  <!-- Construct RSSDigester test classpath -->
  +  <path id="rss.classpath">
  +    <pathelement location="${build.home}/classes"/>
  +    <pathelement location="${jaxp.jaxp.jar}"/>
  +    <pathelement location="${jaxp.parser.jar}"/>
  +    <pathelement location="${beanutils.jar}"/>
  +    <pathelement location="${collections.jar}"/>
  +  </path>
  +
     <!-- Should all tests fail if one does? -->
     <property name="test.failonerror"        value="true"/>
   
  @@ -235,5 +244,13 @@
       </java>
     </target>
   
  +  <target name="test.rss" depends="compile"
  +   description="Run RSSDigester test cases">
  +    <echo message="Running RSSDigester tests ..."/>
  +    <java classname="org.apache.commons.digester.rss.RSSDigester"
  +               fork="yes">
  +      <classpath refid="rss.classpath"/>
  +    </java>
  +  </target>
   
  -</project>
  \ No newline at end of file
  +</project>
  
  
  
  1.1                  
jakarta-commons-sandbox/digester/src/java/org/apache/commons/digester/rss/Channel.java
  
  Index: Channel.java
  ===================================================================
  /*
   * $Header: 
/home/cvs/jakarta-commons-sandbox/digester/src/java/org/apache/commons/digester/rss/Channel.java,v
 1.1 2001/04/19 20:42:30 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2001/04/19 20:42:30 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2001 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", 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 [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * 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.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  
  package org.apache.commons.digester.rss;
  
  
  import java.io.IOException;
  import java.io.OutputStream;
  import java.io.OutputStreamWriter;
  import java.io.PrintWriter;
  import java.io.UnsupportedEncodingException;
  import java.io.Writer;
  import java.util.ArrayList;
  
  
  /**
   * <p>Implementation object representing a <strong>channel</strong> in the
   * <em>Rich Site Summary</em> DTD, version 0.91.  This class may be subclassed
   * to further specialize its behavior.</p>
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2001/04/19 20:42:30 $
   */
  
  public class Channel {
  
  
      // ----------------------------------------------------- Instance Variables
  
  
      /**
       * The set of items associated with this Channel.
       */
      protected ArrayList items = new ArrayList();
  
  
      /**
       * The set of skip days for this channel.
       */
      protected ArrayList skipDays = new ArrayList();
  
  
      /**
       * The set of skip hours for this channel.
       */
      protected ArrayList skipHours = new ArrayList();
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * The channel copyright (1-100 characters).
       */
      protected String copyright = null;
  
      public String getCopyright() {
          return (this.copyright);
      }
  
      public void setCopyright(String copyright) {
          this.copyright = copyright;
      }
  
  
      /**
       * The channel description (1-500 characters).
       */
      protected String description = null;
  
      public String getDescription() {
          return (this.description);
      }
  
      public void setDescription(String description) {
          this.description = description;
      }
  
  
      /**
       * The channel description file URL (1-500 characters).
       */
      protected String docs = null;
  
      public String getDocs() {
          return (this.docs);
      }
  
      public void setDocs(String docs) {
          this.docs = docs;
      }
  
  
      /**
       * The image describing this channel.
       */
      protected Image image = null;
  
      public Image getImage() {
          return (this.image);
      }
  
      public void setImage(Image image) {
          this.image = image;
      }
  
  
      /**
       * The channel language (2-5 characters).
       */
      protected String language = null;
  
      public String getLanguage() {
          return (this.language);
      }
  
      public void setLanguage(String language) {
          this.language = language;
      }
  
  
      /**
       * The channel last build date (1-100 characters).
       */
      protected String lastBuildDate = null;
  
      public String getLastBuildDate() {
          return (this.lastBuildDate);
      }
  
      public void setLastBuildDate(String lastBuildDate) {
          this.lastBuildDate = lastBuildDate;
      }
  
  
      /**
       * The channel link (1-500 characters).
       */
      protected String link = null;
  
      public String getLink() {
          return (this.link);
      }
  
      public void setLink(String link) {
          this.link = link;
      }
  
  
      /**
       * The managing editor (1-100 characters).
       */
      protected String managingEditor = null;
  
      public String getManagingEditor() {
          return (this.managingEditor);
      }
  
      public void setManagingEditor(String managingEditor) {
          this.managingEditor = managingEditor;
      }
  
  
      /**
       * The channel publication date (1-100 characters).
       */
      protected String pubDate = null;
  
      public String getPubDate() {
          return (this.pubDate);
      }
  
      public void setPubDate(String pubDate) {
          this.pubDate = pubDate;
      }
  
  
      /**
       * The channel rating (20-500 characters).
       */
      protected String rating = null;
  
      public String getRating() {
          return (this.rating);
      }
  
      public void setRating(String rating) {
          this.rating = rating;
      }
  
  
      /**
       * The text input description for this channel.
       */
      protected TextInput textInput = null;
  
      public TextInput getTextInput() {
          return (this.textInput);
      }
  
      public void setTextInput(TextInput textInput) {
          this.textInput = textInput;
      }
  
  
      /**
       * The channel title (1-100 characters).
       */
      protected String title = null;
  
      public String getTitle() {
          return (this.title);
      }
  
      public void setTitle(String title) {
          this.title = title;
      }
  
  
      /**
       * The RSS specification version number used to create this Channel.
       */
      protected double version = 0.91;
  
      public double getVersion() {
          return (this.version);
      }
  
      public void setVersion(double version) {
          this.version = version;
      }
  
  
      /**
       * The webmaster email address (1-100 characters).
       */
      protected String webMaster = null;
  
      public String getWebMaster() {
          return (this.webMaster);
      }
  
      public void setWebMaster(String webMaster) {
          this.webMaster = webMaster;
      }
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Add an additional item.
       *
       * @param item The item to be added
       */
      public void addItem(Item item) {
          synchronized (items) {
              items.add(item);
          }
      }
  
  
      /**
       * Add an additional skip day name.
       *
       * @param skipDay The skip day to be added
       */
      public void addSkipDay(String skipDay) {
          synchronized (skipDays) {
              skipDays.add(skipDay);
          }
      }
  
  
      /**
       * Add an additional skip day name.
       *
       * @param skipDay The skip day to be added
       */
      public void addSkipHour(String skipHour) {
          synchronized (skipHours) {
              skipHours.add(skipHour);
          }
      }
  
  
      /**
       * Return the items for this channel.
       */
      public Item[] findItems() {
          synchronized (items) {
              Item items[] = new Item[this.items.size()];
              return ((Item[]) this.items.toArray(items));
          }
      }
  
  
      /**
       * Return the skip days for this channel.
       */
      public String[] findSkipDays() {
          synchronized (skipDays) {
              String skipDays[] = new String[this.skipDays.size()];
              return ((String[]) this.skipDays.toArray(skipDays));
          }
      }
  
  
      /**
       * Return the skip hours for this channel.
       */
      public String[] findSkipHours() {
          synchronized (skipHours) {
              String skipHours[] = new String[this.skipHours.size()];
              return ((String[]) this.skipHours.toArray(skipHours));
          }
      }
  
  
      /**
       * Remove an item for this channel.
       *
       * @param item The item to be removed
       */
      public void removeItem(Item item) {
          synchronized (items) {
              items.remove(item);
          }
      }
  
  
      /**
       * Remove a skip day for this channel.
       *
       * @param skipDay The skip day to be removed
       */
      public void removeSkipDay(String skipDay) {
          synchronized (skipDays) {
              skipDays.remove(skipDay);
          }
      }
  
  
      /**
       * Remove a skip hour for this channel.
       *
       * @param skipHour The skip hour to be removed
       */
      public void removeSkipHour(String skipHour) {
          synchronized (skipHours) {
              skipHours.remove(skipHour);
          }
      }
  
  
      /**
       * Render this channel as XML conforming to the RSS 0.91 specification,
       * to the specified output stream, with no indication of character
       * encoding.
       *
       * @param stream The output stream to write to
       */
      public void render(OutputStream stream) {
  
          try {
              render(stream, null);
          } catch (UnsupportedEncodingException e) {
              ; // Can not happen
          }
  
      }
  
  
      /**
       * Render this channel as XML conforming to the RSS 0.91 specification,
       * to the specified output stream, with the specified character encoding.
       *
       * @param stream The output stream to write to
       * @param encoding The character encoding to declare, or <code>null</code>
       *  for no declaration
       *
       * @exception UnsupportedEncodingException if the named encoding
       *  is not supported
       */
      public void render(OutputStream stream, String encoding)
          throws UnsupportedEncodingException {
  
          PrintWriter pw = null;
          if (encoding == null)
              pw = new PrintWriter(stream);
          else
              pw = new PrintWriter(new OutputStreamWriter(stream, encoding));
          render(pw, encoding);
          pw.flush();
  
      }
  
  
      /**
       * Render this channel as XML conforming to the RSS 0.91 specification,
       * to the specified writer, with no indication of character encoding.
       *
       * @param writer The writer to render output to
       */
      public void render(Writer writer) {
  
          render(writer, null);
  
      }
  
  
      /**
       * Render this channel as XML conforming to the RSS 0.91 specification,
       * to the specified writer, indicating the specified character encoding.
       *
       * @param writer The writer to render output to
       * @param encoding The character encoding to declare, or <code>null</code>
       *  for no declaration
       */
      public void render(Writer writer, String encoding) {
  
          PrintWriter pw = new PrintWriter(writer);
          render(pw, encoding);
          pw.flush();
  
      }
  
  
      /**
       * Render this channel as XML conforming to the RSS 0.91 specification,
       * to the specified writer, with no indication of character encoding.
       *
       * @param writer The writer to render output to
       */
      public void render(PrintWriter writer) {
  
          render(writer, null);
  
      }
  
  
      /**
       * Render this channel as XML conforming to the RSS 0.91 specification,
       * to the specified writer, indicating the specified character encoding.
       *
       * @param writer The writer to render output to
       * @param encoding The character encoding to declare, or <code>null</code>
       *  for no declaration
       */
      public void render(PrintWriter writer, String encoding) {
  
          writer.print("<?xml version=\"1.0\"");
          if (encoding != null) {
              writer.print(" encoding=\"");
              writer.print(encoding);
              writer.print("\"");
          }
          writer.println("?>");
          writer.println();
  
          writer.println("<!DOCTYPE rss PUBLIC");
          writer.println("  \"-//Netscape Communications//DTD RSS 0.91//EN\"");
          writer.println("  \"http://my.netscape.com/publish/formats/rss-0.91.dtd\">");
          writer.println();
  
          writer.println("<rss version=\"0.91\">");
          writer.println();
  
          writer.println("  <channel>");
          writer.println();
  
          writer.print("    <title>");
          writer.print(title);
          writer.println("</title>");
  
          writer.print("    <description>");
          writer.print(description);
          writer.println("</description>");
  
          writer.print("    <link>");
          writer.print(link);
          writer.println("</link>");
  
          writer.print("    <language>");
          writer.print(language);
          writer.println("</language>");
  
          if (rating != null) {
              writer.print("    <rating>");
              writer.print(rating);
              writer.println("</rating>");
          }
  
          if (copyright != null) {
              writer.print("    <copyright>");
              writer.print(copyright);
              writer.print("</copyright>");
          }
  
  
          if (pubDate != null) {
              writer.print("    <pubDate>");
              writer.print(pubDate);
              writer.println("</pubDate>");
          }
  
          if (lastBuildDate != null) {
              writer.print("    <lastBuildDate>");
              writer.print(lastBuildDate);
              writer.println("</lastBuildDate>");
          }
  
          if (docs != null) {
              writer.print("    <docs>");
              writer.print(docs);
              writer.println("</docs>");
          }
  
          if (managingEditor != null) {
              writer.print("    <managingEditor>");
              writer.print(managingEditor);
              writer.println("</managingEditor>");
          }
  
          if (webMaster != null) {
              writer.print("    <webMaster>");
              writer.print(webMaster);
              writer.println("</webMaster>");
          }
  
          writer.println();
  
          if (image != null) {
              image.render(writer);
              writer.println();
          }
  
          if (textInput != null) {
              textInput.render(writer);
              writer.println();
          }
  
          String skipDays[] = findSkipDays();
          if (skipDays.length > 0) {
              writer.println("    <skipDays>");
              for (int i = 0; i < skipDays.length; i++) {
                  writer.print("      <skipDay>");
                  writer.print(skipDays[i]);
                  writer.println("</skipDay>");
              }
              writer.println("    </skipDays>");
          }
  
          String skipHours[] = findSkipHours();
          if (skipHours.length > 0) {
              writer.println("    <skipHours>");
              for (int i = 0; i < skipHours.length; i++) {
                  writer.print("      <skipHour>");
                  writer.print(skipHours[i]);
                  writer.println("</skipHour>");
              }
              writer.println("    </skipHours>");
              writer.println();
          }
  
          Item items[] = findItems();
          for (int i = 0; i < items.length; i++) {
              items[i].render(writer);
              writer.println();
          }
  
          writer.println("  </channel>");
          writer.println();
  
          writer.println("</rss>");
  
      }
  
  
  }
  
  
  
  1.1                  
jakarta-commons-sandbox/digester/src/java/org/apache/commons/digester/rss/Image.java
  
  Index: Image.java
  ===================================================================
  /*
   * $Header: 
/home/cvs/jakarta-commons-sandbox/digester/src/java/org/apache/commons/digester/rss/Image.java,v
 1.1 2001/04/19 20:42:30 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2001/04/19 20:42:30 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2001 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", 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 [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * 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.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  
  package org.apache.commons.digester.rss;
  
  
  import java.io.PrintWriter;
  
  
  /**
   * <p>Implementation object representing an <strong>image</strong> in the
   * <em>Rich Site Summary</em> DTD, version 0.91.  This class may be subclassed
   * to further specialize its behavior.</p>
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2001/04/19 20:42:30 $
   */
  
  public class Image {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * The image description (1-100 characters).
       */
      protected String description = null;
  
      public String getDescription() {
          return (this.description);
      }
  
      public void setDescription(String description) {
          this.description = description;
      }
  
  
      /**
       * The image height in pixels (1-400).
       */
      protected int height = 31;
  
      public int getHeight() {
          return (this.height);
      }
  
      public void setHeight(int height) {
          this.height = height;
      }
  
  
      /**
       * The image link (1-500 characters).
       */
      protected String link = null;
  
      public String getLink() {
          return (this.link);
      }
  
      public void setLink(String link) {
          this.link = link;
      }
  
  
      /**
       * The image alternate text (1-100 characters).
       */
      protected String title = null;
  
      public String getTitle() {
          return (this.title);
      }
  
      public void setTitle(String title) {
          this.title = title;
      }
  
  
      /**
       * The image location URL (1-500 characters).
       */
      protected String url = null;
  
      public String getURL() {
          return (this.url);
      }
  
      public void setURL(String url) {
          this.url = url;
      }
  
  
      /**
       * The image width in pixels (1-400).
       */
      protected int width = 31;
  
      public int getWidth() {
          return (this.width);
      }
  
      public void setWidth(int width) {
          this.width = width;
      }
  
  
      // -------------------------------------------------------- Package Methods
  
  
      /**
       * Render this channel as XML conforming to the RSS 0.91 specification,
       * to the specified writer.
       *
       * @param writer The writer to render output to
       */
      void render(PrintWriter writer) {
  
          writer.println("    <image>");
  
          writer.print("      <title>");
          writer.print(title);
          writer.println("</title>");
  
          writer.print("      <url>");
          writer.print(url);
          writer.println("</url>");
  
          if (link != null) {
              writer.print("      <link>");
              writer.print(link);
              writer.println("</link>");
          }
  
          writer.print("      <width>");
          writer.print(width);
          writer.println("</width>");
  
          writer.print("      <height>");
          writer.print(height);
          writer.println("</height>");
  
          if (description != null) {
              writer.print("      <description>");
              writer.print(description);
              writer.println("</description>");
          }
  
          writer.println("    </image>");
  
      }
  
  
  }
  
  
  
  1.1                  
jakarta-commons-sandbox/digester/src/java/org/apache/commons/digester/rss/Item.java
  
  Index: Item.java
  ===================================================================
  /*
   * $Header: 
/home/cvs/jakarta-commons-sandbox/digester/src/java/org/apache/commons/digester/rss/Item.java,v
 1.1 2001/04/19 20:42:30 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2001/04/19 20:42:30 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2001 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", 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 [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * 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.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  
  package org.apache.commons.digester.rss;
  
  
  import java.io.PrintWriter;
  
  
  /**
   * <p>Implementation object representing an <strong>item</strong> in the
   * <em>Rich Site Summary</em> DTD, version 0.91.  This class may be subclassed
   * to further specialize its behavior.</p>
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2001/04/19 20:42:30 $
   */
  
  public class Item {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * The item description (1-500 characters).
       */
      protected String description = null;
  
      public String getDescription() {
          return (this.description);
      }
  
      public void setDescription(String description) {
          this.description = description;
      }
  
  
      /**
       * The item link (1-500 characters).
       */
      protected String link = null;
  
      public String getLink() {
          return (this.link);
      }
  
      public void setLink(String link) {
          this.link = link;
      }
  
  
      /**
       * The item title (1-100 characters).
       */
      protected String title = null;
  
      public String getTitle() {
          return (this.title);
      }
  
      public void setTitle(String title) {
          this.title = title;
      }
  
  
      // -------------------------------------------------------- Package Methods
  
  
      /**
       * Render this channel as XML conforming to the RSS 0.91 specification,
       * to the specified writer.
       *
       * @param writer The writer to render output to
       */
      void render(PrintWriter writer) {
  
          writer.println("    <item>");
  
          writer.print("      <title>");
          writer.print(title);
          writer.println("</title>");
  
          writer.print("      <link>");
          writer.print(link);
          writer.println("</link>");
  
          if (description != null) {
              writer.print("      <description>");
              writer.print(description);
              writer.println("</description>");
          }
  
          writer.println("    </item>");
  
      }
  
  
  }
  
  
  
  1.1                  
jakarta-commons-sandbox/digester/src/java/org/apache/commons/digester/rss/RSSDigester.java
  
  Index: RSSDigester.java
  ===================================================================
  /*
   * $Header: 
/home/cvs/jakarta-commons-sandbox/digester/src/java/org/apache/commons/digester/rss/RSSDigester.java,v
 1.1 2001/04/19 20:42:30 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2001/04/19 20:42:30 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2001 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", 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 [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * 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.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  
  package org.apache.commons.digester.rss;
  
  
  import java.io.File;
  import java.io.IOException;
  import java.io.InputStream;
  import java.net.URL;
  import org.apache.commons.digester.Digester;
  import org.xml.sax.InputSource;
  import org.xml.sax.SAXException;
  
  
  /**
   * <p>Implementation of <strong>org.apache.commons.digester.Digester</strong>
   * designed to process input streams that conform to the <em>Rich Site
   * Summary</em> DTD, version 0.91.  For more information about this format,
   * see the <a href="http://my.netscape.com/publish/">My Netscape</a> site.</p>
   *
   * <p>The default implementation object returned by calling
   * <code>parse()</code> (an instance of
   * <code>org.apache.commons.digester.rss.Channel</code>)
   * knows how to render itself in XML format via the <code>render()</code>
   * method.  See the test <code>main()</code> method below for an
   * example of using these classes.</p>
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2001/04/19 20:42:30 $
   */
  
  public class RSSDigester extends Digester {
  
  
      // ----------------------------------------------------------- Constructors
  
  
  
      // ----------------------------------------------------- Instance Variables
  
  
      /**
       * Have we been configured yet?
       */
      protected boolean configured = false;
  
  
      /**
       * The set of public identifiers, and corresponding resource names,
       * for the versions of the DTDs that we know about.
       */
      protected static final String registrations[] = {
          "-//Netscape Communications//DTD RSS 0.9//EN",
          "/org/apache/commons/digester/rss/rss-0.9.dtd",
          "-//Netscape Communications//DTD RSS 0.91//EN",
          "/org/apache/commons/digester/rss/rss-0.91.dtd",
      };
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * The fully qualified class name of the <code>Channel</code>
       * implementation class.
       */
      protected String channelClass = "org.apache.commons.digester.rss.Channel";
  
      public String getChannelClass() {
          return (this.channelClass);
      }
  
      public void setChannelClass(String channelClass) {
          this.channelClass = channelClass;
      }
  
  
      /**
       * The fully qualified class name of the <code>Image</code>
       * implementation class.
       */
      protected String imageClass = "org.apache.commons.digester.rss.Image";
  
      public String getImageClass() {
          return (this.imageClass);
      }
  
      public void setImageClass(String imageClass) {
          this.imageClass = imageClass;
      }
  
  
      /**
       * The fully qualified class name of the <code>Item</code>
       * implementation class.
       */
      protected String itemClass = "org.apache.commons.digester.rss.Item";
  
      public String getItemClass() {
          return (this.itemClass);
      }
  
      public void setItemClass(String itemClass) {
          this.itemClass = itemClass;
      }
  
  
      /**
       * The fully qualified class name of the <code>TextInput</code>
       * implementation class.
       */
      protected String textInputClass =
          "org.apache.commons.digester.rss.TextInput";
  
      public String getTextInputClass() {
          return (this.textInputClass);
      }
  
      public void setTextInputClass(String textInputClass) {
          this.textInputClass = textInputClass;
      }
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Parse the content of the specified file using this Digester.  Returns
       * the root element from the object stack (which will be the Channel).
       *
       * @param file File containing the XML data to be parsed
       *
       * @exception IOException if an input/output error occurs
       * @exception SAXException if a parsing exception occurs
       */
      public Object parse(File file) throws IOException, SAXException {
  
          configure();
          return (super.parse(file));
  
      }
  
  
      /**
       * Parse the content of the specified input source using this Digester.
       * Returns the root element from the object stack (which will be the
       * Channel).
       *
       * @param input Input source containing the XML data to be parsed
       *
       * @exception IOException if an input/output error occurs
       * @exception SAXException if a parsing exception occurs
       */
      public Object parse(InputSource input) throws IOException, SAXException {
  
          configure();
          return (super.parse(input));
  
      }
  
  
      /**
       * Parse the content of the specified input stream using this Digester.
       * Returns the root element from the object stack (which will be
       * the Channel).
       *
       * @param input Input stream containing the XML data to be parsed
       *
       * @exception IOException if an input/output error occurs
       * @exception SAXException if a parsing exception occurs
       */
      public Object parse(InputStream input) throws IOException, SAXException {
  
          configure();
          return (super.parse(input));
  
      }
  
  
      /**
       * Parse the content of the specified URI using this Digester.
       * Returns the root element from the object stack (which will be
       * the Channel).
       *
       * @param uri URI containing the XML data to be parsed
       *
       * @exception IOException if an input/output error occurs
       * @exception SAXException if a parsing exception occurs
       */
      public Object parse(String uri) throws IOException, SAXException {
  
          configure();
          return (super.parse(uri));
  
      }
  
  
      // -------------------------------------------------------- Package Methods
  
  
  
      // ------------------------------------------------------ Protected Methods
  
  
      /**
       * Configure the parsing rules that will be used to process RSS input.
       */
      protected void configure() {
  
          if (configured)
              return;
  
          // Register local copies of the DTDs we understand
          for (int i = 0; i < registrations.length; i += 2) {
              URL url = this.getClass().getResource(registrations[i+1]);
              if (url != null)
                  register(registrations[i], url.toString());
          }
  
          // FIXME - validate the "version" attribute of the rss element?
  
          // Add the rules for the Channel object
          addObjectCreate("rss/channel", channelClass);
          addCallMethod("rss/channel/copyright", "setCopyright", 0);
          addCallMethod("rss/channel/description", "setDescription", 0);
          addCallMethod("rss/channel/docs", "setDocs", 0);
          addCallMethod("rss/channel/language", "setLanguage", 0);
          addCallMethod("rss/channel/lastBuildDate", "setLastBuildDate", 0);
          addCallMethod("rss/channel/link", "setLink", 0);
          addCallMethod("rss/channel/managingEditor", "setManagingEditor", 0);
          addCallMethod("rss/channel/pubDate", "setPubDate", 0);
          addCallMethod("rss/channel/rating", "setRating", 0);
          addCallMethod("rss/channel/skipDays/day", "addSkipDay", 0);
          addCallMethod("rss/channel/skipHours/hour", "addSkipHour", 0);
          addCallMethod("rss/channel/title", "setTitle", 0);
          addCallMethod("rss/channel/webMaster", "setWebMaster", 0);
  
          // Add the rules for the Image object
          addObjectCreate("rss/channel/image", imageClass);
          addSetNext("rss/channel/image", "setImage",
                     "org.apache.commons.digester.rss.Image");
          addCallMethod("rss/channel/image/description", "setDescription", 0);
          addCallMethod("rss/channel/image/height", "setHeight", 0,
                        new Class[] { Integer.TYPE });
          addCallMethod("rss/channel/image/link", "setLink", 0);
          addCallMethod("rss/channel/image/title", "setTitle", 0);
          addCallMethod("rss/channel/image/url", "setURL", 0);
          addCallMethod("rss/channel/image/width", "setWidth", 0,
                        new Class[] { Integer.TYPE });
  
          // Add the rules for the Item object
          addObjectCreate("rss/channel/item", itemClass);
          addSetNext("rss/channel/item", "addItem",
                     "org.apache.commons.digester.rss.Item");
          addCallMethod("rss/channel/item/description", "setDescription", 0);
          addCallMethod("rss/channel/item/link", "setLink", 0);
          addCallMethod("rss/channel/item/title", "setTitle", 0);
  
          // Add the rules for the TextInput object
          addObjectCreate("rss/channel/textinput", textInputClass);
          addSetNext("rss/channel/textinput", "setTextInput",
                     "org.apache.commons.digester.rss.TextInput");
          addCallMethod("rss/channel/textinput/description",
                        "setDescription", 0);
          addCallMethod("rss/channel/textinput/link", "setLink", 0);
          addCallMethod("rss/channel/textinput/name", "setName", 0);
          addCallMethod("rss/channel/textinput/title", "setTitle", 0);
  
          // Mark this digester as having been configured
          configured = true;
  
      }
  
  
      // ------------------------------------------------------ Test Main Program
  
  
      /**
       * Test main program that parses the channel description included in this
       * package as a static resource.
       *
       * @param args The command line arguments (ignored)
       */
      public static void main(String args[]) {
  
          try {
              System.out.println("RSSDigester Test Program");
              System.out.println("Opening input stream ...");
              InputStream is = RSSDigester.class.getResourceAsStream
                  ("/org/apache/commons/digester/rss/rss-example.xml");
              System.out.println("Creating new digester ...");
              RSSDigester digester = new RSSDigester();
              if ((args.length > 0) && (args[0].equals("-debug")))
                  digester.setDebug(999);
              System.out.println("Parsing input stream ...");
              Channel channel = (Channel) digester.parse(is);
              System.out.println("Closing input stream ...");
              is.close();
              System.out.println("Dumping channel info ...");
              channel.render(System.out);
          } catch (Exception e) {
              System.out.println("-->Exception");
              e.printStackTrace(System.out);
          }
  
      }
  
  
   }
  
  
  
  1.1                  
jakarta-commons-sandbox/digester/src/java/org/apache/commons/digester/rss/TextInput.java
  
  Index: TextInput.java
  ===================================================================
  /*
   * $Header: 
/home/cvs/jakarta-commons-sandbox/digester/src/java/org/apache/commons/digester/rss/TextInput.java,v
 1.1 2001/04/19 20:42:30 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2001/04/19 20:42:30 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2001 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", 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 [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * 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.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  
  package org.apache.commons.digester.rss;
  
  
  import java.io.PrintWriter;
  
  
  /**
   * <p>Implementation object representing a <strong>textinput</strong> in the
   * <em>Rich Site Summary</em> DTD, version 0.91.  This class may be subclassed
   * to further specialize its behavior.</p>
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2001/04/19 20:42:30 $
   */
  
  public class TextInput {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * The text input description (1-100 characters).
       */
      protected String description = null;
  
      public String getDescription() {
          return (this.description);
      }
  
      public void setDescription(String description) {
          this.description = description;
      }
  
  
      /**
       * The text input link (1-500 characters).
       */
      protected String link = null;
  
      public String getLink() {
          return (this.link);
      }
  
      public void setLink(String link) {
          this.link = link;
      }
  
  
      /**
       * The text input field name (1-100 characters).
       */
      protected String name = null;
  
      public String getName() {
          return (this.name);
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
  
      /**
       * The text input submit button label (1-100 characters).
       */
      protected String title = null;
  
      public String getTitle() {
          return (this.title);
      }
  
      public void setTitle(String title) {
          this.title = title;
      }
  
  
      // -------------------------------------------------------- Package Methods
  
  
      /**
       * Render this channel as XML conforming to the RSS 0.91 specification,
       * to the specified writer.
       *
       * @param writer The writer to render output to
       */
      void render(PrintWriter writer) {
  
          writer.println("    <textinput>");
  
          writer.print("      <title>");
          writer.print(title);
          writer.println("</title>");
  
          writer.print("      <description>");
          writer.print(description);
          writer.println("</description>");
  
          writer.print("      <name>");
          writer.print(name);
          writer.println("</name>");
  
          writer.print("      <link>");
          writer.print(link);
          writer.println("</link>");
  
          writer.println("    </textinput>");
  
      }
  
  
  }
  
  
  
  1.1                  
jakarta-commons-sandbox/digester/src/java/org/apache/commons/digester/rss/rss-0.9.dtd
  
  Index: rss-0.9.dtd
  ===================================================================
  <!--
  
    RDF Site Summary (RSS) 0.9 official DTD, proposed.
    
    RSS is an XML/RDF vocabulary for describing
    metadata about websites, and enabling the display of
    "channels" on the "My Netscape" website.
    
    RSS Info can be found at http://my.netscape.com/publish/
    XML Info can be found at http://www.w3.org/XML/ 
    RDF Info can be found at http://www.w3.org/RDF/
    
    copyright Netscape Communications, 1999
  
    Dan Libby - [EMAIL PROTECTED]
    
    Based on RSS DTD originally created by
    Lars Marius Garshol - [EMAIL PROTECTED]
    $Id: rss-0.9.dtd,v 1.1 2001/04/19 20:42:30 craigmcc Exp $
    
  -->
  
  <!ELEMENT rdf:RDF (channel | image? | item+ | textinput?)*>
  <!ATTLIST rdf:RDF
            xmlns:rdf CDATA #FIXED "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
            xmlns     CDATA #REQUIRED> <!-- must be 
"http://my.netscape.com/rdf/simple/0.9/"> -->
  
  <!ELEMENT channel (title | description | link)*>
  <!ELEMENT title (#PCDATA)>
  <!ELEMENT description (#PCDATA)>
  <!ELEMENT link (#PCDATA)>
  <!ELEMENT image (title | url | link)*>
  <!ELEMENT url (#PCDATA)>
  <!ELEMENT item (title | link)*>
  <!ELEMENT textinput (title | description | name | link)*>
  <!ELEMENT name (#PCDATA)>
  
  <!--
       Copied from HTML 3.2 DTD, with modifications (removed CDATA)
       http://www.w3.org/TR/REC-html32.html#dtd
       =============== BEGIN ===================
  -->
  <!-- 
       Character Entities for ISO Latin-1
       
       (C) International Organization for Standardization 1986
       Permission to copy in any form is granted for use with
       conforming SGML systems and applications as defined in
       ISO 8879, provided this notice is included in all copies.
       This has been extended for use with HTML to cover the full
       set of codes in the range 160-255 decimal.
  -->
  <!-- Character entity set. Typical invocation:
       <!ENTITY % ISOlat1 PUBLIC
         "ISO 8879-1986//ENTITIES Added Latin 1//EN//HTML">
       %ISOlat1;
  -->
      <!ENTITY nbsp   "&#160;"> <!-- no-break space -->
      <!ENTITY iexcl  "&#161;"> <!-- inverted exclamation mark -->
      <!ENTITY cent   "&#162;"> <!-- cent sign -->
      <!ENTITY pound  "&#163;"> <!-- pound sterling sign -->
      <!ENTITY curren "&#164;"> <!-- general currency sign -->
      <!ENTITY yen    "&#165;"> <!-- yen sign -->
      <!ENTITY brvbar "&#166;"> <!-- broken (vertical) bar -->
      <!ENTITY sect   "&#167;"> <!-- section sign -->
      <!ENTITY uml    "&#168;"> <!-- umlaut (dieresis) -->
      <!ENTITY copy   "&#169;"> <!-- copyright sign -->
      <!ENTITY ordf   "&#170;"> <!-- ordinal indicator, feminine -->
      <!ENTITY laquo  "&#171;"> <!-- angle quotation mark, left -->
      <!ENTITY not    "&#172;"> <!-- not sign -->
      <!ENTITY shy    "&#173;"> <!-- soft hyphen -->
      <!ENTITY reg    "&#174;"> <!-- registered sign -->
      <!ENTITY macr   "&#175;"> <!-- macron -->
      <!ENTITY deg    "&#176;"> <!-- degree sign -->
      <!ENTITY plusmn "&#177;"> <!-- plus-or-minus sign -->
      <!ENTITY sup2   "&#178;"> <!-- superscript two -->
      <!ENTITY sup3   "&#179;"> <!-- superscript three -->
      <!ENTITY acute  "&#180;"> <!-- acute accent -->
      <!ENTITY micro  "&#181;"> <!-- micro sign -->
      <!ENTITY para   "&#182;"> <!-- pilcrow (paragraph sign) -->
      <!ENTITY middot "&#183;"> <!-- middle dot -->
      <!ENTITY cedil  "&#184;"> <!-- cedilla -->
      <!ENTITY sup1   "&#185;"> <!-- superscript one -->
      <!ENTITY ordm   "&#186;"> <!-- ordinal indicator, masculine -->
      <!ENTITY raquo  "&#187;"> <!-- angle quotation mark, right -->
      <!ENTITY frac14 "&#188;"> <!-- fraction one-quarter -->
      <!ENTITY frac12 "&#189;"> <!-- fraction one-half -->
      <!ENTITY frac34 "&#190;"> <!-- fraction three-quarters -->
      <!ENTITY iquest "&#191;"> <!-- inverted question mark -->
      <!ENTITY Agrave "&#192;"> <!-- capital A, grave accent -->
      <!ENTITY Aacute "&#193;"> <!-- capital A, acute accent -->
      <!ENTITY Acirc  "&#194;"> <!-- capital A, circumflex accent -->
      <!ENTITY Atilde "&#195;"> <!-- capital A, tilde -->
      <!ENTITY Auml   "&#196;"> <!-- capital A, dieresis or umlaut mark -->
      <!ENTITY Aring  "&#197;"> <!-- capital A, ring -->
      <!ENTITY AElig  "&#198;"> <!-- capital AE diphthong (ligature) -->
      <!ENTITY Ccedil "&#199;"> <!-- capital C, cedilla -->
      <!ENTITY Egrave "&#200;"> <!-- capital E, grave accent -->
      <!ENTITY Eacute "&#201;"> <!-- capital E, acute accent -->
      <!ENTITY Ecirc  "&#202;"> <!-- capital E, circumflex accent -->
      <!ENTITY Euml   "&#203;"> <!-- capital E, dieresis or umlaut mark -->
      <!ENTITY Igrave "&#204;"> <!-- capital I, grave accent -->
      <!ENTITY Iacute "&#205;"> <!-- capital I, acute accent -->
      <!ENTITY Icirc  "&#206;"> <!-- capital I, circumflex accent -->
      <!ENTITY Iuml   "&#207;"> <!-- capital I, dieresis or umlaut mark -->
      <!ENTITY ETH    "&#208;"> <!-- capital Eth, Icelandic -->
      <!ENTITY Ntilde "&#209;"> <!-- capital N, tilde -->
      <!ENTITY Ograve "&#210;"> <!-- capital O, grave accent -->
      <!ENTITY Oacute "&#211;"> <!-- capital O, acute accent -->
      <!ENTITY Ocirc  "&#212;"> <!-- capital O, circumflex accent -->
      <!ENTITY Otilde "&#213;"> <!-- capital O, tilde -->
      <!ENTITY Ouml   "&#214;"> <!-- capital O, dieresis or umlaut mark -->
      <!ENTITY times  "&#215;"> <!-- multiply sign -->
      <!ENTITY Oslash "&#216;"> <!-- capital O, slash -->
      <!ENTITY Ugrave "&#217;"> <!-- capital U, grave accent -->
      <!ENTITY Uacute "&#218;"> <!-- capital U, acute accent -->
      <!ENTITY Ucirc  "&#219;"> <!-- capital U, circumflex accent -->
      <!ENTITY Uuml   "&#220;"> <!-- capital U, dieresis or umlaut mark -->
      <!ENTITY Yacute "&#221;"> <!-- capital Y, acute accent -->
      <!ENTITY THORN  "&#222;"> <!-- capital THORN, Icelandic -->
      <!ENTITY szlig  "&#223;"> <!-- small sharp s, German (sz ligature) -->
      <!ENTITY agrave "&#224;"> <!-- small a, grave accent -->
      <!ENTITY aacute "&#225;"> <!-- small a, acute accent -->
      <!ENTITY acirc  "&#226;"> <!-- small a, circumflex accent -->
      <!ENTITY atilde "&#227;"> <!-- small a, tilde -->
      <!ENTITY auml   "&#228;"> <!-- small a, dieresis or umlaut mark -->
      <!ENTITY aring  "&#229;"> <!-- small a, ring -->
      <!ENTITY aelig  "&#230;"> <!-- small ae diphthong (ligature) -->
      <!ENTITY ccedil "&#231;"> <!-- small c, cedilla -->
      <!ENTITY egrave "&#232;"> <!-- small e, grave accent -->
      <!ENTITY eacute "&#233;"> <!-- small e, acute accent -->
      <!ENTITY ecirc  "&#234;"> <!-- small e, circumflex accent -->
      <!ENTITY euml   "&#235;"> <!-- small e, dieresis or umlaut mark -->
      <!ENTITY igrave "&#236;"> <!-- small i, grave accent -->
      <!ENTITY iacute "&#237;"> <!-- small i, acute accent -->
      <!ENTITY icirc  "&#238;"> <!-- small i, circumflex accent -->
      <!ENTITY iuml   "&#239;"> <!-- small i, dieresis or umlaut mark -->
      <!ENTITY eth    "&#240;"> <!-- small eth, Icelandic -->
      <!ENTITY ntilde "&#241;"> <!-- small n, tilde -->
      <!ENTITY ograve "&#242;"> <!-- small o, grave accent -->
      <!ENTITY oacute "&#243;"> <!-- small o, acute accent -->
      <!ENTITY ocirc  "&#244;"> <!-- small o, circumflex accent -->
      <!ENTITY otilde "&#245;"> <!-- small o, tilde -->
      <!ENTITY ouml   "&#246;"> <!-- small o, dieresis or umlaut mark -->
      <!ENTITY divide "&#247;"> <!-- divide sign -->
      <!ENTITY oslash "&#248;"> <!-- small o, slash -->
      <!ENTITY ugrave "&#249;"> <!-- small u, grave accent -->
      <!ENTITY uacute "&#250;"> <!-- small u, acute accent -->
      <!ENTITY ucirc  "&#251;"> <!-- small u, circumflex accent -->
      <!ENTITY uuml   "&#252;"> <!-- small u, dieresis or umlaut mark -->
      <!ENTITY yacute "&#253;"> <!-- small y, acute accent -->
      <!ENTITY thorn  "&#254;"> <!-- small thorn, Icelandic -->
      <!ENTITY yuml   "&#255;"> <!-- small y, dieresis or umlaut mark -->
      
  <!--
       Copied from HTML 3.2 DTD, with modifications (removed CDATA)
       http://www.w3.org/TR/REC-html32.html#dtd
       ================= END ===================
  -->
  
  
  
  1.1                  
jakarta-commons-sandbox/digester/src/java/org/apache/commons/digester/rss/rss-0.91.dtd
  
  Index: rss-0.91.dtd
  ===================================================================
  <!--
  
    Rich Site Summary (RSS) 0.91 official DTD, proposed.
    
    RSS is an XML vocabulary for describing
    metadata about websites, and enabling the display of
    "channels" on the "My Netscape" website.
    
    RSS Info can be found at http://my.netscape.com/publish/
    XML Info can be found at http://www.w3.org/XML/ 
    
    copyright Netscape Communications, 1999
  
    Dan Libby - [EMAIL PROTECTED]
    
    Based on RSS DTD originally created by
    Lars Marius Garshol - [EMAIL PROTECTED]
    $Id: rss-0.91.dtd,v 1.1 2001/04/19 20:42:30 craigmcc Exp $
    
  -->
  
  <!ELEMENT rss (channel)>
  <!ATTLIST rss
            version     CDATA #REQUIRED> <!-- must be "0.91"> -->
  
  <!ELEMENT channel (title | description | link | language | item+ | rating? | image? 
| textinput? | copyright? | pubDate? | lastBuildDate? | docs? | managingEditor? | 
webMaster? | skipHours? | skipDays?)*>
  <!ELEMENT title (#PCDATA)>
  <!ELEMENT description (#PCDATA)>
  <!ELEMENT link (#PCDATA)>
  <!ELEMENT image (title | url | link | width? | height? | description?)*>
  <!ELEMENT url (#PCDATA)>
  <!ELEMENT item (title | link | description)*>
  <!ELEMENT textinput (title | description | name | link)*>
  <!ELEMENT name (#PCDATA)>
  <!ELEMENT rating (#PCDATA)>
  <!ELEMENT language (#PCDATA)>
  <!ELEMENT width (#PCDATA)>
  <!ELEMENT height (#PCDATA)>
  <!ELEMENT copyright (#PCDATA)>
  <!ELEMENT pubDate (#PCDATA)>
  <!ELEMENT lastBuildDate (#PCDATA)>
  <!ELEMENT docs (#PCDATA)>
  <!ELEMENT managingEditor (#PCDATA)>
  <!ELEMENT webMaster (#PCDATA)>
  <!ELEMENT hour (#PCDATA)>
  <!ELEMENT day (#PCDATA)>
  <!ELEMENT skipHours (hour+)>
  <!ELEMENT skipDays (day+)>
  
  <!--
       Copied from HTML 3.2 DTD, with modifications (removed CDATA)
       http://www.w3.org/TR/REC-html32.html#dtd
       =============== BEGIN ===================
  -->
  <!-- 
       Character Entities for ISO Latin-1
       
       (C) International Organization for Standardization 1986
       Permission to copy in any form is granted for use with
       conforming SGML systems and applications as defined in
       ISO 8879, provided this notice is included in all copies.
       This has been extended for use with HTML to cover the full
       set of codes in the range 160-255 decimal.
  -->
  <!-- Character entity set. Typical invocation:
       <!ENTITY % ISOlat1 PUBLIC
         "ISO 8879-1986//ENTITIES Added Latin 1//EN//HTML">
       %ISOlat1;
  -->
      <!ENTITY nbsp   "&#160;"> <!-- no-break space -->
      <!ENTITY iexcl  "&#161;"> <!-- inverted exclamation mark -->
      <!ENTITY cent   "&#162;"> <!-- cent sign -->
      <!ENTITY pound  "&#163;"> <!-- pound sterling sign -->
      <!ENTITY curren "&#164;"> <!-- general currency sign -->
      <!ENTITY yen    "&#165;"> <!-- yen sign -->
      <!ENTITY brvbar "&#166;"> <!-- broken (vertical) bar -->
      <!ENTITY sect   "&#167;"> <!-- section sign -->
      <!ENTITY uml    "&#168;"> <!-- umlaut (dieresis) -->
      <!ENTITY copy   "&#169;"> <!-- copyright sign -->
      <!ENTITY ordf   "&#170;"> <!-- ordinal indicator, feminine -->
      <!ENTITY laquo  "&#171;"> <!-- angle quotation mark, left -->
      <!ENTITY not    "&#172;"> <!-- not sign -->
      <!ENTITY shy    "&#173;"> <!-- soft hyphen -->
      <!ENTITY reg    "&#174;"> <!-- registered sign -->
      <!ENTITY macr   "&#175;"> <!-- macron -->
      <!ENTITY deg    "&#176;"> <!-- degree sign -->
      <!ENTITY plusmn "&#177;"> <!-- plus-or-minus sign -->
      <!ENTITY sup2   "&#178;"> <!-- superscript two -->
      <!ENTITY sup3   "&#179;"> <!-- superscript three -->
      <!ENTITY acute  "&#180;"> <!-- acute accent -->
      <!ENTITY micro  "&#181;"> <!-- micro sign -->
      <!ENTITY para   "&#182;"> <!-- pilcrow (paragraph sign) -->
      <!ENTITY middot "&#183;"> <!-- middle dot -->
      <!ENTITY cedil  "&#184;"> <!-- cedilla -->
      <!ENTITY sup1   "&#185;"> <!-- superscript one -->
      <!ENTITY ordm   "&#186;"> <!-- ordinal indicator, masculine -->
      <!ENTITY raquo  "&#187;"> <!-- angle quotation mark, right -->
      <!ENTITY frac14 "&#188;"> <!-- fraction one-quarter -->
      <!ENTITY frac12 "&#189;"> <!-- fraction one-half -->
      <!ENTITY frac34 "&#190;"> <!-- fraction three-quarters -->
      <!ENTITY iquest "&#191;"> <!-- inverted question mark -->
      <!ENTITY Agrave "&#192;"> <!-- capital A, grave accent -->
      <!ENTITY Aacute "&#193;"> <!-- capital A, acute accent -->
      <!ENTITY Acirc  "&#194;"> <!-- capital A, circumflex accent -->
      <!ENTITY Atilde "&#195;"> <!-- capital A, tilde -->
      <!ENTITY Auml   "&#196;"> <!-- capital A, dieresis or umlaut mark -->
      <!ENTITY Aring  "&#197;"> <!-- capital A, ring -->
      <!ENTITY AElig  "&#198;"> <!-- capital AE diphthong (ligature) -->
      <!ENTITY Ccedil "&#199;"> <!-- capital C, cedilla -->
      <!ENTITY Egrave "&#200;"> <!-- capital E, grave accent -->
      <!ENTITY Eacute "&#201;"> <!-- capital E, acute accent -->
      <!ENTITY Ecirc  "&#202;"> <!-- capital E, circumflex accent -->
      <!ENTITY Euml   "&#203;"> <!-- capital E, dieresis or umlaut mark -->
      <!ENTITY Igrave "&#204;"> <!-- capital I, grave accent -->
      <!ENTITY Iacute "&#205;"> <!-- capital I, acute accent -->
      <!ENTITY Icirc  "&#206;"> <!-- capital I, circumflex accent -->
      <!ENTITY Iuml   "&#207;"> <!-- capital I, dieresis or umlaut mark -->
      <!ENTITY ETH    "&#208;"> <!-- capital Eth, Icelandic -->
      <!ENTITY Ntilde "&#209;"> <!-- capital N, tilde -->
      <!ENTITY Ograve "&#210;"> <!-- capital O, grave accent -->
      <!ENTITY Oacute "&#211;"> <!-- capital O, acute accent -->
      <!ENTITY Ocirc  "&#212;"> <!-- capital O, circumflex accent -->
      <!ENTITY Otilde "&#213;"> <!-- capital O, tilde -->
      <!ENTITY Ouml   "&#214;"> <!-- capital O, dieresis or umlaut mark -->
      <!ENTITY times  "&#215;"> <!-- multiply sign -->
      <!ENTITY Oslash "&#216;"> <!-- capital O, slash -->
      <!ENTITY Ugrave "&#217;"> <!-- capital U, grave accent -->
      <!ENTITY Uacute "&#218;"> <!-- capital U, acute accent -->
      <!ENTITY Ucirc  "&#219;"> <!-- capital U, circumflex accent -->
      <!ENTITY Uuml   "&#220;"> <!-- capital U, dieresis or umlaut mark -->
      <!ENTITY Yacute "&#221;"> <!-- capital Y, acute accent -->
      <!ENTITY THORN  "&#222;"> <!-- capital THORN, Icelandic -->
      <!ENTITY szlig  "&#223;"> <!-- small sharp s, German (sz ligature) -->
      <!ENTITY agrave "&#224;"> <!-- small a, grave accent -->
      <!ENTITY aacute "&#225;"> <!-- small a, acute accent -->
      <!ENTITY acirc  "&#226;"> <!-- small a, circumflex accent -->
      <!ENTITY atilde "&#227;"> <!-- small a, tilde -->
      <!ENTITY auml   "&#228;"> <!-- small a, dieresis or umlaut mark -->
      <!ENTITY aring  "&#229;"> <!-- small a, ring -->
      <!ENTITY aelig  "&#230;"> <!-- small ae diphthong (ligature) -->
      <!ENTITY ccedil "&#231;"> <!-- small c, cedilla -->
      <!ENTITY egrave "&#232;"> <!-- small e, grave accent -->
      <!ENTITY eacute "&#233;"> <!-- small e, acute accent -->
      <!ENTITY ecirc  "&#234;"> <!-- small e, circumflex accent -->
      <!ENTITY euml   "&#235;"> <!-- small e, dieresis or umlaut mark -->
      <!ENTITY igrave "&#236;"> <!-- small i, grave accent -->
      <!ENTITY iacute "&#237;"> <!-- small i, acute accent -->
      <!ENTITY icirc  "&#238;"> <!-- small i, circumflex accent -->
      <!ENTITY iuml   "&#239;"> <!-- small i, dieresis or umlaut mark -->
      <!ENTITY eth    "&#240;"> <!-- small eth, Icelandic -->
      <!ENTITY ntilde "&#241;"> <!-- small n, tilde -->
      <!ENTITY ograve "&#242;"> <!-- small o, grave accent -->
      <!ENTITY oacute "&#243;"> <!-- small o, acute accent -->
      <!ENTITY ocirc  "&#244;"> <!-- small o, circumflex accent -->
      <!ENTITY otilde "&#245;"> <!-- small o, tilde -->
      <!ENTITY ouml   "&#246;"> <!-- small o, dieresis or umlaut mark -->
      <!ENTITY divide "&#247;"> <!-- divide sign -->
      <!ENTITY oslash "&#248;"> <!-- small o, slash -->
      <!ENTITY ugrave "&#249;"> <!-- small u, grave accent -->
      <!ENTITY uacute "&#250;"> <!-- small u, acute accent -->
      <!ENTITY ucirc  "&#251;"> <!-- small u, circumflex accent -->
      <!ENTITY uuml   "&#252;"> <!-- small u, dieresis or umlaut mark -->
      <!ENTITY yacute "&#253;"> <!-- small y, acute accent -->
      <!ENTITY thorn  "&#254;"> <!-- small thorn, Icelandic -->
      <!ENTITY yuml   "&#255;"> <!-- small y, dieresis or umlaut mark -->
      
  <!--
       Copied from HTML 3.2 DTD, with modifications (removed CDATA)
       http://www.w3.org/TR/REC-html32.html#dtd
       ================= END ===================
  -->
  
  
  
  1.1                  
jakarta-commons-sandbox/digester/src/java/org/apache/commons/digester/rss/rss-example.xml
  
  Index: rss-example.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <!DOCTYPE rss PUBLIC
   "-//Netscape Communications//DTD RSS 0.91//EN"
   "http://my.netscape.com/publish/formats/rss-0.91.dtd">
  
  <rss version="0.91">
  
    <channel>
  
      <title>MozillaZine</title>
      <link>http://www.mozillazine.org</link>
      <description>Your source for Mozilla news, advocacy,
        interviews, builds, and more!</description>
      <language>en-US</language>
      <rating>(PICS-1.1 "http://www.rsac.org/ratingsv01.html"
        2 gen true comment "RSACi North America Server"
        for "http://www.rsac.org" on "1996.04.16T08:15-0500"
        r (n 0 s 0 v 0 l 0))</rating>
  
      <image>
        <title>MozillaZine</title>
        <url>http://www.mozillazine.org/image/mynetscape88.gif</url>
        <link>http://www.mozillazine.org</link>
        <width>88</width>
        <height>31</height>
        <description>Articles, discussions, builds, and more...</description>
      </image>
  
      <item>
        <title>Java2 in Navigator 5?</title>
        <link>http://www.mozillazine.org/talkback.html?article=607</link>
        <description>Will Java2 be an integrated part of Navigator 5?
        Read more about it in this discussion...</description>
      </item>
  
      <item>
        <title>Communicator 4.61 Out</title>
        <link>http://www.mozillazine.org/talkback.html?article=606</link>
        <description>The latest version of Communicator is now
        available.  It includes security enhancements
        and various bug fixes.</description>
      </item>
  
      <item>
        <title>Mozilla Dispenses with Old,
        Proprietary DOM</title>
        <link>http://www.mozillazine.org/talkback.html?article=604</link>
      </item>
  
      <item>
        <title>The Animation Contest is Now Closed</title>
        <link>http://www.mozillazine.org/talkback.html?article=603</link>
      </item>
  
      <textinput>
        <title>Send</title>
        <description>Comments about MozillaZine?</description>
        <name>responseText</name>
        <link>http://www.mozillazine.org/cgi-bin/sampleonly.cgi</link>
      </textinput>
  
    </channel>
  
  </rss>
  
  
  

Reply via email to