DocBook 5 with Relax NG Custom Paper Size and/or Format Customization Layer
Posted: Tue Feb 21, 2012 10:26 pm
For the last week or so I have been evaluating Oxygen XML Editor for use in creating DocBook5-based real paper books. So far the tool is very nice. The DocBook 5 example in Oxygen XML was exactly what I wanted. I am a software developer by background and I like clean and modular source files. As such, it was nice to have a cleaned up example of a DocBook 5 book using Xinclude and Relax NG (Not so easy to figure out the syntax from the published books on the subject)
After entering some text and successfully creating PDFs, I encountered my first bumpy spot -> I need a custom page size. Eventually, by studying forum posts, I was able to figure out how to duplicate the DocBook to PDF conversion, edit the renamed duplicate, select “parameters”, scroll down to “paper.size”, set it to “C5” and generate a new PDF with “C5” paper size. (By the way, the Help file in the tool did not seem to cover this topic)
Unfortunately, this approach does not really get me where I need to go for two reasons:
1. I am making real books, not office documents. When I submit the PDF to Ingram Lightning Source, in order for them to manufacture an 8”x10” book (254x203mm) they need the PDF document size to be slightly larger to allow for paper trimming. In this case, they need the PDF file sized as 8.25”x10.5” (267x210mm) These dimensions don’t match any of the standard European or U.S. office paper sizes.
2. I am going to make a lot of books and I need to be able to set the paper size (and all the other formatting aspects for the book) in an editable file that lives with the book in my source code control system. Ie: what I really want is to have two files:
MyBookContent.xml – the content of the book with validated DocBook 5 markup
MyBookFormat.SomethingML – a structured parameter file that will flow through the tool chain and generate page sizes, margins, and all the other classical “appearance and format” aspects of the PDF file.
I did find this video online:
http://www.oxygenxml.com/demo/DocBook_C ... ation.html
However, it seems to be an older version. Ie: the tool screen shots are rather different than the current tool and it looks like it may be aimed at the previous DTD-oriented version of DocBook (?) In any case, when I typed in the .xsl file as shown in the video, it failed to compile in the tool. I suspect that the URI references shown in the video may not be correct and/or may not be the right approach for use with Relax NG (?)
I also tried making a Relax NG file using Oxygen XML but did not get anywhere. Unfortunately, the two major books on the subject (“DocBook XSL” by Bob Stayton and “DocBook 5”by Norman Walsh) both sort of hint that it should in theory be possible to make a Relax NG customization layer, but neither one contains an actual complete and executable example of one that will do something as simple as setting the paper size.
Another problem with the open source community information is that I could not find a reference that lists what the editable parameters of DocBook XSL Version 5 actually are. A few examples are shown in places, but I could not actually find a reference list. DocBook 5 Language elements are documented in detail, but reference information on formatting parameters seems to be difficult to find.
Suggestions?
Thanks in Advance
David Hetherington
djhreg@yahoo.com
After entering some text and successfully creating PDFs, I encountered my first bumpy spot -> I need a custom page size. Eventually, by studying forum posts, I was able to figure out how to duplicate the DocBook to PDF conversion, edit the renamed duplicate, select “parameters”, scroll down to “paper.size”, set it to “C5” and generate a new PDF with “C5” paper size. (By the way, the Help file in the tool did not seem to cover this topic)
Unfortunately, this approach does not really get me where I need to go for two reasons:
1. I am making real books, not office documents. When I submit the PDF to Ingram Lightning Source, in order for them to manufacture an 8”x10” book (254x203mm) they need the PDF document size to be slightly larger to allow for paper trimming. In this case, they need the PDF file sized as 8.25”x10.5” (267x210mm) These dimensions don’t match any of the standard European or U.S. office paper sizes.
2. I am going to make a lot of books and I need to be able to set the paper size (and all the other formatting aspects for the book) in an editable file that lives with the book in my source code control system. Ie: what I really want is to have two files:
MyBookContent.xml – the content of the book with validated DocBook 5 markup
MyBookFormat.SomethingML – a structured parameter file that will flow through the tool chain and generate page sizes, margins, and all the other classical “appearance and format” aspects of the PDF file.
I did find this video online:
http://www.oxygenxml.com/demo/DocBook_C ... ation.html
However, it seems to be an older version. Ie: the tool screen shots are rather different than the current tool and it looks like it may be aimed at the previous DTD-oriented version of DocBook (?) In any case, when I typed in the .xsl file as shown in the video, it failed to compile in the tool. I suspect that the URI references shown in the video may not be correct and/or may not be the right approach for use with Relax NG (?)
I also tried making a Relax NG file using Oxygen XML but did not get anywhere. Unfortunately, the two major books on the subject (“DocBook XSL” by Bob Stayton and “DocBook 5”by Norman Walsh) both sort of hint that it should in theory be possible to make a Relax NG customization layer, but neither one contains an actual complete and executable example of one that will do something as simple as setting the paper size.
Another problem with the open source community information is that I could not find a reference that lists what the editable parameters of DocBook XSL Version 5 actually are. A few examples are shown in places, but I could not actually find a reference list. DocBook 5 Language elements are documented in detail, but reference information on formatting parameters seems to be difficult to find.
Suggestions?
Thanks in Advance
David Hetherington
djhreg@yahoo.com