How can I embed a XML document inside a XHTML document?
- by Oriol
For example, how can I embed
<?xml version="1.0" encoding="utf-8"?>
<root>
<node><![CDATA[Text]]></node>
</root>
in my XHTML?
I know I can put it in a CDATA section...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>My title</title>
</head>
<body>
<p>I am a XHTML paragraph!</p>
<div>
<![CDATA[
<?xml version="1.0" encoding="utf-8"?>
<root>
<node>Text</node>
</root>
]]>
</div>
</body>
</html>
... but then I have to remove XML file's CDATA sections and the XML is parsed as text instead of XML.
Then, I get this...
... but I want something like this: