File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

html embedded in xml

 
Jez Nicholson
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 html...it might not be fully formed.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic