XHTML DTD Question: span and p

Hello all,

   I'm trying to write valid xhtml documents in which I have span elements 
whose data I rewrite and whose visibility I modify.  In the course of 
authoring and validating it became painfully obvious that, according to the 
XHTML Transitional DTD, a <span> element may not contain a <p> element (or 
a <div> for that matter).  I was wondering if this is an oversight or, if 
not, what reason would there be to design it this way?

   I have the following snippet of XHTML that I'm trying to validate, but 
of course it complains about the <p>...</p> tag inside of the "span_page1" 
span element.

<table align="center" border="0" cellpadding="0" cellspacing="0" width="90%">
   <tr>
     <td>
       <span id="span_page1" style="display:inline;">
         <p>
Please enter the Mathematical equation that will serve as the
basis for this style of question.  Remember that each equation
basis can create a great number of actual problems, depending
on random number generation and restrictions.
         </p>
         <span id="span_basis" style="display:none;">
           <object id="question" width="500" height="100" 
classid="clsid:5AFAB315-AD87-11D3-98BB-002035EFB1A4">
             <param name="DataType" value="1"/>
             <param name="Data" value=""/>
             <param name="AutoSize" value="true"/>
           </object>
           <br clear="all"/>
           <span id="span_basis_mathml" style="display:inline;">
             <!-- -->
           </span>
         </span>
         <div align="center">
           <input type="button" value="Enter Equation" 
onclick="enterBasis();"/>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
           <input type="button" value="Next" onclick="prepSubmit(1);"/>
         </div>
       </span>
       <span id="span_page2" style="display:none;">
         <p>
Page 2 (Incomplete)
         </p>
         <div align="center">
           <input type="button" value="Back" onclick="presentPage(1);"/>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
           <input type="button" value="..." onclick="javascript:;"/>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
           <input type="button" value="Next" onclick="prepSubmit(1);"/>
         </div>
       </span>
     </td>
   </tr>
</table>

   I need the external-most span element to enable/disable the entire cell 
contents, but it seems that I should be able to space paragraphs out within 
that span, rather than using two consecutive <br /> tags to simulate such a 
break.  Also, it's nice to be able to wrap my text block in its own tag for 
my editor (XML Spy) to indent it properly.

   Any thoughts or replies?

Greg Faron
Integre Technical Publishing Co.

Received on Thursday, 18 April 2002 13:54:41 UTC