File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes html embedded in xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "html embedded in xml" Watch "html embedded in xml" New topic

html embedded in xml

Jez Nicholson
Ranch Hand

Joined: Oct 01, 2002
Posts: 39
I have a Java class with a String attribute holding a chunk of html. I use Castor to marshall it to xml and xslt to create html pages including the chunk of html amongst other things.

Justifiably, Castor will output escape it (turn the < symbols into lt;'s, etc.). So when I use xslt to select the contents of the tag into my new html page it will just be text and not html tags as it has already been output escaped.

I can configure Castor to put a CDATA around the field contents, but not to disable output escaping. Is it possible to set disable-output-escaping anywhere during marshalling?

I've got round it by holding the chunk of html as a byte[] but this is not really ideal. How do people generally marshall/unmarshall data with tags in? I don't really want to have to parse the might not be fully formed.
I agree. Here's the link:
subject: html embedded in xml
jQuery in Action, 3rd edition