Thread

Posted on Thu Mar 23 19:19:54 2006 by jeunice
Workaround for getFootnoteList and getFootnoteCitationList problems

I have noticed that getFootnoteList() does not work on ODT files. It does work if one chagnes the line

return $self->getElementList('//text:footnote-body', @_);

to

return $self->getElementList('//text:note-body', @_);

A similar change would fix getFootnoteCitationList(). I'm guessing that this is a glitch created by the shift from SXW to ODT, and that this forum is a reasonable place to report the bug & workaround.

P.S. I note that getFootnoteList() really doesn't get a list of footnotes, but rather a list of footnote bodies. Not sure why there isn't a getFootnoteBodyList() separate from getFootnoteList(). OTOH, it's easy enough to use getElementList('//text:note', @_) if I want the "all parts of the footnote" list.

Direct Responses: 2048 | Write a response
Posted on Mon Mar 27 23:02:13 2006 by jmgdoc in response to 2019
Re: Workaround for getFootnoteList and getFootnoteCitationList problems

You are right, the present footnote-focused methods don't work on ODT files, and this forum is the right place to report the issue.

The reason is quite simple: footnotes, like endnotes, belong to the old OOo format specification. In the current OpenDocument spec, there are "note" objects only (a "note" is either a "footnote" or an "endnote" according to a "note-class" attribute, and a footnote could be turned in an endnote (and vice-versa) through a single setAttributes()). Knowing that, getFootnote() should not be regarded as an appropriate mnemonic for the future.

The same problem occurred with "ordered" and "unordered" item lists, which exists in OOo but not in OD, where any list item, ordered or bulleted, is... a list item. So, getOrderedList() and getUnorderedList() work on OOo only while getItemList() works on OD only.

So getFootnote(), getFootnote() citation, and so on, are no longer supported (however they will remain in the API for a time).

In the next release, they will probably be replaced by getNote() and other note-aware methods which will work on endnotes as well as on footnotes. In addition, "annotations" will probably be supported as well.

In the meantime, the proposed worktaround is right.
Write a response