HTML textarea (was: [xml] Bug Issue?)



Hi Stefan,

It's not very pedagocical, to give you this 
information before you have learned
everything about DOCTYPEs, but for
the two case you mentioned, there
are wellknown pragmatic solutions:

A) 

<textarea name="name" rows="5" cols="50"/>
vs.
<textarea name="name" rows="5" cols="50"></textarea>

Give your textarea element node a text children with
white space content. Then it will get serialized as

<textarea name="name" rows="5" cols="50"> </textarea>

B) 

<br>
vs
<br></br> 
vs
<br/>
vs
<br />

Give your br element a harmless attribute (like name="foo"), and it
will be serialized as

<br name="foo"/>

which is OK with nearly every browser.

As Daniel has mentioned, libxml2 can be made more HTML friendly, but
above mentioned pragmatic solutions can be used for every XML
producing software, to get output which will be grokked fine by
nearly every browser.

Regards,
Peter Jacobi






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]