You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ar...@locus.apache.org on 2000/07/11 04:27:40 UTC

cvs commit: xml-fop/src/org/apache/fop/fo FOTreeBuilder.java

arved       00/07/10 19:27:40

  Modified:    src/org/apache/fop/fo FOTreeBuilder.java
  Log:
  Expresses SAX2 support
  
  Revision  Changes    Path
  1.7       +15 -13    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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FOTreeBuilder.java	2000/06/27 22:13:16	1.6
  +++ FOTreeBuilder.java	2000/07/11 02:27:40	1.7
  @@ -1,4 +1,4 @@
  -/*-- $Id: FOTreeBuilder.java,v 1.6 2000/06/27 22:13:16 fotis Exp $ -- 
  +/*-- $Id: FOTreeBuilder.java,v 1.7 2000/07/11 02:27:40 arved Exp $ -- 
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -57,10 +57,10 @@
   import org.apache.fop.fo.pagination.Root;
   
   // SAX
  -import org.xml.sax.HandlerBase;
  +import org.xml.sax.helpers.DefaultHandler;
   import org.xml.sax.SAXException;
   import org.xml.sax.InputSource;
  -import org.xml.sax.AttributeList;
  +import org.xml.sax.Attributes;
   
   // Java
   import java.util.Hashtable;
  @@ -70,7 +70,7 @@
   /**
    * SAX Handler that builds the formatting object tree.
    */
  -public class FOTreeBuilder extends HandlerBase {
  +public class FOTreeBuilder extends DefaultHandler {
   
       /**
        * table mapping element names to the makers of objects
  @@ -168,7 +168,8 @@
       }
   
       /** SAX Handler for the end of an element */
  -    public void endElement(String name) {
  +    public void endElement(
  +		String uri, String localName, String rawName) {
   	currentFObj.end();
   	currentFObj = (FObj) currentFObj.getParent();
   	level--;
  @@ -183,7 +184,8 @@
       }
   
       /** SAX Handler for the start of an element */
  -    public void startElement(String name, AttributeList attlist)
  +    public void startElement(String uri,
  +    	String localName, String rawName, Attributes attlist)
   	throws SAXException { 
   
   	/* the formatting object started */
  @@ -195,7 +197,7 @@
   	level++;
   	int length = attlist.getLength();
   	for (int i = 0; i < length; i++) {
  -	    String att = attlist.getName(i);
  +	    String att = attlist.getRawName(i);
   	    if (att.equals("xmlns")) {
   		namespaceStack.push( new NSMap("",
   					       attlist.getValue(i),
  @@ -206,8 +208,9 @@
   					      level));
   	    }
   	}
  -	String fullName = mapName(name);
   
  +	String fullName = mapName(rawName);
  +
   	fobjMaker = (FObj.Maker) fobjTable.get(fullName);
   
   	if (fobjMaker == null) {
  @@ -220,12 +223,11 @@
   	}
   	
   	try {
  -	    fobj =
  -		fobjMaker.make(currentFObj, 
  - 	       this.propertyListBuilder.makeList(attlist,  
  -		     (currentFObj == null) ? null : currentFObj.properties));
  +		PropertyList list = this.propertyListBuilder.makeList(attlist,  
  +		     (currentFObj == null) ? null : currentFObj.properties);
  +	    fobj = fobjMaker.make(currentFObj, list);
   	} catch (FOPException e) {
  -	    throw new SAXException(e);
  +		throw new SAXException(e);
   	}
   
   	if (rootFObj == null) {