ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | enhydra List | September 2000 Index

<--  Date Index  --> <--  Thread Index  -->

Re: Enhydra: Displaying HTML text stored in a database


Nathan <nfrund@xxxxxxxxxx> writes:
>     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 &lt;).

>  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  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.