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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML embedded in database being converted to text

Status
Not open for further replies.

carpeliam

Programmer
Mar 17, 2000
990
US
My environment is as follows:
- Apache server
- Tomcat servlet container
- Cocoon web application
- MySQL database

I posted this on the Cocoon users' mailing list without response. If somebody can either answer my question, or point me in the right direction, I'd be EXTREMELY grateful :eek:)

I have data in the db that is being retrieved through JDBC. From there, it is being sent to an XML doc as SAX events and from there being converted to HTML by Cocoon.

Somewhere along the line, &quot;<P/>&quot; in the database is being replaced by &quot;&amplt;P/&ampgt;&quot;. I don't want this to happen. Any clues? Suggestions? Liam Morley
lmorley@wpi.edu
&quot;light the deep, and bring silence to the world.
light the world, and bring depth to the silence.&quot;
 
probably due to the encoding standard somewhere along the line. can't think why this would happen but i've seen it a few times with some microsoft products!!

quick question
1. what is the <P/>?? should it not be </P>??
2. are you storing the data as flat text?
 
Because I'm working with Cocoon, all HTML has to conform to proper XML standards; meaning, you can't have &lt;TD&gt;&lt;/td&gt; (caps-sensitive), and you can't have ANY tags that don't have a beginning and an end. Some tags like P and IMG don't need this in HTML, but they do in XML... it looks the same in a browser. Try it, you shouldn't see any differences if you change tags to close &quot;properly&quot;.<br><br>the data is going in to MySQL as TEXT type, yes. No microsoft product is involved :eek:) (the server's an alpha, in any case..) <p>Liam Morley<br><A HREF="mailto:"></A><br>&quot;light the deep, and bring silence to the world.<br>light the world, and bring depth to the silence.&quot;
 
I have never used Cocoon before but a way out is to search for the text '&amplt;' and replace it with '<' and '&ampgt;' with '>' after you had retrieve the data from the database. This would be simple since the indexOf() method will take care of it :)

Leon
 
That will be good for tracking, I suppose.. my first guess is that it's getting changed a bit further down the pipe, but we'll soon find out :eek:) <p>Liam Morley<br><A HREF="mailto:"></A><br>&quot;light the deep, and bring silence to the world.<br>light the world, and bring depth to the silence.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top