DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion Excluding page numbers in cross-references

  • carmstrong

    Excluding page numbers in cross-references

    Participants 3
    Replies 4
    Last Activity 11 years, 9 months ago

    In XMetaL 5.5 SP1 is there a way to exclude the page number when inserting a cross-reference to a topic? For example, I've created a revision history table as an appendix. The table references each chapter in the document and the changes made, if any. While page numbers are necessary when cross-references are used within the document, they are not necessary in the revision history table.

    I've attached an example table for your reference. Any information you can provide would be helpful. Thanks.

    Reply

    gcrews

    Reply to: Excluding page numbers in cross-references

    You might want to take a look at the insertPageNumberCitation xsl template in links.xsl in xmfo ( assuming your using renderX). You can eather change/override that template or take out the calls to it.  If you haven’t worked with customizing the toolkit files before, you might want to read though the Appendix D of the user guide to know what files to edit.

    Reply

    Derek Read

    Reply to: Excluding page numbers in cross-references

    The file you need to modify will also depend on which 'deliverable' you are using to generate your PDF (there are three different ones).

    If you are using “XMetaL Enhanced PDF via RenderX XEP” then the existing section in links.xsl looks like this:

       
           
           
           

           
               
               
                   
                       
                           
                           
                                                               
                                       
                                   

                               
                           

                       

                   

               

               
                   
                       
                           
                           
                                                               
                                       
                                   

                               
                           

                       

                   

               

           

       

    At minimum you would need additional conditional logic in there to check to see if the link is inside a table. However, you might have links inside tables elsewhere, so if you don't want to suppress page numbers for links in all tables you might need to add something to your XML to identify this table as being special, perhaps using the outputclass attribute for example:

    . Or you could key off of something else. Maybe you never want links inside tables inside an 'appendix' to have page numbers. For bookmaps you might be able to check if the table is in an appendix. For regular maps you might try to just check to see if the topic title contains the text “appendix”.

    The the outputclass type of solution the conditional logic inside the XSLT template might have this kind of logic:

    xsl:when has ancestor “table” and “table” has @outputclass = “docUpdateTable” do not include page number
    xsl:otherwise include page number (ie: existing behavior)

    Reply

    Derek Read

    Reply to: Excluding page numbers in cross-references

    Here's the section I quoted in my previous message modified to exclude the page number for any xref that appears in any table, with the blue part being new code:

       
           
           
           

           
               
               
                   
                       
                           
                           
                                                               
                                       
                                   

                               
                           

                       

                   

               

               
                   
                       

                           
                                                               
                                       
                                   

                               
                           

                       

                   

               

               
                   
                       

                           
                                                               
                                       
                                   

                               
                           

                       

                   

               

           

       

    Here's the same section again but this time modified to exclude the page number for any xref that appears in tables with @outputclass=”docUpdateTable”, with the blue part being the new code:

       
           
           
           

           
               
               
                   
                       
                           
                           
                                                               
                                       
                                   

                               
                           

                       

                   

               

               
                   
                       

                           
                                                               
                                       
                                   

                               
                           

                       

                   

               

               
                   
                       

                           
                                                               
                                       
                                   

                               
                           

                       

                   

               

           

       

    These have been tested with the links.xsl file that is used by the “XMetaL Enhanced PDF via RenderX” deliverable. I think the file for “Book via RenderX” is the same or similar.

    Reply

    carmstrong

    Reply to: Excluding page numbers in cross-references

    This is very helpful. Thanks for the information!

    Reply

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

Lost Your Password?

Products
Downloads
Support