You're right. The check is not really needed. I simply assimilated that part to the one in startPageSequence. So, there's no real reasoning here. I'm aware of the validation scheme for the FO namespace but we're talking about renderers which don't necessarily follow the same structure as the FO tree. The problem was rather that:
The page-master1.xml test case I checked in contains several page-sequences. Now, the XML renderer gets all page-sequences first (because these calls are made during layout stage) and in the last page-sequence all pages of the document appear (even if they are in different page-sequences). That's what it looks like right now: <?xml version="1.0" encoding="UTF-8"?> <!--Produced by FOP Version 1.0dev--> <areaTree> <pageSequence/> <pageSequence/> <pageSequence/> <pageSequence/> <pageSequence> <pageViewport bounds="0 0 360000 360000"> <page> <snip/> </page> </pageViewport> <pageViewport bounds="0 0 360000 360000"> <page> etc. etc. That is primarily bad for testing but not necessarily bad for normal renderers so I didn't take any action for now. But we may want to check if we want create an area-tree level wrapper for pages in a page-sequence. On 20.01.2005 05:46:36 Glen Mazza wrote: > I don't think this is needed (unless I'm missing your reasoning here.) > The validation in the FO Tree would raise errors otherwise, at least one > page-sequence being required by the fo:root FO. The validation scheme > was designed so you don't need subsequent safety checks further downstream. > > Glen > > [EMAIL PROTECTED] schrieb: > > >jeremias 2005/01/19 13:45:07 > > > > Modified: src/java/org/apache/fop/render/xml XMLRenderer.java > > Log: > > Safety check > > > > Revision Changes Path > > 1.38 +3 -1 > > xml-fop/src/java/org/apache/fop/render/xml/XMLRenderer.java > > > > Index: XMLRenderer.java > > =================================================================== > > RCS file: > > /home/cvs/xml-fop/src/java/org/apache/fop/render/xml/XMLRenderer.java,v > > retrieving revision 1.37 > > retrieving revision 1.38 > > diff -u -r1.37 -r1.38 > > --- XMLRenderer.java 18 Jan 2005 08:55:58 -0000 1.37 > > +++ XMLRenderer.java 19 Jan 2005 21:45:07 -0000 1.38 > > @@ -313,7 +313,9 @@ > > * @see org.apache.fop.render.Renderer#stopRenderer() > > */ > > public void stopRenderer() throws IOException { > > - endElement("pageSequence"); > > + if (startedSequence) { > > + endElement("pageSequence"); > > + } > > endElement("areaTree"); > > try { > > handler.endDocument(); Jeremias Maerki