[docbook] def anywhere Re: [docbook] Feedback on DocBook Transclusion proposal

2010-12-17 Thread Justus-bulk
Dave Pawson da...@dpawson.co.uk wrote on Thu, 16 Dec 2010 19:55:17
+:

 On Thu, 16 Dec 2010 20:29:19 +0100
 Jirka Kosek ji...@kosek.cz wrote:

 Of course it would be better to develop and use some more generic
 approach then to develop something specific to DocBook. The problem is
 that solution has to know which attributes are of ID/IDREF types -- it
 is hard to do this without schema introspection.
 ...
 My initial reaction is to restrict it to docbook,
 If implemented, and if it works well there, then perhaps look for wider
 adoption?

Considering the complexity of the issue, I tend to agree with this
viewpoint.

Ultimately I would like to see transclusion become a first-class citizen
of XML, perhaps using an xml* namespace to get around the ID/IDREF type
issue.


To make the already-complex proposal even more complex, I have an
additional use case: As a heavy user of xinclude/xpointer, I routinely
define reused content on the fly (mostly math, in practice).  For
example:


article xmlns=http://docbook.org/ns/docbook;
 xmlns:xi=http://www.w3.org/2001/XInclude;
  titleTransclusion/title

  paraHere is a phrase role=cphrasecomplicated phrase/phrase
  that will reoccur several times./para

  paraFor example, here this xi:include
  xpointer=xpointer(//*...@role='cphrase'][1])/ occurs again./para

  paraAnd here, one more xi:include
  xpointer=xpointer(//*...@role='cphrase'][1])/./para
/article


(This XInclude notation is clearly a mess, and limits me to libxml2.)
Now, how about *permitting the name attribute anywhere*, not only in
def/ elements, allowing me to write equivalently:


article xmlns=http://docbook.org/ns/docbook;
  titleTransclusion/title

  paraHere is a phrase name=cphrasecomplicated phrase/phrase
  that will reoccur several times./para

  paraFor example, here this ref name=cphrase/ occurs again./para

  paraAnd here, one more ref name=cphrase/./para
/article


Or, perhaps @def would be a better name for this attribute than @name.

Of course, I could explicitly define the complicated expression via
definitions/ as in Jirka's proposal. In practice however, ripping
content out of their context is often inconvenient.  It is often more
natural to simply reuse the first occurrence in the text. Or even
better, allow forward references as well.

Justus

-
To unsubscribe, e-mail: docbook-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-h...@lists.oasis-open.org



[docbook] Page Number Prefixes trouble

2010-12-17 Thread J. Adam Craig
Hello!

I stumbled across Jeff Beal's XSL script over on the DocBook.org site for the 
customization layer for adding page number prefixes to page numbers within 
DocBook chapters.  I'm attaching two files.  One is a .txt file which contains 
the errors I received when I ran the fop myfile.fo myfile.pdf script to 
convert the myfile.fo file generated by the xsltproc command to .pdf.  The 
second file is the .xsl file I reference in the xsltproc command, which I 
created based on your script at 
http://wiki.docbook.org/topic/PageNumberPrefixes.

I would very much appreciate any tips you might be able to offer.

I am using version 1.75.2 of Norman Walsh's templates.

Thanks!
- Adam
SEVERE: Exception
org.apache.fop.apps.FOPException: Flow 'xsl-region-body' does not map to the 
region-body in page-master 'blank'.  FOP presently does not support this.
java.lang.IllegalStateException: Flow 'xsl-region-body' does not map to the 
region-body in page-master 'blank'.  FOP presently does not support this.
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
at org.apache.fop.cli.Main.startFOP(Main.java:166)
at org.apache.fop.cli.Main.main(Main.java:197)
Caused by: java.lang.IllegalStateException: Flow 'xsl-region-body' does not map 
to the region-body in page-master 'blank'.  FOP presently does not support this.
at 
org.apache.fop.layoutmgr.PageProvider.cacheNextPage(PageProvider.java:275)
at org.apache.fop.layoutmgr.PageProvider.getPage(PageProvider.java:221)
at org.apache.fop.layoutmgr.PageProvider.getPage(PageProvider.java:185)
at 
org.apache.fop.layoutmgr.PageSequenceLayoutManager.createPage(PageSequenceLayoutManager.java:139)
at 
org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.makeNewPage(AbstractPageSequenceLayoutManager.java:289)
at 
org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.doForcePageCount(AbstractPageSequenceLayoutManager.java:370)
at 
org.apache.fop.area.AreaTreeHandler.finishPrevPageSequence(AreaTreeHandler.java:186)
at 
org.apache.fop.area.AreaTreeHandler.startAbstractPageSequence(AreaTreeHandler.java:199)
at 
org.apache.fop.area.AreaTreeHandler.startPageSequence(AreaTreeHandler.java:194)
at 
org.apache.fop.fo.pagination.PageSequence.startOfNode(PageSequence.java:114)
at 
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:295)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:163)
at 
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown 
Source)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(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.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown 
Source)
at 
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214)
... 3 more

