cvs commit: xml-fop/src/org/apache/fop/svg SVGElement.java SVGElementMapping.java

2001-10-05 Thread keiron

keiron  01/10/05 03:29:48

  Modified:src/org/apache/fop/svg SVGElement.java
SVGElementMapping.java
  Log:
  fixed a couple of occasional problems with svg + batik
  
  Revision  ChangesPath
  1.15  +7 -1  xml-fop/src/org/apache/fop/svg/SVGElement.java
  
  Index: SVGElement.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/svg/SVGElement.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- SVGElement.java   2001/09/26 12:00:43 1.14
  +++ SVGElement.java   2001/10/05 10:29:48 1.15
  @@ -1,5 +1,5 @@
   /*
  - * $Id: SVGElement.java,v 1.14 2001/09/26 12:00:43 keiron Exp $
  + * $Id: SVGElement.java,v 1.15 2001/10/05 10:29:48 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
  @@ -17,6 +17,7 @@
   import org.apache.fop.configuration.Configuration;
   
   import org.apache.batik.dom.svg.*;
  +import org.apache.batik.dom.util.XMLSupport;
   import org.w3c.dom.*;
   import org.w3c.dom.svg.*;
   import org.w3c.dom.svg.SVGLength;
  @@ -146,6 +147,11 @@
   }
   
   Element e = ((SVGDocument)doc).getRootElement();
  +
  +//if(!e.hasAttributeNS(XMLSupport.XMLNS_NAMESPACE_URI, "xmlns")) {
  +e.setAttributeNS(XMLSupport.XMLNS_NAMESPACE_URI, "xmlns", 
SVGDOMImplementation.SVG_NAMESPACE_URI);
  +//}
  +
   String s;
   SVGUserAgent userAgent = new SVGUserAgent(new AffineTransform());
   userAgent.setLogger(log);
  
  
  
  1.17  +9 -1  xml-fop/src/org/apache/fop/svg/SVGElementMapping.java
  
  Index: SVGElementMapping.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/svg/SVGElementMapping.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- SVGElementMapping.java2001/09/24 09:17:12 1.16
  +++ SVGElementMapping.java2001/10/05 10:29:48 1.17
  @@ -1,5 +1,5 @@
   /*
  - * $Id: SVGElementMapping.java,v 1.16 2001/09/24 09:17:12 keiron Exp $
  + * $Id: SVGElementMapping.java,v 1.17 2001/10/05 10:29:48 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
  @@ -14,7 +14,10 @@
   import org.apache.fop.fo.TreeBuilder;
   import org.apache.fop.fo.FOTreeBuilder;
   import org.apache.fop.fo.ElementMapping;
  +import org.apache.fop.apps.Driver;
   
  +import org.apache.batik.util.XMLResourceDescriptor;
  +
   public class SVGElementMapping implements ElementMapping {
   
   private static HashMap foObjs = null;
  @@ -22,6 +25,11 @@
   public synchronized void addToBuilder(TreeBuilder builder) {
   
   if(foObjs == null) {
  +// this sets the parser that will be used
  +// by default (SVGBrokenLinkProvider)
  +// normally the user agent value is used
  +
XMLResourceDescriptor.setXMLParserClassName(Driver.getParserClassName());
  +
   foObjs = new HashMap();
   foObjs.put("svg", SVGElement.maker());
   foObjs.put("rect", SVGObj.maker("rect"));
  
  
  

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




cvs commit: xml-fop/src/org/apache/fop/svg SVGElement.java SVGElementMapping.java SVGObj.java XMLObj.java SVGStringProperty.java

2001-09-12 Thread keiron

keiron  01/09/12 02:28:14

  Modified:src/org/apache/fop/fo FOTreeBuilder.java TreeBuilder.java
   src/org/apache/fop/svg SVGElement.java
SVGElementMapping.java SVGObj.java XMLObj.java
  Added:   src/org/apache/fop/fo DirectPropertyListBuilder.java
  Removed: src/org/apache/fop/svg SVGStringProperty.java
  Log:
  made the construction of foreign name dom a bit more direct
  and simple reducing number of classes
  
  Revision  ChangesPath
  1.27  +12 -1 xml-fop/src/org/apache/fop/fo/FOTreeBuilder.java
  
  Index: FOTreeBuilder.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FOTreeBuilder.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- FOTreeBuilder.java2001/08/21 08:26:11 1.26
  +++ FOTreeBuilder.java2001/09/12 09:28:13 1.27
  @@ -1,5 +1,5 @@
   /*
  - * $Id: FOTreeBuilder.java,v 1.26 2001/08/21 08:26:11 keiron Exp $
  + * $Id: FOTreeBuilder.java,v 1.27 2001/09/12 09:28:13 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
  @@ -137,6 +137,17 @@
   this.propertylistTable.put(namespaceURI, plb);
   } else {
   plb.addElementList(localName, list);
  +}
  +}
  +
  +public void addPropertyListBuilder(String namespaceURI,
  +   PropertyListBuilder propbuilder) {
  +PropertyListBuilder plb;
  +plb = (PropertyListBuilder)this.propertylistTable.get(namespaceURI);
  +if (plb == null) {
  +this.propertylistTable.put(namespaceURI, propbuilder);
  +} else {
  +// Error already added
   }
   }
   
  
  
  
  1.4   +3 -14 xml-fop/src/org/apache/fop/fo/TreeBuilder.java
  
  Index: TreeBuilder.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/TreeBuilder.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TreeBuilder.java  2001/08/20 11:19:22 1.3
  +++ TreeBuilder.java  2001/09/12 09:28:13 1.4
  @@ -1,5 +1,5 @@
   /*
  - * $Id: TreeBuilder.java,v 1.3 2001/08/20 11:19:22 keiron Exp $
  + * $Id: TreeBuilder.java,v 1.4 2001/09/12 09:28:13 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
  @@ -7,21 +7,8 @@
   
   package org.apache.fop.fo;
   
  -// FOP
  -import org.apache.fop.layout.AreaTree;
  -import org.apache.fop.apps.FOPException;
  -import org.apache.fop.fo.pagination.Root;
  -
  -// SAX
  -import org.xml.sax.helpers.DefaultHandler;
  -import org.xml.sax.SAXException;
  -import org.xml.sax.InputSource;
  -import org.xml.sax.Attributes;
  -
   // Java
   import java.util.Hashtable;
  -import java.util.Stack;
  -import java.io.IOException;
   
   /**
*/
  @@ -46,6 +33,8 @@
