DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion Best practices for customizing PDF output – maintainability of changes

  • IF

    Best practices for customizing PDF output – maintainability of changes

    Participants 7
    Replies 8
    Last Activity 11 years, 11 months ago

    I'm not clear on best practices relating changes to the customization of PDF output when I want to make a change to a “xm_*.xsl” file.

    For example, I want to change the glossary from two columns to one column. I can do this by editing line 66 in xm_glosssary.xsl file ( 

    But is this the best place to make this change if I want to minimize pain during upgrades or redeployment of the tookit? should i make the change in custom.xls instead?

    Using XMetal 6.0, Enhanced PDF via RendexX XEP (and by the way, I am making these changes via a customization folder created according to instructions in http://forums.xmetal.com/index.php/topic,710.0.html)

    Reply

    Derek Read

    Reply to: Best practices for customizing PDF output – maintainability of changes

    Yes, I would recommend that whenever you can you should try to make any changes using an “override” in the custom.xsl file(s). This sometimes might mean duplicating whole chunks of stuff that won't change.

    Reply

    IF

    Reply to: Best practices for customizing PDF output – maintainability of changes

    thanks – so just to make sure I understand. A template in custom.xsl (say ProcessGlossarylist) will override a template of the same name in xm_glossary.xsl even though the custom.xsl contains a statement that imports xm_glossary.xsl?

       

    Does it matter where I put my ProcessGlossarylist template in custom.xsl? Should it be after the import statements or before?
    thanks

    Reply

    Derek Read

    Reply to: Best practices for customizing PDF output – maintainability of changes

    Things that come later override things previously defined so your statements should come after any imports. This is similar to CSS cascading.

    Reply

    IF

    Reply to: Best practices for customizing PDF output – maintainability of changes

    There is something odd going on. I cannot override this template.
    I have created a file that contains my customization and I import that from customs.xsl.

    So custom.xls looks like this.

        xmlns:fo=”http://www.w3.org/1999/XSL/Format”
        xmlns:exsl=”http://exslt.org/common”
        xmlns:opentopic=”http://www.idiominc.com/opentopic”
        xmlns:exslf=”http://exslt.org/functions”
        xmlns:opentopic-func=”http://www.idiominc.com/opentopic/exsl/function”
        extension-element-prefixes=”exsl”
        exclude-result-prefixes=”opentopic exslf opentopic-func”
        version=”1.1″>

       

             

       
       
       
       
       
       
       
       
       
           
       
       
       
           
           
       

             
         
       
           

    I can create an output without any problems with this file IF_system_Guide_draft,xsl. That is, i see comments in the PDF output and the appendices don't have a min-toc:

        xmlns:fo=”http://www.w3.org/1999/XSL/Format”
        xmlns:exsl=”http://exslt.org/common”
        xmlns:opentopic=”http://www.idiominc.com/opentopic”
        extension-element-prefixes=”exsl”
        exclude-result-prefixes=”opentopic”
        version='1.1'>

         
         
               
                 
               

       

       
       
           
               
               
                   
                       
                           
                       

                       
                           
                               
                           

                           
                               
                                   
                               

                           

                       

                       

                       
                           
                       

                       
                           
                               
                           

                       

                       

                       
                   
               
           
       

         

    But as soon as I add the processglossarylist template to my IF_system_guide_draft.xsl file, i get a build error. I haven't even made changes to the template. the message is this. the filename changes randomly each time i try it.

    C:UsersIFuseyAppDataRoamingSoftQuadXMETAL~1DITA_OTbuild_preprocess.xml:186: Failed to copy C:UsersIFuseyAppDataRoamingSoftQuadXMETAL~1DITA_OTtemplblg_electrocardiogram.xml.pull to C:UsersIFuseyAppDataRoamingSoftQuadXMETAL~1DITA_OTtemplblg_electrocardiogram.xml due to C:UsersIFuseyAppDataRoamingSoftQuadXMETAL~1DITA_OTtemplblg_electrocardiogram.xml (Access is denied)

    Reply

    IF

    Reply to: Best practices for customizing PDF output – maintainability of changes

    after a couple of hours of random troubleshooting, a bit more info: it seems that this is the problematic section if inserted directly into the custom.xls file or into my if_system_guide_draft.xsl file.

     
                           
                       

    I see this error:

    Error reported by XML parser: undeclared name prefix in: rx:flow-section

    If I remove the rx:flow statements from the custom.xsl or the if_system_guide_draft.xsl files , I don't get any errors. Also, obviously, the rx:flow statements do work in the xm_glossary.xsl file.

    Reply

    Derek Read

    Reply to: Best practices for customizing PDF output – maintainability of changes

    In order to use any RenderX XSLT extension (anything that starts with “rx:”) you will need to add the following namespace to the XSL file:

    xmlns:rx="http://www.renderx.com/XSL/Extensions"

    I believe that should fix your issue.

    Reply

    IF

    Reply to: Best practices for customizing PDF output – maintainability of changes

    I was hopeful but unfortunately it still does not work

    I get a BUILD FAILED error followed by this:

    C:UsersIFuseyAppDataRoamingSoftQuadXMETAL~1DITA_OTbuild_preprocess.xml:186: Failed to copy C:UsersIFuseyAppDataRoamingSoftQuadXMETAL~1DITA_OTtemplblc_device_specifications.xml.pull to C:UsersIFuseyAppDataRoamingSoftQuadXMETAL~1DITA_OTtemplblc_device_specifications.xml due to C:UsersIFuseyAppDataRoamingSoftQuadXMETAL~1DITA_OTtemplblc_device_specifications.xml (Access is denied)

    Reply

    IF

    Reply to: Best practices for customizing PDF output – maintainability of changes

    Problem solved finally. The key was to add the statement xmlns:rx=”http://www.renderx.com/XSL/Extensions”
    to custom.xsl. It was not good enough to add that statement to the file that is imported by custom.xsl (if_systemguide_draft.xsl).
    thanks

    Reply

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

Lost Your Password?

Products
Downloads
Support