-

java.lang.IllegalStateException: Flow 'xsl-region-body' does not map to the 
region-body in page-master 'blank'.  FOP presently does not support this.
at 
org.apache.fop.layoutmgr.PageProvider.cacheNextPage(PageProvider.java:275)
at org.apache.fop.layoutmgr.PageProvider.getPage(PageProvider.java:221)
at org.apache.fop.layoutmgr.PageProvider.getPage(PageProvider.java:185)
at 
org.apache.fop.layoutmgr.PageSequenceLayoutManager.createPage(PageSequenceLayoutManager.java:139)
at 
org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.makeNewPage(AbstractPageSequenceLayoutManager.java:289)
at 
org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.doForcePageCount(AbstractPageSequenceLayoutManager.java:370)
at 
org.apache.fop.area.AreaTreeHandler.finishPrevPageSequence(AreaTreeHandler.java:186)
at 
org.apache.fop.area.AreaTreeHandler.startAbstractPageSequence(AreaTreeHandler.java:199)
at 
org.apache.fop.area.AreaTreeHandler.startPageSequence(AreaTreeHandler.java:194)
at 
org.apache.fop.fo.pagination.PageSequence.startOfNode(PageSequence.java:114)
at 

Fwd: [docbook-apps] titelpage, title spec file, subtitle

2010-12-17 Thread Lwam Berhane

Hi everybody!

I customize the titlepage like this:

!--
!DOCTYPE t:templates [
!ENTITY hsize0 10pt
!ENTITY hsize1 12pt
!ENTITY hsize2 14.4pt
!ENTITY hsize3 17.28pt
!ENTITY hsize4 20.736pt
!ENTITY hsize5 24.8832pt
!ENTITY hsize0space 7.5pt 0.75 * hsize0
!ENTITY hsize1space 9pt 0.75 * hsize1
!ENTITY hsize2space 10.8pt  0.75 * hsize2
!ENTITY hsize3space 12.96pt  0.75 * hsize3
!ENTITY hsize4space 15.552pt  0.75 * hsize4
!ENTITY hsize5space 18.6624pt  0.75 * hsize5
]
--
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;
xsl:version=1.0

!-- 
 $Id: titlepage.templates.xml 8341 2009-03-16 03:00:56Z bobstayton $
 

 This file is part of the DocBook XSL Stylesheet distribution.
 See ../README or http://docbook.sf.net/ for copyright
 copyright and other information.


 --

!--
 --

t:titlepage t:element=article t:wrapper=fo:block
 font-family=Share-Regular

  t:titlepage-content t:side=recto
 start-indent=0pt
 text-align=center

title t:named-template=component.title
   param:node=ancestor-or-self::article[1]
   keep-with-next.within-column=always
   font-size=20pt
   font-weight=bold/

subtitle  t:named-template=component.title
   param:node=ancestor-or-self::article[1]
   font-weight=bold
   space-before=2em
  font-size=14pt/

!--xsl:attribute-set name=monospace.verbatim.properties
   use-attribute-sets=verbatim.properties
monospace.properties
  xsl:attribute name=wrap-optionwrap/xsl:attribute
  xsl:attribute name=hyphenation-character#x25BA;/xsl:attribute
/xsl:attribute-set


   If you add editor, include this t:predicate attribute
 because only the first editor generates the list of editors.
editor t:predicate=[position() = 1]/



