I streamed the transformation to a file (using the built-in Coldfusion
transform function). I brought the streamed FO into OxygenXML which uses
FOP 0.94. FOP complained at this line:

<?xml version="1.0" encoding="ISO8859-1"?>

I then changed it to:
<?xml version="1.0" encoding="ISO-8859-1"?>

I then ran the PDF transformation (from OxygenXML) and it ran fine
outputting the PDF.

I'm assuming the encoding error was introduced by the transformation
method because my XML and XSL have the appropriate encoding specified in
both of them (ie. ISO-8859-1).

I'm really at a loss here. Here's the full exception message:

Notes
- several lines complaining about the required content model
- "44 more ---------" in the middle of the exception - 44 more required
content model errors?

javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: Error(Unknown location): fo:root
is missing child elements. Required Content Model: (layout-master-set,
declarations?, bookmark-tree?, page-sequence+) at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.j
ava:714) at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Trans
formerImpl.java:2318) at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Transfo
rmerImpl.java:2185) at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerIm
pl.java:1263) at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
ava:671) at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
ava:1179) at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
ava:1157) at MyFop.render(MyFop.java:162) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at
coldfusion.runtime.StructBean.invoke(StructBean.java:498) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2291) at
cffoptest2ecfm567750703.runPage(C:\ColdFusion8\wwwroot\foptest.cfm:49)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:192) at
coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:366) at
coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at
coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:279)
at
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:
48) at
coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at
coldfusion.filter.PathFilter.invoke(PathFilter.java:86) at
coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27) at
coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersist
enceFilter.java:28) at
coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at
coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at
coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at
coldfusion.CfmServlet.service(CfmServlet.java:175) at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServ
letFilter.java:42) at
coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at
jrun.servlet.FilterChain.service(FilterChain.java:101) at
jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:284
) at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543
) at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172) at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.j
ava:320) at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java
:428) at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.jav
a:266) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66) 

Caused by: org.apache.fop.fo.ValidationException: Error(Unknown
location): fo:root is missing child elements. Required Content Model:
(layout-master-set, declarations?, bookmark-tree?, page-sequence+) at
org.apache.fop.fo.FONode.missingChildElementError(FONode.java:425) at
org.apache.fop.fo.pagination.Root.endOfNode(Root.java:87) at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.j
ava:378) at
org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:194) at
org.apache.xml.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.jav
a:293) at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.j
ava:705)

... 44 more --------- 

