Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rendering HTML using XML/CDATA in java servlet

Status
Not open for further replies.

mluken

Programmer
Dec 31, 2003
54
US
I am trying to render an HTML page from XML via a java servlet. Not sure if this is the right section or not, but I thought I would start here... I need to use CDATA because there is a section that will more than likely not be formatted correctly. So my XML look something like this:

Code:
<Root>
  <ReqHTML>
     <![CDATA[
     <table><tr><td>tons of HTML here</td></tr></table>
     ]]>
  </ReqHTML>
</Root>

When calling this from within my XSL, the compiled HTML looks something like this, which is not what I want:

Code:
&lt;table&gt;&lt;tr&gt;&lt;td&gt;tons of HTML here&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

I understand why this is happening, but what can I do to make it so that I get the desired effect?

Thanks!!!
 
How does your XSLT file handle the <ReqHTML> tag ?
 
In my XSL, where I would want to have the table displayed, I would say:

<xsl:value-of select="/Root/ReqHTML"/>

and I would want that to output the information inside CDATA (which it does - it just changes things like '<' to '&lt;')
 
This thread may help :

thread426-524423
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top