Mail Archive Home | enhydra List | September 2000 Index
| <-- Date Index --> | <-- Thread Index --> |
Hi Chad! chad fowler <chadfowler@xxxxxxxxx> writes: > We've all seen this thread of discussion over and over again. Every time, > someone dutifully issues the "this is a hack" warning. Being the > conscientious guy that I am, I always prefer to avoid "hacks" whenever > possible. Its a `hack' in terms of the design of the DOM. HTML/XML are structured documents. In the textual representation, markup tags are used to represent the structure of the document. When a document is parsed and stored in the DOM, the structure is now represented as objects. Using CDATASection to hold unparsed HTML mixes the two representations in a non-standard way. This is enabled by the fact that CDATASection is only valid for XML, not HTML. To any tool that understands the DOM, this just forms a blob of text with no interpretation. > But, the truth of the matter is that (as you mentioned) parsing > all of that stored content is expensive. When I say expensive, I'm not just > talking about performance. It's expensive in terms of design and in terms > of clarity (IMHO). > > Being that this is such a frequently asked question, I have to know what > *you* would do. To hack or not to hack? It depends on the application. If the application involved some data that could be pre-parsed into a structured representation (XML or RDB), then there are many advantages of storing the data in a structured format. However, you are probably not dealing with HTML in this cases. If the application is just using bit html tags as a way of enhancing the formating of user-entered text, there is really no advantage to attempting to parse it. In this case, I would go with the CDATASection hack. Mark ----------------------------------------------------------------------------- To unsubscribe from this mailing list, send email to majordomo@xxxxxxxxxxx with the text "unsubscribe enhydra" in the body of the email. If you have other questions regarding this mailing list, send email to the list admin at owner-enhydra@xxxxxxxxxxxx
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.