?
Solved

HTML Code in XML

Posted on 2004-11-26
3
Medium Priority
?
193 Views
Last Modified: 2010-04-23
I tried to generate an xml from a database, some of the fields contain html code.

It seems that the html code messes up the xml so that the xml gets unreadable or missinterpreted.

How do you encode/process the html code so that it does not mess up the xml?

Thanks
0
Comment
Question by:netslt
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
eekj earned 1000 total points
ID: 12679587
I think in the DTD you need to use #CDATA instead of #PCDATA (parsed character data) for the string

Otherwise you could escape all the '<' and '>'s into another character sequence and then swap them back at the other end
"<" --> "&lt;"
">" --> "&gt;"
0
 

Author Comment

by:netslt
ID: 12679605
Hi eekj

Could you please explain the first thing (DTD) a bit more?

Thanks
0
 
LVL 3

Expert Comment

by:eekj
ID: 12679719
this probably does a better job:
http://www.w3schools.com/dtd/dtd_building.asp
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question