gmazza      2004/06/15 17:27:27

  Modified:    src/java/org/apache/fop/apps Document.java
               src/java/org/apache/fop/fo FOInputHandler.java FONode.java
                        FOTreeBuilder.java FObj.java FObjMixed.java
               src/java/org/apache/fop/fo/flow BasicLink.java Block.java
                        ExternalGraphic.java Footnote.java
                        FootnoteBody.java Inline.java Leader.java
                        ListBlock.java ListItem.java ListItemLabel.java
                        PageNumber.java PageNumberCitation.java Table.java
                        TableBody.java TableCell.java TableColumn.java
                        TableRow.java
               src/java/org/apache/fop/fo/pagination ColorProfile.java
                        Declarations.java Flow.java PageSequence.java
                        Root.java Title.java
               src/java/org/apache/fop/layoutmgr BlockLayoutManager.java
  Log:
  1.) Check for fo:color-profile made to ensure no child elements during processing.
  2.) Error messages for bad fo: files now give locator (line/col. #) information.
  3.) Parent of the fo:root (FO Tree) "lowered" from apps.Document to 
fo.FOInputHandler;
  IDReferences moved from former to latter.
  
  Revision  Changes    Path
  1.21      +1 -23     xml-fop/src/java/org/apache/fop/apps/Document.java
  
  Index: Document.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/Document.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Document.java     15 Jun 2004 06:26:55 -0000      1.20
  +++ Document.java     16 Jun 2004 00:27:26 -0000      1.21
  @@ -18,20 +18,12 @@
   
   package org.apache.fop.apps;
   
  -// Java
  -import java.util.Map;
  -import java.util.Set;
  -import java.util.HashSet;
  -
   // FOP
   import org.apache.fop.area.AreaTree;
   import org.apache.fop.area.AreaTreeModel;
  -
   import org.apache.fop.fo.FOInputHandler;
   import org.apache.fop.fonts.FontInfo;
   
  -import org.apache.commons.logging.Log;
  -
   // SAX
   import org.xml.sax.SAXException;
   
  @@ -54,12 +46,6 @@
       public AreaTreeModel atModel;
   
       /**
  -     * The current set of id's in the FO tree.
  -     * This is used so we know if the FO tree contains duplicates.
  -     */
  -    private Set idReferences = new HashSet();
  -
  -    /**
        * Structure handler used to notify structure
        * events such as start end element.
        */
  @@ -97,14 +83,6 @@
        */
       public AreaTree getAreaTree() {
           return areaTree;
  -    }
  -
  -    /**
  -     * Retuns the set of ID references.
  -     * @return the ID references
  -     */
  -    public Set getIDReferences() {
  -        return idReferences;
       }
   
       /**
  
  
  
  1.18      +19 -1     xml-fop/src/java/org/apache/fop/fo/FOInputHandler.java
  
  Index: FOInputHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOInputHandler.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- FOInputHandler.java       15 Jun 2004 06:26:55 -0000      1.17
  +++ FOInputHandler.java       16 Jun 2004 00:27:26 -0000      1.18
  @@ -18,6 +18,10 @@
   
   package org.apache.fop.fo;
   
  +// Java
  +import java.util.HashSet;
  +import java.util.Set;
  +
   // FOP
   import org.apache.fop.apps.Document;
   import org.apache.fop.apps.Driver;
  @@ -69,12 +73,26 @@
       protected Log logger = null;
   
       /**
  +     * The current set of id's in the FO tree.
  +     * This is used so we know if the FO tree contains duplicates.
  +     */
  +    private Set idReferences = new HashSet();
  +
  +    /**
        * Main constructor
        * @param document the apps.Document implementation that is controlling
        * the FO Tree being built
        */
       public FOInputHandler(Document document) {
           doc = document;
  +    }
  +
  +    /**
  +     * Retuns the set of ID references.
  +     * @return the ID references
  +     */
  +    public Set getIDReferences() {
  +        return idReferences;
       }
   
       /**
  
  
  
  1.23      +23 -15    xml-fop/src/java/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- FONode.java       15 Jun 2004 06:26:55 -0000      1.22
  +++ FONode.java       16 Jun 2004 00:27:26 -0000      1.23
  @@ -28,7 +28,6 @@
   import org.apache.commons.logging.Log;
   
   // FOP
  -import org.apache.fop.apps.Document;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.apps.FOUserAgent;
   import org.apache.fop.util.CharUtilities;
  @@ -60,7 +59,7 @@
        * @return FOUserAgent
        */
       public FOUserAgent getUserAgent() {
  -        return getDocument().getDriver().getUserAgent();
  +        return getFOInputHandler().getDriver().getUserAgent();
       }
   
       /**
  @@ -68,7 +67,7 @@
        * @return the logger
        */
       public Log getLogger() {
  -        return getDocument().getDriver().getLogger();
  +        return getFOInputHandler().getDriver().getLogger();
       }
   
       /**
  @@ -101,7 +100,7 @@
        * @param localName (e.g. "table" for "fo:table")
        * @throws IllegalArgumentException if incoming node not valid for parent
        */
  -    protected void validateChildNode(String namespaceURI, String localName) {}
  +    protected void validateChildNode(Locator loc, String namespaceURI, String 
localName) {}
   
       /**
        * Adds characters (does nothing here)
  @@ -180,12 +179,12 @@
       }
   
       /**
  -     * Recursively goes up the FOTree hierarchy until the FONode is found,
  -     * which returns the parent Document.
  -     * @return the Document object that is the parent of this node.
  +     * Recursively goes up the FOTree hierarchy until the fo:root is found,
  +     * which returns the parent FOInputHandler.
  +     * @return the FOInputHandler object that is the parent of the FO Tree
        */
  -    public Document getDocument() {
  -        return parent.getDocument();
  +    public FOInputHandler getFOInputHandler() {
  +        return parent.getFOInputHandler();
       }
   
       /**
  @@ -226,9 +225,9 @@
        * (e.g., two fo:declarations within fo:root)
        * @param offendingNode incoming node that would cause a duplication.
        */
  -    protected void tooManyNodesError(String offendingNode) {
  +    protected void tooManyNodesError(Locator loc, String offendingNode) {
           throw new IllegalArgumentException(
  -            "Error: for " + getName() + ", only one " 
  +            errorText(loc) + getName() + ", only one " 
               + offendingNode + " may be declared.");
       }
   
  @@ -238,9 +237,10 @@
        * @param tooLateNode string name of node that should be earlier in document
        * @param tooEarlyNode string name of node that should be later in document
        */
  -    protected void nodesOutOfOrderError(String tooLateNode, String tooEarlyNode) {
  +    protected void nodesOutOfOrderError(Locator loc, String tooLateNode, 
  +        String tooEarlyNode) {
           throw new IllegalArgumentException(
  -            "Error: for " + getName() + ", " + tooLateNode 
  +            errorText(loc) + getName() + ", " + tooLateNode 
               + " must be declared before " + tooEarlyNode + ".");
       }
       
  @@ -250,11 +250,19 @@
        * @param nsURI namespace URI of incoming invalid node
        * @param lName local name (i.e., no prefix) of incoming node 
        */
  -    protected void invalidChildError(String nsURI, String lName) {
  +    protected void invalidChildError(Locator loc, String nsURI, String lName) {
           throw new IllegalArgumentException(
  -            "Error: " + getNodeString(nsURI, lName) + 
  +            errorText(loc) + getNodeString(nsURI, lName) + 
               " is not valid child element of " + getName() + ".");
       }
       
  +    /**
  +     * Helper function to return "Error (line#/column#)" string for
  +     * above exception messages
  +     * @param loc org.xml.sax.Locator object
  +     */
  +    protected static String errorText(Locator loc) {
  +        return "Error(" + loc.getLineNumber() + "/" + loc.getColumnNumber() + "): ";
  +    }
   }
   
  
  
  
  1.32      +2 -2      xml-fop/src/java/org/apache/fop/fo/FOTreeBuilder.java
  
  Index: FOTreeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOTreeBuilder.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- FOTreeBuilder.java        15 Jun 2004 06:26:55 -0000      1.31
  +++ FOTreeBuilder.java        16 Jun 2004 00:27:26 -0000      1.32
  @@ -234,7 +234,7 @@
               }
           } else { // check that incoming node is valid for currentFObj
               try {
  -                currentFObj.validateChildNode(namespaceURI, localName);
  +                currentFObj.validateChildNode(locator, namespaceURI, localName);
               } catch (IllegalArgumentException e) {
                   throw new SAXException(e);
               }
  @@ -254,7 +254,7 @@
   
           if (rootFObj == null) {
               rootFObj = (Root) foNode;
  -            rootFObj.setDocument(document);
  +            rootFObj.setFOInputHandler(document.getFOInputHandler());
           } else {
               currentFObj.addChild(foNode);
           }
  
  
  
  1.45      +1 -1      xml-fop/src/java/org/apache/fop/fo/FObj.java
  
  Index: FObj.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObj.java,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- FObj.java 15 Jun 2004 06:26:55 -0000      1.44
  +++ FObj.java 16 Jun 2004 00:27:26 -0000      1.45
  @@ -298,7 +298,7 @@
           if (prop != null) {
               String str = prop.getString();
               if (str != null && !str.equals("")) {
  -                Set idrefs = getDocument().getIDReferences();
  +                Set idrefs = getFOInputHandler().getIDReferences();
                   if (!idrefs.contains(str)) {
                       id = str;
                       idrefs.add(id);
  
  
  
  1.25      +3 -3      xml-fop/src/java/org/apache/fop/fo/FObjMixed.java
  
  Index: FObjMixed.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObjMixed.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- FObjMixed.java    15 Jun 2004 06:26:55 -0000      1.24
  +++ FObjMixed.java    16 Jun 2004 00:27:26 -0000      1.25
  @@ -46,8 +46,8 @@
           if (textInfo == null) {
               // Really only need one of these, but need to get fontInfo
               // stored in propMgr for later use.
  -            propMgr.setFontInfo(getDocument());
  -            textInfo = propMgr.getTextLayoutProps(getDocument());
  +            propMgr.setFontInfo(getFOInputHandler().getDocument());
  +            textInfo = 
propMgr.getTextLayoutProps(getFOInputHandler().getDocument());
           }
   
           FOText ft = new FOText(data, start, length, textInfo, this);
  @@ -55,7 +55,7 @@
           ft.setName("text");
           
           /* characters() processing empty for FOTreeHandler, not empty for RTF & 
MIFHandlers */
  -        getDocument().getFOInputHandler().characters(ft.ca, ft.startIndex, 
ft.endIndex);
  +        getFOInputHandler().characters(ft.ca, ft.startIndex, ft.endIndex);
   
           addChild(ft);
       }
  
  
  
  1.14      +2 -3      xml-fop/src/java/org/apache/fop/fo/flow/BasicLink.java
  
  Index: BasicLink.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/BasicLink.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- BasicLink.java    15 Jun 2004 06:26:55 -0000      1.13
  +++ BasicLink.java    16 Jun 2004 00:27:26 -0000      1.14
  @@ -54,7 +54,7 @@
        */
       protected void addProperties(Attributes attlist) throws FOPException {
           super.addProperties(attlist);
  -        getDocument().getFOInputHandler().startLink(this);
  +        getFOInputHandler().startLink(this);
       }
   
       public void setup() {
  @@ -142,8 +142,7 @@
        */
       public void end() {
           super.end();
  -        
  -        getDocument().getFOInputHandler().endLink();
  +        getFOInputHandler().endLink();
       }
       
       public String getName() {
  
  
  
  1.19      +2 -2      xml-fop/src/java/org/apache/fop/fo/flow/Block.java
  
  Index: Block.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Block.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Block.java        15 Jun 2004 06:26:55 -0000      1.18
  +++ Block.java        16 Jun 2004 00:27:26 -0000      1.19
  @@ -111,7 +111,7 @@
   
           setupID();
   
  -        getDocument().getFOInputHandler().startBlock(this);
  +        getFOInputHandler().startBlock(this);
       }
   
       private void setup() {
  @@ -238,7 +238,7 @@
        */
       public void end() {
           handleWhiteSpace();
  -        getDocument().getFOInputHandler().endBlock(this);
  +        getFOInputHandler().endBlock(this);
       }
   
       private void handleWhiteSpace() {
  
  
  
  1.27      +1 -1      xml-fop/src/java/org/apache/fop/fo/flow/ExternalGraphic.java
  
  Index: ExternalGraphic.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/ExternalGraphic.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- ExternalGraphic.java      15 Jun 2004 06:26:55 -0000      1.26
  +++ ExternalGraphic.java      16 Jun 2004 00:27:26 -0000      1.27
  @@ -63,7 +63,7 @@
        */
       protected void addProperties(Attributes attlist) throws FOPException {
           super.addProperties(attlist);
  -        getDocument().getFOInputHandler().image(this);
  +        getFOInputHandler().image(this);
       }
   
       /**
  
  
  
  1.11      +2 -2      xml-fop/src/java/org/apache/fop/fo/flow/Footnote.java
  
  Index: Footnote.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Footnote.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Footnote.java     15 Jun 2004 06:26:55 -0000      1.10
  +++ Footnote.java     16 Jun 2004 00:27:26 -0000      1.11
  @@ -48,7 +48,7 @@
        */
       protected void addProperties(Attributes attlist) throws FOPException {
           super.addProperties(attlist);
  -        getDocument().getFOInputHandler().startFootnote(this);
  +        getFOInputHandler().startFootnote(this);
       }
   
       /**
  @@ -79,7 +79,7 @@
       
       protected void end() {
           super.end();
  -        getDocument().getFOInputHandler().endFootnote(this);
  +        getFOInputHandler().endFootnote(this);
       }
       
       public String getName() {
  
  
  
  1.10      +2 -3      xml-fop/src/java/org/apache/fop/fo/flow/FootnoteBody.java
  
  Index: FootnoteBody.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/FootnoteBody.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- FootnoteBody.java 15 Jun 2004 06:26:55 -0000      1.9
  +++ FootnoteBody.java 16 Jun 2004 00:27:26 -0000      1.10
  @@ -52,7 +52,7 @@
        */
       protected void addProperties(Attributes attlist) throws FOPException {
           super.addProperties(attlist);
  -        getDocument().getFOInputHandler().startFootnoteBody(this);
  +        getFOInputHandler().startFootnoteBody(this);
       }
   
       public void acceptVisitor(FOTreeVisitor fotv) {
  @@ -61,8 +61,7 @@
   
       protected void end() {
           super.end();
  -        
  -        getDocument().getFOInputHandler().endFootnoteBody(this);
  +        getFOInputHandler().endFootnoteBody(this);
       }
       
       public String getName() {
  
  
  
  1.14      +2 -2      xml-fop/src/java/org/apache/fop/fo/flow/Inline.java
  
  Index: Inline.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Inline.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Inline.java       15 Jun 2004 06:26:55 -0000      1.13
  +++ Inline.java       16 Jun 2004 00:27:26 -0000      1.14
  @@ -114,7 +114,7 @@
               this.lineThrough = true;
           }
           
  -        getDocument().getFOInputHandler().startInline(this);
  +        getFOInputHandler().startInline(this);
       }
   
       /**
  @@ -139,7 +139,7 @@
        * @see org.apache.fop.fo.FONode#end
        */
       public void end() {
  -        getDocument().getFOInputHandler().endInline(this);
  +        getFOInputHandler().endInline(this);
       }
   
       public String getName() {
  
  
  
  1.26      +1 -1      xml-fop/src/java/org/apache/fop/fo/flow/Leader.java
  
  Index: Leader.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Leader.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Leader.java       15 Jun 2004 06:26:55 -0000      1.25
  +++ Leader.java       16 Jun 2004 00:27:26 -0000      1.26
  @@ -66,7 +66,7 @@
           CommonBackground bProps = propMgr.getBackgroundProps();
   
           // Common Font Properties
  -        this.fontState = propMgr.getFontState(getDocument());
  +        this.fontState = propMgr.getFontState(getFOInputHandler().getDocument());
   
           // Common Margin Properties-Inline
           CommonMarginInline mProps = propMgr.getMarginInlineProps();
  
  
  
  1.14      +2 -3      xml-fop/src/java/org/apache/fop/fo/flow/ListBlock.java
  
  Index: ListBlock.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/ListBlock.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ListBlock.java    15 Jun 2004 06:26:55 -0000      1.13
  +++ ListBlock.java    16 Jun 2004 00:27:26 -0000      1.14
  @@ -64,7 +64,7 @@
        */
       protected void addProperties(Attributes attlist) throws FOPException {
           super.addProperties(attlist);
  -        getDocument().getFOInputHandler().startList(this);
  +        getFOInputHandler().startList(this);
       }
   
       private void setup() throws FOPException {
  @@ -138,8 +138,7 @@
   
       protected void end() {
           super.end();
  -        
  -        getDocument().getFOInputHandler().endList(this);
  +        getFOInputHandler().endList(this);
       }
       
       public String getName() {
  
  
  
  1.15      +2 -2      xml-fop/src/java/org/apache/fop/fo/flow/ListItem.java
  
  Index: ListItem.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/ListItem.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ListItem.java     15 Jun 2004 06:26:55 -0000      1.14
  +++ ListItem.java     16 Jun 2004 00:27:26 -0000      1.15
  @@ -64,7 +64,7 @@
        */
       protected void addProperties(Attributes attlist) throws FOPException {
           super.addProperties(attlist);
  -        getDocument().getFOInputHandler().startListItem(this);
  +        getFOInputHandler().startListItem(this);
       }
   
       private void setup() {
  @@ -148,7 +148,7 @@
   
       protected void end() {
           super.end();
  -        getDocument().getFOInputHandler().endListItem(this);
  +        getFOInputHandler().endListItem(this);
       }
   
       public String getName() {
  
  
  
  1.16      +2 -3      xml-fop/src/java/org/apache/fop/fo/flow/ListItemLabel.java
  
  Index: ListItemLabel.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/ListItemLabel.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ListItemLabel.java        15 Jun 2004 06:26:55 -0000      1.15
  +++ ListItemLabel.java        16 Jun 2004 00:27:26 -0000      1.16
  @@ -46,7 +46,7 @@
        */
       protected void addProperties(Attributes attlist) throws FOPException {
           super.addProperties(attlist);
  -        getDocument().getFOInputHandler().startListLabel();
  +        getFOInputHandler().startListLabel();
       }
   
       private void setup() {
  @@ -85,8 +85,7 @@
   
       protected void end() {
           super.end();
  -        
  -        getDocument().getFOInputHandler().endListLabel();
  +        getFOInputHandler().endListLabel();
       }
       
       public String getName() {
  
  
  
  1.23      +3 -3      xml-fop/src/java/org/apache/fop/fo/flow/PageNumber.java
  
  Index: PageNumber.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/PageNumber.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- PageNumber.java   15 Jun 2004 06:26:55 -0000      1.22
  +++ PageNumber.java   16 Jun 2004 00:27:26 -0000      1.23
  @@ -61,7 +61,7 @@
       protected void addProperties(Attributes attlist) throws FOPException {
           super.addProperties(attlist);
           setup();
  -        getDocument().getFOInputHandler().startPageNumber(this);
  +        getFOInputHandler().startPageNumber(this);
       }
   
       public void setup() {
  @@ -77,7 +77,7 @@
           CommonBackground bProps = propMgr.getBackgroundProps();
   
           // Common Font Properties
  -        this.fontState = propMgr.getFontState(getDocument());
  +        this.fontState = propMgr.getFontState(getFOInputHandler().getDocument());
   
           // Common Margin Properties-Inline
           CommonMarginInline mProps = propMgr.getMarginInlineProps();
  @@ -129,7 +129,7 @@
       }
   
       protected void end() {
  -        getDocument().getFOInputHandler().endPageNumber(this);
  +        getFOInputHandler().endPageNumber(this);
       }
       
       public String getName() {
  
  
  
  1.23      +1 -1      xml-fop/src/java/org/apache/fop/fo/flow/PageNumberCitation.java
  
  Index: PageNumberCitation.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/PageNumberCitation.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- PageNumberCitation.java   15 Jun 2004 06:26:55 -0000      1.22
  +++ PageNumberCitation.java   16 Jun 2004 00:27:26 -0000      1.23
  @@ -82,7 +82,7 @@
           CommonBackground bProps = propMgr.getBackgroundProps();
   
           // Common Font Properties
  -        this.fontState = propMgr.getFontState(getDocument());
  +        this.fontState = propMgr.getFontState(getFOInputHandler().getDocument());
   
           // Common Margin Properties-Inline
           CommonMarginInline mProps = propMgr.getMarginInlineProps();
  
  
  
  1.18      +2 -2      xml-fop/src/java/org/apache/fop/fo/flow/Table.java
  
  Index: Table.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Table.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Table.java        15 Jun 2004 06:26:55 -0000      1.17
  +++ Table.java        16 Jun 2004 00:27:26 -0000      1.18
  @@ -81,7 +81,7 @@
       protected void addProperties(Attributes attlist) throws FOPException {
           super.addProperties(attlist);
           setupID();
  -        getDocument().getFOInputHandler().startTable(this);
  +        getFOInputHandler().startTable(this);
       }
   
       /**
  @@ -203,7 +203,7 @@
       }
   
       protected void end() {
  -        getDocument().getFOInputHandler().endTable(this);
  +        getFOInputHandler().endTable(this);
       }
   
       public String getName() {
  
  
  
  1.14      +2 -2      xml-fop/src/java/org/apache/fop/fo/flow/TableBody.java
  
  Index: TableBody.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableBody.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- TableBody.java    15 Jun 2004 06:26:55 -0000      1.13
  +++ TableBody.java    16 Jun 2004 00:27:26 -0000      1.14
  @@ -57,7 +57,7 @@
       protected void addProperties(Attributes attlist) throws FOPException {
           super.addProperties(attlist);
           setupID();
  -        getDocument().getFOInputHandler().startBody(this);
  +        getFOInputHandler().startBody(this);
       }
   
       private void setup() throws FOPException {
  @@ -104,7 +104,7 @@
       }
   
       protected void end() {
  -        getDocument().getFOInputHandler().endBody(this);
  +        getFOInputHandler().endBody(this);
       }
   
       public String getName() {
  
  
  
  1.16      +2 -2      xml-fop/src/java/org/apache/fop/fo/flow/TableCell.java
  
  Index: TableCell.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableCell.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- TableCell.java    15 Jun 2004 06:26:55 -0000      1.15
  +++ TableCell.java    16 Jun 2004 00:27:26 -0000      1.16
  @@ -123,7 +123,7 @@
       protected void addProperties(Attributes attlist) throws FOPException {
           super.addProperties(attlist);
           doSetup();    // init some basic property values
  -        getDocument().getFOInputHandler().startCell(this);
  +        getFOInputHandler().startCell(this);
       }
   
       /**
  @@ -348,7 +348,7 @@
       }
   
       protected void end() {
  -        getDocument().getFOInputHandler().endCell(this);
  +        getFOInputHandler().endCell(this);
       }
       
       public String getName() {
  
  
  
  1.19      +2 -2      xml-fop/src/java/org/apache/fop/fo/flow/TableColumn.java
  
  Index: TableColumn.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableColumn.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- TableColumn.java  15 Jun 2004 06:26:55 -0000      1.18
  +++ TableColumn.java  16 Jun 2004 00:27:26 -0000      1.19
  @@ -60,7 +60,7 @@
       protected void addProperties(Attributes attlist) throws FOPException {
           super.addProperties(attlist);
           initialize();    // init some basic property values
  -        getDocument().getFOInputHandler().startColumn(this);
  +        getFOInputHandler().startColumn(this);
       }
   
       /**
  @@ -124,7 +124,7 @@
       }
   
       protected void end() {
  -        getDocument().getFOInputHandler().endColumn(this);
  +        getFOInputHandler().endColumn(this);
       }
       
       public String getName() {
  
  
  
  1.19      +2 -2      xml-fop/src/java/org/apache/fop/fo/flow/TableRow.java
  
  Index: TableRow.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableRow.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- TableRow.java     15 Jun 2004 06:26:55 -0000      1.18
  +++ TableRow.java     16 Jun 2004 00:27:26 -0000      1.19
  @@ -68,7 +68,7 @@
       protected void addProperties(Attributes attlist) throws FOPException {
           super.addProperties(attlist);
           setupID();
  -        getDocument().getFOInputHandler().startRow(this);
  +        getFOInputHandler().startRow(this);
       }
   
       /**
  @@ -145,7 +145,7 @@
       }
   
       protected void end() {
  -        getDocument().getFOInputHandler().endRow(this);
  +        getFOInputHandler().endRow(this);
       }
       
       public String getName() {
  
  
  
  1.9       +10 -1     xml-fop/src/java/org/apache/fop/fo/pagination/ColorProfile.java
  
  Index: ColorProfile.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/ColorProfile.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ColorProfile.java 12 Jun 2004 23:18:52 -0000      1.8
  +++ ColorProfile.java 16 Jun 2004 00:27:26 -0000      1.9
  @@ -24,6 +24,7 @@
   import java.net.URL;
   import java.io.IOException;
   import java.io.InputStream;
  +import org.xml.sax.Locator;
   
   // FOP
   import org.apache.fop.datatypes.ColorType;
  @@ -46,6 +47,14 @@
        */
       public ColorProfile(FONode parent) {
           super(parent);
  +    }
  +
  +    /**
  +     * @see org.apache.fop.fo.FONode#validateChildNode(String, String)
  +        XSL 1.0/FOP: EMPTY (no child nodes permitted)
  +     */
  +    protected void validateChildNode(Locator loc, String nsURI, String localName) {
  +        invalidChildError(loc, nsURI, localName);
       }
   
       /**
  
  
  
  1.9       +5 -4      xml-fop/src/java/org/apache/fop/fo/pagination/Declarations.java
  
  Index: Declarations.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Declarations.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Declarations.java 15 Jun 2004 06:26:56 -0000      1.8
  +++ Declarations.java 16 Jun 2004 00:27:26 -0000      1.9
  @@ -29,6 +29,7 @@
   import org.apache.fop.fo.FObj;
   import org.apache.fop.fo.FOTreeVisitor;
   import org.apache.fop.fo.XMLObj;
  +import org.xml.sax.Locator;
   
   
   /**
  @@ -54,12 +55,12 @@
       /**
        * @see org.apache.fop.fo.FONode#validateChildNode(String, String)
           XSL 1.0: (color-profile)+ (and non-XSL NS nodes)
  -        FOP (currently): (color-profile)* (and non-XSL NS nodes)
  +        FOP/XSL 1.1: (color-profile)* (and non-XSL NS nodes)
        */
  -    protected void validateChildNode(String nsURI, String localName) {
  +    protected void validateChildNode(Locator loc, String nsURI, String localName) {
           if (nsURI == FOElementMapping.URI) {
               if (!localName.equals("color-profile")) {   
  -                invalidChildError(nsURI, localName);
  +                invalidChildError(loc, nsURI, localName);
               }
           } // anything outside of XSL namespace is OK.
       }
  
  
  
  1.12      +3 -3      xml-fop/src/java/org/apache/fop/fo/pagination/Flow.java
  
  Index: Flow.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Flow.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Flow.java 15 Jun 2004 06:26:56 -0000      1.11
  +++ Flow.java 16 Jun 2004 00:27:26 -0000      1.12
  @@ -92,14 +92,14 @@
           // Now done in addChild of page-sequence
           //pageSequence.addFlow(this);
   
  -        getDocument().getFOInputHandler().startFlow(this);
  +        getFOInputHandler().startFlow(this);
       }
   
       /**
        * Tell the StructureRenderer that we are at the end of the flow.
        */
       public void end() {
  -        getDocument().getFOInputHandler().endFlow(this);
  +        getFOInputHandler().endFlow(this);
       }
   
       /**
  
  
  
  1.25      +2 -2      xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java
  
  Index: PageSequence.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- PageSequence.java 15 Jun 2004 06:26:56 -0000      1.24
  +++ PageSequence.java 16 Jun 2004 00:27:26 -0000      1.25
  @@ -291,7 +291,7 @@
        */
       private void startStructuredPageSequence() {
           if (!sequenceStarted) {
  -            getDocument().getFOInputHandler().startPageSequence(this);
  +            getFOInputHandler().startPageSequence(this);
               sequenceStarted = true;
           }
       }
  @@ -303,7 +303,7 @@
        */
       public void end() {
           try {
  -            this.getDocument().getFOInputHandler().endPageSequence(this);
  +            getFOInputHandler().endPageSequence(this);
           } catch (FOPException fopex) {
               getLogger().error("Error in PageSequence.end(): "
                 + fopex.getMessage(), fopex);
  
  
  
  1.16      +26 -22    xml-fop/src/java/org/apache/fop/fo/pagination/Root.java
  
  Index: Root.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Root.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Root.java 15 Jun 2004 06:26:56 -0000      1.15
  +++ Root.java 16 Jun 2004 00:27:26 -0000      1.16
  @@ -22,13 +22,14 @@
   import java.util.List;
   
   // FOP
  -import org.apache.fop.apps.Document;
   import org.apache.fop.fo.FONode;
   import org.apache.fop.fo.FObj;
   import org.apache.fop.fo.FOElementMapping;
   import org.apache.fop.fo.extensions.ExtensionElementMapping;
   import org.apache.fop.fo.extensions.Bookmarks;
  +import org.apache.fop.fo.FOInputHandler;
   import org.apache.fop.fo.FOTreeVisitor;
  +import org.xml.sax.Locator;
   
   /**
    * The fo:root formatting object. Contains page masters, page-sequences.
  @@ -47,7 +48,10 @@
        */
       private int runningPageNumberCounter = 0;
   
  -    private Document document = null;
  +    /** 
  +     * Controlling FOTreeHandler object for this FO Tree
  +     */
  +    private FOInputHandler foInputHandler = null;
   
       /**
        * @see org.apache.fop.fo.FONode#FONode(FONode)
  @@ -66,43 +70,43 @@
           XSL 1.0 Spec: (layout-master-set,declarations?,page-sequence+)
           FOP: (layout-master-set, declarations?, fox:bookmarks?, page-sequence+)
        */
  -    protected void validateChildNode(String nsURI, String localName) {
  +    protected void validateChildNode(Locator loc, String nsURI, String localName) {
           if (nsURI == FOElementMapping.URI) {
               if (localName.equals("layout-master-set")) {   
                   if (layoutMasterSet != null) {
  -                    tooManyNodesError("fo:layout-master-set");
  +                    tooManyNodesError(loc, "fo:layout-master-set");
                   }
               } else if (localName.equals("declarations")) { 
                   if (layoutMasterSet == null) {
  -                    nodesOutOfOrderError("fo:layout-master-set", "fo:declarations");
  +                    nodesOutOfOrderError(loc, "fo:layout-master-set", 
"fo:declarations");
                   } else if (declarations != null) {
  -                    tooManyNodesError("fo:declarations");
  +                    tooManyNodesError(loc, "fo:declarations");
                   } else if (bookmarks != null) {
  -                    nodesOutOfOrderError("fo:declarations", "fox:bookmarks");
  +                    nodesOutOfOrderError(loc, "fo:declarations", "fox:bookmarks");
                   } else if (pageSequenceFound) {
  -                    nodesOutOfOrderError("fo:declarations", "fo:page-sequence");
  +                    nodesOutOfOrderError(loc, "fo:declarations", 
"fo:page-sequence");
                   }
               } else if (localName.equals("page-sequence")) { 
                   if (layoutMasterSet == null) {
  -                    nodesOutOfOrderError("fo:layout-master-set", 
"fo:page-sequence");
  +                    nodesOutOfOrderError(loc, "fo:layout-master-set", 
"fo:page-sequence");
                   } else {
                       pageSequenceFound = true;
                   }
               } else {
  -                invalidChildError(nsURI, localName);
  +                invalidChildError(loc, nsURI, localName);
               }
           } else if (nsURI.equals(ExtensionElementMapping.URI)) {
               if (!localName.equals("bookmarks")) {
  -                invalidChildError(nsURI, localName);
  +                invalidChildError(loc, nsURI, localName);
               } else if (layoutMasterSet == null) {
  -                nodesOutOfOrderError("fo:layout-master-set", "fox:bookmarks");
  +                nodesOutOfOrderError(loc, "fo:layout-master-set", "fox:bookmarks");
               } else if (bookmarks != null) {
  -                tooManyNodesError("fox:bookmarks");
  +                tooManyNodesError(loc, "fox:bookmarks");
               } else if (pageSequenceFound) {
  -                nodesOutOfOrderError("fox:bookmarks", "fo:page-sequence");
  +                nodesOutOfOrderError(loc, "fox:bookmarks", "fo:page-sequence");
               }
           } else {
  -            invalidChildError(nsURI, localName);
  +            invalidChildError(loc, nsURI, localName);
           }
       }
   
  @@ -201,19 +205,19 @@
        * @param document the apps.Document implementation to which this Root
        * is attached
        */
  -    public void setDocument(Document document) {
  -        this.document = document;
  +    public void setFOInputHandler(FOInputHandler foInputHandler) {
  +        this.foInputHandler = foInputHandler;
       }
   
       /**
        * This method overrides the FONode version. The FONode version calls the
        * method by the same name for the parent object. Since Root is at the top
  -     * of the tree, it returns the actual apps.Document object. Thus, any FONode
  -     * can use this chain to find which apps.Document it is being built for.
  -     * @return the Document implementation that this Root is attached to
  +     * of the tree, it returns the actual FOInputHandler object. Thus, any FONode
  +     * can use this chain to find which FOInputHandler it is being built for.
  +     * @return the FOInputHandler implementation that this Root is attached to
        */
  -    public Document getDocument() {
  -        return document;
  +    public FOInputHandler getFOInputHandler() {
  +        return foInputHandler;
       }
   
       /**
  
  
  
  1.18      +2 -2      xml-fop/src/java/org/apache/fop/fo/pagination/Title.java
  
  Index: Title.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Title.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Title.java        15 Jun 2004 06:26:56 -0000      1.17
  +++ Title.java        16 Jun 2004 00:27:26 -0000      1.18
  @@ -59,7 +59,7 @@
           CommonBackground bProps = propMgr.getBackgroundProps();
   
           // Common Font Properties
  -        Font fontState = propMgr.getFontState(getDocument());
  +        Font fontState = propMgr.getFontState(getFOInputHandler().getDocument());
   
           // Common Margin Properties-Inline
           CommonMarginInline mProps = propMgr.getMarginInlineProps();
  
  
  
  1.22      +1 -1      
xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
  
  Index: BlockLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- BlockLayoutManager.java   15 Jun 2004 06:26:56 -0000      1.21
  +++ BlockLayoutManager.java   16 Jun 2004 00:27:27 -0000      1.22
  @@ -74,7 +74,7 @@
           childLMiter = new BlockLMiter(this, childLMiter);
           userAgent = inBlock.getUserAgent();
           setBlockTextInfo(inBlock.getPropertyManager().getTextLayoutProps(
  -            inBlock.getDocument()));
  +            inBlock.getFOInputHandler().getDocument()));
       }
   
       private void setBlockTextInfo(TextInfo ti) {
  
  
  

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

Reply via email to