View Single Post
Old 01-27-2011, 04:26 PM   #32
clarity
Junior Member
clarity began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2011
Location: Southampton, UK
Device: none
Hi Luke,

Thanks for your quick reply. I've been looking through the code in the plugin archive. I guess Traverse.xba and Functions.xba are the main files for my issues. There's a lot of rather distracting &quot; &comma; &lt; etc in the files though. Does the file get passed into another form? could just writing the " ' < etc not work?

Anyway, I don't have XSLT experience. Most of my programming has been in C++, Java (which I notice in the plugin), LAMP stack, Perl and others. But reading through http://www.w3schools.com/xsl/xsl_intro.asp I can see why you might want to use it. If you go down that road, I might be able to offer some assistance with debugging.

re your questions:

when you create headers (Header 1, Header 2 etc.) for chapter, section, sub-sections in writer, writer 'tags' those sections so you can reference them with cross-references (Insert -> Cross-reference...). The tags/ids are also used by the table of contents that writer can generate. I also use cross-references to Bookmarks (Insert -> Bookmark) for the book index and for the 'see page xx' references in the main book text.

The epub source from your plugin for the table of contents writer generates for my book looks like this:
Quote:
<p><b>Contents</b></p>
<p><a href="#__RefHeading__52796_1662616202"><i>Acknowle dgements vi</i></a></p>
<p><a href="#__RefHeading__3271_928939564"><i>Introducti on vii</i></a></p>
<p><a href="#__RefHeading__55283_791455818"><i>How to use this book ix</i></a></p>

<p><a href="#__RefHeading__87745_29593047"><b>Obstacles and new perspectives</b></a><a href="#__RefHeading__87745_29593047"><b> </b></a><a href="#__RefHeading__87745_29593047"><b>1</b></a></p>
So I'm guessing writer is generating its own tags for headers (and I guess other internal links), but your plugin is replacing the link destination ids as previously described with 'heading_id_xx', hence the links break.

If I need to I'm prepared to fix the table of contents manually, but the other internal links, mainly bookmarks, would take a heck of a lot of labour to fix that way and I have the feeling that if I knew your code better there's probably a couple of lines that would allow the internal links ('see page xx' or, in the book index 'honesty xx-xx,xx,xx...') to be preserved.

From the looks of the plugin code I think it will take me longer than I can spend at the moment to figure out for myself, but if you would like me to test or try out specific changes to the code, I'm happy to do that.

cheers,
Joe

Last edited by clarity; 01-27-2011 at 04:28 PM.
clarity is offline   Reply With Quote