You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Johannes Caspary <jo...@cms.hu-berlin.de> on 2008/02/26 16:42:32 UTC

Keeping line feeds from XML and text-align="justify"

Hello!

My problem concerns the functionality to retain formatting information 
such as line feeds or white spaces that have been stored like that in 
the XML document. There is the attribute white-space-collapse of 
fo:block, which, when set false, seems to keep white spaces and line 
feeds from the XML document. That's already pretty much what I wanted. 
Then I tried to combine this configuration with text-align="justify". 
Now it seems that when a line ends, the spaces in between the words get 
stretched out (see picture), which is not intended.

Do you know any solution to this problem? Below, there is the code 
snippet which is responsible for the disfunctional part that's in the 
red frame in the picture.

<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" 
keep-together.within-page="always"  font-family="Verdana" 
font-size="7pt" text-align="justify"      space-after="12pt" 
white-space-collapse="false" linefeed-treatment="preserve" 
white-space-treatment="preserve" wrap-option="wrap">
    <fo:block>Kommentar:</fo:block>
        <xsl:apply-templates select="textToPrintOut" />
</fo:block>

I use the FOP 0.20.5.

Thank you,
Johannes Caspary

Re: fo:simple-page-master is missing child elements

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 17.03.2008 16:49:21 Fournier,Danny [NCR] wrote:
> I may be on to something...
> 
> In my XSLT, I have a few lines like these:
> 
> <xsl:text disable-output-escaping="yes">&lt;fo:page-sequence
> master-reference="myPages"&gt;</xsl:text>
> <xsl:text disable-output-escaping="yes">&lt;fo:flow
> flow-name="xsl-region-body"&gt;</xsl:text> 
> 
> Then later
> 
> <xsl:text disable-output-escaping="yes">&lt;/fo:flow&gt;</xsl:text> 
> <xsl:text
> disable-output-escaping="yes">&lt;/fo:page-sequence&gt;</xsl:text>

This is a hack and you should never do that! It leads to trouble because...
(see below)

> If I transform the XML and XSLT using Coldfusion, I get a valid FO
> document that can be converted into PDF using FOP and the command line.
> 
> I suspect that the processing of the XML/XSLT by FOP is different? Since
> I'm outputting these tags using xsl:text rather than having the tags
> present in the XSLT file, that's probably why it's not finding it and
> I'm getting an error?

Exactly. In the first case you serialize the XML to a file. It is later
reparsed and everything looks good. But if you do the XSLT step together
with FOP, the XML is not serialized. Instead what you're generating is
just text instead of internal startElement()/endElement() method calls
which FOP needs to work properly. The XSLT process and FOP are coupled
through a SAX stream, not a text stream.

> Dan
> 
> PS: since I'm opening and closing these tags in different templates, I
> had no choice to use xsl:text. I may have to review my XSLT in order to
> have these tags present rather than having to output them using
> xsl:text.

Yes, you'll have to rewrite that part of your XSLT. I know it's
sometimes a bit difficult to rid yourself of the sequential way of
programming of most programming languages. XSLT is different, strictly
hierarchical, declarative. Good luck!

<snip/>



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: fo:simple-page-master is missing child elements

Posted by "Fournier,Danny [NCR]" <Da...@ec.gc.ca>.
I may be on to something...

In my XSLT, I have a few lines like these:

<xsl:text disable-output-escaping="yes">&lt;fo:page-sequence
master-reference="myPages"&gt;</xsl:text>
<xsl:text disable-output-escaping="yes">&lt;fo:flow
flow-name="xsl-region-body"&gt;</xsl:text> 

Then later

<xsl:text disable-output-escaping="yes">&lt;/fo:flow&gt;</xsl:text> 
<xsl:text
disable-output-escaping="yes">&lt;/fo:page-sequence&gt;</xsl:text>

If I transform the XML and XSLT using Coldfusion, I get a valid FO
document that can be converted into PDF using FOP and the command line.