org.apache.fop.fo.ValidationException: Error(Unknown location): fo:root
is missing child elements. Required Content Model: (layout-master-set,
declarations?, bookmark-tree?, page-sequence+) at
org.apache.fop.fo.FONode.missingChildElementError(FONode.java:425) at
org.apache.fop.fo.pagination.Root.endOfNode(Root.java:87) at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.j
ava:378) at
org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:194) at
org.apache.xml.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.jav
a:293) at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.j
ava:705) at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Trans
formerImpl.java:2318) at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Transfo
rmerImpl.java:2185) at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerIm
pl.java:1263) at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
ava:671) at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
ava:1179) at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
ava:1157) at MyFop.render(MyFop.java:162) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at
coldfusion.runtime.StructBean.invoke(StructBean.java:498) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2291) at
cffoptest2ecfm567750703.runPage(C:\ColdFusion8\wwwroot\foptest.cfm:49)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:192) at
coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:366) at
coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at
coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:279)
at
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:
48) at
coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at
coldfusion.filter.PathFilter.invoke(PathFilter.java:86) at
coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27) at
coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersist
enceFilter.java:28) at
coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at
coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at
coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at
coldfusion.CfmServlet.service(CfmServlet.java:175) at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServ
letFilter.java:42) at
coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at
jrun.servlet.FilterChain.service(FilterChain.java:101) at
jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:284
) at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543
) at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172) at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.j
ava:320) at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java
:428) at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.jav
a:266) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66) 
> -----Original Message-----
> From: Jeremias Maerki [mailto:[EMAIL PROTECTED] 
> Sent: March 4, 2008 8:19 AM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: fo:simple-page-master is missing child elements
> 
> I can only repeat myself: Is the error message here really 
> the only message in FOP's output?
> 
> To isolate the problem further you can just generate the FO 
> file in your application and stream that to a file. Then run 
> that FO file through FOP from the command-line. If it works 
> that way, you probably have a namespace problem in your code 
> (which should show up as error message in FOP's log output).
> 
> On 04.03.2008 13:06:41 Fournier,Danny [NCR] wrote:
> > First thank you both Jeremias and Miroslav. Getting rid of 
> the border 
> > did fix it at my end too - well, for the example file I 
> initially sent.
> > 
> > However, after applying the same fix to my original file, I get the 
> > same error. There must be some markup that is not supported thus 
> > throwing this generic error?. I'll try to find a validator 
> that could 
> > potentially shed some light on this. I usually just put the 
> FO file in 
> > XML Spy and it would indicate to me what was wrong. So far, 
> it doesn't 
> > complain at this FO though.
> > 
> > @Jeremias Maerki:
> > 
> > I'm using Coldfusion to generate the XML, and read in an 
> XSL file that 
> > I created in XMLSpy. I then pass those two variables stored 
> in memory 
> > to my custom FOP class which accepts these sorts of parameters.
> > 
> > Here's a snippet:
> > 
> > public String setXSLT(String strXSLT){
> >     try{
> >             this.xslt = new
> > ByteArrayInputStream(strXSLT.getBytes("ISO-8859-1"));
> >             return "";      
> >                     
> >     }
> >     catch(UnsupportedEncodingException uee){                        
> >             return getStackTrace(uee);
> >     }       
> > }
> > 
> > @Miroslav Pukhalsky
> > 
> > I am using 0.94. Not sure if this makes any difference?
> > 
> > Thanks again to all.
> > 
> > Dan
> > 
> > > -----Original Message-----
> > > From: Jeremias Maerki [mailto:[EMAIL PROTECTED]
> > > Sent: March 4, 2008 2:56 AM
> > > To: fop-users@xmlgraphics.apache.org
> > > Subject: Re: fo:simple-page-master is missing child elements
> > > 
> > > Hmm, I cannot reproduce the error with your example file. 
> I get an 
> > > error,
> > > though: you specified a border on region-body which is 
> not allowed 
> > > by the spec. But if I remove the border, everything is 
> fine. Shrug.
> > > 
> > > Are you using a peculiar XML parsing setup? Maybe the 
> generated FO 
> > > looks ok (if it is serialized to a file), but FOP does 
> not receive 
> > > the SAX events with the proper namespace information. Is 
> the error 
> > > message here really the only message in FOP's output?
> > > 
> > > On 03.03.2008 20:14:34 Fournier,Danny [NCR] wrote:
> > > > Thanks Jay and Andreas.
> > > > 
> > > > What if I keep getting errors even though I have the
> > > minimalistic of FO?
> > > > 
> > > > fo:root is missing child elements. 
> > > > Required Content Model: (layout-master-set, declarations?, 
> > > > bookmark-tree?, page-sequence+)
> > > > 
> > > > <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
> > > > 
> > > >         <fo:layout-master-set>
> > > >                 <fo:simple-page-master page-width="8.5in"
> > > > page-height="11in" master-name="myPages">
> > > >                         <fo:region-body margin-right="0mm"
> > > > margin-left="0mm" margin-bottom="0mm" margin-top="0mm"/>
> > > >                 </fo:simple-page-master>
> > > >                 <fo:simple-page-master page-width="8.5in"
> > > > page-height="11in" master-name="inventoryPages">
> > > >                         <fo:region-body border="0.5pt 
> solid #000"
> > > > margin-right="8mm" margin-left="7mm" margin-bottom="41mm"
> > > > margin-top="24mm"/>
> > > >                         <fo:region-before display-align="after"
> > > > extent="24mm" region-name="header"/>
> > > >                         <fo:region-after display-align="before"
> > > > extent="41mm" region-name="footer"/>
> > > >                 </fo:simple-page-master>
> > > >         </fo:layout-master-set>
> > > > 
> > > >         <fo:page-sequence master-reference="myPages">
> > > >                 <fo:flow flow-name="xsl-region-body">
> > > >                         <fo:block>Body</fo:block>
> > > >                 </fo:flow>
> > > >         </fo:page-sequence>
> > > > 
> > > > 
> > > > 
> > > >         <fo:page-sequence master-reference="inventoryPages">
> > > >         
> > > >                 <fo:static-content flow-name="header">
> > > >                         <fo:block>Header</fo:block>
> > > >                 </fo:static-content>
> > > >                 
> > > >                 <fo:static-content flow-name="footer">
> > > >                         <fo:block>Footer</fo:block>
> > > >                 </fo:static-content>
> > > >                 
> > > >                 <fo:flow flow-name="xsl-region-body">
> > > >                         <fo:block>Body</fo:block>
> > > >                 </fo:flow>
> > > >         </fo:page-sequence>
> > > >         
> > > > </fo:root>
> > > > 
> > > > I've gone through this document for the past 30 minutes 
> trying to 
> > > > identify the problem. Maybe I should address my questions
> > > to an XSL-FO
> > > > markup list instead?
> > > > 
> > > > Dan
> > > <snip/>
> > > 
> > > 
> > > Jeremias Maerki
> > > 
> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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

Reply via email to