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 gm...@apache.org on 2004/06/12 20:52:08 UTC
cvs commit: xml-fop/src/java/org/apache/fop/fo FOTreeBuilder.java FObj.java
gmazza 2004/06/12 11:52:08
Modified: src/java/org/apache/fop/fo FOTreeBuilder.java FObj.java
Log:
More solid checking to ensure first node encountered is an fo:root FO.
Revision Changes Path
1.28 +8 -6 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.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- FOTreeBuilder.java 22 May 2004 03:59:51 -0000 1.27
+++ FOTreeBuilder.java 12 Jun 2004 18:52:08 -0000 1.28
@@ -224,7 +224,14 @@
/* the node found in the FO document */
FONode foNode;
- /* the maker for the formatting object started */
+ // Check to ensure first node encountered is an fo:root
+ if (rootFObj == null) {
+ if (!namespaceURI.equals(FObj.FO_URI) || !localName.equals("root")) {
+ throw new SAXException(new FOPException("Error: Root element" +
+ " must be fo:root formatting object"));
+ }
+ }
+
ElementMapping.Maker fobjMaker = findFOMaker(namespaceURI, localName);
// System.out.println("found a " + fobjMaker.toString());
@@ -237,11 +244,6 @@
}
if (rootFObj == null) {
- if (!foNode.getName().equals("fo:root")) {
- throw new SAXException(new FOPException("Root element must"
- + " be fo:root, not "
- + foNode.getName()));
- }
rootFObj = (Root) foNode;
rootFObj.setFOTreeControl(foTreeControl);
} else {
1.41 +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.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- FObj.java 23 May 2004 17:00:00 -0000 1.40
+++ FObj.java 12 Jun 2004 18:52:08 -0000 1.41
@@ -36,7 +36,7 @@
* Base class for representation of formatting objects and their processing.
*/
public class FObj extends FONode implements Constants {
- private static final String FO_URI = "http://www.w3.org/1999/XSL/Format";
+ public static final String FO_URI = "http://www.w3.org/1999/XSL/Format";
public static PropertyMaker[] propertyListTable = null;
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org