I suspect that the processing of the XML/XSLT by FOP is different? Since
I'm outputting these tags using xsl:text rather than having the tags
present in the XSLT file, that's probably why it's not finding it and
I'm getting an error?

Dan

PS: since I'm opening and closing these tags in different templates, I
had no choice to use xsl:text. I may have to review my XSLT in order to
have these tags present rather than having to output them using
xsl:text.

> -----Original Message-----
> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
> Sent: March 17, 2008 4:11 AM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: fo:simple-page-master is missing child elements
> 
> 
> On 14.03.2008 18:40:16 Fournier,Danny [NCR] wrote:
> > 
> > > -----Original Message-----
> > > From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
> > > 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).
> > 
> >  
> > I finally got to doing this. I exported the FO and ran it 
> against FOP 
> > using the command line.
> > 
> > I got my PDF even though I had some warnings about content overflow 
> > (these will be painfull to fix IMO).
> 
> They are usually not as painful to fix as you think.
> 
> > Can you explain how this namespace problem works/could be fixed ?
> 
> Not in one paragraph. For one, I don't know anything about 
> ColdFusion so I have no clue how the XML output from 
> ColdFusion is integrated with FOP.
> Usually, this happens when the XML parser is not 
> namespace-enabled or if SAX events are produced in 
> non-namespace-aware fashion:
> 
> Right:
> contentHandler.startElement("http://www.w3.org/1999/XSL/Format
> ", "fo:root", "root", atts);
> 
> Wrong:
> contentHandler.startElement(null, "fo:root", "root", atts);
> 
> It's difficult from here to tell you what you have to do, 
> especially with so little information.
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: fo:simple-page-master is missing child elements

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 14.03.2008 18:40:16 Fournier,Danny [NCR] wrote:
> 
> > -----Original Message-----
> > From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
> > 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).
> 
>  
> I finally got to doing this. I exported the FO and ran it against FOP
> using the command line.
> 
> I got my PDF even though I had some warnings about content overflow
> (these will be painfull to fix IMO).

They are usually not as painful to fix as you think.

> Can you explain how this namespace problem works/could be fixed ?

Not in one paragraph. For one, I don't know anything about ColdFusion so
I have no clue how the XML output from ColdFusion is integrated with FOP.
Usually, this happens when the XML parser is not namespace-enabled or if
SAX events are produced in non-namespace-aware fashion:

Right:
contentHandler.startElement("http://www.w3.org/1999/XSL/Format", "fo:root", "root", atts);

Wrong:
contentHandler.startElement(null, "fo:root", "root", atts);

It's difficult from here to tell you what you have to do, especially
with so little information.

Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: fo:simple-page-master is missing child elements

Posted by Andreas Delmelle <an...@telenet.be>.
On Mar 4, 2008, at 15:02, Fournier,Danny [NCR] wrote:

Hi

>
> I'm really at a loss here. Here's the full exception message:
>
> Notes
> - several lines complaining about the required content model

Yes, but AFAICT they all point to one and the very same error.

> - "44 more ---------" in the middle of the exception - 44 more  
> required
> content model errors?

No. "44 more..." simply means "this stack trace was cut off and is  
actually longer (contains 44 more calls)"

So, no need to worry there. You have one and only one error.

Long shot, but given the below sample code you posted:

public String setXSLT(String strXSLT){
     try{
         this.xslt = new ByteArrayInputStream(strXSLT.getBytes 
("ISO-8859-1"));
         return "";
     } catch(UnsupportedEncodingException uee) {
         return getStackTrace(uee);
     }	
}

This could lead to encoding headaches. The String's bytes are forced  
to IS0-8859-1. Further on, when the BAIStream is used again and  
wrapped into say an InputStreamReader (say by the XSLT processor,  
maybe?), unless the encoding is forced there too, the JVM could  
assume your default platform encoding, or the XML default of UTF-8 to  
determine which character they represent...

My guess is that the FO actually contains such wrongly encoded  
characters/bytes, and this is causing weird errors (?)