othercredit space-before=0.5em/
releaseinfo space-before=0.5em/
copyright space-before=0.5em/
legalnotice text-align=start
 margin-left=0.5in
 margin-right=0.5in
 font-family={$body.fontset}/
pubdate space-before=0.5em/
revision space-before=0.5em/
revhistory space-before=0.5em/
abstract space-before=0.5em
  text-align=start
  margin-left=0.5in
  margin-right=0.5in
  font-family={$body.fontset}/--
  /t:titlepage-content

  t:titlepage-content t:side=verso
  /t:titlepage-content

t:titlepage-separator
 fo:block break-after=page/
 /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


then I rendered an index.xml with mytitlepage.xsl in jEdit (saxon 9).

Then I got this very long fo output:
?xml version=1.0 encoding=UTF-8?
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
font-family=#xA;#x9;#x9;sans-serif#xA;#x9;,Symbol,ZapfDingbats
font-size=10pt text-align=justify l
ine-height=#xA;#x9;#x9;150%#xA;#x9;
font-selection-strategy=character-by-character
line-height-shift-adjustment=disregard-shifts
writing-mode=lr-tb language=de
fo:layout-master-set
fo:simple-page-master
master-name=blank
page-width=#xA;#x9;#x9;210mm#xA;#x9;
page-height=297mm
margin-top=0.5in
margin-bottom=0.5in
margin-left=1in
margin-right=1in
fo:region-body display-align=center
margin-bottom=0.5in margin-top=0.5in/
fo:region-before region-name=xsl-region-before-blank
extent=0.4in display-align=before/
fo:region-after region-name=xsl-region-after-blank
extent=0.4in display-align=after/
/fo:simple-page-master
fo:simple-page-master
master-name=titlepage-first
page-width=#xA;#x9;#x9;210mm#xA;#x9;
page-height=297mm margin-top=0.5in
margin-bottom=0.5in margin-left=1in
margin-right=1in
fo:region-body margin-bottom=0.5in
margin-top=0.5in
column-gap=12pt
column-count=1/
fo:region-before region-name=xsl-region-before-first extent=0.4in
display-align=before/
fo:region-after region-name=xsl-region-after-first extent=0.4in
display-align=after/
/fo:simple-page-master
fo:simple-page-master
master-name=titlepage-odd
page-width=#xA;#x9;#x9;210mm#xA;#x9;
page-height=297mm margin-top=0.5in margin-bottom=0.5in
margin-left=1in margin-right=1in
fo:region-body margin-bottom=0.5in margin-top=0.5in
column-gap=12pt column-count=1/
fo:region-before region-name=xsl-region-before-odd extent=0.4in
display-align=before/
fo:region-after region-name=xsl-region-after-odd extent=0.4in
display-align=after/
/fo:simple-page-master
fo:simple-page-master
master-name=titlepage-even

RE: [docbook-apps] Saxon linenumbering extension in programlisting

2010-12-17 Thread Mauritz Jeanson
|  -Original Message-
|  From: Dick Hamilton 
|  
|  So, the question is, should the extension treat a final newline this
|  way?
|  
|  I'm inclined to think that it should not do this. It's not a 
|  big deal if
|  your content is inline, but with xi:include, it means you need to
|  manipulate your file to remove the newline character, which I suspect
|  can cause problems if you're trying to use that content 
|  elsewhere (for example, to test a function).
|  
|  Any thoughts?


Try Bob's whitespace-trimming customization:
http://lists.oasis-open.org/archives/docbook-apps/201011/msg00012.html

Mauritz



-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org



[docbook-apps] Manually forcing line breaks?

2010-12-17 Thread Faehndrich Philippe
Good evening,

Please excuse me if I'm not on the right mailing list. 

In my document, at different levels (chapter, sect1), I have sometimes very 
long lines as titles. The docbook xsl-fo stylesheet break these lines, but 
don't follow the rules of a «nice» french typography (articles like «le», 
«la», «les» shouldn't stay at the end of a line, but should be pushed at the 
beginning of the following line - of course only for the PDF output, it 
doesn't matter for the HTML output).

In the final version of my document, I'm ready to take a few time to have a 
«nicer» result.

