[jdom-interest] rendering embedded HTML

Gary Lawrence Murphy garym at canada.com
Mon Apr 15 08:54:53 PDT 2002

> The problem has been narrowed to have something to do with the way I
> am invoking the Transformer class on a JDOM Document.

David Carlyle wrote:

    dc> As I think Mike commented earlier it's more or less inevitable
    dc> that a transform that isn't directly written out to a file (or
    dc> an in memory string) will ignore d-o-e as
    dc> disable-output-encoding is just a hint to the XSLT engine's
    dc> serialiser. If you are just passing a tree on to the next
    dc> application and not serialising the output then thatserialiser
    dc> is never used.

This seems consistent with my use of the JDOM + Transformer +
XMLOutputter and now I wonder if it is possible to resolve these
entities given my processing model.

The problem appears to be that I have a general purpose method for
transforming a JDOM Document with a stylesheet, and a seperate method
to output a Document as XML.  From what David says above, my
JDOM1->JDOM2 qualifies as "in memory transform" and thus (probably
rightly) ignores the d-o-e (otherwise the new object would be composed
from invalid XML).  

However, given this JDOM2 which now has escaped text within a <DIV>
element, short of doing a brute-force search and replace for every
possible violation, can I serialize this while decoding escaped HTML
codes?  Is there an "entity resolver" utility function somewhere?

Gary Lawrence Murphy <garym at teledyn.com> TeleDynamics Communications Inc
Business Innovations Through Open Source Systems: http://www.teledyn.com
"Computers are useless.  They can only give you answers."(Pablo Picasso)

More information about the jdom-interest mailing list