As stated above, a long shot, but well worth a try. The above is not  
the best of programming practices anyway, especially if the stream  
will be consumed by a component/module not under your control.


Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: fo:simple-page-master is missing child elements

Posted by "Fournier,Danny [NCR]" <Da...@ec.gc.ca>.
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:dev@jeremias-maerki.ch] 
> 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:dev@jeremias-maerki.ch]
> > > 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: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: fo:simple-page-master is missing child elements

Posted by "Fournier,Danny [NCR]" <Da...@ec.gc.ca>.
> -----Original Message-----
> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
> 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).

 
I finally got to doing this. I exported the FO and ran it against FOP
using the command line.

I got my PDF even though I had some warnings about content overflow
(these will be painfull to fix IMO).

Can you explain how this namespace problem works/could be fixed ?

Regards,

Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: fo:simple-page-master is missing child elements

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
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:dev@jeremias-maerki.ch] 
> > 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: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: fo:simple-page-master is missing child elements

Posted by Miroslav Pukhalsky <mi...@dekasoft.com.ua>.
Hi there,

Fournier,Danny [NCR] wrote:
> @Miroslav Pukhalsky
> 
> I am using 0.94. Not sure if this makes any difference?
> 
Sorry, but I do not know anything about it. I have not tried 0.94 
version yet. I love odd numbers :-)

As of your problem. I had resembling error (child element of 
fo:simple-page-master) when the fo:region-body was not first in the 
children set for fo:simple-page-master. Check it, may it will help.

Regards,

Miroslav.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: fo:simple-page-master is missing child elements

Posted by "Fournier,Danny [NCR]" <Da...@ec.gc.ca>.
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:dev@jeremias-maerki.ch] 
> 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
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: fo:simple-page-master is missing child elements

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
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


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: fo:simple-page-master is missing child elements

Posted by Miroslav Pukhalsky <mi...@dekasoft.com.ua>.
Hi there,

When I try to prform your FO file I have got error (FOP 0.93)

04.03.2008 10:21:07 org.apache.fop.cli.Main startFOP
SEVERE: Exception
javax.xml.transform.TransformerException: 
org.apache.fop.fo.expr.PropertyException: Border and padding for region 
"xsl-region-body" must be '0' (See 6.4.13 in XSL 1.0).
     at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
     at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
     at org.apache.fop.cli.Main.startFOP(Main.java:160)
     at org.apache.fop.cli.Main.main(Main.java:191)

---------

javax.xml.transform.TransformerException: 
org.apache.fop.fo.expr.PropertyException: Border and padding for region 
"xsl-region-body" must be '0' (See 6.4.13 in XSL 1.0).
     at 
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:501)
     at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
     at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
     at org.apache.fop.cli.Main.startFOP(Main.java:160)
     at org.apache.fop.cli.Main.main(Main.java:191)
Caused by: org.apache.fop.fo.expr.PropertyException: Border and padding 
for region "xsl-region-body" must be '0' (See 6.4.13 in XSL 1.0).
     at org.apache.fop.fo.pagination.Region.bind(Region.java:89)
     at org.apache.fop.fo.pagination.RegionBody.bind(RegionBody.java:56)
     at org.apache.fop.fo.FObj.processNode(FObj.java:118)
     at 
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:321)
     at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
     at 
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
     at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown 
Source)
     at 
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown 
Source)
     at 
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown 
Source)
     at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown 
Source)
     at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)
     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
     at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
     at 
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
     ... 4 more
---------
org.apache.fop.fo.expr.PropertyException: Border and padding for region 
"xsl-region-body" must be '0' (See 6.4.13 in XSL 1.0).
     at org.apache.fop.fo.pagination.Region.bind(Region.java:89)
     at org.apache.fop.fo.pagination.RegionBody.bind(RegionBody.java:56)
     at org.apache.fop.fo.FObj.processNode(FObj.java:118)
     at 
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:321)
     at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
     at 
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
     at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown 
Source)
     at 
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown 
Source)
     at 
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown 
Source)
     at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown 
