vhardy      2002/07/11 09:49:28

  Added:       sources/org/apache/batik/apps/svgbrowser
                        SquiggleInputHandlerFilter.java
  Log:
  Added support for XML/XSL documents in Squiggle. Squiggle can now load an XML 
document and apply any referenced XSL stylesheet. This also works for self-referencing 
stylesheets and literal result templates. There are two examples in 
samples/extensions/xsl: data.xml and data.xsl. To enable XSL/XML support in Squiggle, 
you need to uncomment the entry in 
resources/META-INF/services/org.apache.batik.apps.svgbrowser.SquiggleInputHandler. 
Note that the mechanism used to handle XML/XSL files is generic and can be built upon 
to add support for other types of files and, most interstingly, for file types for 
which there are converters to the SVG format
  
  Revision  Changes    Path
  1.1                  
xml-batik/sources/org/apache/batik/apps/svgbrowser/SquiggleInputHandlerFilter.java
  
  Index: SquiggleInputHandlerFilter.java
  ===================================================================
  /*****************************************************************************
   * Copyright (C) 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 which has been included with this distribution in  *
   * the LICENSE file.                                                         *
   *****************************************************************************/
  
  package org.apache.batik.apps.svgbrowser;
  
  import javax.swing.filechooser.FileFilter;
  
  import java.io.File;
  import java.net.MalformedURLException;
  
  /**
   * This class filters file for a given <tt>SquiggleInputHandler</tt>
   *
   * @author <a mailto="[EMAIL PROTECTED]">Vincent Hardy</a>
   * @version $Id: SquiggleInputHandlerFilter.java,v 1.1 2002/07/11 16:49:28 vhardy 
Exp $
   */
  public class SquiggleInputHandlerFilter extends FileFilter {
      protected SquiggleInputHandler handler;
  
      public SquiggleInputHandlerFilter(SquiggleInputHandler handler) {
          this.handler = handler;
      }
  
      public boolean accept(File f) {
          return f.isDirectory() || handler.accept(f);
      }
  
      public String getDescription() {
          StringBuffer sb = new StringBuffer();
          String extensions[] = handler.getHandledExtensions();
          int n = extensions != null ? extensions.length : 0;
          for (int i=0; i<n; i++) {
              if (i > 0) {
                  sb.append(", ");
              }
              sb.append(extensions[i]);
          }
  
          if (n > 0) {
              sb.append(" ");
          }
  
          sb.append(handler.getDescription());
          return sb.toString();
      }
  }
  
  
  

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

Reply via email to