On Tue, 05 Oct 2004 12:12:37 -0400, Isaac Gerg
<> wrote:
>So, I want to embed some HTML into XML. Can I do this?
Yes. There are several ways to do it. You will find it useful to study
RSS, which had to address a similar problem (unfortunately not
particularly well). There's an interesting overview of it here
http://diveintomark.org/archives/200...compatible-rss
You can probably even find PHP code to help you do this, by looking at
RSS tools
If you want to embed HTML, then you have two main options; encoding
and CDATA. Encoding is often simpler.
[...]
<content>
<p>
Now introduction, our <B>NEW</B> product line!
</content>
[...]
Note that encoding the HTML entity reference "<" will need to
appear as "&lt;"
or as CDATA
[...]
<content><![CDATA[
<p>
Now introduction, our <B>NEW</B> product line!
]]></content>
[...]
Note that the sequence ]]> in your HTML (an embedded CDATA section)
will need some special handling too.
If you can abandon HTML in favour of XHTML though, there's a much
better solution available; namespacing. If you control the HTML part
of the process yourself, I'd see this as a good reason to switch to
XHTML.
--
Smert' spamionam