DFN-CIS NetNews Service said:
I don't seem to see the following structure very often ...
<root>
<e1>this
<e2/>
<e3>that</e3>
</e1>
</root>
That is an element with text /and/ child nodes.
Is this just bad form? I know it is OK technically but are there
practical reasons for avoiding doing it?
Well, with a DTD suched mixed content is hard to restrict. Of course if
you look at XHTML container elements they need to allow such content but
even there the different document types make different restrictions, for
instance with the XHTML 1.0 transitional document type the <body>
element is defined as
<!ELEMENT body %Flow;>
where The Flow entity is defined as
<!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc
*">
which is the mixed content of text and markup elements.
With the XHTML 1.0 strict document type <body> is defined as
<!ELEMENT body %Block;>
so there no mixed content is allowed, only block elements can be direct
children of the <body>.
With XHTML strict the reasons for that are that they want you to write
clean structured documents where you use proper container block elements
with the right semantics (for instance a <p> element) to wrap your text
content.
Thus looking at that you could say it is bad (but established form) to
have mixed content in every elements but a few selected ones.
As for your example if <e1> contains sentences in some human language
and <e2 /> is some empty element like an <img> element in XHTML and <e3>
is semantically necessary to mark up a part of a sentences contained in
<e1> then it is certainly not bad form but if <e1> contains different
data nodes then I would say that it is bad style to have some data in a
text node and some in element nodes.