DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion xref Links to same file break in PDF

  • rde

    xref Links to same file break in PDF

    Participants 4
    Replies 5
    Last Activity 11 years, 7 months ago

    I'm trying to create links to various ids in a single file, and the links don't work when the file is output to PDF. The topic type is composite. I don't have any trouble when using similar xref links to ids in different files. I'm using XMetal Author Enterprise 6.0. Here's an example:

       


     
        Main topic
       
             
         
         
           
           
         

         
           
           
             
           

                               
               
             

             
           
         

       
       
         

    The following datatypes are used in the response elements of the XXX operation:

         

             

    •        

    •      

       
       
          DataType1
         
         
           

              Datatype content
             

    The following table shows the elements of the DataType1
                datatype:

             

               
                                                                         

                   
                      Name
                      Description
                      Required
                      Valid values
                   

                 

                 

                   
                      Name1
                     
                       

    Description1

                     
                      No
                     
                   
                   
                      Name2
                     
                       

    Description2

                     
                      No
                     
                   
                 

               
             

           

         
       
       
          DataType2
         
         
           

              Datatype content
             

    The following table shows the elements of the DataType2
                datatype:

             

               
                                                                         

                   
                      Name
                      Description
                      Required
                      Valid values
                   

                 

                 

                   
                      Name3
                     
                       

    Description3

                     
                      No
                     
                   
                   
                      Name4
                     
                       

    Description4

                     
                      No
                     
                   
                 

               
             

           

         
       
       
          Related topics
         
         
           

         
       
     

    The two xref links ( and don't work in the PDF output. Has anyone else seen this problem?

    Thanks,
    Rick

    Reply

    Derek Read

    Reply to: xref Links to same file break in PDF

    I think I can reproduce what you are seeing, but I'm not sure because I'm making a few assumptions. The main one being which deliverable you are using to generate your PDF, “XMetaL Enhanced PDF via RenderX XEP”, and the second one being that no changes have been made to the DITA Open Toolkit.

    If I generate a PDF using “XMetaL Enhanced PDF via RenderX XEP” I see that the links are generated just fine, it is just that if you click on them they don't go anywhere because they both point to the same page. Everything fits on page 3. If you add additional content so that the three topics (topic + 2 reference topics) end up on separate pages you should find that the links actually do something (if they point to different pages).

    See screen capture: pdf_out.gif

    If that isn't what you are seeing please provide some more information so that I can try to reproduce the problem.

    Note: I'm also ignoring the fact that the document is invalid (it has an attribute value “developer” for @type on an audience element). However, the DITA Open Toolkit itself does not catch this error for me for some reason (I'm not sure why but I will look into that). XMetaL Author does catch the error though. Allowed values include (only): user, purchaser, adminstrator, programmer, executive, services, other, and -dita-use-conref-target.

    One more point. This appears to be a test of some kind (unless you've dumbed things down to ask this question on the forum). Unless you have specific reason to do so, I would recommend saving one topic per file and making use of DITA maps. DITA obviously allows “composite” documents but using maps provides many advantages.

    Reply

    rde

    Reply to: xref Links to same file break in PDF

    Thanks for your answers, Derek.

    To answer your questions, I did “dumb down” my example topic because the original topic from which my example was based is for unreleased documentation. Unfortunately I made the example topic so small that you couldn't test whether or not the links actually jumped to a different point on the page. Also we're using composite topics because we are writing API reference pages and we want all of the elements to appear in the same topic.

    Fortunately, I discovered the problem. XMetal appears to require that you use the file name as well as the anchor in your links for the links to work in the transformed PDFs. In other words, I get broken links in my PDFs when I use links like the following: . But the links work fine when I use links like the following: .

    Thanks,
    Rick

    Reply

    Derek Read

    Reply to: xref Links to same file break in PDF

    There is no requirement to include the filename in the @href.

    and this should be equivalent when the xref and what it is linking to are both inside the file filename.dita and the DITA OT treats handles this just fine (at least in my tests).

    The behavior of the DITA OT follows what the DITA 1.1 Language Reference says (my highlighting in blue) for the usage of the href attribute:
    [quote=http://docs.oasis-open.org/dita/v1.1/CS01/langspec/langref/xref.html#xref__xref_attr]A hyperlink to an external Web page (URL) or other non-DITA resource, to another DITA topic in the same file or in another file, or to a specific element inside a DITA topic . . . DITA content is targetted as follows:
    Target elsewhere in the same file:
      href=”#topicID”
      href=”#topicID/elemID

    Target in a different file:
      href=”filename.dita#topicID”
      href=”fname.dita#topicID/elemID”
    . . .

    Having said that, XMetaL Author Enterprise will include the filename when you use the Insert Cross Reference dialog. The DITA OT has no problem handling either and the XMetaL Author Enterprise link checking functionality also handles both methods (when you have broken links you have the option to view a dialog named “Unresolved References Log”).

    Reply

    MarcB

    Reply to: xref Links to same file break in PDF

    I am observing the same behaviour as rde. Using XMetaL 6.0.1 on Windows XP SP3 and outputting to PDF using the XMetaL interface via RenderX, links built with href=”#topicid” pointing to a topic in the same dita file do not work in PDF (they work fine in HTML). Links built as href=”filename.dita#topicid” work in PDF.
    The dita file is a composite topic (a wrapper containing multiple and topics).
    This is an issue to watch when converting legacy formats to DITA.

    However, interestingly enough, the “topicid-only” links work when using FrameMaker with the DITA-FMx plugin to generate PDF.

    Marc Beckers
    Software AG

    Reply

    MarcB

    Reply to: xref Links to same file break in PDF

    I would like to revisit this topic with the following observations:
    1. when inserting an , XMetaL adds the filename to the href attribute, even if the link target is in the same file (#/. When generating PDF output, all is well.
    2. when you have a DITA file that has only #topicid on the href pointing to a target in the same file, all is well in the PDF when using File > Generating Ouput for DITA Topic.
    BUT
    3. when you have a DITA file that has only #topicid on the href pointing to a target in the same file, and the topic file is linked into a DITA map, the links don't work in the PDF output when using File > Generating Ouput for DITA Map (they appear as links, but there is no page reference and don't take you anywhere).

    Bug?

    Reply

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

Lost Your Password?

Products
Downloads
Support