Source)
     at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)
     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
     at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
     at 
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
     at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
     at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
     at org.apache.fop.cli.Main.startFOP(Main.java:160)
     at org.apache.fop.cli.Main.main(Main.java:191)


After killing border from the second fo:region-body I have got result 
PDF. May be it will help you?

Regards,

Miroslav.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: fo:simple-page-master is missing child elements

Posted by "Fournier,Danny [NCR]" <Da...@ec.gc.ca>.
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

> -----Original Message-----
> From: Jay Bryant [mailto:jay@bryantcs.com] 
> Sent: March 3, 2008 1:16 PM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: fo:simple-page-master is missing child elements
> 
> ? means 0 or 1 (so optional, yes)
> + means 1 or more (required and may repeat)
> * means 0 or more (optional and may repeat)
>   (no mark) means just 1 (required and may not repeat)
> 
> Jay Bryant
> Bryant Communication Services
> http://www.bryantcs.com/
> 
> ----- Original Message -----
> From: "Fournier,Danny [NCR]" <Da...@ec.gc.ca>
> To: <fo...@xmlgraphics.apache.org>
> Sent: Monday, March 03, 2008 12:08 PM
> Subject: RE: fo:simple-page-master is missing child elements
> 
> 
> Thanks Andreas. Everything worked in 0.20.5 so I assumed that it would
> still work in 0.94.
> 
> What is the suffix appended to the order of the fields? I've 
> seend "?",
> which I assume mean optional. What about "+" ?
> 
> DF 
> 
> > -----Original Message-----
> > From: Andreas Delmelle [mailto:andreas.delmelle@telenet.be] 
> > Sent: March 3, 2008 12:38 PM
> > To: fop-users@xmlgraphics.apache.org
> > Subject: Re: fo:simple-page-master is missing child elements
> > 
> > On Mar 3, 2008, at 18:09, Fournier,Danny [NCR] wrote:
> > 
> > Hi
> > 
> > > Here is the rendered XSL-FO:
> > 
> > <snip />
> > 
> > >
> > > I get the following message:
> > >
> > > javax.xml.transform.TransformerException:
> > > org.apache.fop.fo.ValidationException: Error(Unknown location):
> > > fo:simple-page-master is missing child elements.
> > > Required Content Model: (region-body, region-before?, 
> > region-after?, 
> > > region-start?, region-end?)
> > >
> > > In both cases I have a region-body child specified.
> > 
> > Yes, but in the second case, the regions are not specified in 
> > the prescribed order (see the error message).
> > 
> > >
> > > I vaguely remember something about the type of validation (loose,
> > > strict?) in the setup of the FOP call - could this be my answer?
> > 
> > No, the best way to avoid the error is move the region-body to the  
> > first position.
> > 
> > 
> > HTH!
> > 
> > Andreas
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: 
> fop-users-help@xmlgraphics.apache.org
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: fo:simple-page-master is missing child elements

Posted by Jay Bryant <ja...@bryantcs.com>.
? means 0 or 1 (so optional, yes)
+ means 1 or more (required and may repeat)
* means 0 or more (optional and may repeat)
  (no mark) means just 1 (required and may not repeat)

Jay Bryant
Bryant Communication Services
http://www.bryantcs.com/

----- Original Message ----- 
From: "Fournier,Danny [NCR]" <Da...@ec.gc.ca>
To: <fo...@xmlgraphics.apache.org>
Sent: Monday, March 03, 2008 12:08 PM
Subject: RE: fo:simple-page-master is missing child elements


Thanks Andreas. Everything worked in 0.20.5 so I assumed that it would
still work in 0.94.

What is the suffix appended to the order of the fields? I've seend "?",
which I assume mean optional. What about "+" ?

DF 

