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
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
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
Van,
As I have inherited this FM appliction, I do not want to change too much. My task was to simply change the page sizes within a particular template which I have done. The only thing I had to alter was the leader dot length, otherwise I altered nothing else.
Everything is working OK apart from this top level TOC. It's part of a book where the XSL does modify the <TOC-ref> element to populate the idref attribute with the target id.
Meanwhile, I ran the XSLT on it through Oxygen as you suggested, and the idref is certainly being populated as follows :
<TOC-entry-1><TOC-ref idref = "D-GA-000047.1" format="TOC-1"/></TOC-entry-1>
The target id is external.
As mentioned the structure view does not show these attributes. Just TOC-ref followed by <WHITESPACE>.
Apparently, according to the customer, this TOC did work before. The original app was compiled using FM8, and I have generated the new templates in FM10. I subsequently upgraded the Read/Write rules and the EDD to reflect FM10 thinking this may be the answer but still not working.
OR, perhaps it's something to do with the XSLT parser version ? Does this need specifying or does FM use a standard version.
I had to specifically set it to Saxon6.5.5 within Oxygen to get it working.
Thanks,
Andy
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
Hi Van,
I've nearly got this resolved.
The TOC is not showing because the cross references are unresolved. In order to resolve them I have to manually go through via Edit>Update References and then individually select each chapter in turn to resolve them.
Why should I have to do this if the chapters are in the same folder and part of the book ?
It's quite time consuming. Is there any way of automating this ?
Thanks,
Andy
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
North America
Europe, Middle East and Africa
Asia Pacific