• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CDATA / html to xml

LEGEND ,
Jan 07, 2008 Jan 07, 2008

Copy link to clipboard

Copied

How do i take the content of an html file and put in in an xml.

The part that's in the CDATA are now individual html files so I want to
take
the content of that html file and put it in the CDATA. I'm not sure if
that's the best way to do it though... might be better to store the HTML in
the DB and then write it out from there???


<emailMessage>
<messagetype>Welcome</MessageTpye>
<Subject>Welcome</Subject>
<MessageContent>
<![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>test</title>
</head>
<body>
welcome to our site<br /> you are blah blah<br /><br />
<p>blah blah</p>
<table><tr><td>whatever</td></tr></table>
</body>
</html>
]]>
</MessageContent>
</emailMessage>

The part that's in the CDATA are now individual html files so I want to
take
the content of that html file and put it in the CDATA. I'm not sure if
that's the best way to do it though... might be better to store the HTML in
the DB and then write it out from there???

Suggestions?




TOPICS
Advanced techniques

Views

209

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jan 07, 2008 Jan 07, 2008

Copy link to clipboard

Copied

LATEST
It is possible that your HTML, if it attempts to conform to XHTML standard, could include a CDATA section and I don't think you're permitted to nest a CDATA section inside another CDATA section.

quote:

I'm not sure if that's the best way to do it though... might be better to store the HTML in the DB and then write it out from there???


It depends on your goal. If you're creating a content management system using a database for storage is probably a better option.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation