As I said actually looking at the MathML 2.0 specification when there are not enough mtd elements then the row should be padded. So for the mtable example what I have done is correct.
If mark up is actually invalid, then I think LibLouisUTDML should raise an error.
This is where my concern is, while my fix might be correct for MathML, is it correct for other types of table? Is it valid in all document formats to pad with additional cells when a row is missing cells?
I am glad you think this approach is looking good, I sometimes get concerned that I spend too long on making sure something is the best approach and most correct way of doing something ("paralysis by analysis" is something I don't want to slip into).
Michael Whapples On 26/03/2014 12:20, Keith Creasy wrote:
Hi Michael. Dealing with "invalid" markup in a graceful way is important. So, even if it is invalid to have empty or missing mtd elements LibLouis/LibLouisUTDML should be able to deal with it in a way that at least makes some sense. I like your approach. I'll get you additional feedback concerning tables. Heba can help us with that since currently she is the main one working directly with APH transcribers. Keith -----Original Message----- From: liblouis-liblouisxml-bounce@xxxxxxxxxxxxx [mailto:liblouis-liblouisxml-bounce@xxxxxxxxxxxxx] On Behalf Of Michael Whapples Sent: Wednesday, March 26, 2014 7:24 AM To: liblouis-liblouisxml@xxxxxxxxxxxxx Subject: [liblouis-liblouisxml] LibLouisUTDML and tables Hello, The last couple of commits I made relate to tables with varying number of entries per row. This was mainly in response to the illegal characters problem Brandon had in BrailleBlaster, which was caused by a mtable element with mtr elements with differing numbers of mtd elements inside them. According to the MathML 2.0 standard, it appears that should an mtr be short of the correct number of entries on a row then it should pad it with empty mtd elements. My fix does not quite do actual padding with empty mtd elements, but rather it accepts that the row has been finished and so will start a new row. I can put in padding to show the additional empty entries if desired. This fix though could potentially apply to other table structures in a document. My reason for taking this route was to try and prevent having format specific code inside liblouisutdml (try and keep the format details in semantic action files), so this seemed the lesser of two evils. Whilst this does not deal with rowspan and columnspan attributes, it does mean though that in these cases liblouisutdml will at least produce something sensible as output as it will understand there being less than the expected number of entries in a row. Another possible concern I have is that if the first row of a mtable element does not have the full set of mtd elements (IE. less than other rows) this might upset liblouisutdml. I will look at creating a fix to this potential issue unless someone comes back and says that it would not be valid MathML anyway. Michael Whapples For a description of the software, to download it and links to project pages go to http://www.abilitiessoft.com For a description of the software, to download it and links to project pages go to http://www.abilitiessoft.com
For a description of the software, to download it and links to project pages go to http://www.abilitiessoft.com