Pages: 1
Print
Author Topic: Applying custom stylesheets  (Read 11997 times)
cdybdahl
Member

Posts: 30


« on: January 13, 2009, 04:18:19 PM »

To generate pdf output, I do the following, using a fresh, unmodified install of XMetaL 5.5:
  • File-->Generate Output for DITA Topic...
  • Select XMetaL Enhanced PDF via RenderX XEP in the Deliverable Type: field
  • Click Configure Output
  • Click Edit
  • In the Advanced tab, I click Browse to specify my custom xsl stylesheet
  • I click OK three times, accepting the default output location.

The output generates (not as desired) using the default OT stylesheets. I think the problem lies with the fact that the custom stylesheet calls a number of other xsl documents, to which only a relative path is provided. Is there any way in XMetaL to specify a folder that contains custom stylesheets, rather than the single file available in the Configure Output dialog?


« Last Edit: January 13, 2009, 06:13:54 PM by Derek Read » Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: January 13, 2009, 06:44:31 PM »

To customize PDF output you cannot use the setting you are referring to. Instead do the following:

1. Duplicate the main folder for the PDF plug-in you wish to modify, keeping it at the same level within the DITA OT we deploy (this is not entirely necessary unless you are very familiar with the DITA OT and can maintain all of the various paths to referenced files).
For example:
C:\Program Files\Common Files\XMetaL Shared\DITA_OT\demo\xmfo\Customization
C:\Program Files\Common Files\XMetaL Shared\DITA_OT\demo\xmfo\Customization2
C:\Program Files\Common Files\XMetaL Shared\DITA_OT\demo\xmfo\Customization3

2. Make your changes to your duplicate copy. I would suggest making one minor change (like changing paragraph text to blue for example) to test the rest of these steps before making more major changes. That way you will at least know you have this all working and that changes you make to the XSL / XSL-FO aren't causing problems.

