| Path: | gradesheet-rows.rb |
| Last Update: | Mon Jul 25 17:14:34 EDT 2005 |
Process rows from an OpenOffice spreadsheet, tailored for class gradesheet. Copyright (C) 2005 by Allyn Dimock Application is to be run on a secure server with access to a grade sheet file. It can be sent a message with a student id, and will return a HTML table containing the contents of the visible spreadsheet columns for the student's row, and for pre-selected rows of the spreadsheet.
bug in REXML: in Ruby 1.8.2, order of "table-column"s not maintained by: col_descs = content_doc.root.get_elements(’.//table:table[position()=1]/table:table-column’)
31-May-2005: Had problems with REXML::XPath.match( rows[rownum - 1], ’.//table:table-cell’) returning <table:table-cell> elements in arbitrary order rather than in order in XML document so used REXML::Element and REXML::Elements methods instead. drilling down to "table-row" then getting "table-cell".
This failure to maintain order in REXML feels like a bug to me, although no promise is made to maintain order. when fixed, some XPATH expressions in the following program can be combined.