Is there a way to force line breaks in my docbook source document? I can't find 
anything about this topic in the documentation.

Philippe Faehndrich

-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org



Re: [docbook-apps] Manually forcing line breaks?

2010-12-17 Thread Ron Catterall

Hi
Try this in your customization layer to generate line breaks
Ron

!-- 
 --

!-- PI to cause a line break
usage
?hard-linebreak?, ?line-break? or ?lb?  --
xsl:template match=processing-instruction('lb')
fo:block/
/xsl:template !-- END match=processing-instruction('lb')  --
xsl:template match=processing-instruction('line-break')
fo:block/
/xsl:template !-- END 
match=processing-instruction('line-break')  --

xsl:template match=processing-instruction('hard-linebreak')
fo:block break-before='page'/
/xsl:template !-- END 
match=processing-instruction('hard-linebreak')  --



On 12/17/10 1:10 PM, Faehndrich Philippe wrote:

Good evening,

Please excuse me if I'm not on the right mailing list.

In my document, at different levels (chapter, sect1), I have sometimes very
long lines as titles. The docbook xsl-fo stylesheet break these lines, but
don't follow the rules of a «nice» french typography (articles like «le»,
«la», «les» shouldn't stay at the end of a line, but should be pushed at the
beginning of the following line - of course only for the PDF output, it
doesn't matter for the HTML output).

In the final version of my document, I'm ready to take a few time to have a
«nicer» result.

Is there a way to force line breaks in my docbook source document? I can't find
anything about this topic in the documentation.

Philippe Faehndrich

-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org





--
Ron Catterall Ph.D. D.Sc.
r...@catterall.net
http://catterall.net



smime.p7s
Description: S/MIME Cryptographic Signature


RE: [docbook-apps] Manually forcing line breaks?

2010-12-17 Thread Cramer, David W (David)
Perhaps you could programmatically process the input file somewhere along the 
way (e.g. the fo file before rendering the pdf) to change the space(s) after 
le, la, and les to #160; (a non-breaking space).

David

 -Original Message-
 From: Faehndrich Philippe [mailto:phfaehndr...@bluewin.ch]
 Sent: Friday, December 17, 2010 1:10 PM
 To: docbook-apps@lists.oasis-open.org
 Subject: [docbook-apps] Manually forcing line breaks?
 
 Good evening,
 
 Please excuse me if I'm not on the right mailing list.
 
 In my document, at different levels (chapter, sect1), I have sometimes
 very
 long lines as titles. The docbook xsl-fo stylesheet break these lines,
 but
 don't follow the rules of a «nice» french typography (articles like
 «le»,
 «la», «les» shouldn't stay at the end of a line, but should be pushed
 at the
 beginning of the following line - of course only for the PDF output, it
 doesn't matter for the HTML output).
 
 In the final version of my document, I'm ready to take a few time to
 have a
 «nicer» result.
 
 Is there a way to force line breaks in my docbook source document? I
 can't find
 anything about this topic in the documentation.
 
 Philippe Faehndrich
 
 -
 To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
 For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org



Re: [docbook-apps] Manually forcing line breaks?

2010-12-17 Thread Christophe HARO
Hi,

See : 
http://www.sagehill.net/docbookxsl/LineBreaks.html
Regards.

-- 
Christophe HARO
christophe.h...@free.fr


- Faehndrich Philippe phfaehndr...@bluewin.ch a écrit :

 Good evening,
 
 Please excuse me if I'm not on the right mailing list. 
 
 In my document, at different levels (chapter, sect1), I have sometimes
 very 
 long lines as titles. The docbook xsl-fo stylesheet break these lines,
 but 
 don't follow the rules of a «nice» french typography (articles like
 «le», 
 «la», «les» shouldn't stay at the end of a line, but should be pushed
 at the 
 beginning of the following line - of course only for the PDF output,
 it 
 doesn't matter for the HTML output).
 
 In the final version of my document, I'm ready to take a few time to
 have a 
 «nicer» result.
 
 Is there a way to force line breaks in my docbook source document? I
 can't find 
 anything about this topic in the documentation.
 
 Philippe Faehndrich
 
 -
 To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
 For additional commands, e-mail:
 docbook-apps-h...@lists.oasis-open.org

-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org