3. [Optionally] create a new deliverable in XMetaL Author Enterprise using the Duplicate button in Configure Output (basing it on the same deliverable type used for the folder you duplicated. Again, creating a new deliverable is a good idea because then you can run the one we ship (without any changes) if you run into problems with the DITA OT.

4. Point XMetaL to your duplicate folder by editing your new deliverable type and adding the following parameter to "Other output parameters" on the Advanced tab:
RX_CUSTOM_DIR = <path to folder>

Example (using folder examples above):
RX_CUSTOM_DIR = "C:\Program Files\Common Files\XMetaL Shared\DITA_OT\demo\xmfo\Customization2"

Note: This parameter is a proprietary XMetaL Author Enterprise parameter. It is supported only in XMetaL Author Enterprise 5.1 and later.
 
Logged
cdybdahl
Member

Posts: 30


« Reply #2 on: January 14, 2009, 12:49:56 PM »

Thanks, Derek, that appears to work.

But it makes me wonder what the specify a custom xsl setting is for.
Does this work only for html output? According to the help...

"When you specify a stylesheet, you override one of the default transform (XSL) files in the DITA Open Toolkit. Specifying a stylesheet has the effect of setting the ‘args’ parameter. For more information, refer to the DITA Open Toolkit User Guide."

Which sounds like exactly what I want to do. There is no mention of this function not working for pdf output.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #3 on: January 14, 2009, 03:36:50 PM »

The DITA OT docs suggest you cannot do this for PDF2 (or PDF3, which is also based on the Idiom plug-in) but that is not something I am able to test at the moment and would likely be quite tricky to accomplish. I think it would also be a waste of effort given that it is possible to accomplish what you want (I think, still not exactly clear what changes you need to make) using the approach outlined in my last message.

The DITA OT argument in question here is "args.xsl" and the DITA OT help states the following:

Quote
args.xsl The xsl file to replace the default xsl file. It will replace dita2docbook.xsl in docbook transformation, dita2fo-shell.xsl in pdf transformation, dita2xhtml.xsl in xhtml/eclipsehelp transformation, dita2rtfImpl.xsl in word transformation and dita2html.xsl in javahelp/htmlhelp transformation.
Logged
Peter Smith
Member

Posts: 2


« Reply #4 on: July 10, 2009, 09:10:23 AM »

I have tried both of these approaches and neither is working for me.  I am running XMetaL v5.5 SP1 on Windows XP with a user id that is an administrator.  I have duplicated the .../Customization folder and all of the subdirectories underneat it.

When I use the RX_CUSTOM_DIR=<path> method, I get the following on the last line of the log file.
<log_line>
C:\DOCUME~1\psmi\APPLIC~1\SoftQuad\XMETAL~1\DITA_OT&gt;IF ""C:\Documents and Settings\psmi\Application Data\SoftQuad\XMetaL Shared\DITA_OT\demo\xmfo\Customization PW"" == "" (</log_line>

I have also tried this under C:\Program Files\Common Files\XMetaL Shared\DITA_OT\demo\xmfo.

When I specify an XSL stylesheet to override the default stylesheet, it picks up default customization stylesheet.  If I remove the default customization directory, it still does not use my customization.


What am I missing?  Thanks for your assistance,
Peter
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #5 on: July 20, 2009, 04:58:30 PM »

This is trickier in 5.5 due to the deployment we do to support limited users (which is on by default) as part of the Vista compatibility support. Another topic deals with that specifically here: http://forums.xmetal.com/index.php/topic,237

What I did to get this working with 5.5 (absolute paths used here for clarity):

1. On my test machine I duplicated the Customization folder (as per previous instructions in this thread) so that I have the following:

C:\Program Files\Common Files\XMetaL Shared\DITA_OT\demo\xmfo\Customization
C:\Program Files\Common Files\XMetaL Shared\DITA_OT\demo\xmfo\Customization2


2. I then made one (and only one) further config change to force the DITA OT to be redeployed to my user profile. RX_CUSTOM_DIR does not come into play here yet. The change needed was to alter the setting in the "Advanced" tab of the "Configure Output" dialog (without selecting any deliverables) as follows:

cmd_dita_ot_per_user_version  =  1

Note that this setting should already be there, if you don't see it you are probably in the wrong place.

I increased the value by 1. If yours equals 1 already, make it 2, etc.

3. Generate output for any deliverable type (doesn't matter which). This together with the change made in step 2 redeploys the DITA OT. Answer 'yes' when you are asked if you want the redeployment to occur. This will update your deployed copy so it now also has a copy of the Customization2 folder (which is the folder you will ultimately be modding).

4. You now have two options. The first one (4a) is best as it does not hard code the path to a particular user's deployment (ie: yours) but uses another variable to locate your deployed copy of the DITA OT. That way you can use the same setting for all users.

   4a) Use the following setting for RX_CUSTOM_DIR in the Advanced tab (Other output parameters) for your custom deliverable type (which should have been based on 'XMetaL Enhanced PDF via RenderX XEP'):
      RX_CUSTOM_DIR = %DITA_OT_DIR%\demo\xmfo\Customization2

   4b) Or you can open the log file and find out what %DITA_OT_DIR% is by looking for the string "set DITA_OT_DIR" and then finding the value it is set to. You can then add \demo\xmfo\Customization2 to the end of that. It might end up looking something like this:
   RX_CUSTOM_DIR = "C:\Documents and Settings\<your windows login name>\APPLIC~1\SoftQuad\XMETAL~1\DITA_OT\demo\xmfo\Customization2"

Quotes are required when a path contains spaces. If you have trouble with paths containing spaces use the Windows "short" (8.3) path format instead and remove the quotes.
Logged
kwag_myers
Member

Posts: 69


« Reply #6 on: July 09, 2010, 08:15:16 AM »

To customize PDF output you cannot use the setting you are referring to. Instead do the following:

1. Duplicate the main folder for the PDF plug-in you wish to modify, keeping it at the same level within the DITA OT we deploy (this is not entirely necessary unless you are very familiar with the DITA OT and can maintain all of the various paths to referenced files).
For example:
C:\Program Files\Common Files\XMetaL Shared\DITA_OT\demo\xmfo\Customization
C:\Program Files\Common Files\XMetaL Shared\DITA_OT\demo\xmfo\Customization2
C:\Program Files\Common Files\XMetaL Shared\DITA_OT\demo\xmfo\Customization3

2. Make your changes to your duplicate copy. I would suggest making one minor change (like changing paragraph text to blue for example) to test the rest of these steps before making more major changes. That way you will at least know you have this all working and that changes you make to the XSL / XSL-FO aren't causing problems.

3. [Optionally] create a new deliverable in XMetaL Author Enterprise using the Duplicate button in Configure Output (basing it on the same deliverable type used for the folder you duplicated. Again, creating a new deliverable is a good idea because then you can run the one we ship (without any changes) if you run into problems with the DITA OT.

4. Point XMetaL to your duplicate folder by editing your new deliverable type and adding the following parameter to "Other output parameters" on the Advanced tab:
RX_CUSTOM_DIR = <path to folder>

Example (using folder examples above):
RX_CUSTOM_DIR = "C:\Program Files\Common Files\XMetaL Shared\DITA_OT\demo\xmfo\Customization2"

Note: This parameter is a proprietary XMetaL Author Enterprise parameter. It is supported only in XMetaL Author Enterprise 5.1 and later.
 
Yes, I realize this topic is a year old. Still, I'd like to try bumping it instead of starting over.

Is there a way to do this for WebHelp? I'm running Author 6.0 Trial Version on Vista Home Basic SP2.

Here's my dilemma; I'm working on a suite of products and I'd like to tweek the index.html and webhelp.css for each deliverable. Thx to Su-Laine Yeo's tutorial (http://forums.xmetal.com/index.php/topic,626.0.html) I've been able to make the desired edits for one product, but I'd like to be able to output each product's help without switching these files every time I publish.
Logged

XMetaL 6 Author in Windows 7 Home Premium
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #7 on: July 09, 2010, 11:43:29 AM »

@kwag_myers: we don't have a similar mechanism (and associated parameters) for other output types yet, just the RenderX PDF.

I'll raise this as a feature request with our development team.
Logged
WouterTron
Member

Posts: 2


« Reply #8 on: September 17, 2014, 03:29:16 AM »

EDIT: Ended up fixing this by making several customization subfolders within the org.dita.pdf2 folder and using the output parameter ANT_PARAM_customization.dir = <path> in XMetaL to point my various output scenarios towards the appropriate paths. Leaving my original message in the hopes it might be informative to others.

Hi,

Sorry about the thread necromancy, but I'm having some trouble with the above also. Is the RX_CUSTOM_DIR parameter still relevant in XMetaL Author Enterprise 9.0?

I am trying to publish a PDF through Book via RenderX (i.e. plugins/org.dita.pdf2), but want to change the page margins on certain publications. Hence, I've copied the plugin folder, named it org.dita.pdf2.fullpage and made the appropriate changes to Customization\fo\xsl\custom-page-layouts.xsl. I've also created a new deliverable type based on the existing one and added RX_CUSTOM_DIR  =  C:\ProgramData\DITA-OT\DITA-OT1.6.3\plugins\org.dita.pdf2.fullpage\Customization to the output parameters.

I must be doing something wrong however, because my customizations are ignored in output. When I make the same changes to the xsl in the original folder, they do show up (regardless of whether I use the RX_CUSTOM_DIR parameter). But that of course means they show up in all publications, rather than just the ones I want. Any help would be much appreciated!

EDIT: I should mention that our PDF output was already customized previously by a consultant, so the relevant paths in catalog.xml have been changed. I'm now trying to add more customization to the previously customized files.
« Last Edit: September 17, 2014, 08:47:13 AM by WouterTron » Logged
WouterTron
Member

Posts: 2


« Reply #9 on: September 17, 2014, 08:35:47 AM »

[whoops, quote is not edit]
« Last Edit: September 17, 2014, 08:45:53 AM by WouterTron » Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #10 on: September 18, 2014, 05:12:06 PM »

I believe this parameter has only every been applicable to the deliverable named "XMetaL Enhanced PDF via RenderX XEP". It was created as part of some custom work for a client and then rolled into the software later as an unofficial feature. So, if you are using the deliverable named "Book via RenderX" it will not work, as far as I know.
Logged
Pages: 1
Print
Jump to: