Skip navigation
StrucInfo
Currently Being Moderated

TOC built on import using XSLT

Jul 17, 2012 2:09 AM

Hello,

 

I am working on a FM application which modifies the XML via preprocessing XSLT.

This includes building a full TOC on the front matter which contains hyperlinks to all the top level chapter titles via unique id's @idref on the TOC/TOC-entry-1/TOC-ref element.

 

However, when the front matter FM is generated, the structure view does not show the idref attribute and therefore an empty TOC.

 

Is there a way of refreshing the .FM file somehow to reflect the new structure and show the TOC entries ?

 

Thanks,

 

Andy

 
Replies
  • Currently Being Moderated
    Jul 17, 2012 5:19 AM   in reply to StrucInfo

    Keith,

     

    I have to say that this is quite a complicated thing you are asking without providing a whole lot of info. I get the idea of what you are doing, but I'm not clear on where the process is breaking down. It might be difficult to troubleshoot such a complex, customized process over this forum.

     

    Russ

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 17, 2012 5:33 AM   in reply to StrucInfo

    Andy,

     

    An easy answer is not to generate the TOC with the XSLT, but let FrameMaker do it after you open the XML, using FrameMaker's built-in TOC tools.

     

    However, if you want to pursue what you have started, you first need to make sure that the  XSLT output (before FrameMaker imports it into the template) really does contain the correct TOC entries you believe to be there. The fact that the structure view does not show the idref attribute indicates that the XSLT output may not be correct.

     

    If you do not have one, you can download a trial version of an XSL processor, such as Oxygen. Open the XML and apply the XSLT. Then look at the result. If the idref is missing there, then the XSLT needs to be fixed.

     

    OR, at least FIRST assume that what you see in the structure view IS in fact the result of applying the XSLT to the XML. Then review your XSLT to see if you can find the mistake.

     

    Van

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 17, 2012 10:23 AM   in reply to StrucInfo

    Andy,

     

    I doubt that one can specify the XSLT version in FrameMaker. I believe it is still version 1 or maybe 1.something, but not 2.

     

    If everything worked in Frame 8, then I would think it should work in 10.

     

    Once the XML is opened in FrameMaker, is the result one file or several files in a book? When you update the references (for a single file) or update the book, do you get ANY errors, specifically unresolved cross-references?

    The target id is external.

    When you create a cross-reference in FrameMaker to an external file, FrameMaker stores the name of the file in addition to the value of the ID. When this is exported to XML (said with some caveats), the idref of the cross-reference element contains the file name, like file_name#id. I am not sure whether this additional information is needed to make it all work...BUT it worked before.

     

    As mentioned in my previous post, the workaround is to create the TOC within FrameMaker. The resulting PDF will have links from the TOC to the various chapters.

     

    Van

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 18, 2012 10:28 AM   in reply to StrucInfo

    Andy,

     

    Why should I have to do this if the chapters are in the same folder and part of the book ?

    Just being in the same folder does not mean that FrameMaker can find the target of the link. It needs to know which file contains the target.

     

    I doubt this will work but it is easy to try. Open your book file and then open all the files in the book (holding the shift key, select File > Open). THEN try updating the book with all the files open. MAYBE FrameMaker will be smart enough to look through all the open files to find each target. No guarantees...I am just guessing of a way to resolve the unresolved without manual labor.

     

    The other way is to delete the TOC from the book and then use FrameMaker's Add > Table of Contents command to create the TOC from within FrameMaker.

     

    Van

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points