> -----Original Message-----
> From: Andreas Delmelle [mailto:andreas.delmelle@telenet.be] 
> Sent: March 3, 2008 12:38 PM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: fo:simple-page-master is missing child elements
> 
> On Mar 3, 2008, at 18:09, Fournier,Danny [NCR] wrote:
> 
> Hi
> 
> > Here is the rendered XSL-FO:
> 
> <snip />
> 
> >
> > I get the following message:
> >
> > javax.xml.transform.TransformerException:
> > org.apache.fop.fo.ValidationException: Error(Unknown location):
> > fo:simple-page-master is missing child elements.
> > Required Content Model: (region-body, region-before?, 
> region-after?, 
> > region-start?, region-end?)
> >
> > In both cases I have a region-body child specified.
> 
> Yes, but in the second case, the regions are not specified in 
> the prescribed order (see the error message).
> 
> >
> > I vaguely remember something about the type of validation (loose,
> > strict?) in the setup of the FOP call - could this be my answer?
> 
> No, the best way to avoid the error is move the region-body to the  
> first position.
> 
> 
> HTH!
> 
> Andreas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: fo:simple-page-master is missing child elements

Posted by Andreas Delmelle <an...@telenet.be>.
On Mar 3, 2008, at 19:08, Fournier,Danny [NCR] wrote:

> Thanks Andreas. Everything worked in 0.20.5 so I assumed that it would
> still work in 0.94.
>
> What is the suffix appended to the order of the fields? I've seend  
> "?",
> which I assume mean optional. What about "+" ?

Basically the same as with regular expressions:

? = once, or not at all
+ = once, or more
* = zero, or more

HTH!

Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: fo:simple-page-master is missing child elements

Posted by "Fournier,Danny [NCR]" <Da...@ec.gc.ca>.
Thanks Andreas. Everything worked in 0.20.5 so I assumed that it would
still work in 0.94.

What is the suffix appended to the order of the fields? I've seend "?",
which I assume mean optional. What about "+" ?

DF 

> -----Original Message-----
> From: Andreas Delmelle [mailto:andreas.delmelle@telenet.be] 
> Sent: March 3, 2008 12:38 PM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: fo:simple-page-master is missing child elements
> 
> On Mar 3, 2008, at 18:09, Fournier,Danny [NCR] wrote:
> 
> Hi
> 
> > Here is the rendered XSL-FO:
> 
> <snip />
> 
> >
> > I get the following message:
> >
> > javax.xml.transform.TransformerException:
> > org.apache.fop.fo.ValidationException: Error(Unknown location):
> > fo:simple-page-master is missing child elements.
> > Required Content Model: (region-body, region-before?, 
> region-after?, 
> > region-start?, region-end?)
> >
> > In both cases I have a region-body child specified.
> 
> Yes, but in the second case, the regions are not specified in 
> the prescribed order (see the error message).
> 
> >
> > I vaguely remember something about the type of validation (loose,
> > strict?) in the setup of the FOP call - could this be my answer?
> 
> No, the best way to avoid the error is move the region-body to the  
> first position.
> 
> 
> HTH!
> 
> Andreas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: fo:simple-page-master is missing child elements

Posted by Andreas Delmelle <an...@telenet.be>.
On Mar 3, 2008, at 18:09, Fournier,Danny [NCR] wrote:

Hi

> Here is the rendered XSL-FO:

<snip />

>
> I get the following message:
>
> javax.xml.transform.TransformerException:
> org.apache.fop.fo.ValidationException: Error(Unknown location):
> fo:simple-page-master is missing child elements.
> Required Content Model: (region-body, region-before?, region-after?,
> region-start?, region-end?)
>
> In both cases I have a region-body child specified.

Yes, but in the second case, the regions are not specified in the  
prescribed order (see the error message).

>
> I vaguely remember something about the type of validation (loose,
> strict?) in the setup of the FOP call - could this be my answer?

No, the best way to avoid the error is move the region-body to the  
first position.


HTH!

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


fo:simple-page-master is missing child elements

Posted by "Fournier,Danny [NCR]" <Da...@ec.gc.ca>.
Here is the rendered XSL-FO:

<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-before display-align="after" extent="24mm"
region-name="header"/>
    <fo:region-after display-align="before" extent="41mm"
