Print

Print


At 15:17 09/02/98 CST, Glen Worthey wrote:
>I need to do this:
>
>    <note><p>first paragraph of note</p>
>          <p>second paragraph of note</p>
>          <p>third paragraph of note</p>
>    </note>
>
>This is an example of the famous "mixed content GOTCHA" which has long
haunted the TEI and all other serious users of SGML.
 
First, here's a solution: the following version *will* parse correctly
with TEI Lite
 
<note><p>first paragraph of note
</p><p>second paragraph of note
</p><p>third paragraph of note
</p></note>
</p></body></text>
 
Second, here's a (rough) explanation. <note> and a few other elements
are defined using a parameter entity called "specialPara" which is
intended to allow you to use EITHER a mixture of phrase level elements
(including PCDATA) OR a sequence of chunk level items such as
paragraphs -- but to prevent you from mixing them. It seemed a good
idea at the time. The problem arises when (as in your original) you
have embedded PCDATA between the chunk level items -- i.e. where you
have embedded blanks or even newlines between the end of one para and
the start of another. My revised version above therefore works by
making sure there is nothing between </p> and <p>.
 
Third, a promissory note. We are trying to reduce the number of times
this problem raises its ugly head in the corrected reprint of TEI P3
which is currently being worked on. Stay tuned for further
announcements!
 
 
Lou
From the Laptop at Burnard Towers