Breaking lines with a hyphen
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 5
- Joined: Fri Mar 04, 2005 12:10 am
Breaking lines with a hyphen
I'm trying to output some java souce code in a docbook pdf. I want long lines to be wrapped with a continuation character. The problem is that when I turn on hyphenation to allow this, I get a hyphen in front of almost every word. Is this a problem with the built in fop? Or am I doing something wrong? Here's the xsl in my customisation layer:
Code: Select all
...
<xsl:import href="file:/Applications/oxygen/frameworks/docbook/xsl/fo/docbook.xsl"/>
<xsl:param name="hyphenate.verbatim" select="1"/>
<xsl:attribute-set name="monospace.verbatim.properties"
use-attribute-sets="verbatim.properties monospace.properties">
<xsl:attribute name="font-size">75%</xsl:attribute>
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
<xsl:attribute name="hyphenation-character">►</xsl:attribute>
</xsl:attribute-set>
...
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
It doesn't seem to be a problem in FOP. Do you use a hyphenation file together with FOP ? How did you obtain it ?
Regards,
Sorin
It doesn't seem to be a problem in FOP. Do you use a hyphenation file together with FOP ? How did you obtain it ?
Regards,
Sorin
-
- Posts: 5
- Joined: Fri Mar 04, 2005 12:10 am
First I should point out that I'm new to this and I've just been gathering information about docbook and fo from the web as I go, so it's quite possible I've misunderstood somewhere along the line. I thought getting a hyphenation file might fix the problem so I got en.xml via this page http://xml.apache.org/fop/hyphenation.html. I downloaded an example fop configuration file and set the hyphenation directory where I put en.xml, then I set oxygen's fo preferences to the location of the config file. It didn't make any difference! Is that what I should have done? Thanks for your help.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
The English hyphenation file is part of the FOP's standard hyphenation support so you don't have to download and set any config file for that. Using the <oXygen/> built in FOP is enough. I tested that and it works with non verbatim DocBook elements like para (verbatim elements are programlisting, screen, synopsis).
For verbatim elements I got the same wrong result: a hyphen in front of almost every word. This happened for me both with the FOP's builtin hyphenation support for the English language and with a config file specifying the directory with the en.xml file downloaded from the Apache site. What you did in your customisation layer is right but the problem is in the DocBook XSL stylesheet imported by your layer. You can see that if you disable the FO processing in the transformation scenario edit dialog (the FO Processor tab), change the value of Save As (the Output tab) to FOPinput.fo for example and look at the generated .fo file. So FOP does not add the strange hyphens to your document content but they are already present in the FOP input file. The next step is to ask about the strange hyphens on the docbook-apps list:
http://www.oasis-open.org/docbook/mailinglist/
The list archives are at:
http://lists.oasis-open.org/archives/docbook-apps/
I hope this helps,
Sorin
The English hyphenation file is part of the FOP's standard hyphenation support so you don't have to download and set any config file for that. Using the <oXygen/> built in FOP is enough. I tested that and it works with non verbatim DocBook elements like para (verbatim elements are programlisting, screen, synopsis).
For verbatim elements I got the same wrong result: a hyphen in front of almost every word. This happened for me both with the FOP's builtin hyphenation support for the English language and with a config file specifying the directory with the en.xml file downloaded from the Apache site. What you did in your customisation layer is right but the problem is in the DocBook XSL stylesheet imported by your layer. You can see that if you disable the FO processing in the transformation scenario edit dialog (the FO Processor tab), change the value of Save As (the Output tab) to FOPinput.fo for example and look at the generated .fo file. So FOP does not add the strange hyphens to your document content but they are already present in the FOP input file. The next step is to ask about the strange hyphens on the docbook-apps list:
http://www.oasis-open.org/docbook/mailinglist/
The list archives are at:
http://lists.oasis-open.org/archives/docbook-apps/
I hope this helps,
Sorin
-
- Posts: 41
- Joined: Fri Dec 15, 2006 8:09 pm
- Location: Madrid
- Contact:
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service