* @param maker Maker for class representing formatting object
*/
   public void addPropertyList(String namespaceURI, Hashtable list);
  +
  +public void addPropertyListBuilder(String namespaceURI, PropertyListBuilder 
list);
   
   /**
* add a mapping from element name to maker.
  
  
  
  1.1  xml-fop/src/org/apache/fop/fo/DirectPropertyListBuilder.java
  
  Index: DirectPropertyListBuilder.java
  ===
  /*
   * $Id: DirectPropertyListBuilder.java,v 1.1 2001/09/12 09:28:13 keiron Exp $
   * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
   * For details on use and redistribution please refer to the
   * LICENSE file included with these sources.
   */
  
  package org.apache.fop.fo;
  
  import org.apache.fop.fo.properties.*;
  import org.apache.fop.svg.*;
  import org.apache.fop.datatypes.*;
  
  import org.apache.fop.apps.FOPException;
  
  import org.xml.sax.Attributes;
  
  /**
   * This is a property list builder that bypasses overhead.
   * The attribute list is made available directly so it can
   * be used to build a dom.
   * Note: there should be a better way to handle this and
   * the attribute list is only valid within the startElement
   * call of the sax events.
   */
  public class DirectPropertyListBuilder extends PropertyListBuilder {
  
  public DirectPropertyListBuilder() {
  }
  
  public PropertyList makeList(String elementName, Attributes attributes,
   PropertyList parentPropertyList,
   FObj parentFO) throws FOPException {
  AttrPropertyList ret = new AttrPropertyList(attributes);
  return ret;
  }
  
  pub