DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion Applying custom stylesheets

  • cdybdahl

    Applying custom stylesheets

    Participants 9
    Replies 10
    Last Activity 13 years, 8 months ago

    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?

    Reply

    Derek Read

    Reply to: Applying custom stylesheets

    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 FilesCommon FilesXMetaL SharedDITA_OTdemoxmfoCustomization
    C:Program FilesCommon FilesXMetaL SharedDITA_OTdemoxmfoCustomization2
    C:Program FilesCommon FilesXMetaL SharedDITA_OTdemoxmfoCustomization3

    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 =

    Example (using folder examples above):
    RX_CUSTOM_DIR = “C:Program FilesCommon FilesXMetaL SharedDITA_OTdemoxmfoCustomization2”

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

    Reply

    cdybdahl

    Reply to: Applying custom stylesheets

    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.

    Reply

    Derek Read

    Reply to: Applying custom stylesheets

    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:

    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.

    Reply

    Peter Smith

    Reply to: Applying custom stylesheets

    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= method, I get the following on the last line of the log file.

    C:DOCUME~1psmiAPPLIC~1SoftQuadXMETAL~1DITA_OT>IF “”C:Documents and SettingspsmiApplication DataSoftQuadXMetaL SharedDITA_OTdemoxmfoCustomization PW”” == “” (

    I have also tried this under C:Program FilesCommon FilesXMetaL SharedDITA_OTdemoxmfo.

    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

    Reply

    Derek Read

    Reply to: Applying custom stylesheets

    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 FilesCommon FilesXMetaL SharedDITA_OTdemoxmfoCustomization
    C:Program FilesCommon FilesXMetaL SharedDITA_OTdemoxmfoCustomization2

    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%demoxmfoCustomization2

    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 demoxmfoCustomization2 to the end of that. It might end up looking something like this:
    RX_CUSTOM_DIR = "C:Documents and SettingsAPPLIC~1SoftQuadXMETAL~1DITA_OTdemoxmfoCustomization2"

    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.

    Reply

    kwag_myers

    Reply to: Applying custom stylesheets

    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 FilesCommon FilesXMetaL SharedDITA_OTdemoxmfoCustomization
    C:Program FilesCommon FilesXMetaL SharedDITA_OTdemoxmfoCustomization2
    C:Program FilesCommon FilesXMetaL SharedDITA_OTdemoxmfoCustomization3

    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 =

    Example (using folder examples above):
    RX_CUSTOM_DIR = “C:Program FilesCommon FilesXMetaL SharedDITA_OTdemoxmfoCustomization2”

    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 ([url=http://forums.xmetal.com/index.php/topic,626.0.html]http://forums.xmetal.com/index.php/topic,626.0.html[/url]) 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.

    Reply

    Derek Read

    Reply to: Applying custom stylesheets

    @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.

    Reply

    WouterTron

    Reply to: Applying custom stylesheets

    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 = 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 Customizationfoxslcustom-page-layouts.xsl. I've also created a new deliverable type based on the existing one and added RX_CUSTOM_DIR  =  C:ProgramDataDITA-OTDITA-OT1.6.3pluginsorg.dita.pdf2.fullpageCustomization 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.

    Reply

    WouterTron

    Reply to: Applying custom stylesheets

    [whoops, quote is not edit]

    Reply

    Derek Read

    Reply to: Applying custom stylesheets

    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.

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support