|
View:
New views
8 Messages
—
Rating Filter:
Alert me
|
|
|
What is wrong in this title page spec?I have to create a page-master for legal notice-only. In the page sequence it appears after the default titlepage.
But, despite spending long time reading the customization section on TDG5, I am stuck at 2 places: 1) The pages (recto & verso) are being generated, but they always turned empty. 2) The page number in footer is not roman numerals. The table of contents (coming after the page containing legal notice) is in romal numerals. Here is my spec: <t:titlepage t:element="d:legalnotice" t:wrapper="fo:block"> <t:titlepage-content t:side="recto"> <legalnotice /> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> Also tried this (in spec above): <legalnotice param:mode = "titlepage" /> what could be going wrong here? ~spr ~spr |
|
|
Re: What is wrong in this title page spec?Any help??
~spr |
|
|
Re: What is wrong in this title page spec?Hi,
You need to do a couple of things to get this to work. 1. In your titlepage spec file, omit the d: namespace prefix on this attribute value: t:element="legalnotice" instead of "d:legalnotice". I know, it is DocBook 5, but this attribute is used to create the named template, and the element will get the namespace when the templates are generated. 2. The titlepage templates in your generated file do not create page sequences. They create fo:blocks that are intended to be used within page-sequences that you define. So you need to customize the template matching on d:book as follows: <xsl:template match="d:book"> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="preamble" select="d:title|d:subtitle|d:titleabbrev|d:bookinfo|d:info"/> <xsl:variable name="content" select="node()[not(self::d:title or self::d:subtitle or self::d:titleabbrev or self::d:info or self::d:bookinfo)]"/> <xsl:variable name="titlepage-master-reference"> <xsl:call-template name="select.pagemaster"> <xsl:with-param name="pageclass" select="'titlepage'"/> </xsl:call-template> </xsl:variable> <xsl:call-template name="front.cover"/> <xsl:if test="$preamble"> <xsl:call-template name="page.sequence"> <xsl:with-param name="master-reference" select="$titlepage-master-reference"/> <xsl:with-param name="content"> <fo:block id="{$id}"> <xsl:call-template name="book.titlepage"/> </fo:block> </xsl:with-param> </xsl:call-template> </xsl:if> <xsl:call-template name="page.sequence"> <xsl:with-param name="master-reference" select="$titlepage-master-reference"/> <xsl:with-param name="content"> <fo:block id="ln-{$id}"> <xsl:call-template name="legalnotice.titlepage"/> </fo:block> </xsl:with-param> </xsl:call-template> <xsl:apply-templates select="d:dedication" mode="dedication"/> <xsl:call-template name="make.book.tocs"/> <xsl:apply-templates select="$content"/> <xsl:call-template name="back.cover"/> </xsl:template> Notice that in the original template, the "book.titlepage" template is called within a call to the "page.sequence" template. The part I added was another call-template name="page.sequence" that contains a call to "legalnotice.titlepage". The "legalnotice.titlepage" template was created when you regenerated your titlepage templates. Bob Stayton Sagehill Enterprises DocBook Consulting bobs@... ----- Original Message ----- From: "spr" <spremi@...> To: <docbook-apps@...> Sent: Tuesday, October 16, 2007 11:06 AM Subject: Re: [docbook-apps] What is wrong in this title page spec? > > Any help?? > > spr wrote: >> >> I have to create a page-master for legal notice-only. In the page >> sequence >> it appears after the default titlepage. >> >> But, despite spending long time reading the customization section on >> TDG5, >> I am stuck at 2 places: >> 1) The pages (recto & verso) are being generated, but they always turned >> empty. >> 2) The page number in footer is not roman numerals. The table of >> contents >> (coming after the page containing legal notice) is in romal numerals. >> >> Here is my spec: >> <t:titlepage t:element="d:legalnotice" t:wrapper="fo:block"> >> <t:titlepage-content t:side="recto"> >> <legalnotice /> >> </t:titlepage-content> >> >> <t:titlepage-content t:side="verso"> >> </t:titlepage-content> >> >> <t:titlepage-separator> >> </t:titlepage-separator> >> >> <t:titlepage-before t:side="recto"> >> </t:titlepage-before> >> >> <t:titlepage-before t:side="verso"> >> </t:titlepage-before> >> </t:titlepage> >> >> Also tried this (in spec above): >> <legalnotice param:mode = "titlepage" /> >> >> what could be going wrong here? >> >> ~spr >> > > -- > View this message in context: > http://www.nabble.com/What-is-wrong-in-this-title-page-spec--tf4630333.html#a13239007 > Sent from the docbook apps mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-apps-unsubscribe@... > For additional commands, e-mail: docbook-apps-help@... > > > --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@... For additional commands, e-mail: docbook-apps-help@... |
|
|
Re: What is wrong in this title page spec?Hi Bob!
1) I was using: t:element="legalnotice" Due to failures, i tried adding name space "d:" 2) I have modified the page sequence, and I can see 2 additional pages being generated. But both are empty. (verso - expected, but recto - expected some content). Will try the exact contents in your mail & get back... ~spr
~spr |
|
|
Re: What is wrong in this title page spec?I did not work... getting exception for duplicate id.
Surprisingly i did not get it earlier :( ~spr Mininal Book ============ <?xml version='1.0'?> <!DOCTYPE book [ <!ENTITY nbsp " "> ]> <book lang = "en" xmlns = "http://docbook.org/ns/docbook" version="5.0" xmlns:xi = "http://www.w3.org/2001/XInclude" xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" xmlns:xlink = "http://www.w3.org/1999/xlink"> <info> <title>Book Title</title> <releaseinfo>Release Info</releaseinfo> <legalnotice> <title>IMPORTANT NOTICE</title> <para>Legal para</para> </legalnotice> </info> <chapter id="test"> <info> <title>Test Chapter</title> </info> <para>simple test para</para> </chapter> </book> Mininal XSL =========== <xsl:stylesheet version = "1.0" xmlns:d = "http://docbook.org/ns/docbook" xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" xmlns:fo = "http://www.w3.org/1999/XSL/Format" xmlns:l = "http://docbook.sourceforge.net/xmlns/l10n/1.0"> <xsl:import href = "../docbook-xsl-ns-1.73.2/fo/docbook.xsl" /> <!-- Had to add these attributes to avoid this exception: SEVERE: Exception javax.xml.transform.TransformerException: attribute-set named legalnotice.titlepage.recto.style does not exist --> <xsl:attribute-set name="legalnotice.titlepage.recto.style"/> <xsl:attribute-set name="legalnotice.titlepage.verso.style"/> <xsl:include href = "./pdf/test-title.xsl" /> <!-- generated from spec below --> <xsl:param name = "fop1.extensions" select = "1" /> <xsl:param name = "draft.mode" select = "no" /> <xsl:param name = "draft.watermark.image" select = "images/draft.png" /> <xsl:param name = "double.sided" select = "1" /> <xsl:template match="d:book"> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="preamble" select="d:title|d:subtitle|d:titleabbrev|d:bookinfo|d:info"/> <xsl:variable name="content" select="node()[not(self::d:title or self::d:subtitle or self::d:titleabbrev or self::d:info or self::d:bookinfo)]"/> <xsl:variable name="titlepage-master-reference"> <xsl:call-template name="select.pagemaster"> <xsl:with-param name="pageclass" select="'titlepage'"/> </xsl:call-template> </xsl:variable> <xsl:call-template name="front.cover"/> <xsl:if test="$preamble"> <xsl:call-template name="page.sequence"> <xsl:with-param name="master-reference" select="$titlepage-master-reference"/> <xsl:with-param name="content"> <fo:block id="{$id}"> <xsl:call-template name="book.titlepage"/> </fo:block> </xsl:with-param> </xsl:call-template> </xsl:if> <!-- This section causes exception: SEVERE: Exception javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: Property id "N1000E" previously used; id values must be unique in document. --> <xsl:call-template name="page.sequence"> <xsl:with-param name="master-reference" select="$titlepage-master-reference"/> <xsl:with-param name="content"> <fo:block id="ln-{$id}"> <xsl:call-template name="legalnotice.titlepage"/> </fo:block> </xsl:with-param> </xsl:call-template> <xsl:apply-templates select="d:dedication" mode="dedication"/> <xsl:call-template name="make.book.tocs"/> <xsl:apply-templates select="$content"/> <xsl:call-template name="back.cover"/> </xsl:template> </xsl:stylesheet> Spec for additional titlepage ============================= <!DOCTYPE t:templates [ <!ENTITY hsize0 "10pt"> ]> <t:templates xmlns:t = "http://nwalsh.com/docbook/xsl/template/1.0" xmlns:param = "http://nwalsh.com/docbook/xsl/template/1.0/param" xmlns:fo = "http://www.w3.org/1999/XSL/Format" xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"> <t:titlepage t:element="legalnotice" t:wrapper="fo:block"> <t:titlepage-content t:side="recto"> <legalnotice /> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> </t:templates> Command-line executed ===================== $ ./fop-0.94/fop -d -xml ./input/test/index.xml -xsl ./custom/test.xsl -pdf ./output/test/test.pdf Oct 17, 2007 1:53:24 AM org.apache.fop.cli.InputHandler warning WARNING: javax.xml.transform.TransformerException: Making portrait pages on USletter paper (8.5inx11in) Oct 17, 2007 1:53:28 AM org.apache.fop.hyphenation.Hyphenator getHyphenationTree SEVERE: Couldn't find hyphenation pattern en Oct 17, 2007 1:53:28 AM org.apache.fop.fo.FOTreeBuilder$MainFOHandler endElement WARNING: Mismatch: block (http://www.w3.org/1999/XSL/Format) vs. flow (http://www.w3.org/1999/XSL/Format) Oct 17, 2007 1:53:28 AM org.apache.fop.fo.FOTreeBuilder$MainFOHandler endElement WARNING: Mismatch: block (http://www.w3.org/1999/XSL/Format) vs. page-sequence (http://www.w3.org/1999/XSL/Format) Oct 17, 2007 1:53:28 AM org.apache.fop.fo.FOTreeBuilder$MainFOHandler endElement WARNING: Mismatch: block (http://www.w3.org/1999/XSL/Format) vs. root (http://www.w3.org/1999/XSL/Format) Oct 17, 2007 1:53:28 AM org.apache.fop.cli.Main startFOP SEVERE: Exception javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: Property id "N1000E" previously used; id values must be unique in document. 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:166) at org.apache.fop.cli.Main.main(Main.java:197) --------- javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: Property id "N1000E" previously used; id values must be unique in document.
~spr |
|
|
Re: What is wrong in this title page spec?Do you still have a legalnotice on your book verso titlepage? Can you tell
what element is producing the duplicate ID by looking in the FO file? Bob Stayton Sagehill Enterprises DocBook Consulting bobs@... ----- Original Message ----- From: "spr" <spremi@...> To: <docbook-apps@...> Sent: Tuesday, October 16, 2007 1:43 PM Subject: Re: [docbook-apps] What is wrong in this title page spec? > > I did not work... getting exception for duplicate id. > > Surprisingly i did not get it earlier :( > > ~spr > > > Mininal Book > ============ > <?xml version='1.0'?> > <!DOCTYPE book [ > <!ENTITY nbsp " "> > ]> > > <book > lang = "en" > xmlns = "http://docbook.org/ns/docbook" version="5.0" > xmlns:xi = "http://www.w3.org/2001/XInclude" > xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" > xmlns:xlink = "http://www.w3.org/1999/xlink"> > > <info> > <title>Book Title</title> > <releaseinfo>Release Info</releaseinfo> > <legalnotice> > <title>IMPORTANT NOTICE</title> > <para>Legal para</para> > </legalnotice> > </info> > > <chapter id="test"> > <info> > <title>Test Chapter</title> > </info> > <para>simple test para</para> > </chapter> > </book> > > Mininal XSL > =========== > > <xsl:stylesheet > version = "1.0" > xmlns:d = "http://docbook.org/ns/docbook" > xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" > xmlns:fo = "http://www.w3.org/1999/XSL/Format" > xmlns:l = "http://docbook.sourceforge.net/xmlns/l10n/1.0"> > > <xsl:import > href = "../docbook-xsl-ns-1.73.2/fo/docbook.xsl" /> > > <!-- > Had to add these attributes to avoid this exception: > > SEVERE: Exception > javax.xml.transform.TransformerException: attribute-set named > legalnotice.titlepage.recto.style does not exist > --> > <xsl:attribute-set name="legalnotice.titlepage.recto.style"/> > <xsl:attribute-set name="legalnotice.titlepage.verso.style"/> > > > <xsl:include > href = "./pdf/test-title.xsl" /> <!-- generated from spec below --> > > <xsl:param > name = "fop1.extensions" > select = "1" /> > > <xsl:param > name = "draft.mode" > select = "no" /> > > <xsl:param > name = "draft.watermark.image" > select = "images/draft.png" /> > > <xsl:param > name = "double.sided" > select = "1" /> > > > <xsl:template match="d:book"> > <xsl:variable name="id"> > <xsl:call-template name="object.id"/> > </xsl:variable> > > <xsl:variable name="preamble" > > select="d:title|d:subtitle|d:titleabbrev|d:bookinfo|d:info"/> > > <xsl:variable name="content" > select="node()[not(self::d:title or self::d:subtitle > or self::d:titleabbrev > or self::d:info > or self::d:bookinfo)]"/> > > <xsl:variable name="titlepage-master-reference"> > <xsl:call-template name="select.pagemaster"> > <xsl:with-param name="pageclass" select="'titlepage'"/> > </xsl:call-template> > </xsl:variable> > > <xsl:call-template name="front.cover"/> > > > <xsl:if test="$preamble"> > <xsl:call-template name="page.sequence"> > <xsl:with-param name="master-reference" > select="$titlepage-master-reference"/> > <xsl:with-param name="content"> > <fo:block id="{$id}"> > <xsl:call-template name="book.titlepage"/> > </fo:block> > </xsl:with-param> > </xsl:call-template> > </xsl:if> > > > <!-- > This section causes exception: > > SEVERE: Exception > javax.xml.transform.TransformerException: > org.apache.fop.fo.ValidationException: Property id "N1000E" previously > used; > id values must be unique in document. > --> > <xsl:call-template name="page.sequence"> > <xsl:with-param name="master-reference" > select="$titlepage-master-reference"/> > <xsl:with-param name="content"> > <fo:block id="ln-{$id}"> > <xsl:call-template name="legalnotice.titlepage"/> > </fo:block> > </xsl:with-param> > </xsl:call-template> > > <xsl:apply-templates select="d:dedication" mode="dedication"/> > > <xsl:call-template name="make.book.tocs"/> > > <xsl:apply-templates select="$content"/> > > <xsl:call-template name="back.cover"/> > > </xsl:template> > > </xsl:stylesheet> > > Spec for additional titlepage > ============================= > <!DOCTYPE t:templates [ > <!ENTITY hsize0 "10pt"> > ]> > > <t:templates > xmlns:t = "http://nwalsh.com/docbook/xsl/template/1.0" > xmlns:param = "http://nwalsh.com/docbook/xsl/template/1.0/param" > xmlns:fo = "http://www.w3.org/1999/XSL/Format" > xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"> > > <t:titlepage > t:element="legalnotice" > t:wrapper="fo:block"> > <t:titlepage-content t:side="recto"> > <legalnotice /> > </t:titlepage-content> > > <t:titlepage-content t:side="verso"> > </t:titlepage-content> > > <t:titlepage-separator> > </t:titlepage-separator> > > <t:titlepage-before t:side="recto"> > </t:titlepage-before> > > <t:titlepage-before t:side="verso"> > </t:titlepage-before> > </t:titlepage> > > </t:templates> > > > Command-line executed > ===================== > > $ ./fop-0.94/fop -d -xml ./input/test/index.xml -xsl > ./custom/test.xsl -pdf > ./output/test/test.pdf > Oct 17, 2007 1:53:24 AM org.apache.fop.cli.InputHandler warning > WARNING: javax.xml.transform.TransformerException: Making portrait pages > on > USletter paper (8.5inx11in) > Oct 17, 2007 1:53:28 AM org.apache.fop.hyphenation.Hyphenator > getHyphenationTree > SEVERE: Couldn't find hyphenation pattern en > Oct 17, 2007 1:53:28 AM org.apache.fop.fo.FOTreeBuilder$MainFOHandler > endElement > WARNING: Mismatch: block (http://www.w3.org/1999/XSL/Format) vs. flow > (http://www.w3.org/1999/XSL/Format) > Oct 17, 2007 1:53:28 AM org.apache.fop.fo.FOTreeBuilder$MainFOHandler > endElement > WARNING: Mismatch: block (http://www.w3.org/1999/XSL/Format) vs. > page-sequence (http://www.w3.org/1999/XSL/Format) > Oct 17, 2007 1:53:28 AM org.apache.fop.fo.FOTreeBuilder$MainFOHandler > endElement > WARNING: Mismatch: block (http://www.w3.org/1999/XSL/Format) vs. root > (http://www.w3.org/1999/XSL/Format) > Oct 17, 2007 1:53:28 AM org.apache.fop.cli.Main startFOP > SEVERE: Exception > javax.xml.transform.TransformerException: > org.apache.fop.fo.ValidationException: Property id "N1000E" previously > used; > id values must be unique in document. > 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:166) > at org.apache.fop.cli.Main.main(Main.java:197) > > --------- > > javax.xml.transform.TransformerException: > org.apache.fop.fo.ValidationException: Property id "N1000E" previously > used; > id values must be unique in document. > > > > > spr wrote: >> >> Hi Bob! >> >> 1) I was using: >> t:element="legalnotice" >> Due to failures, i tried adding name space "d:" >> >> 2) I have modified the page sequence, and I can see 2 additional pages >> being generated. >> But both are empty. (verso - expected, but recto - expected some >> content). >> >> Will try the exact contents in your mail & get back... >> >> ~spr >> > > -- > View this message in context: > http://www.nabble.com/What-is-wrong-in-this-title-page-spec--tf4630333.html#a13242130 > Sent from the docbook apps mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-apps-unsubscribe@... > For additional commands, e-mail: docbook-apps-help@... > > > --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@... For additional commands, e-mail: docbook-apps-help@... |
|
|
Re: What is wrong in this title page spec?1) No I have removed the legal notice from book verso titlepage.
2) I am not any good at "fo" syntax, but figured that the 'title' in legal notice was being printed twice. traced it back to a typo in my command-line. I was generating "tets.xsl" where as include was "test.xsl" 3) the duplicate id problem is gone, but the legal text appears on page 5! (see attached test.fo & pdf) test.fo test.pdf ~spr
~spr |
|
|
Re: What is wrong in this title page spec?I think your book titlepage spec file still has an extra break-after="page"
in it from earlier attempts? In the fo file I see these in the fo:flow for the titlepage sequence: <fo:block> <fo:block break-after="page"/> </fo:block> <fo:block break-after="page"/> That extra break forces the page sequence to page 3 (but no content, so it is empty), and the double.sided setting rounds that to a blank page 4 before the new page sequence starts for your legalnotice on page 5. I started with the original titlepage spec file and did not get that extra break. Bob Stayton Sagehill Enterprises DocBook Consulting bobs@... ----- Original Message ----- From: "spr" <spremi@...> To: <docbook-apps@...> Sent: Wednesday, October 17, 2007 12:44 PM Subject: Re: [docbook-apps] What is wrong in this title page spec? > > 1) No I have removed the legal notice from book verso titlepage. > > 2) I am not any good at "fo" syntax, but figured that the 'title' in > legal > notice was being printed twice. > traced it back to a typo in my command-line. I was generating > "tets.xsl" > where as include was "test.xsl" > > 3) the duplicate id problem is gone, but the legal text appears on page > 5! > (see attached test.fo & pdf) > http://www.nabble.com/file/p13261483/test.fo test.fo > http://www.nabble.com/file/p13261483/test.pdf test.pdf > > ~spr > > > Bob Stayton wrote: >> >> Do you still have a legalnotice on your book verso titlepage? Can you >> tell >> what element is producing the duplicate ID by looking in the FO file? >> >> Bob Stayton >> Sagehill Enterprises >> DocBook Consulting >> bobs@... >> >> > > -- > View this message in context: > http://www.nabble.com/What-is-wrong-in-this-title-page-spec--tf4630333.html#a13261483 > Sent from the docbook apps mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-apps-unsubscribe@... > For additional commands, e-mail: docbook-apps-help@... > > > --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@... For additional commands, e-mail: docbook-apps-help@... |
| Free embeddable forum powered by Nabble | Forum Help |