Skip to main content
Participant
February 1, 2024
Question

Chapter and Page Numbering variable names for read/write rules

  • February 1, 2024
  • 2 replies
  • 321 views

I am trying to get a table of contents to display chapter numbers for a report I am publishing in FrameMaker. The report is exported into XML from Access, then processed through XSLT to get into a structured format for FrameMaker. I asked a similar question at https://community.adobe.com/t5/framemaker-discussions/building-blocks-in-toc-for-structured-documents/m-p/14390625#M82579, but haven't yet found a suitable answer so I am considering another approach. I have added a read/write rule that converts the XML into several chapters as a part of a book. 

reader generate book {
 put element "Chapter" in file;
}

This works, but when I pull open the document, all of the page and chapter numbering properties are wrong (everything restarts numbering). The problem is that I want to be able to pull in this report over and over as I continue building it out and add things, but to do that I would have to manually click on every single chapter and fix the numbering properties for each. I am hoping there is a way to modify the read/write rule to set these numbering properties, or some other way to set them, such that I won't have to adjust things every time I pull the report together again. This seems to be a gap in the available documentation, as there is nowhere I am aware of that pulls together a comprehensive list of FrameMaker options available with each type of read/write rule. The structured app dev guide lists the syntax and basic concept, but no further information.

 

I also considered that this might be something that could be solved in the EDD, but I couldn't find anything there to sort this out.

This topic has been closed for replies.

2 replies

Matt-Tech Comm Tools
Community Expert
Community Expert
February 15, 2024

It looks like you and Rick are tracking on this, but have you looked at setting the properties you need via attributes set upon running your report? I would think the "math" would be easier from the DB side.

 

 

-Matt Sullivan, FrameMaker Course Creator, Author, Trainer, Consultant
frameexpert
Community Expert
Community Expert
February 1, 2024

I love what you are doing here, going from database XML to FrameMaker. Setting numbering at the book level may be a gap in FrameMaker's capabilities, although I am not positive. I have solved many of these tasks with ExtendScript, which is built into FrameMaker since version 10. You could trigger a script automatically that would update the book's numbering after it is opened by FrameMaker.

 

Another approach I have used: ExtendScript has access to FrameMaker's XSLT engines (Saxon EE is built in). So you can have ExtendScript drive the whole process: invoke the XSLT on the XML, including separating your main XML into chapters, open each chapter XML and save to FrameMaker binary, then build the book and update its numbering.

 

I would be open to a web meeting so I can see what you are doing and offer you some suggestions. There would be no charge for this meeting. If you are interested, please contact me offlist. rick at frameexpert dot com

Participant
February 13, 2024

I appreciate the offer Rick, and it may be that I need to go down the ExtendScript rabbithole, though I am trying to find a way to avoid that if possible. At the moment, I was able to get around my issue by inserting elements in the XML and reading them into FrameMaker as markers, which allows my TOC (actually LOM) to use a different formatting compared to my chaptername elements. This solution has worked so far so I will stick with it.

frameexpert
Community Expert
Community Expert
February 13, 2024

That looks like a creative solution. Thank you for the feedback.