dita-ot/dita-ot — pull request #1668 by eerohele (2014-04-04 18:46:12+00:00)
Title: Fix table cell @id and @headers attributes #1596

**[Gist](https://gist.github.com/eerohele/9980525)**.

Besides #1596, there's another semi-related issue to table cells: the `@id` attribute on `
` elements in regular tables is not retained in the XHTML output. Instead, it's replaced by a generated ID, which means links to `

` descendants of `
` will break. Likewise, the `@headers` attribute on the corresponding `

` elements in the table body uses the generated ID instead of the `@id` attribute value of the header.

This pull request should fix all three issues. Might make more sense to have the XSL functions elsewhere, so just let me know if you'd like to move them (should we have something like `functions.xsl`, for example?).

The original code checked whether the current table is a descendant of `topic/body` for some reason so I kept that in, although I couldn't think of a case where a table or a simpletable would be outside of a topic body.