How to tag for mutliple outputs
Oxygen general issues.
How to tag for mutliple outputs
Hi
I'm using the DocBook editor--and am really new to DocBook. I want to use a single set of source files and output for multiple purposes: PDF, online help, website.
Which element (or which attribute of which element) should I use to indicate which elements should be included in each output? I'm guessing it would be the "condition" or "role" attribute.
Since most of the content needs to be included in most of the outputs, is there a way to specify that I want to exclude certain elements from a particular output--or is that done when I transform the document with some kind of "not" statement?
Once I've tagged the content correctly, how do I get the right content into the different outputs?
Thanks--really new to this.
Tricia
I'm using the DocBook editor--and am really new to DocBook. I want to use a single set of source files and output for multiple purposes: PDF, online help, website.
Which element (or which attribute of which element) should I use to indicate which elements should be included in each output? I'm guessing it would be the "condition" or "role" attribute.
Since most of the content needs to be included in most of the outputs, is there a way to specify that I want to exclude certain elements from a particular output--or is that done when I transform the document with some kind of "not" statement?
Once I've tagged the content correctly, how do I get the right content into the different outputs?
Thanks--really new to this.
Tricia
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: How to tag for mutliple outputs
Post by sorin_ristache »
Hello,
A method for specifying the elements for a type of output is using the profile attributes: profile.audience or profile.role or profile.os, etc. You add the profile attribute to the elements that you want to include in only one or more output types but not in all output types. For example if you want to include a sect2 element only in PDF output you add the following attribute to that sect2 element:
and when you apply the DocBook transformation you set the DocBook XSL parameter profile.role to the value 'pdf' which will include in the output only the elements that have a role attribute that includes the 'pdf' value and the elements with no role attribute. If the role attribute has other values it will not be included in the output.
Regards,
Sorin
A method for specifying the elements for a type of output is using the profile attributes: profile.audience or profile.role or profile.os, etc. You add the profile attribute to the elements that you want to include in only one or more output types but not in all output types. For example if you want to include a sect2 element only in PDF output you add the following attribute to that sect2 element:
Code: Select all
<sect2 role="pdf"> ... </sect2>
Regards,
Sorin
Re: How to tag for mutliple outputs
Hi,
It's been awhile since I asked this question. But I'm actually trying to do it now. And can't get it to work.
I want to use two roles: pdfOutput and htmlOutput. Mostly I want to output images in different sizes for the different outputs.
I have two transformation scenarios (one for PDF and one for HTML), and I define the profile.role parameter accordingly in each. I ran the scenarios a number of times, each time adding the role attribute to different elements in my DocBook source: imagedata, imageobject, mediaobject, figure, para. I assumed I need to have two almost identical elements with different roles and different scales--for example:
<imagedata fileref="images/assessment.jpg" align="center" scale="110" role="htmlOutput"/>
<imagedata fileref="images/assessment.jpg" align="center" scale="40" role="pdfOutput" />
But in the result I get 2 images, or a repeated paragraph (or whatever element I put in twice). So it seems like the role is not being picked up.
Thanks for any help.
Patricia
It's been awhile since I asked this question. But I'm actually trying to do it now. And can't get it to work.
I want to use two roles: pdfOutput and htmlOutput. Mostly I want to output images in different sizes for the different outputs.
I have two transformation scenarios (one for PDF and one for HTML), and I define the profile.role parameter accordingly in each. I ran the scenarios a number of times, each time adding the role attribute to different elements in my DocBook source: imagedata, imageobject, mediaobject, figure, para. I assumed I need to have two almost identical elements with different roles and different scales--for example:
<imagedata fileref="images/assessment.jpg" align="center" scale="110" role="htmlOutput"/>
<imagedata fileref="images/assessment.jpg" align="center" scale="40" role="pdfOutput" />
But in the result I get 2 images, or a repeated paragraph (or whatever element I put in twice). So it seems like the role is not being picked up.
Thanks for any help.
Patricia
Re: How to tag for mutliple outputs
Hi,
The first thing I would like to point out is that role isn't the best choice for a profiling attribute. It can cause problems if you also use emphasis with role(e.g. <emphasis role="bold">) in your document. You can read more about it here:
http://www.sagehill.net/docbookxsl/Prof ... hRole.html
If you need a generic attribute with no preassigned semantics I would recommend condition.
Now, regarding the transformation scenarios, for profiling you need to change the stylesheet(XSL URL) in the scenario:
- for HTML change it to ${frameworks}/docbook/xsl/html/profile-docbook.xsl
- for PDF change it to ${frameworks}/docbook/xsl/fo/profile-docbook.xsl
There usually is a corresponding profile-docbook.xsl stylesheet in the same directory as the default stylesheet.
Let me know if you need further assistance.
Regards,
Adrian
The first thing I would like to point out is that role isn't the best choice for a profiling attribute. It can cause problems if you also use emphasis with role(e.g. <emphasis role="bold">) in your document. You can read more about it here:
http://www.sagehill.net/docbookxsl/Prof ... hRole.html
If you need a generic attribute with no preassigned semantics I would recommend condition.
Now, regarding the transformation scenarios, for profiling you need to change the stylesheet(XSL URL) in the scenario:
- for HTML change it to ${frameworks}/docbook/xsl/html/profile-docbook.xsl
- for PDF change it to ${frameworks}/docbook/xsl/fo/profile-docbook.xsl
There usually is a corresponding profile-docbook.xsl stylesheet in the same directory as the default stylesheet.
Let me know if you need further assistance.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Re: How to tag for mutliple outputs
Hi,
It worked finally, but some fiddling was required. Finally, this worked:
I had to put the condition in <imageobject>, and I had to put the <imageobject> for html first; if not, I get two images in the html output. The PDF works better: doesn't matter whether I put its <imageobject> first or second, in both cases I just get one image.
Patricia
It worked finally, but some fiddling was required. Finally, this worked:
Code: Select all
<figure xml:id="figure-assessmentCentre" >
<title>Typical activities of the staff</title>
<mediaobject>
<imageobject condition="html">
<imagedata fileref="images/assessment.jpg" scale="110"/>
</imageobject>
<imageobject condition="pdf">
<imagedata fileref="images/assessment.jpg"scale="35"/>
</imageobject>
</mediaobject>
</figure>
Patricia
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