pagebreak before element identified with attribute
Post here questions and problems related to editing and publishing DITA content.
pagebreak before element identified with attribute
Hi,
I am trying to identify an element by attribute and then add a pagebreak before. Right now I can identify the element and the pagebreak works but the element is removed. I managed to copy the content with <xsl:copy-of but the formatting is not applied. Is there some option to add the formatting by calling the title formatting? I already tried to create a new <title> element inside the template node but nothing is created when doing this.
The following example results in a pagebreak but without the formatting of the title:
Thanks a lot in advance!
I am trying to identify an element by attribute and then add a pagebreak before. Right now I can identify the element and the pagebreak works but the element is removed. I managed to copy the content with <xsl:copy-of but the formatting is not applied. Is there some option to add the formatting by calling the title formatting? I already tried to create a new <title> element inside the template node but nothing is created when doing this.
The following example results in a pagebreak but without the formatting of the title:
Code: Select all
<xsl:template match="//title[@formatting='pageBreakBefore']">
<fo:block page-break-before="always"/>
<xsl:copy-of select="node()"/>
</xsl:template>
Code: Select all
<title formatting="pageBreakBefore">Some Title</title>
Re: pagebreak before element identified with attribute
Hi,
The XSLT is applied on a DITA document and it produces XSL-FO output.
Using "xsl:copy-of" means that the DITA <title> element will be copied to the output XSL-FO as a <title> element instead of being processed as an XSL-FO element.
My recommendation:
That <xsl:next-match/> means to continue the processing by applying the default XSLT template which matches the title element.
Using <xsl:apply-imports/> instead of xsl:next-match might also work.
An alternative is to specify the page break using a processing instruction:
https://github.com/dita-community/org.d ... page-break
Regards,
Radu
The XSLT is applied on a DITA document and it produces XSL-FO output.
Using "xsl:copy-of" means that the DITA <title> element will be copied to the output XSL-FO as a <title> element instead of being processed as an XSL-FO element.
My recommendation:
Code: Select all
<xsl:template match="title[@formatting='pageBreakBefore']">
<fo:block page-break-before="always"/>
<xsl:next-match/>
</xsl:template>
Using <xsl:apply-imports/> instead of xsl:next-match might also work.
An alternative is to specify the page break using a processing instruction:
https://github.com/dita-community/org.d ... page-break
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 11
- Joined: Tue Aug 23, 2016 6:18 pm
Re: pagebreak before element identified with attribute
Post by Quick van Rijt »
You tagging a title with an attribute to trigger a page-break.
If your goal is to start selected topics of interest on a new page, check-out the following plugin:
https://github.com/dita-community/org.d ... page-break
I just submitted a solution to use:
If your goal is to start selected topics of interest on a new page, check-out the following plugin:
https://github.com/dita-community/org.d ... page-break
I just submitted a solution to use:
Code: Select all
<prolog>
<?pagebreak?>
</prolog>
Regards
Quick van Rijt
Professional user of Oxygen XML and DITA OT
Quick van Rijt
Professional user of Oxygen XML and DITA OT
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service