You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2004/06/08 21:02:52 UTC

cvs commit: cocoon-2.1/src/blocks/html/java/org/apache/cocoon/transformation HTMLTransformer.java

vgritsenko    2004/06/08 12:02:52

  Modified:    src/blocks/html/conf tidy.xmap
               src/blocks/html/java/org/apache/cocoon/transformation
                        HTMLTransformer.java
  Added:       src/blocks/html/WEB-INF tidy.properties
  Log:
  Add tidy.properties file, can be used by HTMLGenerator / HTMLTransformer.
  Properties file contains complete list of jTidy properties with defaults.
  
  Revision  Changes    Path
  1.1                  cocoon-2.1/src/blocks/html/WEB-INF/tidy.properties
  
  Index: tidy.properties
  ===================================================================
  # CVS $Id: tidy.properties,v 1.1 2004/06/08 19:02:51 vgritsenko Exp $
  #
  # Tidy properties file used by HTMLGenerator, HTMLTransformer.
  # List compiled based on jTidy 04aug2000r7-dev, see also:
  #     http://jtidy.sourceforge.net/apidocs/org/w3c/tidy/Configuration.html
  #
  # Please note that output format properties (indent, etc) will have no
  # effect on HTMLGenerator or HTMLTransformer as they use DOM created by
  # jTidy, and not use jTidy to output actual HTML.
  # (Is there a need for HTMLReader?)
  
  
  # Spaces for indentation
  #indent-spaces=2
  # Line length
  #wrap=68
  # Tab size
  #tab-size=4
  
  # Wrap within attribute values
  #wrap-attributes=false
  # Wrap within JavaScript string literals
  #wrap-script-literals=false
  # Wrap within <![ ... ]> section tags
  #wrap-sections=true
  # Wrap within ASP pseudo elements
  #wrap-asp=true
  # Wrap within JSTE pseudo elements
  #wrap-jste=true
  # Wrap within PHP pseudo elements
  #wrap-php=true
  
  # If true attributes may use newlines
  #literal-attributes=false
  
  # If true normal output is suppressed
  #markup=false
  
  # No 'Parsing X', guessed DTD or summary
  #quiet=false
  
  # Add meta element indicating tidied doc
  #tidy-mark=true
  
  # Indent content of appropriate tags
  #indent=
  
  # Newline+indent before each attribute
  #indent-attributes=false
  
  # Suppress optional end tags
  #hide-endtags=false
  
  # Treat input as XML
  #input-xml=false
  
  # Create output as XML
  #output-xml=false
  
  # Output extensible HTML
  #output-xhtml=false
  
  # Add <?xml?> for XML docs
  #add-xml-decl=false
  
  # If set to yes PIs must end with ?>
  #assume-xml-procins=false
  
  # Avoid mapping values > 127 to entities
  #raw=false
  
  # Output tags in upper not lower case
  #uppercase-tags=false
  
  # Output attributes in upper not lower case
  #uppercase-attributes=false
  
  # Remove presentational clutter
  #clean=false
  
  # Replace i by em and b by strong
  #logical-emphasis=false
  
  # Draconian cleaning for Word2000
  #word-2000=false
  
  # Discard empty p elements
  #drop-empty-paras=true
  
  # Discard presentation tags
  #drop-font-tags=false
  
  # If yes text at body is wrapped in <p>'s
  #enclose-text=false
  
  # If yes text in blocks is wrapped in <p>'s
  #enclose-block-text=false
  
  # Default text for alt attribute
  #alt-text=
  
  # If set to yes adds xml:space attr as needed
  #add-xml-space=false
  
  # Fix comments with adjacent hyphens
  #fix-bad-comments=true
  
  # Create slides on each h2 element
  #split=false
  
  # O/p newline before <br> or not?
  #break-before-br=false
  
  # Use numeric entities
  #numeric-entities=false
  
  # Output " marks as &quot;
  #quote-marks=false
  
  # Output non-breaking space as entity
  #quote-nbsp=true
  
  # Output naked ampersand as &amp;
  #quote-ampersand=true
  
  # If true then output tidied markup
  #write-back=false
  
  # If yes last modied time is preserved
  #keep-time=true
  
  # However errors are always shown
  #show-warnings=true
  
  # File name to write errors to
  #error-file=
  
  # Style sheet for slides
  #slide-style=
  
  
  #new-inline-tags=
  #new-blocklevel-tags=
  #new-empty-tags=
  #new-pre-tags=
  
  #char-encoding=ASCII
  
  # User specified doctype
  #doctype=
  
  # Fix URLs by replacing \ with /
  #fix-backslash=true
  
  # If true format error output for GNU Emacs
  #gnu-emacs=false
  
  
  
  1.5       +5 -1      cocoon-2.1/src/blocks/html/conf/tidy.xmap
  
  Index: tidy.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/html/conf/tidy.xmap,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- tidy.xmap	11 Mar 2004 16:25:47 -0000	1.4
  +++ tidy.xmap	8 Jun 2004 19:02:52 -0000	1.5
  @@ -20,5 +20,9 @@
   
       <map:generator name="html" logger="sitemap.generator.html"
                      src="org.apache.cocoon.generation.HTMLGenerator"
  -                   label="content"/>
  +                   label="content">
  +      <!-- Tidy configuration file.
  +      <jtidy-config>context://WEB-INF/tidy.properties</jtidy-config>
  +      -->
  +    </map:generator>
   </xmap>
  
  
  
  1.5       +9 -8      cocoon-2.1/src/blocks/html/java/org/apache/cocoon/transformation/HTMLTransformer.java
  
  Index: HTMLTransformer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/html/java/org/apache/cocoon/transformation/HTMLTransformer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HTMLTransformer.java	5 Mar 2004 13:01:57 -0000	1.4
  +++ HTMLTransformer.java	8 Jun 2004 19:02:52 -0000	1.5
  @@ -40,23 +40,26 @@
   import org.xml.sax.SAXException;
   
   /**
  - * Unstable transformer: converts (escaped) HTML snippets into JTidied HTML. 
  + * Converts (escaped) HTML snippets into JTidied HTML. 
    * This transformer expects a list of elements, passed as comma separated
    * values of the "tags" parameter. It records the text enclosed in such
    * elements and pass it thru JTidy to obtain valid XHTML.
  - * TODO: add namespace support.
  - * WARNING: this transformer should be considered unstable.
  + *
  + * <p>TODO: Add namespace support.
  + * <p><strong>WARNING:</strong> This transformer should be considered unstable.
    *
    * @author <a href="mailto:d.madama@pro-netics.com">Daniele Madama</a>
    * @author <a href="mailto:gianugo@apache.org">Gianugo Rabellino</a>
  + *
  + * @version CVS $Id$
    */
   public class HTMLTransformer
       extends AbstractSAXTransformer
       implements Configurable {
   
  -	/**
  -	 * Properties for Tidy format
  -	 */
  +    /**
  +     * Properties for Tidy format
  +     */
       private Properties properties;
       
       /**
  @@ -104,7 +107,6 @@
       /**
        * Configure this transformer, possibly passing to it
        * a jtidy configuration file location.
  -     *
        */
       public void configure(Configuration config) throws ConfigurationException {
           String configUrl = config.getChild("jtidy-config").getValue(null);
  @@ -209,5 +211,4 @@
               this.tags.put(tok, tok);
           }
       }
  -    
   }