Hi Bart,

I've done some playing with markers also and gotten them to work pretty well. One of the things I've noticed is that FOP complains mightily about both "fo:marker must be an initial child"" and "marker-class-name' must be unique for same parent."but, they are recoverable errors and can be ignored.

Here's an XML and XSL to demonstrate the capabilities. Notice that I place a marker at the beginning and end of each marked block (That's strictly illegal! But it works) I also have placed an "x" in the illegal marker contents so you can see the illegal retrieval. I do that so that the functions first-including-carryover and last-ending-within-page will work. Arved did a great job of implementing markers, you just have to break the rules for now (and be prepared to unbreak the rules when FOP has a correct implementation)

fop -xsl dictionary.xsl -xml dictionary.xml -pdf dictionary.pdf

Chuck

Bart Locanthi wrote:

does fop support markers? i'm having trouble getting them to work.

my input looks like
...
<fo:flow>
 <fo:block>
   <fo:block>
     <fo:marker marker-class-name="chap">chapter one</fo:marker>
     ...
   </fo:block>
 </fo:block>
 <fo:block>
   <fo:block>
     <fo:marker marker-class-name="chap">chapter two</fo:marker>
...

note that the markers share a common great-grandparent.

the error message i get from any fop-0.20.[23] is:

[ERROR]: fo:marker must be an initial child,and 'marker-class-name' must be unique for same parent.

i'm following all the rules, i think, but no joy.

sounds like a simple misconception on my part but i'm stumped.



<root>
	<block>One</block>
	<block>Two</block>
	<block>Thr</block>
	<block>Fou</block>
	<block>Fiv</block>
	<block>Six</block>
	<block>Sev</block>
	<block>Eig</block>
	<block>Nin</block>
	<block>Ten</block>
	<block>Ele</block>
	<block>Twe</block>
	<block>Thi</block>
	<block>For</block>
	<block>Fif</block>
	<block>Sex</block>
	<block>Siv</block>
	<block>Egg</block>
	<block>Non</block>
</root>
<?xml version="1.0"?>

<xsl:stylesheet
		version="1.0"
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
		xmlns:fo="http://www.w3.org/1999/XSL/Format";
		exclude-result-prefixes="fo">

<xsl:output method="xml" version="4.0" omit-xml-declaration="yes" indent="yes"/>

<xsl:template match="/">

			<fo:root>
				<fo:layout-master-set>
					<fo:simple-page-master master-name  ="page-first"
											page-height  ="8.5in"
											page-width   ="11in">
						<fo:region-body     margin-top   ="5cm"
										margin-bottom    =".5in"
										margin-left      =".5in"
										margin-right     =".5in"
										column-count     ="3"/>
						<fo:region-before extent="6cm"/>
					</fo:simple-page-master>
				</fo:layout-master-set>

				<fo:page-sequence master-name="page-first">
					<fo:static-content flow-name="xsl-region-before">
						<fo:table>
							<fo:table-column column-width="5.5in"/>
							<fo:table-column column-width="5.5in"/>
							<fo:table-body>
								<fo:table-row>
									<fo:table-cell>
										<fo:block keep-together="auto">
											first-starting-within-page:
											<fo:retrieve-marker retrieve-class-name="entry" retrieve-boundary="page" retrieve-position="first-starting-within-page"/>
										</fo:block>
									</fo:table-cell>
									<fo:table-cell>
										<fo:block keep-together="auto" text-align="end">
											first-including-carryover :
											<fo:retrieve-marker retrieve-class-name="entry" retrieve-boundary="page" retrieve-position="first-including-carryover"/>
										</fo:block>
									</fo:table-cell>
								</fo:table-row>
								<fo:table-row>
									<fo:table-cell>
										<fo:block keep-together="auto">
											last-starting-within-page :
											<fo:retrieve-marker retrieve-class-name="entry" retrieve-boundary="page" retrieve-position="last-starting-within-page"/>
										</fo:block>
									</fo:table-cell>
									<fo:table-cell>
										<fo:block keep-together="auto" text-align="end">
											last-ending-within-page   :
											<fo:retrieve-marker retrieve-class-name="entry" retrieve-boundary="page" retrieve-position="last-ending-within-page"/>
										</fo:block>
									</fo:table-cell>
								</fo:table-row>
							</fo:table-body>
						</fo:table>
					</fo:static-content>
					<fo:flow flow-name="xsl-region-body">

						<xsl:for-each select="/root/block">
							<xsl:variable name="this" select="."/>
							<fo:block><fo:marker marker-class-name="entry"><xsl:value-of select="."/></fo:marker>
									<xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/>
									<xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/>
									<xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/>
									<xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/>
									<xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/>
									<xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/>
									<xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/>
									<xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/>
									<xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/>
									<xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/><xsl:value-of select="concat($this,' ')"/>
							<fo:marker marker-class-name="entry"><xsl:value-of select="."/>x</fo:marker></fo:block>
						</xsl:for-each>

					</fo:flow>
				</fo:page-sequence>
			</fo:root>

</xsl:template>


</xsl:stylesheet>

Reply via email to