🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.framemaker.sgml
8 messages
8 total messages Started by Larry_Jodoin Thu, 20 Nov 2008 14:18
Document title in footer (using DITA)
#428
Author: Larry_Jodoin
Date: Thu, 20 Nov 2008 14:18
11 lines
1370 bytes
We want to put our document title in the footer. I did it by editing the FM template to include an empty DocTitle variable, and importing a DocTitle variable from another file into the book after map-to-book.

This works well. But is there a way to accomplish something similar that doesn't require post-processing after map-to-book?

Currently, the only mention of the document title is in the title attribute of the map element in the ditamap file. Any suggestions on how to automatically pull the document title from the map attribute into the structured FM template for footer use?

If it requires much coding, it may be easier to continue the manual import. But I wanted to check in case there's a simple solution. Any thoughts?

Thanks,

Larry
Re: Document title in footer (using DITA)
#429
Author: Van_Kurtz
Date: Thu, 20 Nov 2008 15:03
14 lines
1327 bytes
Larry,

I do not use DITA, but I do use structured documents and books. In structured books, one can pull in an attribute from an element as a running header or footer.

I am assuming that after you convert the map to a book, the attribute that holds the document title is in some element in the book. If so, you edit one of the running header/footer variables with the following:

<$attribute[theAttributeName:theElementName]>

If on the other hand, the title is the content of an element, use the following:

<$elemtextonly[theElementName]>

Hope this helps,
Van
Re: Document title in footer (using DITA)
#431
Author: Larry_Jodoin
Date: Thu, 20 Nov 2008 20:21
11 lines
1212 bytes
Thanks for the response, Van.

You mentioned: "I am assuming that after you convert the map to a book, the attribute that holds the document title is in some element in the book."

I think that might be the issue. The attribute I need doesn't end up in the book after the map-to-book process.

Looks like I need to use the variable import method, or put the title into a topic attribute that survives the map-to-book process. I'll probably stay with the variable method, as the other would be tough to manage since topics are used in multiple documents.

Thanks again,

Larry
Re: Document title in footer (using DITA)
#437
Author: Van_Kurtz
Date: Fri, 21 Nov 2008 15:00
7 lines
1152 bytes
Larry,

Just to be clear...

When you create the book from the map, select the book window and open the structure view. Does the structure view have a root element and possibly some child elements that are NOT the document root elements? If so, and I think it should be, then it seems that one of those elements should have the attribute you want. Again, just guessing because that is the way it is in structured books.

Van
Re: Document title in footer (using DITA)
#438
Author: Larry_Jodoin
Date: Fri, 21 Nov 2008 15:52
9 lines
1367 bytes
The root element of the book is "fm-ditabook", with two attributes (href and format). Child "fm-ditafile" elements represent each generated FM file, and they also have two attributes (href and format).

In the ditamap, the root element is "map" and the attribute of interest is "title". This element and attribute are not carried forward during the map-to-book process.

If the map-to-book function could be modified to create and populate a title attribute in the "fm-ditabook" element (based on the ditamap "map" title attribute), I think the running header/footer variable could then access it. But I'm not sure how to modify that map-to-book function. It may require editing the XSL.

Thanks,

Larry
Re: Document title in footer (using DITA)
#439
Author: Scott_Prentice
Date: Fri, 21 Nov 2008 17:39
14 lines
1367 bytes
The map-to-book process basically works like this ..

- select command from menu
- specify output book name
- map is opened with the Book application, which runs the XSLT import script to aggregate the separate XML topic files into chapter files
- after book has been built, a process runs over the book to relink the references

Note that this assumes that you select the command from the menu rather than opening the map with the Book app .. which may seem to work, but does not properly relink the references in the generated FM files.

So, yes .. if you make tweaks to the XSLT, you should be able to get your additional attributes onto the fm-ditabook element.

Cheers,

...scott
Re: Document title in footer (using DITA)
#440
Author: Larry_Jodoin
Date: Fri, 21 Nov 2008 19:02
15 lines
1410 bytes
Got it. Thanks Van and Scott! Here's a summary in case anyone is interested:

1. Edited the dita-book-fm.dtd to add support for a "doctitle" attribute in the fm-ditabook element.

2. Made the same edit to the book.edd.fm, and imported definitions into the structured template.

3. Edited ditamap2fmbook.xsl to include: <xsl:attribute name="doctitle"><xsl:value-of select="@title"/></xsl:attribute> in the <fm-ditabook> area.

4. Entered a title attribute in the ditamap map element.

5. Built the book and the fm-ditabook doctitle element contains the correct title from the map, which can now be used in running headers/footers.

Seems to work well so far. Thanks again.

Larry
Re: Document title in footer (using DITA)
#442
Author: Scott_Prentice
Date: Fri, 21 Nov 2008 19:38
9 lines
894 bytes
Hey Larry...

That's great! This is probably something that others will want to do as well. If you can take a moment and add this to the DITA/FrameMaker Community KB, then it will be preserved for easy access by others ..

 <http://kb.leximation.com/dfm/>

Cheers!

...scott
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads