Re: [docbook-apps] Generating multiple metadata elements in user.head.content
Thanks Bob, that's a nice solution. Inexplicably, calling the person.name.last-first template didn't apply the punctuation between surname and firstname (there was a space but no comma). I substituted in your custom template instead: xsl:apply-templates select=d:personname/d:surname/ xsl:text, /xsl:text xsl:apply-templates select=d:personname/d:firstname/ Dave On 29-08-13 3:12 AM, Bob Stayton wrote: Hi Dave, When processing an element that can appear zero or more times, I've found that creating a template that matches on that element and then using apply-templates works best. If there are no such elements, then the apply-templates does nothing. If there are, it is applied as many times as there are elements. Doing that in a new mode will prevent any interference from existing templates. This customization should do what you want. xsl:template name=user.head.content xsl:param name=node select=./ xsl:param name=info select=d:info[1]/ xsl:apply-templates select=$info//d:authorgroup[@role='leadauthor']/d:author mode=author.meta.mode/ /xsl:template xsl:template match=d:author mode=author.meta.mode meta name=dcterms:creator xsl:attribute name=content xsl:variable name=personname xsl:choose xsl:when test=d:personname/d:surname xsl:call-template name=person.name.last-first/ /xsl:when xsl:otherwise xsl:call-template name=person.name/ /xsl:otherwise /xsl:choose /xsl:variable xsl:value-of select=$personname/ /xsl:attribute /meta /xsl:template /xsl:stylesheet I called a couple of utility templates from common/common.xsl to arrange the author information in a temporary variable named 'personname', and then took the value of the result to eliminate html span wrappers and reduce it to plain text for the attribute value. Bob Stayton Sagehill Enterprises b...@sagehill.net mailto:b...@sagehill.net *From:* Xmplar mailto:i...@xmplar.biz *Sent:* Tuesday, August 27, 2013 6:48 PM *To:* DocBook Apps mailto:docbook-apps@lists.oasis-open.org *Subject:* [docbook-apps] Generating multiple metadata elements in user.head.content * *I have two book author names marked up in authorgroup: authorgrouprole=leadauthor author personnamehonorificMr/honorificfirstnameJohn/firstnamesurnameSmith/surname/personname contribLead author contribution/contrib affiliation shortaffilShort affil./shortaffil jobtitleJob title/jobtitle orgnameOrganisational affiliation/orgname orgdivOrg div/orgdiv addressOrg address/address /affiliation /author author personnameName of second lead author/personname /author /authorgroup My first issue is trying to generate both author names in separate meta elements in HTML5 using 1.78.1-ns. This is all I get: metaname=dcterms:creatorcontent=Smith, John/ I have a customization that generates only the first author's names (firstname and surname) -- I don't get the second author, nor do I get any content inside only personname (so far I need both firstname and surname to generate content): xsl:templatename=user.head.content xsl:paramname=nodeselect=./ xsl:variablename=infoselect=(d:info)[1]/ ... xsl:iftest=$info and $info//d:author[ancestor::d:authorgroup[@role='leadauthor']] metaname=dcterms:creator xsl:attributename=content !--xsl:call-template name=person.name.last-first xsl:with-param name=node select=./ /xsl:call-template-- xsl:choose xsl:whentest=descendant::d:surname xsl:value-ofselect=normalize-space(string($info/d:authorgroup[@role='leadauthor']/d:author/d:personname/d:surname))/ xsl:text, /xsl:text xsl:value-ofselect=normalize-space(string($info/d:authorgroup[@role='leadauthor']/d:author/d:personname/d:firstname))/ /xsl:when xsl:otherwise xsl:value-ofselect=normalize-space(string($info/d:authorgroup[@role='leadauthor']/d:author/d:personname))/ /xsl:otherwise /xsl:choose /xsl:attribute /meta /xsl:if ... /xsl:template I tried using xsl:for-each around the meta coding, and then again inside meta, but that generates the first author's name multiple times in one meta element. I can't see any clues from the EPUB metadata stylesheets either. So: (1) How do I generate one meta element *for each author*, and (2) What coding works to generate content marked up in personname only (i.e. no child elements)? -- *Dave Gardiner*
[docbook-apps] Generating multiple metadata elements in user.head.content
* *I have two book author names marked up in authorgroup: authorgrouprole=leadauthor author personnamehonorificMr/honorificfirstnameJohn/firstnamesurnameSmith/surname/personname contribLead author contribution/contrib affiliation shortaffilShort affil./shortaffil jobtitleJob title/jobtitle orgnameOrganisational affiliation/orgname orgdivOrg div/orgdiv addressOrg address/address /affiliation /author author personnameName of second lead author/personname /author /authorgroup My first issue is trying to generate both author names in separate meta elements in HTML5 using 1.78.1-ns. This is all I get: metaname=dcterms:creatorcontent=Smith, John/ I have a customization that generates only the first author's names (firstname and surname) -- I don't get the second author, nor do I get any content inside only personname (so far I need both firstname and surname to generate content): xsl:templatename=user.head.content xsl:paramname=nodeselect=./ xsl:variablename=infoselect=(d:info)[1]/ ... xsl:iftest=$info and $info//d:author[ancestor::d:authorgroup[@role='leadauthor']] metaname=dcterms:creator xsl:attributename=content !--xsl:call-template name=person.name.last-first xsl:with-param name=node select=./ /xsl:call-template-- xsl:choose xsl:whentest=descendant::d:surname xsl:value-ofselect=normalize-space(string($info/d:authorgroup[@role='leadauthor']/d:author/d:personname/d:surname))/ xsl:text, /xsl:text xsl:value-ofselect=normalize-space(string($info/d:authorgroup[@role='leadauthor']/d:author/d:personname/d:firstname))/ /xsl:when xsl:otherwise xsl:value-ofselect=normalize-space(string($info/d:authorgroup[@role='leadauthor']/d:author/d:personname))/ /xsl:otherwise /xsl:choose /xsl:attribute /meta /xsl:if ... /xsl:template I tried using xsl:for-each around the meta coding, and then again inside meta, but that generates the first author's name multiple times in one meta element. I can't see any clues from the EPUB metadata stylesheets either. So: (1) How do I generate one meta element *for each author*, and (2) What coding works to generate content marked up in personname only (i.e. no child elements)? -- *Dave Gardiner*
Re: [docbook-apps] Generating e-pub and html indexes
Hi Richard, Please do publicize my customization - I haven't changed any of that coding in the meantime. Dave On 23-07-13 11:49 AM, Richard Hamilton wrote: Hi Paul, Dave Gardiner put together an index customization that I've used to generate index entries that point to numbered sections. That is, if you have section numbering turned on, and you use this customization, the index will use the section number instead of the title. So you get index entries that look like this: agile development, 1.4, 2.3.6 This doesn't work if you have section numbering turned off. I have an item on my todo list to make it so it will still work with section numbering on or off, but that has sunk to the bottom of my todo list for now:-). If you'd like to see the customization, I can send it to you if it's okay with Dave. Dick Hamilton --- XML Press XML for Technical Communicators http://xmlpress.net hamil...@xmlpress.net On Jul 22, 2013, at 5:02 PM, Pc Thoms wrote: A specific example I should not provide, as it is beyond my expertise, but I have expectations and hopes for such. I am fairly competent in xml, but not with xslt. If the locators in a DocBook formatted xml file can point to thechapter/,section,para/,table/, etc., within the document, the more specific the reference between the locator and the origination of theindexterm/ so much the better. Preferably the generated locator will point directly to the originatingindexterm/ placed in the document, or the lowest hierarchical block element. Rather than linking to thechapter/, which may contain hundreds, to thousands, of words it would be better to link to the lowest hierarchical block element that contains theindexterm/, such as apara/ orline/ (DocBook-Publisher). This should make the anindex/ locator link directly to specific place in the text, that one would presumably be interested in once they click a link. Locators that link to the beginning of achapter/ orsection/ that may contain 500+ words is not very useful. But a locator that links one directly to thesection,para/,table/, orline/, would serve its’ readers well. What I’m looking for is an index locator that has an “href” attribute that links directly to an anchored point in an XHTML and E-Pub document. Any assistance, and direction, is appreciated. Paul - 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] Link from part of SVG
Here is an old thread by Eliot Kimber that discusses SVG linking in FO generally: http://groups.yahoo.com/group/XSL-FO/message/6779. On 14-06-13 3:46 AM, Camille Bégnis wrote: Hello, I want to create a clickable SVG with various zones inside the SVG that point to different chapters in my document. I have managed to create an HTML link from within a SVG, by adding the element a xlink:href=chap3 view-source:file:///home/camille/Bureau/tmp/images/chap3 so when I add that SVG inside a DocBook document, and transform it to HTML, that zone of the SVG points to the chapter with xml:id chap3. So far so good. I haven't found the required code to be added to the SVG so that the same behavior is achieved in the PDF (made with fop) output. Any idea? Have a nice day, -- *NeoDoc* *Camille Bégnis* cami...@neodoc.fr Tél: +33 (0)4.42.52.24.20 5, rue de la Touloubre 13770 Venelles France http://www.neodoc.fr/
Re: [docbook-apps] Can I link directly to a WebHelp page?
Thanks Radu, that's excellent! It's good this solution works for relative file names/directories. Dave On 30-04-13 12:33 AM, Radu Coravu wrote: Hi Dave, The Oxygen Docbook WebHelp was branched from the Docbook WebHelp original XSLs so this is more of a question to ask on the Oxygen XML Editor support email address (supp...@oxygenxml.com). Basically there is a GET parameter called q which you can use to point to the absolute HTML file path which will be opened in the right side of the frameset, for example on my local drive the path would be something like: file:///D:/projects/eXml/samples/docbook/v4/out/webhelp/index_frames.html?q=/D:/projects/eXml/samples/docbook/v4/out/webhelp/ar01s02.html Regards, Radu Radu Coravu oXygen/ XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 4/29/2013 5:19 PM, Xmplar wrote: I'd like to link into a specific WebHelp page that is formatted in frames. I've created SVG graphics with a href links, and want to go straight to a frameset page created with DocBook WebHelp in oXygen. I can link to the home page easily enough (index_frames.html) - is there a HTML target specification to then navigate to a page in that frameset? Or is it possible with Javascript? -- *Dave Gardiner* - 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] Can I link directly to a WebHelp page?
I'd like to link into a specific WebHelp page that is formatted in frames. I've created SVG graphics with a href links, and want to go straight to a frameset page created with DocBook WebHelp in oXygen. I can link to the home page easily enough (index_frames.html) - is there a HTML target specification to then navigate to a page in that frameset? Or is it possible with Javascript? -- *Dave Gardiner*
[docbook-apps] DocBook implementation in Madcap Flare?
Does anyone know if Madcap Flare is able to support DocBook yet? I haven't found any discussions about it so I suspect it's still a DITA editor only. -- *Dave Gardiner*
Re: [docbook-apps] partintro deletes part TOC
Thanks Bob. On 16-03-13 2:25 AM, Bob Stayton wrote: The missing TOC when partintro is used is a bug in the fo stylesheet. I've fixed it in SVN. If you want to patch your customization layer, then copy the template named 'generate.part.toc' from fo/division.xsl and change this variable: xsl:variable name=nodes select=reference| preface| chapter| appendix| article| bibliography| glossary| index/ to: xsl:variable name=nodes select=$part/reference| $part/preface| $part/chapter| $part/appendix| $part/article| $part/bibliography| $part/glossary| $part/index/ That template has the partintro as the context element when a partintro exists, but it is passed the part element as a template param named $part. But it wasn't using the param in selecting nodes for the TOC. Since the partintro does not contain preface, chapter, etc., it thought the TOC was empty. This patch makes sure it looks in the part element for content. Bob Stayton Sagehill Enterprises b...@sagehill.net From: Xmplar Sent: Thursday, March 14, 2013 4:46 PM To: aleksey.tsalolik...@bydeluxe.com ; DocBook Apps Subject: Re: [docbook-apps] partintro deletes part TOC I haven't got an answer for this yet Aleksey. I'm reposting it to the list in case someone else might have found a solution. However, my issue is not a part within a part - it is partintro in a part. On 15-03-13 7:01 AM, Aleksey Tsalolikhin wrote: Hi. Did you figure this out, please? I have a similar issue; if I have a part inside a book, I get the TOC for the part, but if I have a part inside a part inside a book, then I don't get a TOC for the part that is inside the book. Best, -at On Tue, Feb 5, 2013 at 10:57 PM, Xmplar i...@xmplar.biz wrote: I was testing an FO customization to remove a part toc title by setting 'part toc' in template generate.toc, and wasn't able to. I have the customization in TDG (page 210) to add a toc to the part title page, plus I have my own customization to set the order of partintro and the part toc on recto and verso pages. I then tested output using the standard 1.78.0 stylesheets without customization. For the first part title page, I have a partintro: part titlePart 1 title/title titleabbrevPart 1 abbrevtitle/titleabbrev subtitleThe part subtitle goes here.../subtitle partintro titlePart introduction title goes here (optional).../title subtitlePart introduction subtitle goes here (optional)/subtitle info authorgroup author personnamefirstnameAndrew/firstnamesurnameWalker/surname/personname contribSenior Researcher/contrib /author author personnamefirstnameBrian/firstnamesurnameCharleston/surname/personname contribJunior bottlewasher/contrib /author /authorgroup /info paraAn introduction to the part can be put into para elements. /para mediaobject imageobject imagedata fileref=images/redlettucelogo.png width=60mm/ /imageobject /mediaobject paraAn introduction (again) to the part can be put into para elements. /para paraFurther info for part titlepage goes here.../para /partintro xi:include href=book_chap1.xml xi:fallback para emphasisFIXME: MISSING XINCLUDE CONTENT chap1/emphasis /para /xi:fallback /xi:include /part Using the standard stylesheets, I don't get a part toc generated. However, for the second part title page I don't have any additional content: part label=2 titlePart 2 title/title titleabbrevPart 2 abbrevtitle/titleabbrev xi:include href=book_chap2.xml xi:fallback para emphasisFIXME: MISSING XINCLUDE CONTENT chap2/emphasis /para /xi:fallback /xi:include xi:include href=book_chap3.xml xi:fallback para emphasisFIXME: MISSING XINCLUDE CONTENT chap3/emphasis /para /xi:fallback /xi:include /part This does produce a part toc. What would be stopping the part toc from generating where there is partintro? - 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] partintro deletes part TOC
I haven't got an answer for this yet Aleksey. I'm reposting it to the list in case someone else might have found a solution. However, my issue is not a part within a part - it is *partintro* in a part. On 15-03-13 7:01 AM, Aleksey Tsalolikhin wrote: Hi. Did you figure this out, please? I have a similar issue; if I have a part inside a book, I get the TOC for the part, but if I have a part inside a part inside a book, then I don't get a TOC for the part that is inside the book. Best, -at On Tue, Feb 5, 2013 at 10:57 PM, Xmplar i...@xmplar.biz mailto:i...@xmplar.biz wrote: I was testing an FO customization to remove a part toc title by setting 'part toc' in template generate.toc, and wasn't able to. I have the customization in TDG (page 210) to add a toc to the part title page, plus I have my own customization to set the order of partintro and the part toc on recto and verso pages. I then tested output using the standard 1.78.0 stylesheets without customization. For the first part title page, I have a partintro: part titlePart 1 title/title titleabbrevPart 1 abbrevtitle/titleabbrev subtitleThe part subtitle goes here.../subtitle partintro titlePart introduction title goes here (optional).../title subtitlePart introduction subtitle goes here (optional)/subtitle info authorgroup author personnamefirstnameAndrew/firstnamesurnameWalker/surname/personname contribSenior Researcher/contrib /author author personnamefirstnameBrian/firstnamesurnameCharleston/surname/personname contribJunior bottlewasher/contrib /author /authorgroup /info paraAn introduction to the part can be put into para elements. /para mediaobject imageobject imagedata fileref=images/redlettucelogo.png width=60mm/ /imageobject /mediaobject paraAn introduction (again) to the part can be put into para elements. /para paraFurther info for part titlepage goes here.../para /partintro xi:include href=book_chap1.xml xi:fallback para emphasisFIXME: MISSING XINCLUDE CONTENT chap1/emphasis /para /xi:fallback /xi:include /part Using the standard stylesheets, I don't get a part toc generated. However, for the second part title page I don't have any additional content: part label=2 titlePart 2 title/title titleabbrevPart 2 abbrevtitle/titleabbrev xi:include href=book_chap2.xml xi:fallback para emphasisFIXME: MISSING XINCLUDE CONTENT chap2/emphasis /para /xi:fallback /xi:include xi:include href=book_chap3.xml xi:fallback para emphasisFIXME: MISSING XINCLUDE CONTENT chap3/emphasis /para /xi:fallback /xi:include /part This does produce a part toc. What would be stopping the part toc from generating where there is partintro? -- *Dave Gardiner*
[docbook-apps] DocBook mobile stylesheets
Will the mobile stylesheets that Gihan Karunarathne created be integrated into an upcoming release? What stage of development are they at? -- **
[docbook-apps] partintro deletes part TOC
I was testing an FO customization to remove a part toc title by setting 'part toc' in template generate.toc, and wasn't able to. I have the customization in TDG (page 210) to add a toc to the part title page, plus I have my own customization to set the order of partintro and the part toc on recto and verso pages. I then tested output using the standard 1.78.0 stylesheets without customization. For the first part title page, I have a partintro: part titlePart 1 title/title titleabbrevPart 1 abbrevtitle/titleabbrev subtitleThe part subtitle goes here.../subtitle partintro titlePart introduction title goes here (optional).../title subtitlePart introduction subtitle goes here (optional)/subtitle info authorgroup author personnamefirstnameAndrew/firstnamesurnameWalker/surname/personname contribSenior Researcher/contrib /author author personnamefirstnameBrian/firstnamesurnameCharleston/surname/personname contribJunior bottlewasher/contrib /author /authorgroup /info paraAn introduction to the part can be put into para elements. /para mediaobject imageobject imagedata fileref=images/redlettucelogo.png width=60mm/ /imageobject /mediaobject paraAn introduction (again) to the part can be put into para elements. /para paraFurther info for part titlepage goes here.../para /partintro xi:include href=book_chap1.xml xi:fallback para emphasisFIXME: MISSING XINCLUDE CONTENT chap1/emphasis /para /xi:fallback /xi:include /part Using the standard stylesheets, I don't get a part toc generated. However, for the second part title page I don't have any additional content: part label=2 titlePart 2 title/title titleabbrevPart 2 abbrevtitle/titleabbrev xi:include href=book_chap2.xml xi:fallback para emphasisFIXME: MISSING XINCLUDE CONTENT chap2/emphasis /para /xi:fallback /xi:include xi:include href=book_chap3.xml xi:fallback para emphasisFIXME: MISSING XINCLUDE CONTENT chap3/emphasis /para /xi:fallback /xi:include /part This does produce a part toc. What would be stopping the part toc from generating where there is partintro? -- *Dave Gardiner*
[docbook-apps] Extra title generated for revhistory
I have a customization to select either the gentext key or title content for revhistory. When it's the latter, an additional title is generated after the table head in HTML5, viz: div class=revhistorytable style=border-style:solid; width:100%; class=revhistorytbl tr th style=align: left; valign: top; colspan=4Revision history (this book)/th /tr *h1 class=titleRevision history (this book)/h1* tr td style=align: left; width: 25%;Revision 1/td Part of the customization of xsl:template match=d:revhistory mode=titlepage.mode is: xsl:variable name=title xsl:choose xsl:when test=d:title xsl:value-of select=d:title/ !--xsl:apply-templates select=d:title|d:info/d:title mode=titlepage.mode/-- /xsl:when xsl:otherwise xsl:call-template name=gentext xsl:with-param name=key select='RevHistory'/ /xsl:call-template /xsl:otherwise /xsl:choose !--xsl:call-template name=gentext xsl:with-param name=keyRevHistory/xsl:with-param /xsl:call-template-- /xsl:variable xsl:variable name=contents div xsl:apply-templates select=. mode=common.html.attributes/ xsl:call-template name=id.attribute/ table !--remove hardcoded style + add class attrib ***works 19/1/13-- !--xsl:if test=$css.decoration != 0 xsl:attribute name=style xsl:textborder-style:solid; width:100%;/xsl:text /xsl:attribute /xsl:if-- xsl:attribute name=class xsl:value-of select='revhistorytbl'/ /xsl:attribute !-- include summary attribute if not HTML5 -- xsl:if test=$div.element != 'section' xsl:attribute name=summary xsl:call-template name=gentext xsl:with-param name=keyrevhistory/xsl:with-param /xsl:call-template /xsl:attribute /xsl:if tr !--HTML5 attrs added to th 19/1/13-- th style=align: {$direction.align.start}; valign: top; colspan={$numcols} xsl:copy-of select=$title/ !--strong xmlns:xslo=http://www.w3.org/1999/XSL/Transform; xsl:call-template name=gentext xsl:with-param name=key select='RevHistory'/ /xsl:call-template /strong-- /th /tr xsl:apply-templates mode=titlepage.mode xsl:with-param name=numcols select=$numcols/ /xsl:apply-templates /table /div /xsl:variable So the second title is generated by the xsl:apply-templates mode=titlepage.mode. How can I exclude the second title? -- *Dave Gardiner*
[docbook-apps] HTML5 invalid attributes
I've tested the latest snapshot of 1.78.0 without any customization and am getting these invalid HTML5 errors using oXygen 14.1: In the table element I'm still getting: border=0, summary and width attributes. For td I'm getting width, align and valign attributes. For th I get valign. For div class=mediaobject I get align. Is anyone else experiencing these results for EPUB3/HTML5? Dave Gardiner - 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] URI in bibliography
Why is uri not permitted in bibliography inlines? I'm using DB 5.0 and it would be consistent if I could use uri throughout a document. I'm needing to use link in a bibliography instead. -- *Dave Gardiner*
[docbook-apps] HTML5 style attributes override CSS
I'm getting other spurious 'style' attributes with hardcoded styles using 1.77.1 HTML5/EPUB 3. (My previous question about width and height on img has been fixed.) These attributes should probably be removed, because I can't override them with CSS styles. (The HTML5 specs don't state that my specific examples are deprecated/obsolete.) The elements are being generated with classes, which is sufficient for CSS, but the additional 'style' attribute seems to effectively kill that functionality. I'm aware that a lot of this is probably generated by templates in html5-element-mods.xsl. Can these style templates please be revised? Width (and height) on external SVG: divclass=mediaobjectobject style=width: 106.29921259842521; type=image/svg+xmldata=images/test.svg width=106.29921259842521height=106.29921259842521 Bullet symbol on itemizedlist (and similarly for numeration in orderedlist): divclass=itemizedlistepub:type=listulclass=itemizedlist compact style=list-style-type: circle; Horizontal alignment for img (and in the wrapping div): divstyle=text-align: center; class=mediaobjectimg style=text-align: middle; src=images/Figure2-1.gif alt=Alternate text for the image in XHTML file//div Also please recheck style attributes for table, td, th, tr. -- *Dave Gardiner*
[docbook-apps] table.borders.with.css - doesn't allow CSS styles?
I'm experimenting with 'table.borders.with.css' set to '1' in 1.77.1-ns and the styles I've set in my customization layer for border color, style and thickness are still being generated in HTML5. I would expect that when table.borders.with.css is '1', any params in my customization should be ignored, and that I would then be able to set border attributes in CSS. My param settings are: xsl:param name=table.borders.with.css1/xsl:param xsl:param name=default.table.framenone/xsl:param xsl:param name=table.frame.border.color#00/xsl:param xsl:param name=table.frame.border.stylesolid/xsl:param xsl:param name=table.frame.border.thickness2px/xsl:param xsl:param name=table.cell.border.color#00/xsl:param xsl:param name=table.cell.border.stylenone/xsl:param xsl:param name=table.cell.border.thickness1px/xsl:param And typical output is: div class=table-contentsa id=d0e1169 class=indexterm/atable style=width: 100%; border-collapse: collapse;border-top: 2px solid #00; border-bottom: 2px solid #00; colgroup... Any border styles I then set in CSS are not overriding the values in the table style attribute. What should I be doing differently? -- *Dave Gardiner*
[docbook-apps] Remove hyperlink from space after footnote number
I found in the HTML (and XHTML etc) stylesheets that the template xsl:template match=d:footnote/d:para[1]|d:footnote/d:simpara[1] priority=2 generates a hyperlink in the space between the footnote number and its para. This looks a bit untidy so I've modified the template to put the space after the a element. Please consider this for the next release. xsl:template match=d:footnote/d:para[1]|d:footnote/d:simpara[1] priority=2 !-- this only works if the first thing in a footnote is a para, -- !-- which is ok, because it usually is. -- xsl:variable name=href xsl:text#/xsl:text xsl:call-template name=object.id xsl:with-param name=object select=ancestor::d:footnote/ /xsl:call-template /xsl:variable xsl:call-template name=paragraph xsl:with-param name=class xsl:if test=@role and $para.propagates.style != 0 xsl:value-of select=@role/ /xsl:if /xsl:with-param xsl:with-param name=content a href={$href} xsl:apply-templates select=. mode=class.attribute/ sup xsl:apply-templates select=. mode=class.attribute/ xsl:text[/xsl:text xsl:apply-templates select=ancestor::d:footnote mode=footnote.number/ !--modification 25/1/13 to remove/add spaces-- xsl:text]/xsl:text /sup /a xsl:text /xsl:text !--end mod-- xsl:apply-templates/ /xsl:with-param /xsl:call-template /xsl:template -- *Dave Gardiner*
[docbook-apps] Setting width for mediaobject in EPUB
I'm specifying the width of an image using the imagedata attribute 'width' (and I've also tried 'contentwidth'). When I transform to an EPUB 3, I get the width coded as a style attribute: img style=width: 150; src=images/by-nc.gif alt=alt text for Creative Commons licence logo / The image doesn't render to a width of 150px. But removing the style setting and replacing it with the img attribute 'width' does work. Where do I find the stylesheet coding that sets style=width: ; . I've looked in XHTML1-1/graphics.xsl and there's nothing obvious that sets the style attribute with a value of 'width' (all instance of 'style' refer to text-align). -- *Dave Gardiner*
Re: [docbook-apps] Setting width for mediaobject in EPUB
Bob, According to the specs, I believe that width and height *may* be permitted on img. These should actually be the default, or at least a parameterized option, for DocBook. I'm testing my HTML pages in the latest Firefox - if images don't appear sized correctly (i.e. as they are coded in the xml with 'width' or 'contentwidth') then it means a lot of post-processing of the HTML. I'd rather have images turn out the size that I specify (funnily enough), and 'width' inside 'style' doesn't work. On 19-01-13 4:54 AM, Bob Stayton wrote: Hi Dave, The status of the width and many other attributes changed in HTML5, which is what Epub3 is based on. For most HTML5 elements, the width attribute is deprecated, and should be replaced with the CSS style. In an earlier draft of HTML5, that was true for img as well. However, the latest draft shows that width and height attributes are permitted on img. The xhtml5 stylesheet is a customization of the DocBook xhtml stylesheet. To handle these deprecated attributes, there is a template with match=* in mode=convert.to.style that rewrites the deprecated attributes as parts of a style attribute for an HTML element. That template is in xhtml5/html5-element-mods.xsl. You will see that it includes width. Since this is a mode, we should be able to add a template with match=x:img (the x: namespace is the XHTML namespace) and change that behavior so width is output for img. However, I'm not sure it is that easy, since width is also involved with creating a viewport for an image. I'll look into it. Bob Stayton Sagehill Enterprises b...@sagehill.net mailto:b...@sagehill.net *From:* Xmplar mailto:i...@xmplar.biz *Sent:* Friday, January 18, 2013 6:33 AM *To:* DocBook Apps mailto:docbook-apps@lists.oasis-open.org *Subject:* [docbook-apps] Setting width for mediaobject in EPUB I'm specifying the width of an image using the imagedata attribute 'width' (and I've also tried 'contentwidth'). When I transform to an EPUB 3, I get the width coded as a style attribute: img style=width: 150; src=images/by-nc.gif alt=alt text for Creative Commons licence logo / The image doesn't render to a width of 150px. But removing the style setting and replacing it with the img attribute 'width' does work. Where do I find the stylesheet coding that sets style=width: ; . I've looked in XHTML1-1/graphics.xsl and there's nothing obvious that sets the style attribute with a value of 'width' (all instance of 'style' refer to text-align). -- *Dave Gardiner* -- *Dave Gardiner*
Re: [docbook-apps] Specifying directory for epub 3 output
I was able to remove the full pathname of base.dir from the lists of titles in the book toc by this customization of the template make.lot.chunk: xsl:variable name=href xsl:value-of select=$type/ xsl:text-toc/xsl:text xsl:value-of select=$html.ext/ !--xsl:call-template name=make-relative-filename xsl:with-param name=base.dir select=''/ xsl:with-param name=base.name xsl:call-template name=dbhtml-dir/ xsl:value-of select=$type/ xsl:text-toc/xsl:text xsl:value-of select=$html.ext/ /xsl:with-param /xsl:call-template-- /xsl:variable Removing the call to make-relative-filename for 'href' doesn't seem to affect any other generated lots. On 16-01-13 7:54 AM, Bob Stayton wrote: Hi Dave, I don't think this is an issue for DocBook XSL, but with Oxygen's transformation scenarios. You should ask them if there is an option to specify the current working directory as a base for a transformation so you don't have to specify a full path in base.dir. That said, you still should not be getting full paths in the ListofTitles links. Those should be computed relative to base.dir where the book TOC file is, and should not contain base.dir in their path. I'm not clear how Oxygen is changing that aspect. Bob Stayton Sagehill Enterprises b...@sagehill.net mailto:b...@sagehill.net *From:* Xmplar mailto:i...@xmplar.biz *Sent:* Tuesday, January 15, 2013 2:43 AM *To:* DocBook Apps mailto:docbook-apps@lists.oasis-open.org *Subject:* [docbook-apps] Specifying directory for epub 3 output I'd like to know if there is a way to save all epub files (META-INF, OEBPS, mimetype) to the current directory without modifying the param base.dir. I've posted a question on the oXygen forum: http://www.oxygenxml.com/forum/topic7814.html but it doesn't answer my specific query because I'm not using oXygen's EPUB transformation scenario. To save all output files I've had to specify the exact pathname of my current directory in the 'base.dir' param with a few custom variables: xsl:variable name=epuboutput.dirc:/xmplar/cop-e-boox v0-2/master1-20120826/xsl:variable xsl:variable name=basemetainf.dir select=concat($epuboutput.dir, '/epuboutput/') / xsl:param name=base.dir select=concat($basemetainf.dir, 'OEBPS/')/ I get the files generating where I want them, but in the resulting book toc I get the lists of titles all being generated with the entire pathname in the a href... element: div xmlns:xlink=http://www.w3.org/1999/xlink; class=ListofTitles a href=c:/xmplar/cop-e-boox v0-2/master1-20120826/epuboutput/OEBPS/figure-toc.xhtmlFigures/a/div div xmlns:xlink=http://www.w3.org/1999/xlink; class=ListofTitles a href=c:/xmplar/cop-e-boox v0-2/master1-20120826/epuboutput/OEBPS/table-toc.xhtmlTables/a/div div xmlns:xlink=http://www.w3.org/1999/xlink; class=ListofTitles a href=c:/xmplar/cop-e-boox v0-2/master1-20120826/epuboutput/OEBPS/example-toc.xhtmlBoxes/a/div div xmlns:xlink=http://www.w3.org/1999/xlink; class=ListofTitles a href=c:/xmplar/cop-e-boox v0-2/master1-20120826/epuboutput/OEBPS/equation-toc.xhtmlEquations/a/div I thought I found where to remove the full pathname from href (in template name=make.lot.chunk) but commenting out the lines containing base.dir doesn't work. So in short, I'd like to know: 1. How I can use the standard base.dir param without my pathname modifications and generate files in the current directory (instead of them being saved to the oXygen program directory), or 2. How I can remove the pathname from the href of the lists of titles while using the modified base.dir. Thanks! -- *Dave Gardiner*
[docbook-apps] Specifying directory for epub 3 output
I'd like to know if there is a way to save all epub files (META-INF, OEBPS, mimetype) to the current directory without modifying the param base.dir. I've posted a question on the oXygen forum: http://www.oxygenxml.com/forum/topic7814.html but it doesn't answer my specific query because I'm not using oXygen's EPUB transformation scenario. To save all output files I've had to specify the exact pathname of my current directory in the 'base.dir' param with a few custom variables: xsl:variable name=epuboutput.dirc:/xmplar/cop-e-boox v0-2/master1-20120826/xsl:variable xsl:variable name=basemetainf.dir select=concat($epuboutput.dir, '/epuboutput/') / xsl:param name=base.dir select=concat($basemetainf.dir, 'OEBPS/')/ I get the files generating where I want them, but in the resulting book toc I get the lists of titles all being generated with the entire pathname in the a href... element: div xmlns:xlink=http://www.w3.org/1999/xlink; class=ListofTitles a href=c:/xmplar/cop-e-boox v0-2/master1-20120826/epuboutput/OEBPS/figure-toc.xhtmlFigures/a/div div xmlns:xlink=http://www.w3.org/1999/xlink; class=ListofTitles a href=c:/xmplar/cop-e-boox v0-2/master1-20120826/epuboutput/OEBPS/table-toc.xhtmlTables/a/div div xmlns:xlink=http://www.w3.org/1999/xlink; class=ListofTitles a href=c:/xmplar/cop-e-boox v0-2/master1-20120826/epuboutput/OEBPS/example-toc.xhtmlBoxes/a/div div xmlns:xlink=http://www.w3.org/1999/xlink; class=ListofTitles a href=c:/xmplar/cop-e-boox v0-2/master1-20120826/epuboutput/OEBPS/equation-toc.xhtmlEquations/a/div I thought I found where to remove the full pathname from href (in template name=make.lot.chunk) but commenting out the lines containing base.dir doesn't work. So in short, I'd like to know: 1. How I can use the standard base.dir param without my pathname modifications and generate files in the current directory (instead of them being saved to the oXygen program directory), or 2. How I can remove the pathname from the href of the lists of titles while using the modified base.dir. Thanks! -- *Dave Gardiner*
Re: [docbook-apps] Specifying directory for epub 3 output
Thanks Bob, I'll try experimenting some more with the make.lot.chunk template to remove the full pathname - because the pathname isn't generated for all other hyperlinked section titles in the book toc (only the filename is present in the href), the generated pathname in the lists of titles is incongruous. On 16-01-13 7:54 AM, Bob Stayton wrote: Hi Dave, I don't think this is an issue for DocBook XSL, but with Oxygen's transformation scenarios. You should ask them if there is an option to specify the current working directory as a base for a transformation so you don't have to specify a full path in base.dir. That said, you still should not be getting full paths in the ListofTitles links. Those should be computed relative to base.dir where the book TOC file is, and should not contain base.dir in their path. I'm not clear how Oxygen is changing that aspect. Bob Stayton Sagehill Enterprises b...@sagehill.net mailto:b...@sagehill.net *From:* Xmplar mailto:i...@xmplar.biz *Sent:* Tuesday, January 15, 2013 2:43 AM *To:* DocBook Apps mailto:docbook-apps@lists.oasis-open.org *Subject:* [docbook-apps] Specifying directory for epub 3 output I'd like to know if there is a way to save all epub files (META-INF, OEBPS, mimetype) to the current directory without modifying the param base.dir. I've posted a question on the oXygen forum: http://www.oxygenxml.com/forum/topic7814.html but it doesn't answer my specific query because I'm not using oXygen's EPUB transformation scenario. To save all output files I've had to specify the exact pathname of my current directory in the 'base.dir' param with a few custom variables: xsl:variable name=epuboutput.dirc:/xmplar/cop-e-boox v0-2/master1-20120826/xsl:variable xsl:variable name=basemetainf.dir select=concat($epuboutput.dir, '/epuboutput/') / xsl:param name=base.dir select=concat($basemetainf.dir, 'OEBPS/')/ I get the files generating where I want them, but in the resulting book toc I get the lists of titles all being generated with the entire pathname in the a href... element: div xmlns:xlink=http://www.w3.org/1999/xlink; class=ListofTitles a href=c:/xmplar/cop-e-boox v0-2/master1-20120826/epuboutput/OEBPS/figure-toc.xhtmlFigures/a/div div xmlns:xlink=http://www.w3.org/1999/xlink; class=ListofTitles a href=c:/xmplar/cop-e-boox v0-2/master1-20120826/epuboutput/OEBPS/table-toc.xhtmlTables/a/div div xmlns:xlink=http://www.w3.org/1999/xlink; class=ListofTitles a href=c:/xmplar/cop-e-boox v0-2/master1-20120826/epuboutput/OEBPS/example-toc.xhtmlBoxes/a/div div xmlns:xlink=http://www.w3.org/1999/xlink; class=ListofTitles a href=c:/xmplar/cop-e-boox v0-2/master1-20120826/epuboutput/OEBPS/equation-toc.xhtmlEquations/a/div I thought I found where to remove the full pathname from href (in template name=make.lot.chunk) but commenting out the lines containing base.dir doesn't work. So in short, I'd like to know: 1. How I can use the standard base.dir param without my pathname modifications and generate files in the current directory (instead of them being saved to the oXygen program directory), or 2. How I can remove the pathname from the href of the lists of titles while using the modified base.dir. Thanks! -- *Dave Gardiner*
[docbook-apps] Processing instructions ignored in biblioentry and bibliomixed
I have FO processing instructions to insert punctuation such as apostrophes and dashes. Typical PIs are: xsl:template match=processing-instruction('apos') fo:character character=#x2019;/ xsl:apply-templates/ /xsl:template xsl:template match=processing-instruction('endash') fo:character character=#x2013;/ xsl:apply-templates/ /xsl:template These do not work for text that is within biblioentry or bibliomixed elements. Other combinations of elements do work, such as text in a citetitle element that is not nested in biblioentry or bibliomixed. There is nothing in either of those templates that excludes processing instructions, so I'm wondering what else might be affecting this. - 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] Typo in epub3 stylesheet?
There is an 'errant' apostrophe within a template in the 1.78.0 stylesheet epub3-element-mods.xsl: xsl:template name=mimetype' Does it need to be removed? -- *Dave Gardiner*
[docbook-apps] XSLT 2.0 default.table.column.widths error
I just started using the standard stylesheets for 2.0.3 and attempted a FO transformation using fo/docbook.xsl with Saxon 9-HE. I get an error that Variable default.table.column.widths has not been declared. The error is generated from the file common/table.xsl. The variable is in html/param.xsl. Is that param in the correct directory? Is my transformation setup OK? -- *Dave Gardiner*
Re: [docbook-apps] Generating SVG in PDF
I found the issue - I had created the SVG from Adobe Illustrator, which adds a !DOCTYPE DTD declaration - that was not parsed when processed with RenderX XEP. On 01-11-12 9:44 PM, Dew, Simon wrote: Hi Dave Sure, I use external SVG files all the time. The following code works for me: fo:external-graphic src=url('images/external.svg') content-height=1.72cm content-width=3.92cm content-type=content-type:image/svg+xml/ Note the url('...') wrapper in src, I think xep requires this but fop doesn't. This works with fop 1.0 and xep 4.19 demo version. Simon Dew Technical Author | Stanley Security Solutions 1 Park Gate Close, Bredbury, Stockport SK6 2SZ, U.K. simon@sbdinc.com | +44 (0) 161 406 3405 www.stanleysecuritysolutions.co.uk Registered Office: Stanley House, Bramble Road, Swindon Registered in England and Wales No. 181585 VAT No. 232 2446 95 On 01/11/2012 06:07, Xmplar wrote: Has anyone managed to produce PDFs with SVG files? I can only achieve this with fo:instream-foreign-object, even though it is apparently possible to use fo:external-graphicto refer to an external SVG (see “SVG Essentials”, O’Reilly). Using fo:external-graphic (or even background-image in fo:block) just gives me a little box with red cross and the SVG is not generated. I’m using XEP 4.21, Saxon 6.5.5. The markup that works is: fo:blockxmlns:ex=http://www.renderx.com/XSL/Extensions; xmlns:xi=http://www.w3.org/2001/XIncludespan=allbackground-color=#cc9933; border-top=1pt solid #ffborder-bottom=1pt solid #ff border-left=0pt none #00border-right=0pt none #00margin-top=0mm margin-bottom=3mmmargin-left=0mmmargin-right=0mmpadding-top=3mm padding-bottom=3mmpadding-left=3mmpadding-right=3mmbackground-repeat=no-repeat background-image=url(images/Figure5-4.gif)ex:background-content-width=170mm background-position=50% 50%fo:instream-foreign-objectsvgversion=1.1id=Layer_1xmlns=http://www.w3.org/2000/svgxmlns:xlink=http://www.w3.org/1999/xlinkx=0pxy=0px; width=193.26pxheight=163.26pxviewBox=0 0 193.26 163.26enable-background=new 0 0 193.26 163.26xml:space=preservetransform=translate(0,100) rectx=0.63y=0.63fill=#fffill-opacity=0.7stroke=#00stroke-width=0.5width=192height=162/ /svg/fo:instream-foreign-objectfo:block …. -- *Dave Gardiner* - 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
[docbook-apps] Generating SVG in PDF
Has anyone managed to produce PDFs with SVG files? I can only achieve this with fo:instream-foreign-object, even though it is apparently possible to use fo:external-graphicto refer to an external SVG (see SVG Essentials, O'Reilly). Using fo:external-graphic (or even background-image in fo:block) just gives me a little box with red cross and the SVG is not generated. I'm using XEP 4.21, Saxon 6.5.5. The markup that works is: fo:blockxmlns:ex=http://www.renderx.com/XSL/Extensions; xmlns:xi=http://www.w3.org/2001/XIncludespan=allbackground-color=#cc9933; border-top=1pt solid #ffborder-bottom=1pt solid #ff border-left=0pt none #00border-right=0pt none #00margin-top=0mm margin-bottom=3mmmargin-left=0mmmargin-right=0mmpadding-top=3mm padding-bottom=3mmpadding-left=3mmpadding-right=3mmbackground-repeat=no-repeat background-image=url(images/Figure5-4.gif)ex:background-content-width=170mm background-position=50% 50%fo:instream-foreign-objectsvgversion=1.1id=Layer_1xmlns=http://www.w3.org/2000/svgxmlns:xlink=http://www.w3.org/1999/xlinkx=0pxy=0px; width=193.26pxheight=163.26pxviewBox=0 0 193.26 163.26enable-background=new 0 0 193.26 163.26xml:space=preservetransform=translate(0,100) rectx=0.63y=0.63fill=#fffill-opacity=0.7stroke=#00stroke-width=0.5width=192height=162/ /svg/fo:instream-foreign-objectfo:block -- *Dave Gardiner*
Re: [docbook-apps] Renaming processing instructions
Thanks Bob - works perfectly. I had to declare my custom PI names as strings when calling the dbfo-attribute template, so there are extra quote marks around each name in the following line: xsl:with-param name=attribute select=*'*bgposition*'*/ Dave On 31-10-12 3:10 AM, Bob Stayton wrote: Yes, you can use names in the PIs that differ from the output attribute names. In fact, there is no automatic passthrough. The information inside a dbfo PI is actually pseudo-attributes. They look like attributes, but they are just text strings organized in a way that can assign a value to a name. The PI processing templates parse them as strings to extract a value assigned to a given pseudo-attribute name. Then some template has to generate an actual xsl:attribute to assign the value to an output attribute name, which is independent of the pseudo-attribute name. So your example could be: A PI in the source file: ?dbfo bgimage=myfile.jpg? Extracting the value: xsl:variable name=bgroundimage xsl:call-template name=dbfo-attribute xsl:with-param name=pis select=ancestor-or-self::d:abstract/processing-instruction('dbfo')/ xsl:with-param name=attribute select=bgimage/ /xsl:call-template /xsl:variable xsl:variable name=backgroundimg xsl:value-of select=concat('url(', $bgroundimage, ')')/ /xsl:variable and further down, using the value for an output attribute: xsl:attribute name=background-image xsl:value-of select=$backgroundimg/ /xsl:attribute Bob Stayton Sagehill Enterprises b...@sagehill.net From: Xmplar Sent: Tuesday, October 30, 2012 3:11 AM To: docbook-apps@lists.oasis-open.org Subject: [docbook-apps] Renaming processing instructions I have managed to (mostly) achieve the PIs I need, but I'd like to know if it's possible to rename PIs to shorten the amount of text. In the XML I have: abstract ?dbfo background-image=images/Box5-4.gif background-position=0% 30% ex:background-content-width=60mm? titleChapter 1 overview/title ... My customization so far needs to use those long names (background-image, etc.). Can I somehow rename these to, say, bgimage instead of background-image? My customization is: xsl:template match=d:abstract mode=chapter.titlepage.recto.auto.mode xsl:variable name=bgroundimage xsl:call-template name=dbfo-attribute xsl:with-param name=pis select=ancestor-or-self::d:abstract/processing-instruction('dbfo')/ xsl:with-param name=attribute select='background-image'/ /xsl:call-template /xsl:variable xsl:variable name=backgroundimg xsl:value-of select=concat('url(', $bgroundimage, ')')/ /xsl:variable xsl:variable name=bgroundwidth xsl:call-template name=dbfo-attribute xsl:with-param name=pis select=ancestor-or-self::d:abstract/processing-instruction('dbfo')/ xsl:with-param name=attribute select='ex:background-content-width'/ /xsl:call-template /xsl:variable xsl:variable name=bgroundposition xsl:call-template name=dbfo-attribute xsl:with-param name=pis select=ancestor-or-self::d:abstract/processing-instruction('dbfo')/ xsl:with-param name=attribute select='background-position'/ /xsl:call-template /xsl:variable fo:block xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:ex=http://www.renderx.com/XSL/Extensions; xsl:use-attribute-sets=chapsummaryprops xsl:if test=processing-instruction() xsl:attribute name=background-image xsl:value-of select=$backgroundimg/ /xsl:attribute xsl:attribute name=ex:background-content-width xsl:value-of select=$bgroundwidth/ /xsl:attribute xsl:attribute name=background-position xsl:value-of select=$bgroundposition/ /xsl:attribute /xsl:if xsl:apply-templates select=d:title / xsl:apply-templates select=d:para / /fo:block /xsl:template Thanks, On 29-10-12 10:35 PM, Xmplar wrote: I'm trying to create a custom processing instruction to insert and format a background image in a chapter abstract. I've followed the instructions in Chapter 9 of DocBook XSL TDG but am getting error messages about empty parameters. The XML is: abstract ?dbfo bgimage=images/Box5-4.gif? ?dbfo bgposition=50% 30%? ?dbfo bgwidth=170mm? titleChapter 1 overview/title paraThe text in . /para /abstract /info (I'd like to combine all three params into one pi if possible.) I've set up variables for background-image, content-width and position: xsl:template match=d:abstract mode=chapter.titlepage.recto.auto.mode xsl:variable name=bgimage xsl:call-template name=dbfo-attribute xsl:with-param name=pis select=ancestor-or-self::d:abstract/processing-instruction('dbfo')/ xsl:with-param name=attribute select='background-image'/ /xsl:call-template /xsl:variable xsl:variable name=bgwidth xsl:call-template name=dbfo-attribute xsl:with-param name=pis select=ancestor-or-self::d:abstract/processing-instruction('dbfo')/ xsl:with-param name=attribute select='ex:background-content-width'/ /xsl:call-template /xsl:variable xsl:variable name=bgposition xsl:call-template name=dbfo-attribute xsl:with-param name=pis
[docbook-apps] Customizing processing instructions
I'm trying to create a custom processing instruction to insert and format a background image in a chapter abstract. I've followed the instructions in Chapter 9 of DocBook XSL TDG but am getting error messages about empty parameters. The XML is: abstract ?dbfo bgimage=images/Box5-4.gif? ?dbfo bgposition=50% 30%? ?dbfo bgwidth=170mm? titleChapter 1 overview/title paraThe text in ... /para /abstract /info (I'd like to combine all three params into one pi if possible.) I've set up variables for background-image, content-width and position: xsl:templatematch=d:abstractmode=chapter.titlepage.recto.auto.mode xsl:variablename=bgimage xsl:call-templatename=dbfo-attribute xsl:with-paramname=pis select=ancestor-or-self::d:abstract/processing-instruction('dbfo')/ xsl:with-paramname=attributeselect='background-image'/ /xsl:call-template /xsl:variable xsl:variablename=bgwidth xsl:call-templatename=dbfo-attribute xsl:with-paramname=pis select=ancestor-or-self::d:abstract/processing-instruction('dbfo')/ xsl:with-paramname=attributeselect='ex:background-content-width'/ /xsl:call-template /xsl:variable xsl:variablename=bgposition xsl:call-templatename=dbfo-attribute xsl:with-paramname=pis select=ancestor-or-self::d:abstract/processing-instruction('dbfo')/ xsl:with-paramname=attributeselect='background-position'/ /xsl:call-template /xsl:variable fo:blockxmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:ex=http://www.renderx.com/XSL/Extensions; xsl:use-attribute-sets=chapsummaryprops background-image={$bgimage} ex:background-content-width={$bgwidth} background-position={$bgposition} xsl:apply-templatesselect=d:title/ xsl:apply-templatesselect=d:para/ !--xsl:apply-templates select=. mode=chapter.titlepage.recto.mode/-- /fo:block /xsl:template And when I process it with Saxon 6.5.5 the error messages are: [warning] Attribute 'background-image' cannot have a value of : should be either 'inherit' or a URI: background-image=url(...). [error] Attribute 'rx:background-content-width' cannot have a value of . I'm using DB 1.77.1, XEP 4.19. Thanks -- *Dave Gardiner*
Re: [docbook-apps] Page before inside title
I have a solution to customize a 'half title' page. This 'book.titlepage.before.recto' generates the book title, and includes a variable 'halftitle' which turns on/off the titlepage.before.recto: xsl:template name=book.titlepage.before.recto xsl:if test=$halftitle != 0 fo:block xmlns:fo=http://www.w3.org/1999/XSL/Format; xsl:use-attribute-sets=booktitleprops xsl:attribute name=space-before xsl:value-of select=$halftitlespacebefore/ /xsl:attribute xsl:apply-templates mode=book.titlepage.recto.mode select=d:bookinfo/d:title|d:info/d:title|d:title/ /fo:block /xsl:if /xsl:template And the verso always generates, even if there is no content (I specify content for this with d:cover[@role='halftitle']): xsl:template name=book.titlepage.before.verso xsl:if test=$halftitle != 0 fo:block xmlns:fo=http://www.w3.org/1999/XSL/Format; xsl:use-attribute-sets=book.titlepage.verso.style break-before=page break-after=odd-page xsl:apply-templates mode=book.titlepage.verso.auto.mode select=d:info/d:cover[@role='halftitle']/ /fo:block /xsl:if /xsl:template But I also had to modify 'book.titlepage' to get the order of templates and page breaks correct - the standard template generates content in 'book.titlepage.before.verso' */after '/*book.titlepage.recto', which is incorrect order. xsl:template name=book.titlepage fo:block xmlns:fo=http://www.w3.org/1999/XSL/Format; !--xsl:variable name=recto.content xsl:call-template name=book.titlepage.before.recto/ xsl:call-template name=book.titlepage.recto/ /xsl:variable-- !--halftitle order added 5/10/12:-- xsl:variable name=halftitle.content xsl:call-template name=book.titlepage.before.recto/ xsl:call-template name=book.titlepage.before.verso/ /xsl:variable !--end mod-- xsl:variable name=recto.elements.count xsl:choose xsl:when test=function-available('exsl:node-set')xsl:value-of select=count(exsl:node-set($halftitle.content)/*)//xsl:when xsl:when test=contains(system-property('xsl:vendor'), 'Apache Software Foundation') !--Xalan quirk--xsl:value-of select=count(exsl:node-set($halftitle.content)/*)//xsl:when xsl:otherwise1/xsl:otherwise /xsl:choose /xsl:variable xsl:if test=(normalize-space($halftitle.content) != '') or ($recto.elements.count gt; 0) fo:blockxsl:copy-of select=$halftitle.content//fo:block /xsl:if !--xsl:variable name=verso.content xsl:call-template name=book.titlepage.before.verso/ xsl:call-template name=book.titlepage.verso/ /xsl:variable-- !--title order added 5/10/12:-- xsl:variable name=titlepage.content xsl:call-template name=book.titlepage.recto/ fo:block break-after=page/!--force titlepage verso to start on next page OK 5/10/12-- xsl:call-template name=book.titlepage.verso/ /xsl:variable !--end mod-- xsl:variable name=verso.elements.count xsl:choose xsl:when test=function-available('exsl:node-set')xsl:value-of select=count(exsl:node-set($titlepage.content)/*)//xsl:when xsl:when test=contains(system-property('xsl:vendor'), 'Apache Software Foundation') !--Xalan quirk--xsl:value-of select=count(exsl:node-set($titlepage.content)/*)//xsl:when xsl:otherwise1/xsl:otherwise /xsl:choose /xsl:variable xsl:if test=(normalize-space($titlepage.content) != '') or ($verso.elements.count gt; 0) fo:blockxsl:copy-of select=$titlepage.content//fo:block /xsl:if xsl:call-template name=book.titlepage.separator/ /fo:block /xsl:template Dave On 01-10-12 11:50 AM, Bob Stayton wrote: Hi Dick, Take a look at callout #12 on this page: http://www.sagehill.net/docbookxsl/HTMLTitlePage.html#TitlePageElems It includes mention of of a template named t:titlepage-before t:side=recto, which by default generates an empty placeholder template named 'book.titlepage.before.recto' that is executed before the recto titlepage. You could most add a customized 'book.titlepage.before.recto' template to your customization. If you want it to generate a page, you would need to wrap your content in a page-sequence, which can be done by calling the utility template page.sequence, which is defined in fo/component.xsl. Bob Stayton Sagehill Enterprises b...@sagehill.net -- From: Richard Hamilton hamil...@xmlpress.net Sent: Wednesday, September 26, 2012 5:22 PM To: DocBook Apps docbook-apps@lists.oasis-open.org Subject: [docbook-apps] Page before inside title Has anyone figured out how to do a page before the inside title in a DocBook book? This is typically a page that has blurbs, etc., and normally appears as the very first page in a book, before the inside title page. I can get a page after the inside title and before the TOC by using dedication, but I can't figure out how to get something in front of the inside title. Thanks, Dick Hamilton --- XML Press New from XML Press: The Content Pool http://xmlpress.net/publications/the-content-pool - To unsubscribe, e-mail:
Re: [docbook-apps] Forcing order of book titlepage templates
This works perfectly thanks Bob. On 01-10-12 11:41 AM, Bob Stayton wrote: Hi Dave, The order=document attribute is part of the titlepage schema, not FO, so it should not be passed through to the output. Try changing the specification to use t:order=document instead. I think that part was written before the special titlepage attributes were moved into the titlepage namespace. Bob Stayton Sagehill Enterprises b...@sagehill.net mailto:b...@sagehill.net *From:* Xmplar mailto:i...@xmplar.biz *Sent:* Sunday, September 30, 2012 1:17 AM *To:* DocBook Apps mailto:docbook-apps@lists.oasis-open.org *Subject:* [docbook-apps] Forcing order of book titlepage templates I have a complex book verso titlepage where I want to apply elements in the order I have them in the XML. For example, I have elements in the order: copyright legalnotice releaseinfo cover role=imprint printhistory cover role=imprint revhistory cover role=imprint I have general information within each cover attribute and want to apply other elements in between. I read in The Definitive Guide that: If instead you want to force the output order to match the order of those elements in your documents, add a order=document attribute to the t:titlepage-content element. I did this and transforming the spec file to XSL it created the attribute *order=document *on fo:blocks (for recto and verso content) in the template book.titlepage. But when I transform to FO (Saxon 6.5.5, XEP 4.19) I get the error that attribute *order* is not permitted on fo:block. Have I missed something? -- *Dave Gardiner*
[docbook-apps] Forcing order of book titlepage templates
I have a complex book verso titlepage where I want to apply elements in the order I have them in the XML. For example, I have elements in the order: copyright legalnotice releaseinfo cover role=imprint printhistory cover role=imprint revhistory cover role=imprint I have general information within each cover attribute and want to apply other elements in between. I read in The Definitive Guide that: If instead you want to force the output order to match the order of those elements in your documents, add a order=document attribute to the t:titlepage-content element. I did this and transforming the spec file to XSL it created the attribute *order=document *on fo:blocks (for recto and verso content) in the template book.titlepage. But when I transform to FO (Saxon 6.5.5, XEP 4.19) I get the error that attribute *order* is not permitted on fo:block. Have I missed something? -- *Dave Gardiner*
[docbook-apps] [ANN] Release of cop-e-boox v 0.1
Xmplar have released cop-e-boox v 0.1, a bundle of open-source DocBook stylesheets and templates for learning XML digital publishing. Cop-e-boox works with desktop publishing software and has a browser interface that lets users set styles for document and page layout to produce ebook formats. The stylesheets produce PDF, EPUB 2 and XHTML web documents from a single-source publishing workflow. Small publishers can use cop-e-boox with lightweight commercial XML packages and are not locked into any proprietary system. A browser-based interface makes it easy to change text, tables and graphics styles for complex book layouts. The package is supported with training for small publishers that introduces the concepts and capabilities of XML for publishing. Xmplar are digital editors developing desktop publishing technologies. For more information, visit www.xmplar.biz. -- *Dave Gardiner*
[docbook-apps] Antenna House Formatter - customising extensions
I'd like to move from RenderX XEP to Antenna House Formatter because it seems to offer better typography and page layout for complex material. But looking at their website, in particular the axf extensions available, I can't determine whether: 1. all the extensions come bundled with the formatter out of the box, or 2. if there are supporting stylesheets available at cost I need to integrate with my customisations, or 3. if there are only examples of stylesheet implementations available for individual extensions, which I would then need to copy and somehow get to work with DocBook. I've read a few posts about others who were looking at AXF - which of the options above is correct? I need to know if what I spend on the formatter is going to be good value, or if I need to still put in a lot more effort and dollars to get the extensions working. Thanks! Dave -- **
Re: [docbook-apps] Antenna House Formatter - customising extensions
Thanks Jirka, Now I know what I'm up for - a small amount of extra code in FO, or a heap of stylesheet development. So I need to learn how to reverse-engineer FO back to DocBook stylesheet templates. On 24-09-12 12:15 AM, Jirka Kosek wrote: On 23.9.2012 12:46, Xmplar wrote: But looking at their website, in particular the axf extensions available, I can't determine whether: 1. all the extensions come bundled with the formatter out of the box, or Extensions available depends on version you purchase (Full/Lite) and some of them are available if you buy some additional add-on. 2. if there are supporting stylesheets available at cost I need to integrate with my customisations, or Standard DocBook XSL stylesheets supports some extensions for document metadata, PDF bookmarks and index creation. 3. if there are only examples of stylesheet implementations available for individual extensions, which I would then need to copy and somehow get to work with DocBook. If you need something additional except few things I have mentioned above you will have to customize stylesheets. Jirka -- *Dave Gardiner* Xmplar i...@xmplar.biz http://xmplar.biz Mob. 0416 833 993
[docbook-apps] Selecting text styles for elements within indexterm
I have a customization for styling emphasis, quote and literal elements that are contained in primary index elements. Typical markup is: indextermclass=startofrangexml:id=abstract primaryliteralabstract/literalelement/tag/primary /indexterm In the autoindex, I only want to style the text contained within the literal tags as font-family monospace, but all of the text within the primary element is styled as monospace. My customization in xsl:templatematch=d:indextermmode=index-primary is: xsl:choose xsl:whentest=d:primary/d:emphasis fo:inlinefont-style=italic xsl:value-ofselect=d:primary/ /fo:inline /xsl:when xsl:whentest=d:primary/d:literal fo:inlinefont-family=monospace xsl:value-ofselect=d:primary/d:literal/ /fo:inline xsl:value-ofselect=d:primary[not(child::d:literal)]/ /xsl:when xsl:whentest=d:primary/d:quote xsl:variablename=content xsl:call-templatename=gentext.startquote/ xsl:value-ofselect=d:primary/ xsl:call-templatename=gentext.endquote/ /xsl:variable fo:inline xsl:copy-ofselect=$content/ /fo:inline /xsl:when xsl:otherwise xsl:value-ofselect=d:primary/ /xsl:otherwise /xsl:choose As you can see, for d:primary/d:literal, I'm attempting to style only d:literal as monospace, and for any text following that (within d:primary) as normal text. So, I'm trying to separate text in d:primary/d:literal from all other text within d:primary so I can apply two types of font styles. The expression d:primary[not(child::d:literal)] doesn't generate the text outside of d:literal. Is there an XPath expression to achieve this? -- *Dave Gardiner*
Re: [docbook-apps] Producing an arbitrary chunk in epub
This looks promising - I've been looking for this functionality in EPUB for a while now. I'll try it out shortly once I migrate my customizations to EPUB 3. Dave On 16-08-12 7:36 AM, Jason Zech wrote: I was able to get it working. The problem is that I hadn't included the path in the output chunk's generated filename. It was getting made but not put into the epub or anywhere near it. I was able to get a separate copyright chunk with legal notices by addingxsl:call-template name=copyright.chunk/ to the root template at the same time as the call to the opf, ncx, etc templates and adding templates below to my customization layer (the main/chunking one). I still need to true up the manifest and spine to get it in there, but it seems to be working. xsl:template name=copyright.chunk xsl:apply-templates select=/*/*[contains(name(.), 'info')]/ /xsl:template xsl:template match=/*/*[contains(name(.), 'info')] xsl:variable name=copyright.filename select=concat($epub.oebps.dir, 'copyright', $html.ext)/ xsl:call-template name=write.chunk xsl:with-param name=filename xsl:value-of select=$copyright.filename / /xsl:with-param xsl:with-param name=method select='xml' / xsl:with-param name=encoding select='utf-8' / xsl:with-param name=indent select='yes' / xsl:with-param name=quiet select=$chunk.quietly / xsl:with-param name=content html head titleCopyright/title xsl:call-template name=output.html.stylesheets xsl:with-param name=stylesheets select=normalize-space($html.stylesheet)/ /xsl:call-template /head body xsl:call-template name=body.attributes/ div xsl:attribute name=classcopyright/xsl:attribute xsl:if test=d:copyright xsl:apply-templates select=d:copyright mode=titlepage.mode/ /xsl:if xsl:if test=d:legalnotice xsl:apply-templates select=d:legalnotice mode=titlepage.mode/ /xsl:if /div /body /html /xsl:with-param /xsl:call-template /xsl:template From: Jason Zech [mailto:z...@loyolapress.com] Sent: Wednesday, August 15, 2012 1:06 PM To: Bob Stayton; DocBook Apps Subject: RE: [docbook-apps] Producing an arbitrary chunk in epub The older epub (for now). From: Bob Stayton [mailto:b...@sagehill.net] Sent: Wednesday, August 15, 2012 1:04 PM To: Jason Zech; DocBook Apps Subject: Re: [docbook-apps] Producing an arbitrary chunk in epub Are you using the epub or epub3 stylesheets in DocBook XSL? They are structured differently for customizations. Bob Stayton Sagehill Enterprises b...@sagehill.net - Original Message - From: Jason Zech To: DocBook Apps Sent: Wednesday, August 15, 2012 6:23 AM Subject: [docbook-apps] Producing an arbitrary chunk in epub Hi all, I'm doing heavy customization on the 1.77.1-ns transform to epub, via Oxygen's ANT transform. I cannot, though, seem to figure out how to generate a separate copyright page chunk with the copyright info and my legal notices. I have a good working chunk customization setup with the formatting in the imported stylesheet and the chunking in the main one, and I've cleared the copyright and legal notices from the default index.html page. I can't quite seem to figure out how to generate a new chunk with a named template and put what I want in there. I tried addingxsl:call-template name=copyright.chunk/ to the end of the root templatexsl:template match=/ where the opf, ncx, cover, and container templates are called. Then I created my own copyright.chunk template (I copied the cover template and just changed the filename and the contents going into it). But the chunk isn't appearing in my epub. Any suggestions? Thanks - 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
Re: [docbook-apps] Indexing software and DocBook
Richard, I have an indexer working on an ebook now. He's using embedded indexing (as per Bob's book) with oXygen, but apparently prefers to use SkyIndex for the indexing, then transfer the entries into XML chunks. I'll let you know in a few weeks exactly how he handled the job. Dave On 10-08-12 5:11 AM, Richard Hamilton wrote: Has anyone worked with indexing software (like Cindex) and DocBook? It looks like Cindex will operate on XML instances and even export XML, but I don't know how practical it might be to use it for an indexing project in DocBook. If anyone has experience doing that and could spend a few minutes off-line talking/emailing about it, please let me know. Thanks, Dick Hamilton --- XML Press New from XML Press: The Content Pool http://xmlpress.net/publications/the-content-pool - 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
[docbook-apps] XSLT/CSS border style specifications
How does one control the specifications for the various border styles for tables, etc. I know how to select the line styles - solid, dashed, double, groove, etc - but can the specific metrics for each of these be defined? I want to modify the line widths and spacing between lines for the 'double' style. (I can specify the overall width of line, but is there any finer metrics?) I can't find anything in the XSLT specification, apart from the fact that CSS properties apply. nor is there anything in the DB stylesheets. I'd like to know if this is possible for FO and HTML output. Thanks, -- *Dave Gardiner*
[docbook-apps] Re: footnote mark not generated
Problem already fixed - I found some other coding related to a para within footnote that referred to only d:table - so I added d:informaltable which fixed the missing footnote mark. -- *Dave Gardiner*
Re: [docbook-apps] Aligning numbers in table cells with xsl
Thanks Bob for the tip about translate. I finally worked it out - coding as follows: xsl:templatename=table.cell.block.properties xsl:variablename=stringanglesymbol xsl:choose xsl:whentest=contains(., 'lt;') xsl:value-ofselect=(translate(., 'lt;', ''))/ /xsl:when xsl:whentest=contains(., 'gt;') xsl:value-ofselect=(translate(., 'gt;', ''))/ /xsl:when /xsl:choose /xsl:variable !--margin and indent for portrait format tables-- xsl:choose xsl:whentest=(ancestor-or-self::d:table/@tabstyle = 'numbers' or ancestor-or-self::d:table/@tabstyle = 'numberstripe') and not(ancestor::d:thead or ancestor::d:tfoot) and preceding-sibling::d:entry and ((string(number($stringanglesymbol)) != 'NaN') or (string(number(.)) != 'NaN')) xsl:attributename=text-alignright/xsl:attribute!--text alignment for numbers in cells-- !--specify right margin as a percentage of cell width (default: 30)-- xsl:attributename=margin-right xsl:choose xsl:whentest=self::d:entry/d:footnote!--reduce the right margin if there is a footnote in the cell-- xsl:value-ofselect=$cellfootnoteindent/ /xsl:when xsl:otherwise xsl:value-ofselect=$cellnumberindent/ /xsl:otherwise /xsl:choose xsl:text%/xsl:text /xsl:attribute /xsl:when xsl:otherwise/ /xsl:choose /xsl:template On 26-05-12 5:59 AM, Bob Stayton wrote: One way to handle those characters is to use the translate() function to remove them before doing the test. If the third argument of translate() is empty, then the matching characters in the second argument disappear, and all other characters are left untouched. Something like: string(number(translate(., 'lt;gt;', ''))) Bob Stayton Sagehill Enterprises b...@sagehill.net mailto:b...@sagehill.net - Original Message - *From:* Xmplar mailto:i...@xmplar.biz *To:* Bob Stayton mailto:b...@sagehill.net *Cc:* DocBook Apps mailto:docbook-apps@lists.oasis-open.org *Sent:* Thursday, May 24, 2012 7:38 PM *Subject:* Re: [docbook-apps] Aligning numbers in table cells with xsl I managed to (almost) fix the problem by adding a test for NaN to the string variable: xsl:if test=(ancestor-or-self::d:table/@tabstyle = 'numbers' or ancestor-or-self::d:table/@tabstyle = 'numberstripe') and not(ancestor::d:thead or ancestor::d:tfoot) and preceding-sibling::d:entry and (string(number(.) != 'NaN')) This however will not select any cells that have a number *and* a non-numeric string (such as greater than or less than signs: 1, or 20) - my test treats those cells as a string and not as a number. I now need to find how to convert lt; and gt; to a number so that the test selects cells with a number and a lt or gt sign. On 24-05-12 4:24 PM, Bob Stayton wrote: xsl:if test=(ancestor-or-self::d:table/@tabstyle = 'numbers' or ancestor-or-self::d:table/@tabstyle = 'numberstripe') and not(ancestor::d:thead or ancestor::d:tfoot) and preceding-sibling::d:entry and string(number(.)) -- *Dave Gardiner* Xmplar i...@xmplar.biz http://xmplar.biz Mob. 0416 833 993 -- *Dave Gardiner*
Re: [docbook-apps] Aligning numbers in table cells with xsl
I managed to (almost) fix the problem by adding a test for NaN to the string variable: xsl:if test=(ancestor-or-self::d:table/@tabstyle = 'numbers' or ancestor-or-self::d:table/@tabstyle = 'numberstripe') and not(ancestor::d:thead or ancestor::d:tfoot) and preceding-sibling::d:entry and (string(number(.) != 'NaN')) This however will not select any cells that have a number *and* a non-numeric string (such as greater than or less than signs: 1, or 20) - my test treats those cells as a string and not as a number. I now need to find how to convert lt; and gt; to a number so that the test selects cells with a number and a lt or gt sign. On 24-05-12 4:24 PM, Bob Stayton wrote: xsl:if test=(ancestor-or-self::d:table/@tabstyle = 'numbers' or ancestor-or-self::d:table/@tabstyle = 'numberstripe') and not(ancestor::d:thead or ancestor::d:tfoot) and preceding-sibling::d:entry and string(number(.)) -- *Dave Gardiner* Xmplar i...@xmplar.biz http://xmplar.biz Mob. 0416 833 993
[docbook-apps] Aligning numbers in table cells with xsl
I have an xpath expression in a customisation which is trying to achieve the following: In a CALS table I have a mixture of columns with text and a column with numbers. I've created a tabstyle 'numbers' (and also 'numberstripe') that should set, only for cells containing a number, a text align of 'right' and an indent (set as a percentage of cell width from the right margin). If a cell contains a text string, then it should not set a right margin or indent. I have had the following coding working in a previous document, but in another document it sets all text and numbers with a text-align of 'right' and a margin-right equal to a user setting (e.g. 40% of cell width). It is a complicated xpath expression to select only the cells contained within tbody (i.e. doesn't apply to cells in thead) and only if a cell contains a number. I don't know much about xpath and less about whether the string selection is correct. The XML is: table frame=all label=2 tabstyle=numbers titleMining and manufacturing water use in high and medium water development SWMAs /title tgroup cols=4 colspec colname=c1 colnum=1 colwidth=1.0*/ colspec colname=c2 colnum=2 colwidth=1.0*/ colspec colname=c3 colnum=3 colwidth=1.0*/ colspec colname=c4 colnum=4 colwidth=1.0*/ thead row entry align=center valign=bottomDrainage division/entry entry align=center valign=bottomSWMA/entry entry align=center valign=bottomWater use by mining and manufacturing (%)/entry entry align=center valign=bottomMain commodities mined/entry /row /thead tbody row entry morerows=3North-East Coast/entry entry valign=bottomBarron River/entry entry valign=bottom10/entry entry valign=bottomMetals/entry /row row entry valign=bottomBurdekin River/entry entry valign=bottom1/entry entry valign=bottomCoal/entry /row row entry valign=bottomFitzroy River/entry entry valign=bottom6/entry entry valign=bottomCoal/entry /row row entry valign=bottomBrisbane River/entry entry valign=bottom1/entry entry valign=bottomCoal/entry /row row entry morerows=9Murray--Darling Basin/entry entry valign=bottomCondamine--Culgoa rivers/entry entry valign=bottomlt;1/entry entry valign=bottomCoal/entry /row row entry valign=bottomBorder Rivers/entry entry valign=bottom2/entry entry valign=bottomCoal/entry /row row entry valign=bottomGwydir River/entry entry valign=bottom2/entry entry valign=bottomCoal/entry /row row entry valign=bottomNamoi River/entry entry valign=bottom2/entry entry valign=bottomCoal/entry /row row entry valign=bottomLachlan River/entry entry valign=bottom4/entry entry valign=bottomMetals/entry /row row entry valign=bottomMurrumbidgee River/entry entry valign=bottomlt;1/entry entry valign=bottomMetals/entry /row row entry valign=bottomLoddon River/entry entry valign=bottomlt;1/entry entry valign=bottomGold/entry /row row entry valign=bottomCampaspe River/entry entry valign=bottomlt;1/entry entry valign=bottomGold/entry /row row entry valign=bottomAvoca River/entry entry valign=bottom1/entry entry valign=bottomGold/entry /row row entry valign=bottomWimmera--Avon rivers/entry entry valign=bottom1/entry entry valign=bottomMineral sands/entry /row row entry morerows=3South East Coast/entry entry valign=bottomHunter River/entry entry valign=bottom12/entry entry valign=bottomCoal/entry /row row entry valign=bottomMacquarie--Tuggerah lakes/entry entry valign=bottom6/entry entry valign=bottomCoal/entry /row row entry valign=bottomHawkesbury River/entry entry valign=bottom4/entry entry valign=bottomCoal/entry /row row entry valign=bottomLatrobe River/entry entry valign=bottom25/entry entry valign=bottomCoal/entry /row row entry morerows=2South-West Coast/entry entry valign=bottomBusselton Coast, Preston River/entry entry valign=bottom3/entry entry valign=bottomMineral sands/entry /row row entry valign=bottomCollie River/entry entry valign=bottom3/entry entry valign=bottomCoal/entry /row row entry valign=bottomMurray River/entry entry valign=bottom13/entry entry valign=bottomBauxite, gold, copper, mineral sands/entry /row row entry morerows=3Others/entry entry valign=bottomOrd (WA)/entry entry valign=bottom15/entry entry valign=bottomGold, diamonds/entry /row row entry valign=bottomPort Hedland (WA)[1]/entry entry valign=bottom47/entry entry valign=bottomIron ore/entry /row row entry valign=bottomOnkaparinga River (SA)/entry entry valign=bottom1/entry entry valign=bottomMetals/entry /row row entry valign=bottomTorrens River (SA)/entry entry valign=bottom1/entry entry valign=bottomMetals/entry /row /tbody /tgroup /table And the customisation: xsl:template name=table.cell.block.properties xsl:if test=ancestor::d:thead xsl:attribute name=font-weight xsl:value-of select=$tablehdrfontweight/ /xsl:attribute xsl:attribute name=color xsl:value-of select=$tablehdrfontcolour/ /xsl:attribute xsl:attribute name=font-size xsl:value-of select=$tablehdrfontsize/xsl:value-ofxsl:textpt/xsl:text /xsl:attribute xsl:attribute name=font-style xsl:value-of
Re: [docbook-apps] page-wide figures in a two-column layout
My setup uses the latest DB5 stylesheets and I have RenderX XEP running from oXygen/ - though I'm not sure if FOP can handle floats. But this markup works for a two-column layout: figure xml:id=fig2.2 pgwide=1 floatstyle=before titleTitle of the figure goes here/title mediaobject textobject phraseAlternate text for image is here.../phrase /textobject imageobject role=pdf imagedata fileref=images/Figure2-2.png width=70% align=center format=PNG / /imageobject imageobject role=epub imagedata fileref=images/Figure2-2.gif align=center format=GIF / /imageobject imageobject role=web imagedata fileref=images/Figure2-2.png align=center format=PNG width=100% contentwidth=70% / /imageobject /mediaobject /figure HTH. On 12-05-12 9:50 PM, Stefan Seefeld wrote: On 05/12/2012 01:01 AM, redlettucemail wrote: You might need to also float the formal objects using a float value of before. That should put the tables and figures onto a following page and span columns. Thanks for the suggestion. However, DB 5 doesn't appear to have such an attribute. Stefan -- *Dave Gardiner* Xmplar i...@xmplar.biz http://xmplar.biz Mob. 0416 833 993
[docbook-apps] Inline graphics line-stacking-strategy
I have icons formatted with inlinemediaobject and have the problem of an increased line height where those graphics occur. I've read the solution on page 296-297, to change the line-stacking-strategy to font-height. Where do you apply the line-stacking-strategy as an fo attribute? Thanks -- *Dave Gardiner*
Re: [docbook-apps] Inline graphics line-stacking-strategy
Ahh...fixed already. On 22-04-12 7:02 PM, Xmplar wrote: I have icons formatted with inlinemediaobject and have the problem of an increased line height where those graphics occur. I've read the solution on page 296-297, to change the line-stacking-strategy to font-height. Where do you apply the line-stacking-strategy as an fo attribute? Thanks -- *Dave Gardiner*
Re: [docbook-apps] Cannot resolve SVG DTD for FO output
Okay, I changed all references to jre7 in xep.bat to conform to what's in the CLASSPATH. Still doesn't resolve the public DTD to my local SVG DTD. On 21-04-12 11:07 PM, Mauritz Jeanson wrote: What JRE do you actually use? In your setup, there are references to both C:\Program Files\Java\jre6 and C:\Program Files\Java\jre7. Mauritz | -Original Message- | From: Xmplar [mailto:i...@xmplar.biz] | Sent: Saturday, April 21, 2012 8:34 AM | To: docbook-apps@lists.oasis-open.org | Subject: [docbook-apps] Cannot resolve SVG DTD for FO output | | Setup: DB 1.76.1 ns, XEP 4.19, Saxon 6.5.5. | | I have produced SVG 1.1 files from Adobe Illustrator CS3 and | am linking to these from XML (not embedded). I can only | display these in FO if I remove the DTD from the SVG file - | problem with this is that fonts are substituted (e.g. | ArialMT becomes substituted with Helvetica). | | So I've attempted to set up an XML catalog using the steps | in The Definitive Guide. My results are: | | 1. SVG 1.1 DTD svg11.dtd put into c:/svg_dtd/. | | 2. Catalog file svgdtd.xml put into c:/svg_dtd/: | |?xml version=1.0 encoding=UTF-8? |!DOCTYPE catalog PUBLIC -//OASIS//DTD XML Catalogs V1.1//EN | http://www.oasis-open.org/committees/entity/release/1.1/cata | log.dtd |http://www.oasis-open.org/committees/entity/release/1.1/cata | log.dtd |catalog xmlns=urn:oasis:names:tc:entity:xmlns:xml:catalog | |group prefer=public xml:base=file:///c:/svg_dtd/ |file:///c:/svg_dtd/ |public | publicId=-//W3C//DTD SVG 1.1//EN | uri=svg11.dtd/ |/group | |/catalog | | 3. Downloaded resolver.jar and associated files to | c:/xml-commons-resolver-1.2/. Added resolver.jar and | CatalogManager.properties to CLASSPATH: | | .;C:\Program | Files\Java\jre7\lib\ext\QTJava.zip;C:\xml-commons-resolver-1. | 2\resolver.jar;C:\svg_dtd\CatalogManager.properties | | | | CatalogManager.properties contains: | | catalogs=c:/svg_dtd/svgdtd.xml | relative-catalogs=yes | verbosity=4 | prefer=public | static-catalog=yes | allow-oasis-xml-catalog-pi=yes | | | | 4. And the xep.bat file was modified (this is what I'm | unsure about - whether I need to specify certain config options): | | @echo off | | rem This batch file encapsulates a standard XEP call. | | set CP=C:\Program | Files\RenderX\XEP\lib\xep.jar;C:\xml-commons-resolver-1.2\res | olver.jar;C:\Program | Files\RenderX\XEP\lib\saxon6.5.5\saxon.jar;C:\Program | Files\RenderX\XEP\lib\saxon6.5.5\saxon-xml-apis.jar;C:\Program | | Files\RenderX\XEP\lib\xt.jar | | if x%OS%==xWindows_NT goto WINNT | | C:\Program Files\Java\jre6\bin\java | -Dcom.renderx.sax.entityresolver=org.apache.xml.resolver.tool | s.CatalogResolver | \-Dcom.renderx.jaxp.uriresolver=org.apache.resolver.tools.Cat | alogResolver \ -classpath %CP% com.renderx.xep.XSLDriver - | | DCONFIG=C:\Program Files\RenderX\XEP\xep.xml %1 %2 %3 %4 %5 | %6 %7 %8 %9 | | goto END | | :WINNT | | C:\Program Files\Java\jre6\bin\java -classpath %CP% | com.renderx.xep.XSLDriver -DCONFIG=C:\Program | | Files\RenderX\XEP\xep.xml %* | | :END | | set CP= | | | | Thanks! | | -- | Dave Gardiner | | | - 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] Setting alignment of mediaobject in html5
I have a logo that I want to centre on a web page, which is located in a book titlepage. When using the HTML5 stylesheets, the logo is not centred -- it is positioned at the left and I can't find the coding responsible for centring it. I've noticed that now the HTML5 stylesheets generate a table around the mediaobject, which has the same width as the mediaobject. The previous XHTML1-1 stylesheets didn't generate a table around the mediaobject, which made it easy to position the logo using CSS. Here is the XHTML1-1 output: div class=mediaobject style=text-align: centerimg src=images/redlettucelogo.gif style=text-align: middle width=300 alt=alt text for publisher's logo//div And the HTML5 output: div style=text-align: center; class=mediaobjecttable style=border: 0; border-spacing: 0; padding: 0; width: 300; trtd style=text-align: center; img style=text-align: middle; width: 300; src=images/redlettucelogo.gif alt=alt text for publisher's logo//td/tr/table/div The table does not have a style attribute for text-align=center and is getting its width from the enclosed mediaobject. Why is a table now generated (is this mandatory for HTML5?), and in what template is that generated? -- *Dave Gardiner*
Re: [docbook-apps] Setting alignment of mediaobject in html5
Well, it looks like setting width for the imagedata element creates the table markup, which then apparently causes browsers (Firefox, Chrome) to ignore the text-align attribute. When I removed width from imagedata (which contained a GIF image) but I still had the 'align' attribute, the resulting HTML5 markup didn't have table and the image was centred on the page. I rechecked all other images in my book and none has 'width' specified - they are all centred (in figure, example and sidebar elements). Oddly, when I consequently set a width attribute in the CSS stylesheet for the .mediaobject class, the image is not centred - it is left-justified. It seems that you must create an image at its correct (intrinsic?) width for output, because setting a width in XML or CSS affects text-align. On 08-04-12 9:05 AM, Bob Stayton wrote: Hi Dave, The HTML5 stylesheets make use of almost all the stylesheet params that are defined for the stock html outputs, in order to support all of the stock features and options. In this case, there is a param named 'make.graphic.viewport', which is set to 1 by default. To make a viewport, the stylesheet uses a table. Set that param to zero to turn off the table. The strange thing is that when the table is included, the style tag on the surrounding div element should still center it: div style=text-align: center; class=mediaobject table style=border: 0; border-spacing: 0; padding: 0; width: 300; tr td style=text-align: center; img style=text-align: middle; width: 200; src=images/note.png/ /td /tr /table If I hardcode the center property with an align attribute div align=center instead of a CSS style, then the table is centered. That doesn't seem right to me. Bob Stayton Sagehill Enterprises b...@sagehill.net mailto:b...@sagehill.net - Original Message - *From:* Xmplar mailto:i...@xmplar.biz *To:* docbook-apps@lists.oasis-open.org mailto:docbook-apps@lists.oasis-open.org *Sent:* Saturday, April 07, 2012 12:14 AM *Subject:* [docbook-apps] Setting alignment of mediaobject in html5 I have a logo that I want to centre on a web page, which is located in a book titlepage. When using the HTML5 stylesheets, the logo is not centred -- it is positioned at the left and I can't find the coding responsible for centring it. I've noticed that now the HTML5 stylesheets generate a table around the mediaobject, which has the same width as the mediaobject. The previous XHTML1-1 stylesheets didn't generate a table around the mediaobject, which made it easy to position the logo using CSS. Here is the XHTML1-1 output: div class=mediaobject style=text-align: centerimg src=images/redlettucelogo.gif style=text-align: middle width=300 alt=alt text for publisher's logo//div And the HTML5 output: div style=text-align: center; class=mediaobjecttable style=border: 0; border-spacing: 0; padding: 0; width: 300; trtd style=text-align: center; img style=text-align: middle; width: 300; src=images/redlettucelogo.gif alt=alt text for publisher's logo//td/tr/table/div The table does not have a style attribute for text-align=center and is getting its width from the enclosed mediaobject. Why is a table now generated (is this mandatory for HTML5?), and in what template is that generated? -- *Dave Gardiner*
Re: [docbook-apps] Deleting blank pages in chapters
I finally sorted the problems with the incorrect starting page number for the first chapter. In template 'initial.page.number' I used the following: xsl:when test=starts-with($master-reference,'bodycustom') xsl:choose xsl:when test=($element = 'chapter' or $element = 'article') and not(preceding-sibling::d:chapter) and following-sibling::d:chapter1/xsl:when xsl:otherwiseauto/xsl:otherwise /xsl:choose /xsl:when That makes all chapter page numbers sequential starting at 1. I also had a problem with the content disappearing from headers and footers in the chapters. I finally realised I had a customisation to select the content for headers and footers: when test=$pageclass = 'body'. So I simply added another test to that line: or $pageclass = 'bodycustom'. On 06-04-12 3:21 AM, Bob Stayton wrote: Hi Dave, I might suggest a different approach that requires less customization. In this approach, the first chapter creates a page-sequence, and all chapter content is placed in that single page-sequence, with just forced page breaks in between. That lets you use the standard 'body' page-master without modification. It would still put a blank even page at the end of the last chapter, though. Here is what I tried: ?xml version=1.0 encoding=UTF-8? xsl:stylesheet xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:d=http://docbook.org/ns/docbook; xmlns:xsl=http://www.w3.org/1999/XSL/Transform; version=1.0 xsl:import href=../docbook-xsl-ns-1.76.1/fo/docbook.xsl/ xsl:template match=d:chapter[not(preceding-sibling::d:chapter)] xsl:variable name=id xsl:call-template name=object.id/ /xsl:variable xsl:variable name=master-reference xsl:call-template name=select.pagemaster/ /xsl:variable xsl:call-template name=page.sequence xsl:with-param name=master-reference select=$master-reference/ xsl:with-param name=content !-- This chapter's content -- fo:block id={$id} xsl:use-attribute-sets=component.titlepage.properties xsl:call-template name=chapter.titlepage/ /fo:block xsl:variable name=toc.params xsl:call-template name=find.path.params xsl:with-param name=table select=normalize-space($generate.toc)/ /xsl:call-template /xsl:variable xsl:if test=contains($toc.params, 'toc') xsl:call-template name=component.toc xsl:with-param name=toc.title.p select=contains($toc.params, 'title')/ /xsl:call-template xsl:call-template name=component.toc.separator/ /xsl:if xsl:apply-templates/ !-- and subsequent chapters included in this page sequence -- xsl:apply-templates select=following-sibling::d:chapter/ /xsl:with-param /xsl:call-template /xsl:template !-- include subsequent chapters in first chapter's page-sequence -- xsl:template match=d:chapter[preceding-sibling::d:chapter] xsl:variable name=id xsl:call-template name=object.id/ /xsl:variable fo:block break-before=page/ fo:block id={$id} xsl:use-attribute-sets=component.titlepage.properties xsl:call-template name=chapter.titlepage/ /fo:block xsl:variable name=toc.params xsl:call-template name=find.path.params xsl:with-param name=table select=normalize-space($generate.toc)/ /xsl:call-template /xsl:variable xsl:if test=contains($toc.params, 'toc') xsl:call-template name=component.toc xsl:with-param name=toc.title.p select=contains($toc.params, 'title')/ /xsl:call-template xsl:call-template name=component.toc.separator/ /xsl:if xsl:apply-templates/ /xsl:template /xsl:stylesheet Bob Stayton Sagehill Enterprises b...@sagehill.net mailto:b...@sagehill.net - Original Message - *From:* Xmplar mailto:i...@xmplar.biz *To:* docbook-apps@lists.oasis-open.org mailto:docbook-apps@lists.oasis-open.org *Sent:* Thursday, April 05, 2012 4:06 AM *Subject:* [docbook-apps] Deleting blank pages in chapters I've been trying to delete blank pages in chapters so that the first chapter starts on an odd page and subsequent chapters start on even or odd. After having incorporated several customisations from information in other postings on the topic, the closest I get is being able to generate the correct 'odd-then-even' page sequence and have no blank pages between chapters, /but/ the first page starts on page 15 (i.e. it follows on from the prelims page count) and the page numbers disappear from the footer. I have firstly specified a variable chaptersrunon which gives the options of generating the usual page sequence, plus the 'no-blanks' page sequence (0 -- all chapters start on odd page; 1 -- chapters after chapter 1 start on even or odd page with no blanks). I have added a page-sequence-master called bodycustom to template 'user.pagemasters' and am calling that in template select.user.pagemaster, depending on the value of chaptersrunon. I have also set the bodycustom page sequence in template 'initial.page.number' and template 'force.page.count'. I've experimented with the bodycustom page
[docbook-apps] Generating p tags around first para of a table entry
When transforming to xhtml1-1 I've noticed that in a formal table, the first para inside an entry element does not generate with any p tags -- the text sits immediately inside td style=border-right: 1px none #00; border-bottom: 1px none #00; . However, the second and subsequent paragraphs are surrounded with p.It is the same situation with text in an entry element on its own. This is problematic, because when using iBooks, the first para is not rendered in the selected font style for the document. I looked at xsl:templatematch=d:entry|d:entrytblname=entry and thought I'd found the right place, so I customised with putting p in this coding: xsl:choose xsl:whentest=$empty.cell xsl:text#160;/xsl:text /xsl:when xsl:whentest=self::d:entrytbl xsl:call-templatename=tgroup/ /xsl:when xsl:otherwise p xsl:apply-templates/ /p /xsl:otherwise /xsl:choose /xsl:element That only generated an opening p tag before the first paragraph -- there was no closing tag. Where else should I be looking? -- *Dave Gardiner*
Re: [docbook-apps] WebHelp search results - can they be generated in context?
The option to add a summary to WebHelp search results appears not to work as expected when using: phrase role=summary. I set this tag immediately inside each para and when I search for a word, the summary text I get will be from the *last* phrase element in the whole section within which is the search term - and not the text from the para that contains the search term. Further, the text within phrase role=summary is generated in HTML files - so there needs to be either some sort of filter for the d:phrase template that excludes the text specified with @role=summary from being propagated, or change the name of the element in the relevant WebHelp template (and even then, the summary displayed in a search must come from the para containing the found term). On 16-03-12 12:32 AM, David Cramer wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Not sure if this is what you mean, but you can have it include brief summaries in the search results: http://snapshots.docbook.org/xsl/webhelp/docs/content/ch02s02.html When you perform a search, the results can include brief summaries. These are populated in one of two ways: * By adding |role=summary| to a |para| or |phrase| in the |chapter| or |section|. * By adding an |abstract| to the |chapterinfo| or |sectioninfo| element. Including a few words before and after the found term would be hard to implement with the current client-side search. You probably want to use a google site search for that. David On 3/15/12 6:35 AM, Xmplar wrote: Am wondering whether it's possible to customise or develop WebHelp so that when invoking a search, the results include a few words before and after the search term. It seems that (say, with autoindex) at best only the section title within which a search term is located will be displayed as a search result. Is it possible to get search term results linking to the actual search term? -- *Dave Gardiner* -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJPYe9aAAoJEMHeSXG7afUh2/kH/0tX0YmTgXIOzfzqIkIz3Oa5 9Ha+cC1EYL9ZlMrlDBn7ztB80SsXRqDfc0SMRogbupmCi85yR1NJzGtK4tHAw9au hDR7zYV9Cjnx4enBkJIN0yd6vJhn77n4WhBfe2rVOAGw7FyubLKPasIjnzpUcZKo cLveyZkgnlTBkcP7AaTrbPLjm7FPmrQ5HG+23En4d1QaRAkSB5uQh4zIvVtC30o7 KK7p8lGktLgQ3eutekyzYpLiCTt2W/Wy6Br+gw8PryrBhVyL/eNEJSPlNLn8yh6B OOmk1L1OGLstPpYek+u3KZpw/pv37ahncBWX7YoGy4skJ+cV5Q1kepxBf3VWhPk= =gf1P -END PGP SIGNATURE- -- *Dave Gardiner*
[docbook-apps] WebHelp search results - can they be generated in context?
Am wondering whether it's possible to customise or develop WebHelp so that when invoking a search, the results include a few words before and after the search term. It seems that (say, with autoindex) at best only the section title within which a search term is located will be displayed as a search result. Is it possible to get search term results linking to the actual search term? -- *Dave Gardiner*
[docbook-apps] Applying emphasis to indexterms
I'm trying to ensure that any primary, secondary or tertiary entries in the indexterm element, and which have a nested emphasis element, are generated in the index with an italic font style. I'm using the basic indexing method with 1.76.1ns. I've tried to track the coding to customise, and from autoidx.xsl I thought that the template xsl:templatematch=d:indextermmode=index-primary would be the most likely (I'm looking for an fo:block where the primary term is applied). Here is my customisation from that template: xsl:for-eachselect=$refs/d:primary xsl:iftest=@id or @xml:id fo:inlineid={(@id|@xml:id)[1]}/ /xsl:if /xsl:for-each !--modified 12/3/12:-- xsl:choose xsl:whentest=d:emphasis fo:inlinefont-style=italic xsl:value-ofselect=d:primary/ /fo:inline /xsl:when xsl:otherwise xsl:value-ofselect=d:primary/ /xsl:otherwise /xsl:choose ... and obviously not working (this template in my customisation -and seemingly any from autoidx - gives me error messages about variables not declared -- so it won't transform). Where do I need to customise? Typical markup in a chunk (to format primary entries with emphasis) is: entryindexterm primaryemphasisEuropean carp/emphasis/primary secondaryCyprinus carpio/secondary /indexterm Where should I be looking so that emphasis is applied? -- *Dave Gardiner*
[docbook-apps] Webhelp files chunking to wrong directory
I just started using WebHelp this weekend and followed the instructions to install Ant. I couldn't test that Ant was installed properly because when I ran ant -version at the command prompt I got an error message that ant is not a recognised command, etc However, I decided to run webhelp from within oXygen v 13.2 anyway (apparently not using ant), and it is creating chunks, but it is creating the docs directory in the oXygen 13.2 program directory. I have modified the webhelp build.properties file to specify an output directory: output-dir=file:///c:/xmplar/cop-e-boox v 0-1a/docs ..but this makes no difference. Do I need to specify an output directory somewhere else? Have I missed an installation step? I'm using the ns version 1.76.1 in Windows XP. -- **Dave Gardiner
[docbook-apps] Embedding indexterms for fo and html
I'm just starting to experiment with the automatic index generation, following the procedure in The Complete Guide, and wondered if anyone would like to comment on how they approached the procedure to generate indexes for PDF and HTML output. Are there any shortcuts to specifying the indexterms? Did you do any post-generation editing for the HTML index? It'd be great to get some insight. Thanks, -- *Dave Gardiner*
[docbook-apps] Re: Reasoning behind epub h level numbering
Thanks Robert. That solution gives me the H level numbers I'd expect for all section levels. I also had to customise the template for bridgeheads, because that was generating an H number that was one level higher than it should be (e.g. sect1 was rendered as H1). In xsl:template match=d:bridgehead I changed the following: xsl:variable name=hlevel xsl:choose !--workaround added 22/2/12:-- xsl:when test=@renderas = 'sect1'2/xsl:when xsl:when test=@renderas = 'sect2'3/xsl:when xsl:when test=@renderas = 'sect3'4/xsl:when xsl:when test=@renderas = 'sect4'5/xsl:when xsl:when test=@renderas = 'sect5'6/xsl:when xsl:otherwise xsl:value-of select=$clevel + 1/ /xsl:otherwise /xsl:choose /xsl:variable Then I compared the epub output with web output and realised the web stylesheets were generating the wrong H level number for the components preface, glossary, bibliography and index (these were H2). So in component.xsl (for XHTML 1-1) my customisation is now: xsl:template name=component.title ... !--workaround 22/2/12 - removed $level+1 :-- xsl:element name=h{$level} namespace=http://www.w3.org/1999/xhtml; It's interesting (confusing?) that this is part of coding for when a component occurs inside a section - when would that ever happen? On 22-02-12 6:47 AM, Robert Nagle wrote: With regard to this problem, I wrote this description of how I solved it last year. It probably is not the ideal solution, but it worked for me. Hopefully the epub3 won't have this problem (and Kindle Fire won't have it). The main reason it mattered was that Kindle 3 and below only did styling for H tags. rj Because of a Docbook bug, chapters and sections and subsections are all h1. This is bad for Kindle format (i.e., Kindle 3) because that is the only way to contrast headings. Kindle can only differentiate between h1, h2, h3 and not h1.chapter, h1.section, h1.subsection. I have noticed that when you use the epub/docbook.xsl stylesheet, by default epub output shows h1 for both chapters and sections (which is bad). Sections are supposed to output h2, subsections as h3, etc. With epub output, this problem is not so bad because you can create a css rule for div.chapter and div.section, but still that is not right. I think there is a bug in epub/docbook.xsl which causes this. To fix this, I copied the entire contents of the code inside and including xsl:template name=section.headingfrom epub/docbook.xsl into my XSL customization layer and simply edited one line: xsl:variable name=hlevel xsl:choose !-- highest valid HTML H level is H6; so anything nested deeper than 7 levels down just becomes H6 Note from Robert: I added + 1 on the xsl: otherwise statement-- xsl:when test=$levelgt; 66/xsl:when xsl:otherwise xsl:value-of select=$level+1/ /xsl:otherwise /xsl:choose /xsl:variable -- *Dave Gardiner* Xmplar i...@xmplar.biz http://xmplar.biz Mob. 0416 833 993
[docbook-apps] Reasoning behind epub h level numbering
I have encountered the issue of epub and web files having different h title level numbers for the same content. It follows on from Robert Nagle's posting of 15 March 2011. Specifically, the epub stylesheets produce titles one level higher than the web stylesheets, e.g.: preface title: web (h2), epub (h1) This is consistent behaviour for the elements: preface, glossary, bibliography, index, sect1 through to sect5, and bridgeheads sect1 to sect5. The epub docbook.xsl has modified HTML H level numbering in both xsl:template match=d:bridgehead and xsl:template name=component.title (apparently as an SEO customisation). Can someone elucidate why there is this change in h numbering for the epub customisation? -- *Dave Gardiner*
Re: [docbook-apps] Superscript footnote numbers in XHTML not formatting correctly
Bob, I've viewed this chunk with Firefox 10, Google Chrome 17 and SeaMonkey 2.7 - they all show the first footnote the same way as my screenshots. Internet Explorer 8 actually shows the left-bracket, then *breaks* the rest of the footnote number onto the next line! (number and right-bracket). Only IE6 shows the first footnote number correctly. Here is the part of the HTML output: ... earth occur in Australia.sup[a id=d0e490 href=#ftn.d0e490 class=footnote1/a]/sup More ... This is exactly the same output for the next footnote - it seems to be a browser problem. Interesting... On 17-02-12 5:03 AM, Bob Stayton wrote: Hi Dave, Can you show what the generated HTML code looks like? Does this problem show up in other browsers? Bob Stayton Sagehill Enterprises b...@sagehill.net mailto:b...@sagehill.net - Original Message - *From:* Xmplar mailto:i...@xmplar.biz *To:* docbook-apps@lists.oasis-open.org mailto:docbook-apps@lists.oasis-open.org *Sent:* Thursday, February 16, 2012 3:28 AM *Subject:* [docbook-apps] Superscript footnote numbers in XHTML not formatting correctly I am producing XHTML 1.1 files with DB5 1.76.1ns and Saxon 6.5.5 - regarding superscript footnote numbers in body text, the first footnote is not correctly sized to superscript size - the footnote number and the closing right square bracket are the same size as the body text (whereas the opening square bracket is correctly sized). The second footnote number in the same paragraph is sized properly. See the attached screenshots. I have made sure my customisation layer and CSS file is not interfering. I'm using the markup: footnoteparatext.../para/footnote. -- *Dave Gardiner* - 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] Superscript footnote numbers in XHTML not formatting correctly
I tried a few variations, and noted that with the default generated sup markup, the problem of a split footnote number occurs only with the first footnote in a chunk -- subsequent footnotes in the chunk are rendered correctly (which is, a smaller superscript number and the hyperlink immediately underneath only the number: sup[a id=d0e490 href=#ftn.d0e490 class=footnote1c/a]/sup). This is the case for Firefox, Chrome and SeaMonkey. IE8 breaks the footnote across two lines. I then found a workaround that renders the first footnote correctly in most browsers (IE8 still breaks across lines) -- put an empty a tag before the sup (though having duplicate a tags might have issues regarding accessibility or validity, and I'm not sure if epubcheck would pass such a chunk as valid): a/asup[a id=d0e490 href=#ftn.d0e490 class=footnote1c/a]/sup But the markup that is rendered most consistently across browsers is to put the superscript inside the a: a id=d0e490 href=#ftn.d0e490 class=footnotesup[1a]/sup/a This places the hyperlink underline a small distance below the superscript and makes the square brackets and the number active -- this could be better than the default markup because there's a slightly larger active link area. On 18-02-12 4:42 AM, Bob Stayton wrote: Hi Dave, That HTML code looks legit to me. Can you try these variants and see if any of them work in all the browsers? pOriginal: earth occur in Australia.sup[a id=d0e490 href=#ftn.d0e490 class=footnote1/a]/sup More .../p pVariant 1: earth occur in Australia.supa id=d0e490 href=#ftn.d0e490 class=footnote[1]/a/sup More .../p pVariant 2: earth occur in Australia.a id=d0e490 href=#ftn.d0e490 class=footnotesup[1]/sup/a More .../p Bob Stayton Sagehill Enterprises b...@sagehill.net mailto:b...@sagehill.net - Original Message - *From:* Xmplar mailto:i...@xmplar.biz *To:* docbook-apps@lists.oasis-open.org mailto:docbook-apps@lists.oasis-open.org *Sent:* Friday, February 17, 2012 6:46 AM *Subject:* Re: [docbook-apps] Superscript footnote numbers in XHTML not formatting correctly Bob, I've viewed this chunk with Firefox 10, Google Chrome 17 and SeaMonkey 2.7 - they all show the first footnote the same way as my screenshots. Internet Explorer 8 actually shows the left-bracket, then *breaks* the rest of the footnote number onto the next line! (number and right-bracket). Only IE6 shows the first footnote number correctly. Here is the part of the HTML output: ... earth occur in Australia.sup[a id=d0e490 href=#ftn.d0e490 class=footnote1/a]/sup More ... This is exactly the same output for the next footnote - it seems to be a browser problem. Interesting... On 17-02-12 5:03 AM, Bob Stayton wrote: Hi Dave, Can you show what the generated HTML code looks like? Does this problem show up in other browsers? Bob Stayton Sagehill Enterprises b...@sagehill.net mailto:b...@sagehill.net - Original Message - *From:* Xmplar mailto:i...@xmplar.biz *To:* docbook-apps@lists.oasis-open.org mailto:docbook-apps@lists.oasis-open.org *Sent:* Thursday, February 16, 2012 3:28 AM *Subject:* [docbook-apps] Superscript footnote numbers in XHTML not formatting correctly I am producing XHTML 1.1 files with DB5 1.76.1ns and Saxon 6.5.5 - regarding superscript footnote numbers in body text, the first footnote is not correctly sized to superscript size - the footnote number and the closing right square bracket are the same size as the body text (whereas the opening square bracket is correctly sized). The second footnote number in the same paragraph is sized properly. See the attached screenshots. I have made sure my customisation layer and CSS file is not interfering. I'm using the markup: footnoteparatext.../para/footnote. -- *Dave Gardiner* - 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] Can't select link if 'linkend' contains text
I have in a document, d:link - for both links to other text in the document (e.g. link to a figure) as well as links to URLs. For both types of links I am using d:link. I would like the following code to select only those instances where the @linkend contains the string 'http' - and to then put angle brackets before and after those URLs. The if:test syntax under variable content is obviously wrong - what is the correct syntax for selecting linkends that are only URLs? Thanks xsl:template match=d:link name=link xsl:param name=linkend select=@linkend/ xsl:param name=targets select=key('id',$linkend)/ xsl:param name=target select=$targets[1]/ xsl:variable name=xrefstyle xsl:choose xsl:when test=@role and not(@xrefstyle) and $use.role.as.xrefstyle != 0 xsl:value-of select=@role/ /xsl:when xsl:otherwise xsl:value-of select=@xrefstyle/ /xsl:otherwise /xsl:choose /xsl:variable xsl:variable name=content xsl:if test=contains(linkend,'http') xsl:value-of select=$puncbeforeurl/ /xsl:if !--xsl:if test=ancestor::d:bibliomixed or ancestor::d:bibliography xsl:value-of select=$puncbeforeurl/ /xsl:if-- fo:inline xsl:use-attribute-sets=xref.properties xsl:choose xsl:when test=count(child::node()) gt; 0 !-- If it has content, use it -- xsl:apply-templates/ /xsl:when !-- look for an endterm -- xsl:when test=@endterm xsl:variable name=etargets select=key('id',@endterm)/ xsl:variable name=etarget select=$etargets[1]/ xsl:choose xsl:when test=count($etarget) = 0 xsl:message xsl:value-of select=count($etargets)/ xsl:textEndterm points to nonexistent ID: /xsl:text xsl:value-of select=@endterm/ /xsl:message xsl:text???/xsl:text /xsl:when xsl:otherwise xsl:apply-templates select=$etarget mode=endterm/ /xsl:otherwise /xsl:choose /xsl:when !-- Use the xlink:href if no other text -- xsl:when test=@xlink:href xsl:call-template name=hyphenate-url xsl:with-param name=url select=@xlink:href/ /xsl:call-template /xsl:when xsl:otherwise xsl:message xsl:textLink element has no content and no Endterm. /xsl:text xsl:textNothing to show in the link to /xsl:text xsl:value-of select=$target/ /xsl:message xsl:text???/xsl:text /xsl:otherwise /xsl:choose /fo:inline xsl:if test=contains(linkend,'http') xsl:value-of select=$puncafterurl/ /xsl:if -- *Dave Gardiner*
[docbook-apps] Specifying space-before relative to the page margins
I have on a book title page several elements (title, subtitle, author, contributor, mediaobject etc) all centred below each other. For each element, I have set space-before values which are, of course, measured from the preceding element (so, the space-before for subtitle is applied relative to the position of the title). Instead of specifying space-before for each element relative to the preceding element, is it possible to specify the space-before relative to the top margin of the page? -- *Dave Gardiner*
[docbook-apps] Option to select an import statement
In a customised stylesheet, I have two options to import a chunking stylesheet for HTML chunking: xsl:import href=file:///c:/DocBook_xslns1-76/xhtml-1_1/onechunk.xsl / xsl:import href=file:///c:/DocBook_xslns1-76/xhtml-1_1/chunkfast.xsl / How can I give users the option of selecting one import statement or the other, by using some sort of selection variable? I know I can comment out either import statement, but is there a slicker way to do this with a simple 1 or 0 selection? -- *Dave Gardiner*
[docbook-apps] Cannot write xml:lang to content.opf
I have specified an xml:lang value in a book element (i.e. not within an info tag) and need to write that value to the content.opf metadata element. Here is my customisation: xsl:elementnamespace=http://purl.org/dc/elements/1.1/name=dcterms:language; xsl:apply-templates select=d:book[@xml:lang]|d:article[@xml:lang]|d:part[@xml:lang]/ /xsl:element And all I get in content.opf is an empty element: dcterms:languagexmlns:dcterms=http://purl.org/dc/elements/1.1// What am I missing from the element selection syntax? I'm using 1.76.1, epub2. Thanks -- *Dave Gardiner*
[docbook-apps] Web-based parameterization
I came across some info about being able to define params in a web browser: http://nwalsh.com/docs/articles/dbdesign/#webparam Is there any more info available? It looks like one can develop a GUI interface for customised stylesheets - is that correct? -- *Dave Gardiner*
[docbook-apps] Chunking dedication element for epub
I have a report with dedication elements used for acknowledgments and executive summary. Currently, the acknowledgments and executive summary appear in the index.html chunk (following the titlepage recto and verso content). I want to create a separate chunk for each of the acknowledgments and executive summary, and have added to a customised stylesheet the templates xsl:templatename=chunk (to define dedication as a chunk), the template xsl:templatematch=*mode=recursive-chunk-filenamepriority=1 (to define a filename prefix for dedication) and the template match: xsl:templatematch=d:set| d:book| d:part| d:dedication| d:preface| d:chapter| d:appendix| d:article| d:reference| d:refentry| d:book/d:glossary| d:article/d:glossary| d:part/d:glossary| d:bibliography| d:colophon priority=1 xsl:choose xsl:whentest=$onechunk != 0 and parent::* xsl:apply-imports/ /xsl:when xsl:otherwise xsl:call-templatename=process-chunk-element/ /xsl:otherwise /xsl:choose /xsl:template While the customisation creates chunks for both acknowledgments and executive summary, this last template has the effect of: 1.Not including titles for both new chunks (although the content is there) 2.Not generating any tocs and lots chunks (I have set the book toc with separate lots for figures, tables, etc) 3.Removing all content from index.html. ... and I haven't even looked at what's happening with the OPF and NCX files yet. I've tried to trace the chunking template logic starting with the template match coding above to see where I need to add the dedication element to the relevant coding -- I've added it to xsl:templatename=chunk-first-section-with-parentpriority=1 and xsl:templatename=chunk-all-sectionspriority=1 . I hope there is a straightforward solution, otherwise can someone help to debug my customisations -- my other option is to try manual chunking using the maketoc.xsl procedure in TCG. I'm using 1.76.1-ns. Thanks, -- *Dave Gardiner*
Re: [docbook-apps] Removing blank space in chapter TOC
Bob, Thanks so much for helping to follow the toc processing logic between stylesheets. I eventually solved the problem by looking at the fo: output and tracing back where a particular fo:block places the toc id number. It is in template ‘component.toc’, so I specified space-before… attributes: … xsl:iftest=$nodes fo:blockid=toc...{$id} space-before.minimum=0pt space-before.optimum=0pt space-before.maximum=0pt xsl:use-attribute-sets=toc.margin.properties … Dave On 23-10-11 7:35 AM, Bob Stayton wrote: Hi Dave, The template with match=d:chapter in fo/comonent.xsl calls the template named 'component.toc', which resides in fo/autotoc.xsl. In the component.toc template, the main fo:block has xsl:use-attribute-sets=toc.margin.properties. That attribute-set is in fo/param.xsl and includes space-before properties. I see that you also include a toc title, so the component.toc template also calls the template named 'table.of.contents.titlepage'. That template is part of the titlepage spec system based on processing the titlepage.templates.xml specification file into a customized titlepage module titlepage.templates.xsl. If you look in titlepage.templates.xml, you will find: t:titlepage t:element=table.of.contents ... Even though 'table.of.contents' is not an element, is it treated as a fake element in the titlepage system. In that specification,the title element has space-before properties. That would be a second source of space above your toc. Bob Stayton Sagehill Enterprises b...@sagehill.net mailto:b...@sagehill.net - Original Message - *From:* redlettucemail mailto:redlettucem...@mailscan.acenet.net.au *To:* docbook-apps@lists.oasis-open.org mailto:docbook-apps@lists.oasis-open.org *Sent:* Friday, October 21, 2011 7:13 PM *Subject:* [docbook-apps] Removing blank space in chapter TOC I am generating chapter tocs with a two-column layout, and the toc generates with a space before the toc title (attached screenshot). I have tried to modify both xsl:templatematch=d:preface|d:chapter|d:appendix|d:article mode=toc and xsl:templatename=division.toc by applying margin-top to the relevant blocks (e.g. fo:block id =toc.{$cid}.{$id} ), and even trying to use fo:inline instead of fo:block (based on the assumption that fo:block generates a one-line space). I thought the fo:block that contains the toc is somehow adding something like a ‘space-before’ property (or to that effect) before the first content (which is the title). I’ve experimented by applying negative margin-top and padding-top attributes to no avail. I’d like some guidance please on what I need to modify. Thanks, Dave Gardiner - 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] Linkable index in The Complete Guide
How was the hyperlinking index created for DocBook XSL: TCG? I'd like to try this for my FO output. Was it generated entirely from embedded indexterms? Thanks -- *Dave Gardiner* Xmplar i...@xmplar.biz http://xmplar.biz Mob. 0416 833 993