region-name="footer"/>
    <fo:region-body border="0.5pt solid #000" margin-right="8mm"
margin-left="7mm" margin-bottom="41mm" margin-top="24mm"/>
  </fo:simple-page-master>
</fo:layout-master-set>

I get the following message:

javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: Error(Unknown location):
fo:simple-page-master is missing child elements. 
Required Content Model: (region-body, region-before?, region-after?,
region-start?, region-end?)

In both cases I have a region-body child specified. 

I vaguely remember something about the type of validation (loose,
strict?) in the setup of the FOP call - could this be my answer?

Regards,

Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Keeping line feeds from XML and text-align="justify"

Posted by ca...@cms.hu-berlin.de.
> On Feb 26, 2008, at 16:42, Johannes Caspary wrote:
>
> Hi
>
>> My problem concerns the functionality to retain formatting
>> information such as line feeds or white spaces that have been
>> stored like that in the XML document. There is the attribute white-
>> space-collapse of fo:block, which, when set false, seems to keep
>> white spaces and line feeds from the XML document. That's already
>> pretty much what I wanted. Then I tried to combine this
>> configuration with text-align="justify". Now it seems that when a
>> line ends, the spaces in between the words get stretched out (see
>> picture), which is not intended.
>>
>> Do you know any solution to this problem? Below, there is the code
>> snippet which is responsible for the disfunctional part that's in
>> the red frame in the picture.
>>
>> <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" keep-
>> together.within-page="always"  font-family="Verdana" font-
>> size="7pt" text-align="justify"      space-after="12pt" white-space-
>> collapse="false" linefeed-treatment="preserve" white-space-
>> treatment="preserve" wrap-option="wrap">
>>    <fo:block>Kommentar:</fo:block>
>>        <xsl:apply-templates select="textToPrintOut" />
>> </fo:block>
>
> Why did you add the text-align property? If it is set to justify, all
> spaces are stretched to align the text as specified (= justified).
> If you remove that, then the effect will be more what you seek, IIC.
>
> Cheers
>
> Andreas
>

Hi Andreas,
thanks for your reply. The problem is that I would like to combine keeping
line feeds in my text and justified text alignment. With this older FOP
version, there doesn't seem to be any support for the attribute
"linefeed-treatment", thus I used white-space-collapse which worked with
normal alignment. With FOP 0.94, everything works fine.

Maybe with white-space-collpase = "false" each linefeed is interpreted as
a linefeed _and_ a white space. And then unfortunately the justified text
alignment extends each line to the end, although it may only contain two
or three words.

Regards,
Johannes

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Keeping line feeds from XML and text-align="justify"

Posted by Andreas Delmelle <an...@telenet.be>.
On Feb 26, 2008, at 16:42, Johannes Caspary wrote:

Hi

> My problem concerns the functionality to retain formatting  
> information such as line feeds or white spaces that have been  
> stored like that in the XML document. There is the attribute white- 
> space-collapse of fo:block, which, when set false, seems to keep  
> white spaces and line feeds from the XML document. That's already  
> pretty much what I wanted. Then I tried to combine this  
> configuration with text-align="justify". Now it seems that when a  
> line ends, the spaces in between the words get stretched out (see  
> picture), which is not intended.
>
> Do you know any solution to this problem? Below, there is the code  
> snippet which is responsible for the disfunctional part that's in  
> the red frame in the picture.
>
> <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" keep- 
> together.within-page="always"  font-family="Verdana" font- 
> size="7pt" text-align="justify"      space-after="12pt" white-space- 
> collapse="false" linefeed-treatment="preserve" white-space- 
> treatment="preserve" wrap-option="wrap">
>    <fo:block>Kommentar:</fo:block>
>        <xsl:apply-templates select="textToPrintOut" />
> </fo:block>

Why did you add the text-align property? If it is set to justify, all  
spaces are stretched to align the text as specified (= justified).
If you remove that, then the effect will be more what you seek, IIC.

Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org