Setting images for admonitions
-
- Posts: 13
- Joined: Mon Oct 07, 2013 6:04 pm
- Location: Bucharest, Romania
Setting images for admonitions
I'm having trouble with setting the images to be used for admonitions (PDF output).
In my document, I have the following bit:
In my customization layer, I added the following:
I am expecting my PDF to use the tip.svg image in frameworks\docbook\xsl\images... but instead, I get the tip.png image under frameworks\docbook\css\img. I tried to change the extension; I also tried to set base.dir and set the admon.graphics.path as relative... still get the wrong image in PDF. Am I missing something obvious? Thanks!
In my document, I have the following bit:
Code: Select all
<tip><para>The amount of disk space required by a project depends on the number of lines of code.</para></tip>
Code: Select all
<xsl:param name="admon.graphics.extension">.svg</xsl:param>
<xsl:param name="admon.graphics.path">C:\Program Files\Oxygen XML Editor 15\frameworks\docbook\xsl\images\</xsl:param>
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Setting images for admonitions
Post by sorin_ristache »
Hi Ioana,
The value of the admon.graphics.path parameter must be a URL, not a file path. For example in the built-in Docbook transformations that come in Oxygen you can see that this value is: ${frameworks}/docbook/css/img/ which will be expanded to a URL that will point to a sub-directory of the Oxygen install directory, because the ${frameworks} Oxygen variable is expanded to a URL, in your case: file:/C:/Program%20Files/Oxygen%20XML%20Editor%2015/frameworks/. Please set a URL in the admon.graphics.path parameter as required by the Docbook transformations.
Regards,
Sorin
The value of the admon.graphics.path parameter must be a URL, not a file path. For example in the built-in Docbook transformations that come in Oxygen you can see that this value is: ${frameworks}/docbook/css/img/ which will be expanded to a URL that will point to a sub-directory of the Oxygen install directory, because the ${frameworks} Oxygen variable is expanded to a URL, in your case: file:/C:/Program%20Files/Oxygen%20XML%20Editor%2015/frameworks/. Please set a URL in the admon.graphics.path parameter as required by the Docbook transformations.
Regards,
Sorin
-
- Posts: 13
- Joined: Mon Oct 07, 2013 6:04 pm
- Location: Bucharest, Romania
Re: Setting images for admonitions
Thanks for pointing me in the right direction! I managed to get it working, but there's still something I don't understand.
I checked the Configure Parameters window (Configure Transformation Scenario > Edit > Configure) and admon.graphics.path was indeed set to ${frameworks}/docbook/css/img/. Then, in my xsl file, I changed the line to:
but the value displayed in Configure Parameters did not change (it was still ${frameworks}/docbook/css/img/). Once I edited it manually, I could generate the PDF the way I wanted it. My question is: aren't the values in Configure Parameters derived from my stylesheet (the one I set under XSL URL)?
I checked the Configure Parameters window (Configure Transformation Scenario > Edit > Configure) and admon.graphics.path was indeed set to ${frameworks}/docbook/css/img/. Then, in my xsl file, I changed the line to:
Code: Select all
<xsl:param name="admon.graphics.path">${frameworks}/docbook/xsl/images/</xsl:param>
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Setting images for admonitions
Post by sorin_ristache »
In the Configure Parameters dialog box only the default values of the parameters are derived from the stylesheet set under XSL URL, that is the parameters displayed with a normal font. If a value was set manually in this dialog box (the parameter is displayed with a bold font) this value will override the default value from the stylesheet.
Did you create your Docbook transformation by duplicating an existing transformation in which the admon.graphics.path parameter was bolded? If yes it will keep its value because it is not the value from the stylesheet (it is not displayed with normal font).
Regards,
Sorin
Did you create your Docbook transformation by duplicating an existing transformation in which the admon.graphics.path parameter was bolded? If yes it will keep its value because it is not the value from the stylesheet (it is not displayed with normal font).
Regards,
Sorin
-
- Posts: 13
- Joined: Mon Oct 07, 2013 6:04 pm
- Location: Bucharest, Romania
Re: Setting images for admonitions
I'm coming back to this topic since something still doesn't seem right.
To get my transformation scenario, I duplicated an existing one (DocBook PDF) and then I manually unset all the parameters. In the Edit scenario window, the Parameters button shows 0. In the Configure parameters window, admon.graphics.path displays the correct path, in my case ${frameworks}/docbook/xsl/images/. Despite this, if I generate my PDF, I don't get admonition graphics in the output.
The workaround is simple: I edit the admon.graphics.path parameter and I click OK without changing anything. Now the parameter is displayed in bold, the path is the same, and I do get admonition images in the document. Is this a bug?
To get my transformation scenario, I duplicated an existing one (DocBook PDF) and then I manually unset all the parameters. In the Edit scenario window, the Parameters button shows 0. In the Configure parameters window, admon.graphics.path displays the correct path, in my case ${frameworks}/docbook/xsl/images/. Despite this, if I generate my PDF, I don't get admonition graphics in the output.
The workaround is simple: I edit the admon.graphics.path parameter and I click OK without changing anything. Now the parameter is displayed in bold, the path is the same, and I do get admonition images in the document. Is this a bug?
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Setting images for admonitions
Post by sorin_ristache »
When the Parameters button shows 0, after you unset manually all parameters, admon.graphics.path should have the default value picked up from the XSLT stylesheet, and that is: images/. I don't understand how this parameter has the value ${frameworks}/docbook/xsl/images/ in your case, when it is displayed in normal font (not bolded anymore), after you unset the parameter. What Oxygen version do you use?
Regards,
Sorin
Regards,
Sorin
-
- Posts: 13
- Joined: Mon Oct 07, 2013 6:04 pm
- Location: Bucharest, Romania
Re: Setting images for admonitions
I think it's normal because I use a customization layer and I set the parameter there as ${frameworks}/docbook/xsl/images/. Or at least that's my understanding of how customization layers work with oXygen. (I'm on 15.1, but I had made all customizations in 15 and copied them over.)
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Setting images for admonitions
Post by sorin_ristache »
OK I understand now. You may use the variable ${frameworks} only in the Oxygen GUI, not in an XSLT stylesheet. It is an Oxygen variable which is replaced with an actual physical file path by Oxygen before the transformation is started. If you use it directly in the XSLT stylesheet nobody will replace it.
Regards,
Sorin
Regards,
Sorin
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