jhellingman / tei2html

XSLT stylesheets to convert TEI to HTML and ePub format.
GNU General Public License v3.0
35 stars 9 forks source link

Output HTML is invalid when TEI contains nested paragraphs. #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a TEI file with a footnote in a paragraph with embedded text
document with verse  (that is <q><text><body><div1>....)
2. Render using tei2html
3. Validate in HTML validator

What is the expected output? What do you see instead?

Expected: Valid HTML.

Actual: Invalid HTML (additional </p> tags.)

Since the paragraph model of HTML and TEI do not match, the current code
closes HTML paragraphs at certain points where the stylesheet needs to
place an element (such as a table) in the HTML file. To do this, it checks
whether we are in a <p> in TEI. Sometimes, in TEI, however, we can be
inside a <p> twice (for example in <note>s). This is not handled correctly.

Original issue reported on code.google.com by jhellingman on 20 Oct 2006 at 7:12

GoogleCodeExporter commented 9 years ago

Original comment by jhellingman on 20 Oct 2006 at 7:14

GoogleCodeExporter commented 9 years ago
In general, the current solution (inserting </p> and <p> using unquoted text) is
fragile. A more robust solution would use XSLT 2.0 group-adjacent to pull out 
those
elements forbidden in HTML paragraphs.

Original comment by jhellingman on 23 Nov 2009 at 7:53