Mail Archive Home | enhydra List | September 2000 Index
| <-- Date Index --> | <-- Thread Index --> |
Hi Mark.
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. 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?
Thanks,
Chad
Mark Diekhans <markd@xxxxxxxxxx> wrote:
Nathanwrites:
> I've got HTML in a database and I want to suck it out of there and
> insert it into a page via XMLC. (Basically the extent of the HTML is
> the italics and strong tags) I've got the database stuff down pat but
> I'm stuck at getting the HTML back out of the db unadultered. From what
> I can tell the text is HTML encoded before it is passed back to the
> browser so of course I see the tags in the rendered page. I do know
> that the text is being inserted into the db without being HTML encoded.
> How do I turn off the HTML encoding? Is it because I'm using the
> mechanics of XMLC that I'm having this problem?
It is because the the DOM contains an object representation of
a XML or HTML document, not the textual encoding.
The characters inserted in the DOM are display as inserted. If character
entity encoding is require to represent the character, this is done
on output (e.g. < to <).
> Do I have to insert the
> HTML/text out of the db via DOM manipulation?
There is two approach: parse the HTML is the `legal' way to do it,
that is convert the HTML in the database to an DOM representation.
However, this is expensive; a hack has been added by the DOM formatter
XMLC uses. If an CDATASection node is encountered; its contents
are written as-is. Thus you can insert the HTML from your database
using CDATASection nodes. Note, this is a `hack', its not part of the
DOM specification.
-----------------------------------------------------------------------------
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.